public class GroupTableHeader extends AutoFilterTableHeader
JTableHeader.AccessibleJTableHeader
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
static String |
PROPERTY_CONNECTION_LINE_VISIBLE |
static String |
PROPERTY_GROUP_AREA_BACKGROUND |
static String |
PROPERTY_GROUP_AREA_FOREGROUND |
static String |
PROPERTY_GROUP_AREA_LABEL_FONT |
static String |
PROPERTY_GROUP_HEADER_ENABLED |
static String |
PROPERTY_MARGIN |
static String |
PROPERTY_VERTICAL_INDENTION |
_autoFilterEnabled, _filterableTableModel, CLIENT_PROPERTY_CUSTOM_FILTER_EDITOR_TYPE, CUSTOM_FILTER_EDITOR_TYPE_TABLE_CUSTOM_FILTER_EDITOR, PROPERTY_ACCEPT_TEXT_INPUT, PROPERTY_AUTO_FILTER_ENABLED, PROPERTY_USE_NATIVE_CELL_RENDERER
_cellEditor, _defaultEditor, _editingColumn, _editorComp, HEADER_ROW
PROPERTY_SHOW_SORT_ARROW
_cellStyleList
PROPERTY_DRAGGED_COLUMN, PROPERTY_DRAGGED_DISTANCE, PROPERTY_RESIZING_COLUMN
columnModel, draggedColumn, draggedDistance, reorderingAllowed, resizingAllowed, resizingColumn, table, updateTableInRealTime
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
GroupTableHeader(JTable table)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
columnAtPoint(Point point) |
protected GroupTableInputListener |
createGroupTableInputListener()
Create the mouse and key listener for DnD feature.
|
int |
getActualHeaderHeight()
Get the height of the real header.
|
int |
getActualHeaderY()
Get the start Y of the real header.
|
String |
getActualUIClassID()
Returns a string that specifies the name of the L&F class that renders this component.
|
Color |
getGroupAreaBackground()
Gets the background color of the group area.
|
Color |
getGroupAreaForeground()
Gets the foreground color of the group area.
|
Rectangle |
getGroupedHeaderRect(int groupIndex)
Get the rectangle for the group column
|
Rectangle |
getHeaderRect(int column) |
Font |
getLabelFont()
Gets the font of the label while there is no grouping column.
|
int |
getLabelHeight()
Gets the default label height if there is no grouped column.
|
Insets |
getMargin()
Get group header margin.
|
String |
getResourceString(String key)
Gets the resource string used in GroupTableHeader.
|
int |
getRollOverGroupColumn() |
String |
getUIDelegateClassID()
Returns a string that specifies the name of the UIDelegate class that paints this component.
|
int |
getVerticalIndention()
Get the indent to display next grouped column.
|
int |
groupedColumnAtPoint(Point point)
Returns the grouped column index at the specified point or -1 if no such column.
|
boolean |
isConnectionLineVisible()
Get the flag indicating if the connect lines between grouped columns are visible.
|
boolean |
isGroupHeaderEnabled()
Get the flag indicating if the group header is enabled.
|
protected void |
paintComponent(Graphics g)
Overrides to paint the sort arrows on table header.
|
void |
setComponentOrientation(ComponentOrientation o) |
void |
setConnectionLineVisible(boolean connectionLineVisible)
Set the flag indicating if the connect lines between grouped columns are visible.
|
void |
setGroupAreaBackground(Color groupAreaBackground)
Sets the background color of the group area.
|
void |
setGroupAreaForeground(Color groupAreaForeground)
Sets the foreground color of the group area.
|
void |
setGroupedWidths(int[] widths) |
void |
setGroupHeaderEnabled(boolean groupHeaderEnabled)
Set the flag indicating if the group header is enabled.
|
void |
setLabelFont(Font labelFont)
Sets the font of the label while there is no grouping column.
|
void |
setLabelHeight(int labelHeight)
Sets the default label height if there is no grouped column.
|
void |
setMargin(Insets margin)
Set the group header margin.
|
void |
setTable(JTable table) |
void |
setVerticalIndention(int verticalIndention)
Set the indent to display next grouped column.
|
protected int |
toggleSortOrder(int sorting)
Toggle between sort orders
By default cycles through ascending and descending.
|
clearFilters, columnMarginChanged, createDefaultEditor, createDefaultFilterableTableModel, createDefaultRenderer, createFilterableTableHeaderCellDecorator, createFilterableTableModel, customizeAutoFilterBox, editingStopped, filterableTableModelChanged, formatColumnTitle, getAutoFilterTableHeaderRenderer, getFilterableTableHeaderCellDecorator, getFilterableTableModel, getFilterableTableModel, getFilterIcon, getFormattedColumnName, getToolTipText, initTable, isAcceptTextInput, isAllowMultipleValues, isAllowMultipleValues, isAutoFilterEnabled, isAutoRequestFocus, isCellEditable, isPreferSelectedValues, isRolloverEnabled, isShowFilterIcon, isShowFilterName, isShowFilterNameAsToolTip, isUseNativeHeaderRenderer, propertyChange, setAcceptTextInput, setAllowMultipleValues, setAutoFilterEnabled, setPreferSelectedValues, setShowFilterIcon, setShowFilterName, setShowFilterNameAsToolTip, setShowSortArrow, setUseNativeHeaderRenderer, tableModelChanged
cancelEditing, customizeEditorComponent, editCellAt, editCellAt, editingCanceled, getCellEditor, getCellEditor, getDefaultEditor, getEditingColumn, getEditorComponent, isClickToStartEditing, isEditing, prepareEditor, removeEditor, removeNotify, resizeAndRepaint, setCellEditor, setClickToStartEditing, setDefaultEditor, setDraggedColumn, setEditingColumn, setRolloverEnabled, stopEditing
createSortableTableHeaderCellDecorator, createSortIcon, getSortableTableHeaderCellDecorator, isShowSortArrow, paintSortArrow, paintSortArrows
addCellDecorator, addCellDecorator, addCellStyleCustomizer, clearCellStyleCustomizers, collectCellStyles, createToolTip, customizeRendererComponent, getCellDecorators, getCellStyleAt, getCellStyleCustomizers, getDefaultCursor, mergeCellStyles, originalColumnAtPoint, releaseRendererComponent, removeCellDecorator, removeCellStyleCustomizer, setCursor, setDefaultRenderer, updateUI
getPreferredSize, setDraggedDistance, setResizingColumn
columnAdded, columnMoved, columnRemoved, columnSelectionChanged, createDefaultColumnModel, getAccessibleContext, getColumnModel, getDefaultRenderer, getDraggedColumn, getDraggedDistance, getReorderingAllowed, getResizingAllowed, getResizingColumn, getTable, getUI, getUIClassID, getUpdateTableInRealTime, initializeLocalVars, paramString, setColumnModel, setReorderingAllowed, setResizingAllowed, setUI, setUpdateTableInRealTime
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public static final String PROPERTY_MARGIN
public static final String PROPERTY_VERTICAL_INDENTION
public static final String PROPERTY_CONNECTION_LINE_VISIBLE
public static final String PROPERTY_GROUP_HEADER_ENABLED
public static final String PROPERTY_GROUP_AREA_BACKGROUND
public static final String PROPERTY_GROUP_AREA_FOREGROUND
public static final String PROPERTY_GROUP_AREA_LABEL_FONT
public GroupTableHeader(JTable table)
table
- the group table to install this header.public String getActualUIClassID()
SortableTableHeader
getActualUIClassID
in class AutoFilterTableHeader
public String getUIDelegateClassID()
getUIDelegateClassID
in class AutoFilterTableHeader
public void setTable(JTable table)
setTable
in class AutoFilterTableHeader
public void setComponentOrientation(ComponentOrientation o)
setComponentOrientation
in class Component
public Color getGroupAreaBackground()
setGroupAreaBackground(java.awt.Color)
public void setGroupAreaBackground(Color groupAreaBackground)
groupAreaBackground
- the backgroundpublic Color getGroupAreaForeground()
setGroupAreaForeground(java.awt.Color)
public void setGroupAreaForeground(Color groupAreaForeground)
groupAreaForeground
- the foregroundprotected void paintComponent(Graphics g)
SortableTableHeader
paintComponent
in class SortableTableHeader
g
- the Graphics objectpublic int getActualHeaderHeight()
public int getActualHeaderY()
getActualHeaderY
in class CellStyleTableHeader
public Rectangle getHeaderRect(int column)
getHeaderRect
in class JTableHeader
public int columnAtPoint(Point point)
columnAtPoint
in class JTableHeader
public int groupedColumnAtPoint(Point point)
point
- the pointpublic Rectangle getGroupedHeaderRect(int groupIndex)
groupIndex
- the index of the group columnpublic void setGroupedWidths(int[] widths)
protected GroupTableInputListener createGroupTableInputListener()
public void setMargin(Insets margin)
margin
- the marginpublic Insets getMargin()
(java.awt.Insets)
public int getRollOverGroupColumn()
protected int toggleSortOrder(int sorting)
sorting
- current sort orderpublic String getResourceString(String key)
key
- the resource keypublic int getVerticalIndention()
public void setVerticalIndention(int verticalIndention)
verticalIndention
- the indentionpublic boolean isConnectionLineVisible()
public void setConnectionLineVisible(boolean connectionLineVisible)
connectionLineVisible
- the flagpublic boolean isGroupHeaderEnabled()
public void setGroupHeaderEnabled(boolean groupHeaderEnabled)
groupHeaderEnabled
- the flagpublic int getLabelHeight()
public void setLabelHeight(int labelHeight)
labelHeight
- the height of the labelpublic Font getLabelFont()
setLabelFont(java.awt.Font)
public void setLabelFont(Font labelFont)
labelFont
- the font