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 Details

  • Constructor Details

    • CalendarAdapter

      public CalendarAdapter(JXMonthView component)
      Parameters:
      component -
  • Method Details

    • install

      public CalendarAdapter install(Calendar calendar, CalendarState dayState)
      Parameters:
      calendar2 -
      dayState2 -
      Returns:
    • getComponent

      public JXMonthView getComponent()
      Description copied from class: ComponentAdapter
      Returns the component which is this adapter's target.
      Overrides:
      getComponent in class ComponentAdapter
      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: ComponentAdapter
      Returns true if the cell identified by this adapter is currently selected. Otherwise, it returns false.
      Specified by:
      isSelected in class ComponentAdapter
      Returns:
      true if the cell identified by this adapter is currently selected; Otherwise, return false
    • getFilteredValueAt

      public Object getFilteredValueAt(int row, int column)
      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 class ComponentAdapter
      Parameters:
      row - the row of the cell in view coordinates
      column - 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 Object getValueAt(int row, int column)
      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 class ComponentAdapter
      Parameters:
      row - in model coordinates
      column - 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 class ComponentAdapter
      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 class ComponentAdapter
      Parameters:
      row - the row to query in model coordinates
      column - 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
      Returns true if the cell identified by this adapter is editable, false otherwise.
      Specified by:
      isEditable in class ComponentAdapter
      Returns:
      true if the cell is editable, false otherwise