| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| public class | BasicTableHeaderUI.
This class should be treated as a "protected" inner class. |
| Modifier and Type | Field and Description |
|---|---|
| private static FocusListener | |
| protected JTableHeader | header
The |
| protected MouseInputListener | mouseInputListener
Listeners that are attached to the |
| protected CellRendererPane | rendererPane
The instance of |
| private static Cursor | |
| private int | |
| private int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private static boolean | |
| private int | |
| private Dimension | |
| protected MouseInputListener | Returns: the mouse listener for theJTableHeaderCreates the mouse listener for the |
| public static ComponentUI | Returns: a new instance ofBasicTableHeaderUIa component. h)Hides javax. Returns a new instance of |
| public int | getBaseline(JComponent c, int width, int height)
Overrides javax. Returns the baseline. |
| private int | |
| private Component | |
| public Dimension | getMaximumSize(JComponent c)
Overrides javax. Return the maximum size of the header. |
| public Dimension | getMinimumSize(JComponent c)
Overrides javax. Return the minimum size of the header. |
| public Dimension | getPreferredSize(JComponent c)
Overrides javax. Return the preferred size of the header. |
| protected int | Returns: the index of the current rollover columnReturns the index of the column header over which the mouse currently is. |
| private int | |
| protected void | |
| protected void | |
| protected void | |
| public void | installUI(JComponent c)
Overrides javax. Configures the specified component appropriately for the look and feel. |
| pack-priv static void | |
| public void | paint(Graphics g, JComponent c)
Overrides javax. Paints the specified component appropriately for the look and feel. |
| private void | |
| protected void | rolloverColumnUpdated(int
the index of the previous rollover column or -1 if the
mouse was not over a column oldColumn, int the index of the new rollover column or -1 if the mouse
is not over a column newColumn)This method gets called every time when a rollover column in the table header is updated. |
| private void | scrollToColumn(int col)
Used by selectColumn to scroll horizontally, if necessary, to ensure that the newly selected column is visible. |
| pack-priv void | |
| pack-priv void | |
| private int | |
| private int | |
| protected void | |
| protected void | |
| protected void | |
| public void | uninstallUI(JComponent c)
Overrides javax. Reverses configuration which was done on the specified component during
|
| private void | |
| private int |
| focusListener | back to summary |
|---|---|
| private static FocusListener focusListener | |
| header | back to summary |
|---|---|
| protected JTableHeader header The | |
| mouseInputListener | back to summary |
|---|---|
| protected MouseInputListener mouseInputListener Listeners that are attached to the | |
| rendererPane | back to summary |
|---|---|
| protected CellRendererPane rendererPane The instance of | |
| resizeCursor | back to summary |
|---|---|
| private static Cursor resizeCursor | |
| rolloverColumn | back to summary |
|---|---|
| private int rolloverColumn | |
| selectedColumnIndex | back to summary |
|---|---|
| private int selectedColumnIndex | |
| BasicTableHeaderUI | back to summary |
|---|---|
| public BasicTableHeaderUI() Constructs a | |
| canResize | back to summary |
|---|---|
| private static boolean canResize(TableColumn column, JTableHeader header) | |
| changeColumnWidth | back to summary |
|---|---|
| private int changeColumnWidth(TableColumn resizingColumn, JTableHeader th, int oldWidth, int newWidth) | |
| createHeaderSize | back to summary |
|---|---|
| private Dimension createHeaderSize(long width) | |
| createMouseInputListener | back to summary |
|---|---|
| protected MouseInputListener createMouseInputListener() Creates the mouse listener for the
| |
| createUI | back to summary |
|---|---|
| public static ComponentUI createUI(JComponent h) Hides javax. Returns a new instance of
| |
| getBaseline | back to summary |
|---|---|
| public int getBaseline(JComponent c, int width, int height) Overrides javax. Returns the baseline.
| |
| getHeaderHeight | back to summary |
|---|---|
| private int getHeaderHeight() | |
| getHeaderRenderer | back to summary |
|---|---|
| private Component getHeaderRenderer(int columnIndex) | |
| getMaximumSize | back to summary |
|---|---|
| public Dimension getMaximumSize(JComponent c) Overrides javax. Return the maximum size of the header. The maximum width is the sum of the maximum widths of each column (plus inter-cell spacing). | |
| getMinimumSize | back to summary |
|---|---|
| public Dimension getMinimumSize(JComponent c) Overrides javax. Return the minimum size of the header. The minimum width is the sum of the minimum widths of each column (plus inter-cell spacing). | |
| getPreferredSize | back to summary |
|---|---|
| public Dimension getPreferredSize(JComponent c) Overrides javax. Return the preferred size of the header. The preferred height is the maximum of the preferred heights of all of the components provided by the header renderers. The preferred width is the sum of the preferred widths of each column (plus inter-cell spacing). | |
| getRolloverColumn | back to summary |
|---|---|
| protected int getRolloverColumn() Returns the index of the column header over which the mouse currently is. When the mouse is not over the table header, -1 is returned.
| |
| getSelectedColumnIndex | back to summary |
|---|---|
| private int getSelectedColumnIndex() | |
| installDefaults | back to summary |
|---|---|
| protected void installDefaults() Initializes JTableHeader properties such as font, foreground, and background. The font, foreground, and background properties are only set if their current value is either null or a UIResource, other properties are set if the current value is null.
| |
| installKeyboardActions | back to summary |
|---|---|
| protected void installKeyboardActions() Register all keyboard actions on the JTableHeader. | |
| installListeners | back to summary |
|---|---|
| protected void installListeners() Attaches listeners to the JTableHeader. | |
| installUI | back to summary |
|---|---|
| public void installUI(JComponent c) Overrides javax. Doc from javax. Configures the specified component appropriately for the look and feel.
This method is invoked when the
| |
| loadActionMap | back to summary |
|---|---|
| pack-priv static void loadActionMap(LazyActionMap map) Populates TableHeader's actions. | |
| paint | back to summary |
|---|---|
| public void paint(Graphics g, JComponent c) Overrides javax. Doc from javax. Paints the specified component appropriately for the look and feel.
This method is invoked from the | |
| paintCell | back to summary |
|---|---|
| private void paintCell(Graphics g, Rectangle cellRect, int columnIndex) | |
| rolloverColumnUpdated | back to summary |
|---|---|
| protected void rolloverColumnUpdated(int oldColumn, int newColumn) This method gets called every time when a rollover column in the table header is updated. Every look and feel that supports a rollover effect in a table header should override this method and repaint the header.
| |
| scrollToColumn | back to summary |
|---|---|
| private void scrollToColumn(int col) Used by selectColumn to scroll horizontally, if necessary, to ensure that the newly selected column is visible. | |
| selectColumn | back to summary |
|---|---|
| pack-priv void selectColumn(int newColIndex) Selects the specified column in the table header. Repaints the affected header cells and makes sure the newly selected one is visible. | |
| selectColumn | back to summary |
|---|---|
| pack-priv void selectColumn(int newColIndex, boolean doScroll) | |
| selectNextColumn | back to summary |
|---|---|
| private int selectNextColumn(boolean doIt) | |
| selectPreviousColumn | back to summary |
|---|---|
| private int selectPreviousColumn(boolean doIt) | |
| uninstallDefaults | back to summary |
|---|---|
| protected void uninstallDefaults() Uninstalls default properties | |
| uninstallKeyboardActions | back to summary |
|---|---|
| protected void uninstallKeyboardActions() Unregisters default key actions. | |
| uninstallListeners | back to summary |
|---|---|
| protected void uninstallListeners() Unregisters listeners. | |
| uninstallUI | back to summary |
|---|---|
| public void uninstallUI(JComponent c) Overrides javax. Doc from javax. Reverses configuration which was done on the specified component during
| |
| updateRolloverColumn | back to summary |
|---|---|
| private void updateRolloverColumn(MouseEvent e) | |
| viewIndexForColumn | back to summary |
|---|---|
| private int viewIndexForColumn(TableColumn aColumn) | |
| Modifier and Type | Field and Description |
|---|---|
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | accept(Object sender)
Overrides sun. Overrides default javax. Subclasses that need to conditionalize the enabled state should override this. |
| public void | actionPerformed(ActionEvent e)
Implements java. Invoked when an action occurs. |
| private boolean | |
| private void | |
| private void |
| FOCUS_TABLE | back to summary |
|---|---|
| public static final String FOCUS_TABLE | |
| MOVE_COLUMN_LEFT | back to summary |
|---|---|
| public static final String MOVE_COLUMN_LEFT | |
| MOVE_COLUMN_RIGHT | back to summary |
|---|---|
| public static final String MOVE_COLUMN_RIGHT | |
| RESIZE_LEFT | back to summary |
|---|---|
| public static final String RESIZE_LEFT | |
| RESIZE_RIGHT | back to summary |
|---|---|
| public static final String RESIZE_RIGHT | |
| SELECT_COLUMN_TO_LEFT | back to summary |
|---|---|
| public static final String SELECT_COLUMN_TO_LEFT | |
| SELECT_COLUMN_TO_RIGHT | back to summary |
|---|---|
| public static final String SELECT_COLUMN_TO_RIGHT | |
| TOGGLE_SORT_ORDER | back to summary |
|---|---|
| public static final String TOGGLE_SORT_ORDER | |
| Actions | back to summary |
|---|---|
| public Actions(String name) | |
| accept | back to summary |
|---|---|
| public boolean accept(Object sender) Overrides sun. Overrides default javax. Doc from sun. Subclasses that need to conditionalize the enabled state should
override this. Be aware that
| |
| actionPerformed | back to summary |
|---|---|
| public void actionPerformed(ActionEvent e) Implements java. Doc from java. Invoked when an action occurs. | |
| maybeMoveColumn | back to summary |
|---|---|
| private boolean maybeMoveColumn(boolean leftArrow, JTableHeader th, BasicTableHeaderUI ui, boolean doIt) | |
| moveColumn | back to summary |
|---|---|
| private void moveColumn(boolean leftArrow, JTableHeader th, BasicTableHeaderUI ui) | |
| resize | back to summary |
|---|---|
| private void resize(boolean leftArrow, JTableHeader th, BasicTableHeaderUI ui) | |
BasicTableHeaderUI.
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private Cursor |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private TableColumn | |
| private TableColumn | |
| public void | mouseClicked(MouseEvent e)
Implements java. Invoked when the mouse button has been clicked (pressed and released) on a component. |
| public void | mouseDragged(MouseEvent e)
Implements java. Invoked when a mouse button is pressed on a component and then dragged. |
| public void | mouseEntered(MouseEvent e)
Implements java. Invoked when the mouse enters a component. |
| public void | mouseExited(MouseEvent e)
Implements java. Invoked when the mouse exits a component. |
| public void | mouseMoved(MouseEvent e)
Implements java. Invoked when the mouse cursor has been moved onto a component but no buttons have been pushed. |
| public void | mousePressed(MouseEvent e)
Implements java. Invoked when a mouse button has been pressed on a component. |
| public void | mouseReleased(MouseEvent e)
Implements java. Invoked when a mouse button has been released on a component. |
| private void | |
| private void |
| mouseXOffset | back to summary |
|---|---|
| private int mouseXOffset | |
| otherCursor | back to summary |
|---|---|
| private Cursor otherCursor | |
| MouseInputHandler | back to summary |
|---|---|
| public MouseInputHandler() Constructs a | |
| getResizingColumn | back to summary |
|---|---|
| private TableColumn getResizingColumn(Point p) | |
| getResizingColumn | back to summary |
|---|---|
| private TableColumn getResizingColumn(Point p, int column) | |
| mouseClicked | back to summary |
|---|---|
| public void mouseClicked(MouseEvent e) Implements java. Doc from java. Invoked when the mouse button has been clicked (pressed and released) on a component. | |
| mouseDragged | back to summary |
|---|---|
| public void mouseDragged(MouseEvent e) Implements java. Doc from java. Invoked when a mouse button is pressed on a component and then
dragged.
Due to platform-dependent Drag&Drop implementations,
| |
| mouseEntered | back to summary |
|---|---|
| public void mouseEntered(MouseEvent e) Implements java. Doc from java. Invoked when the mouse enters a component. | |
| mouseExited | back to summary |
|---|---|
| public void mouseExited(MouseEvent e) Implements java. Doc from java. Invoked when the mouse exits a component. | |
| mouseMoved | back to summary |
|---|---|
| public void mouseMoved(MouseEvent e) Implements java. Doc from java. Invoked when the mouse cursor has been moved onto a component but no buttons have been pushed. | |
| mousePressed | back to summary |
|---|---|
| public void mousePressed(MouseEvent e) Implements java. Doc from java. Invoked when a mouse button has been pressed on a component. | |
| mouseReleased | back to summary |
|---|---|
| public void mouseReleased(MouseEvent e) Implements java. Doc from java. Invoked when a mouse button has been released on a component. | |
| setDraggedDistance | back to summary |
|---|---|
| private void setDraggedDistance(int draggedDistance, int column) | |
| swapCursor | back to summary |
|---|---|
| private void swapCursor() | |