public class DefaultTreeTableRowHeaderRenderer extends JLabel implements ITreeTableRowHeaderRenderer
IRowHeaderRenderer
.AbstractRowHeader.setRowHeaderRenderer(Class, IRowHeaderRenderer)
,
AbstractGanttChart.setTreeTableRowHeaderWidth(int)
,
Serialized FormModifier and Type | Class and Description |
---|---|
static class |
DefaultTreeTableRowHeaderRenderer.Type
A type enumerator that is used to indicate to the renderer whether the
application wants standard row numbers to be shown or information based
on model information.
|
JLabel.AccessibleJLabel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
protected Icon |
createIcon
The icon used to mark the row where the user can create a new entry.
|
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
DefaultTreeTableRowHeaderRenderer()
Constructs a new renderer.
|
DefaultTreeTableRowHeaderRenderer(DefaultTreeTableRowHeaderRenderer.Type type)
Constructs a new renderer.
|
Modifier and Type | Method and Description |
---|---|
protected String |
createText(Object rowHeaderValue)
Returns a text representation of the given row header value that was
previously retrieved from the tree table model.
|
void |
firePropertyChange(String propertyName,
boolean oldValue,
boolean newValue)
Overriden for performance reasons.
|
void |
firePropertyChange(String propertyName,
byte oldValue,
byte newValue)
Overriden for performance reasons.
|
void |
firePropertyChange(String propertyName,
char oldValue,
char newValue)
Overriden for performance reasons.
|
void |
firePropertyChange(String propertyName,
double oldValue,
double newValue)
Overriden for performance reasons.
|
void |
firePropertyChange(String propertyName,
float oldValue,
float newValue)
Overriden for performance reasons.
|
void |
firePropertyChange(String propertyName,
long oldValue,
long newValue)
Overriden for performance reasons.
|
protected void |
firePropertyChange(String propertyName,
Object oldValue,
Object newValue)
Overriden for performance reasons.
|
void |
firePropertyChange(String propertyName,
short oldValue,
short newValue)
Overriden for performance reasons.
|
Icon |
getCollapsedIcon()
Returns the icon shown by the row header renderer to express that the
tree node is collapsed.
|
Icon |
getCreateIcon()
Returns the icon used to mark the row where new entries can be created.
|
Icon |
getEmptyIcon()
Returns the placeholder icon used for a row header renderer if a row can
not be expanded or collapsed.
|
Icon |
getExpandedIcon()
Returns the icon shown by the row header renderer to express that the
tree node is expanded.
|
Color |
getFocusBackground()
Returns the background color used for indicating that the header is the
focus owner.
|
Color |
getFocusForeground()
Returns the foreground color used for indicating that the header is the
focus owner.
|
Component |
getRowHeaderRendererComponent(TreeTableRowHeader header,
Object node,
Object headerValue,
int depth,
boolean selected,
boolean expanded,
boolean leaf,
int row,
boolean hasFocus,
boolean newNodePosition)
Returns a component suitable for rendering a row header.
|
Rectangle |
getRowHeaderToggleBounds(TreeTableRowHeader header,
int x,
int y,
int width,
int height)
Returns the bounds of the toggle used for expanding and collapsing the
hierarchy / tree table node.
|
void |
invalidate()
Overriden for performance reasons.
|
boolean |
isDisplayedAsLeaf(ITreeTableModel model,
Object node)
Determines whether the given node will be displayed as a leaf or not.
|
boolean |
isShowingFocus()
Determines whether the renderer visualizes mouse over events or not.
|
boolean |
isShowingSelection()
Determines whether the renderer visualizes that the row next to it is
currently selected.
|
boolean |
isVisible()
Overriden in order to fix a bug in AWT, which causes the cursor to
flicker during drag and drop operations.
|
protected void |
paintComponent(Graphics g) |
void |
repaint()
Overriden for performance reasons.
|
void |
repaint(int x,
int y,
int width,
int height)
Overriden for performance reasons.
|
void |
repaint(long tm)
Overriden for performance reasons.
|
void |
revalidate()
Overriden for performance reasons.
|
void |
setCollapsedIcon(Icon icon)
Sets the icon shown by the row header renderer to express that the tree
node is collapsed.
|
void |
setCreateIcon(Icon icon)
Sets the icon used to mark the row where new entries can be created.
|
void |
setExpandedIcon(Icon icon)
Sets the icon shown by the row header renderer to express that the tree
node is expanded.
|
void |
setFocusBackground(Color color)
Sets the background color used for indicating that the header is the
focus owner.
|
void |
setFocusForeground(Color color)
Sets the foreground color used for indicating that the header is the
focus owner.
|
void |
setShowingFocus(boolean showingFocus)
Determines whether the renderer visualizes mouse over events or not.
|
void |
setShowingSelection(boolean showingSelection)
Determines whether the renderer visualizes that the row next to it is
currently selected.
|
void |
validate()
Overriden for performance reasons.
|
checkHorizontalKey, checkVerticalKey, getAccessibleContext, getDisabledIcon, getDisplayedMnemonic, getDisplayedMnemonicIndex, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getLabelFor, getText, getUI, getUIClassID, getVerticalAlignment, getVerticalTextPosition, imageUpdate, paramString, setDisabledIcon, setDisplayedMnemonic, setDisplayedMnemonic, setDisplayedMnemonicIndex, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setLabelFor, setText, setUI, setVerticalAlignment, setVerticalTextPosition, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, 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, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, 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, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, 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, 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, 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, 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, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, 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, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
protected Icon createIcon
public DefaultTreeTableRowHeaderRenderer(DefaultTreeTableRowHeaderRenderer.Type type)
type
- the type of rendering requested from the rendererpublic DefaultTreeTableRowHeaderRenderer()
public void setExpandedIcon(Icon icon)
icon
- the icon shown by the row header renderer to express that the
tree node is expandedpublic Icon getExpandedIcon()
public void setCollapsedIcon(Icon icon)
icon
- the icon shown by the row header renderer to express that the
tree node is collapsedpublic Icon getCollapsedIcon()
public Icon getEmptyIcon()
public Component getRowHeaderRendererComponent(TreeTableRowHeader header, Object node, Object headerValue, int depth, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus, boolean newNodePosition)
IRowHeaderRenderer
getRowHeaderRendererComponent
in interface IRowHeaderRenderer<TreeTableRowHeader>
header
- the row header component in which the header gets rendererdnode
- the tree node to which the row header belongsheaderValue
- the header value objectdepth
- the hierarcy depth of the row for which the header gets
renderedselected
- a flag signalling whether the row is currently selectedexpanded
- a flag signalling whether the hierarcy node to which the
header belongs is currently in an expanded state (opened)leaf
- a flag signalling whether the hierarchy node to which the
header belongs is a leaf (has no children)row
- the row in which the header is locatedhasFocus
- a flag signalling whether the header is the focus ownernewNodePosition
- a flag signalling whether the row is used for creating new
tree nodespublic boolean isDisplayedAsLeaf(ITreeTableModel model, Object node)
ITreeTableRowHeaderRenderer
DefaultTreeTableRowHeaderRenderer
calls
TreeModel.isLeaf(Object)
. Subclasses can choose to change this
behaviour by, for example, changing the code to check the child count of
the node. This way the expansion icon could be configured to only show up
if the tree node actually does have at least one child.isDisplayedAsLeaf
in interface ITreeTableRowHeaderRenderer
model
- the tree model to which the node belongsnode
- the tree node to checkprotected String createText(Object rowHeaderValue)
rowHeaderValue
- the row header value that will be shown by the rendererITreeTableModel.getRowHeaderValue(Object)
public Icon getCreateIcon()
setCreateIcon(Icon)
public void setCreateIcon(Icon icon)
icon
- the icon that will be shown in the row where new rows can be
createdsetCreateIcon(Icon)
protected void paintComponent(Graphics g)
paintComponent
in class JComponent
public Rectangle getRowHeaderToggleBounds(TreeTableRowHeader header, int x, int y, int width, int height)
ITreeTableRowHeaderRenderer
getRowHeaderToggleBounds
in interface ITreeTableRowHeaderRenderer
header
- the row header componentx
- the x-coordinate where the header will be renderedy
- the y-coordinate where the header will be renderedwidth
- the width of the headerheight
- the height of the headerpublic Color getFocusForeground()
public void setFocusForeground(Color color)
color
- the focus foreground colorpublic Color getFocusBackground()
public void setFocusBackground(Color color)
color
- the focus background colorpublic boolean isShowingFocus()
public void setShowingFocus(boolean showingFocus)
showingFocus
- if TRUE the renderer draws differently when the mouse hovers
over itpublic boolean isShowingSelection()
public void setShowingSelection(boolean showingSelection)
showingSelection
- if TRUE the renderer draws differently when the row is
selected itpublic void validate()
public void invalidate()
invalidate
in class Container
public void revalidate()
revalidate
in class JComponent
public void firePropertyChange(String propertyName, boolean oldValue, boolean newValue)
firePropertyChange
in class JComponent
public void firePropertyChange(String propertyName, byte oldValue, byte newValue)
firePropertyChange
in class Component
public void firePropertyChange(String propertyName, char oldValue, char newValue)
firePropertyChange
in class JComponent
public void firePropertyChange(String propertyName, double oldValue, double newValue)
firePropertyChange
in class Component
public void firePropertyChange(String propertyName, float oldValue, float newValue)
firePropertyChange
in class Component
public void firePropertyChange(String propertyName, long oldValue, long newValue)
firePropertyChange
in class Component
protected void firePropertyChange(String propertyName, Object oldValue, Object newValue)
firePropertyChange
in class Component
public void firePropertyChange(String propertyName, short oldValue, short newValue)
firePropertyChange
in class Component
public void repaint()
public void repaint(int x, int y, int width, int height)
public void repaint(long tm)
Copyright © 2006–2020 Dirk Lemmermann Software & Consulting. All rights reserved.