public class DefaultRowRenderer extends JPanel implements IRowRenderer
RowLayer.setRowRenderer(Class, IRowRenderer)
,
ILinePolicy
,
setFocusVisible(boolean)
,
setShowingSelection(boolean)
,
setPaintingLines(boolean)
,
Serialized FormJPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
protected IGanttChartModel |
model
The model that returned the node for which the row renderer gets invoked.
|
protected Object |
node
The node for which the row renderer gets invoked.
|
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
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
DefaultRowRenderer()
Constructs a new row renderer instance.
|
Modifier and Type | Method and Description |
---|---|
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.
|
Color |
getFocusBackground()
Returns the color used for the background when the row is the focus
owner.
|
Color |
getFocusForeground()
Returns the color used for the foreground when the row is the focus
owner.
|
Color |
getLineColor()
Returns the color used for drawing inner lines.
|
protected Color |
getLineColor(int lineIndex)
Returns the line color for the given line index.
|
protected IGanttChartModel |
getModel()
Returns the Gantt chart model of which the node in need of rendering is a
member.
|
protected Object |
getNode()
Returns the tree node shown in the row that gets currently drawn.
|
protected int |
getRow()
Returns the row number of the currently drawn row.
|
protected RowLayer |
getRowLayer()
Returns the row layer in which the drawing takes place.
|
Component |
getRowRendererComponent(RowLayer layer,
Object node,
boolean selected,
int row,
ITimeSpan span,
boolean hasFocus)
Returns a component that will be used for renderering additional
information about a row (for example resource capacity lines).
|
protected ITimeSpan |
getTimeSpan()
Returns the time span that is currently being drawn by the renderer.
|
boolean |
hasFocus() |
void |
invalidate()
Overriden for performance reasons.
|
boolean |
isDebug()
Determines whether the visual debugging feature is turned on for the row
renderer.
|
boolean |
isFocusVisible()
Determines if the row renderer will visualize that the row is the current
focus owner.
|
boolean |
isPaintingLines()
Determines whether the renderer also draws lines for each inner line
shown inside the row.
|
protected boolean |
isSelected()
Determines whether the current row is considered 'selected' or not.
|
boolean |
isShowingSelection()
Determines if the row renderer will show the selection state of the row.
|
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) |
protected void |
paintLines(Graphics g)
Draws the inner lines of the row.
|
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 |
setDebug(boolean debug)
Specifies whether the visual debugging feature is turned on for the row
renderer.
|
void |
setFocusBackground(Color color)
Sets the color used for the background when the row is the focus owner.
|
void |
setFocusForeground(Color color)
Sets the color used for the foreground when the row is the focus owner.
|
void |
setFocusVisible(boolean visible)
Specifies whether the row renderer will visualize that the row is the
current focus owner.
|
void |
setLineColor(Color lineColor)
Sets the color used for drawing inner lines.
|
void |
setPaintingLines(boolean paint)
Specifies whether the renderer also draws lines for each inner line shown
inside the row.
|
void |
setShowingSelection(boolean show)
Specifies whether the row renderer will show the selection state of the
row.
|
void |
validate()
Overriden for performance reasons.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, 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, imageUpdate, 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 IGanttChartModel model
protected Object node
public DefaultRowRenderer()
public Component getRowRendererComponent(RowLayer layer, Object node, boolean selected, int row, ITimeSpan span, boolean hasFocus)
IRowRenderer
Integer.MAX_VALUE
). The
rendering routine needs to use the clipping information for its paint
operations to guarantee high performance.getRowRendererComponent
in interface IRowRenderer
layer
- the layer component that will lookup the renderer and call its
paint methodnode
- the tree table / Gantt chart node for the given rowselected
- a flag indicating whether the row is currently selected on the
left-hand side. Usually selections are only visualized in the
tree table but row renderers are free to choose whether they
would also like to visualize itrow
- the row for which a renderer component gets requestedspan
- the time span that needs to be painted. This span is not
equivalent to the entire span of the Gantt chart. It is the
time span that covers the clip that needs to be painted.hasFocus
- a flag indicating whether the row currently has the focus (the
mouse cursor hovers on top of it)protected void paintComponent(Graphics g)
paintComponent
in class JComponent
protected void paintLines(Graphics g)
g
- the graphics context into which to drawILinePolicy
public boolean isPaintingLines()
public void setPaintingLines(boolean paint)
paint
- if TRUE the renderer will draw a line for each inner lineprotected Color getLineColor(int lineIndex)
Color.GRAY
. This default color can
be changed by calling setLineColor(Color)
.lineIndex
- the line index for which to return a colorpublic Color getLineColor()
getLineColor(int)
. Subclasses
can override either method to customize the line color.ILinePolicy
public void setLineColor(Color lineColor)
getLineColor(int)
. Subclasses can
override either method to customize the line color.lineColor
- the lineColor to setprotected IGanttChartModel getModel()
protected Object getNode()
protected RowLayer getRowLayer()
protected int getRow()
protected boolean isSelected()
protected ITimeSpan getTimeSpan()
public Color getFocusBackground()
public void setFocusBackground(Color color)
color
- the focus background color to setpublic Color getFocusForeground()
public void setFocusForeground(Color color)
color
- the focus foreground color to setpublic boolean isFocusVisible()
setFocusForeground(Color)
,
setFocusBackground(Color)
public void setFocusVisible(boolean visible)
visible
- if TRUE the renderer will show the focussetFocusForeground(Color)
,
setFocusBackground(Color)
public boolean isShowingSelection()
public void setShowingSelection(boolean show)
show
- if TRUE the renderer will fill its background with the
selection color from the tree tablepublic boolean isDebug()
public void setDebug(boolean debug)
debug
- if TRUE the debugging feature will be turned onpublic 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.