Package org.jdesktop.swingx.plaf.basic
Class CalendarAdapter
java.lang.Object
org.jdesktop.swingx.decorator.ComponentAdapter
org.jdesktop.swingx.plaf.basic.CalendarAdapter
ComponentAdapter for a JXMonthView (experimental for internal use of BasicMonthViewUI).
For now, this effectively disables all notion of row/column coordinates. It's focused on an externally provided date (as Calendar) and CalendarState. Yeah, I know, that's tweaking too much but then, I want to use highlighters which need an adapter...
-
Field Summary
FieldsFields inherited from class org.jdesktop.swingx.decorator.ComponentAdapter
column, DEFAULT_COLUMN_IDENTIFIER, row, target
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the component which is this adapter's target.getFilteredValueAt
(int row, int column) Returns the filtered value of the cell identified by the row in view coordinate and the column in model coordinates.getValueAt
(int row, int column) Returns the value of the target component's cell identified by the specified row and column in model coordinates.boolean
hasFocus()
Returns true if the cell identified by this adapter currently has focus.install
(Calendar calendar, CalendarState dayState) boolean
isCellEditable
(int row, int column) Determines whether this cell is editable.boolean
Returnstrue
if the cell identified by this adapter is editable,false
otherwise.boolean
private boolean
boolean
Returns true if the cell identified by this adapter is currently selected.boolean
Methods inherited from class org.jdesktop.swingx.decorator.ComponentAdapter
convertColumnIndexToModel, convertColumnIndexToView, convertRowIndexToModel, convertRowIndexToView, getCellBounds, getColumnClass, getColumnClass, getColumnCount, getColumnIdentifierAt, getColumnIndex, getColumnName, getDepth, getFilteredStringAt, getRowCount, getString, getString, getStringAt, getValue, getValue, isExpanded, isHierarchical, isLeaf, isTestable
-
Field Details
-
calendar
Calendar calendar -
dayState
CalendarState dayState
-
-
Constructor Details
-
CalendarAdapter
- Parameters:
component
-
-
-
Method Details
-
install
- Parameters:
calendar2
-dayState2
-- Returns:
-
getComponent
Description copied from class:ComponentAdapter
Returns the component which is this adapter's target.- Overrides:
getComponent
in classComponentAdapter
- Returns:
- the component which is this adapter's target.
-
getCalendarState
-
isFlagged
public boolean isFlagged() -
isUnselectable
public boolean isUnselectable() -
isSelectable
private boolean isSelectable()- Parameters:
dayState
-- Returns:
-
isSelected
public boolean isSelected()Description copied from class:ComponentAdapter
Returns true if the cell identified by this adapter is currently selected. Otherwise, it returns false.- Specified by:
isSelected
in classComponentAdapter
- Returns:
- true if the cell identified by this adapter is currently selected; Otherwise, return false
-
getFilteredValueAt
Description copied from class:ComponentAdapter
Returns the filtered value of the cell identified by the row in view coordinate and the column in model coordinates. Note: the asymmetry of the coordinates is intentional - clients like Highlighters are interested in view values but might need to access non-visible columns for testing. While it is possible to access row coordinates different from the current (that is this.row) it is not safe to do so for row > this.row because the adapter doesn't allow to query the count of visible rows.- Overrides:
getFilteredValueAt
in classComponentAdapter
- Parameters:
row
- the row of the cell in view coordinatescolumn
- the column of the cell in model coordinates.- Returns:
- the filtered value of the cell identified by the row in view coordinate and the column in model coordinates
-
getValueAt
Description copied from class:ComponentAdapter
Returns the value of the target component's cell identified by the specified row and column in model coordinates.- Specified by:
getValueAt
in classComponentAdapter
- Parameters:
row
- in model coordinatescolumn
- in model coordinates- Returns:
- the value of the target component's cell identified by the specified row and column
-
hasFocus
public boolean hasFocus()Description copied from class:ComponentAdapter
Returns true if the cell identified by this adapter currently has focus. Otherwise, it returns false.- Specified by:
hasFocus
in classComponentAdapter
- Returns:
- true if the cell identified by this adapter currently has focus; Otherwise, return false
-
isCellEditable
public boolean isCellEditable(int row, int column) Description copied from class:ComponentAdapter
Determines whether this cell is editable.- Specified by:
isCellEditable
in classComponentAdapter
- Parameters:
row
- the row to query in model coordinatescolumn
- the column to query in model coordinates- Returns:
true
if the cell is editable,false
otherwise
-
isEditable
public boolean isEditable()Description copied from class:ComponentAdapter
Returnstrue
if the cell identified by this adapter is editable,false
otherwise.- Specified by:
isEditable
in classComponentAdapter
- Returns:
true
if the cell is editable,false
otherwise
-