Package org.jdesktop.swingx.plaf.basic
Class CalendarAdapter
- java.lang.Object
-
- org.jdesktop.swingx.decorator.ComponentAdapter
-
- org.jdesktop.swingx.plaf.basic.CalendarAdapter
-
class CalendarAdapter extends ComponentAdapter
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
Fields Modifier and Type Field Description (package private) java.util.Calendarcalendar(package private) CalendarStatedayState-
Fields inherited from class org.jdesktop.swingx.decorator.ComponentAdapter
column, DEFAULT_COLUMN_IDENTIFIER, row, target
-
-
Constructor Summary
Constructors Constructor Description CalendarAdapter(JXMonthView component)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CalendarStategetCalendarState()JXMonthViewgetComponent()Returns the component which is this adapter's target.java.lang.ObjectgetFilteredValueAt(int row, int column)Returns the filtered value of the cell identified by the row in view coordinate and the column in model coordinates.java.lang.ObjectgetValueAt(int row, int column)Returns the value of the target component's cell identified by the specified row and column in model coordinates.booleanhasFocus()Returns true if the cell identified by this adapter currently has focus.CalendarAdapterinstall(java.util.Calendar calendar, CalendarState dayState)booleanisCellEditable(int row, int column)Determines whether this cell is editable.booleanisEditable()Returnstrueif the cell identified by this adapter is editable,falseotherwise.booleanisFlagged()private booleanisSelectable()booleanisSelected()Returns true if the cell identified by this adapter is currently selected.booleanisUnselectable()-
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 Detail
-
calendar
java.util.Calendar calendar
-
dayState
CalendarState dayState
-
-
Constructor Detail
-
CalendarAdapter
public CalendarAdapter(JXMonthView component)
- Parameters:
component-
-
-
Method Detail
-
install
public CalendarAdapter install(java.util.Calendar calendar, CalendarState dayState)
- Parameters:
calendar2-dayState2-- Returns:
-
getComponent
public JXMonthView getComponent()
Description copied from class:ComponentAdapterReturns the component which is this adapter's target.- Overrides:
getComponentin classComponentAdapter- Returns:
- the component which is this adapter's target.
-
getCalendarState
public CalendarState getCalendarState()
-
isFlagged
public boolean isFlagged()
-
isUnselectable
public boolean isUnselectable()
-
isSelectable
private boolean isSelectable()
- Parameters:
dayState-- Returns:
-
isSelected
public boolean isSelected()
Description copied from class:ComponentAdapterReturns true if the cell identified by this adapter is currently selected. Otherwise, it returns false.- Specified by:
isSelectedin classComponentAdapter- Returns:
- true if the cell identified by this adapter is currently selected; Otherwise, return false
-
getFilteredValueAt
public java.lang.Object getFilteredValueAt(int row, int column)Description copied from class:ComponentAdapterReturns 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:
getFilteredValueAtin 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
public java.lang.Object getValueAt(int row, int column)Description copied from class:ComponentAdapterReturns the value of the target component's cell identified by the specified row and column in model coordinates.- Specified by:
getValueAtin 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:ComponentAdapterReturns true if the cell identified by this adapter currently has focus. Otherwise, it returns false.- Specified by:
hasFocusin 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:ComponentAdapterDetermines whether this cell is editable.- Specified by:
isCellEditablein classComponentAdapter- Parameters:
row- the row to query in model coordinatescolumn- the column to query in model coordinates- Returns:
trueif the cell is editable,falseotherwise
-
isEditable
public boolean isEditable()
Description copied from class:ComponentAdapterReturnstrueif the cell identified by this adapter is editable,falseotherwise.- Specified by:
isEditablein classComponentAdapter- Returns:
trueif the cell is editable,falseotherwise
-
-