Class TableRolloverController<T extends javax.swing.JTable>

  • All Implemented Interfaces:
    java.beans.PropertyChangeListener, java.util.EventListener

    public class TableRolloverController<T extends javax.swing.JTable>
    extends RolloverController<T>
    listens to rollover properties. Repaints effected component regions. Updates link cursor.
    • Field Detail

      • oldCursor

        private java.awt.Cursor oldCursor
    • Constructor Detail

      • TableRolloverController

        public TableRolloverController()
    • Method Detail

      • rollover

        protected void rollover​(java.awt.Point oldLocation,
                                java.awt.Point newLocation)
        Description copied from class: RolloverController
        called on change of client property Rollover_Key.
        Specified by:
        rollover in class RolloverController<T extends javax.swing.JTable>
        Parameters:
        oldLocation - the old value of the rollover location.
        newLocation - the new value of the rollover location.
      • getPaintRectangles

        private java.util.List<java.awt.Rectangle> getPaintRectangles​(java.util.List<java.awt.Rectangle> rectangles,
                                                                      java.awt.Point cellLocation,
                                                                      boolean paintRow,
                                                                      boolean paintColumn)
        Parameters:
        rectangles - List of rectangles to paint, maybe null
        cellLocation - the location of the cell, guaranteed to be not null
        paintRow - boolean indicating whether the row should be painted
        paintColumn - boolean indicating whether the column should be painted
        Returns:
        list of rectangles to paint, maybe null
      • hasColumn

        private boolean hasColumn​(java.awt.Point cellLocation)
        Parameters:
        cellLocation - the cell location to check, may be null
        Returns:
        a boolean indicating whether the given cellLocation has a column to paint
      • hasRow

        private boolean hasRow​(java.awt.Point cellLocation)
        Parameters:
        cellLocation - the cell location to check, may be null
        Returns:
        a boolean indicating whether the given cellLocation has a row to paint
      • isClickable

        protected boolean isClickable​(java.awt.Point location)
        overridden to return false if cell editable.
        Overrides:
        isClickable in class RolloverController<T extends javax.swing.JTable>
        Parameters:
        location - in cell coordinates, p.x == column, p.y == row.
        Returns:
        true if the cell at the given location is clickable
        See Also:
        RolloverController.hasRollover(Point)
      • getRolloverRenderer

        protected RolloverRenderer getRolloverRenderer​(java.awt.Point location,
                                                       boolean prepare)
        Description copied from class: RolloverController
        Returns the rolloverRenderer at the given location.

        The result may be null if there is none or if rollover is not enabled. If the prepare flag is true, the renderer will be prepared with value and state as appropriate for the given location. Note: PRE - the location must be valid in cell coordinate space.

        Specified by:
        getRolloverRenderer in class RolloverController<T extends javax.swing.JTable>
        Parameters:
        location - a valid location in cell coordinates, p.x == column, p.y == row.
        Returns:
        RolloverRenderer at the given location
      • setRolloverCursor

        private void setRolloverCursor​(java.awt.Point location)
      • getFocusedCell

        protected java.awt.Point getFocusedCell()
        Description copied from class: RolloverController
        The coordinates of the focused cell in view coordinates. This method is called if the click action is invoked by a keyStroke. The returned cell coordinates should be related to what is typically interpreted as "focused" in the context of the component. p.x == focused column, p.y == focused row. A null return value or any coordinate value of < 0 is interpreted as "outside".
        Specified by:
        getFocusedCell in class RolloverController<T extends javax.swing.JTable>
        Returns:
        the location of the focused cell.