|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel com.dlsc.flexgantt.swing.layer.system.DefaultRowRenderer
public class DefaultRowRenderer
The default row renderer implementation. This renderer is capable of visualizing the row focus and selection state. It also renders grid lines for inner lines.
RowLayer.setRowRenderer(Class, IRowRenderer)
,
ILinePolicy
,
setFocusVisible(boolean)
,
setShowingSelection(boolean)
,
setPaintingLines(boolean)
,
Serialized FormNested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
javax.swing.JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected IGanttChartModel |
model
The model that returned the node for which the row renderer gets invoked. |
protected java.lang.Object |
node
The node for which the row renderer gets invoked. |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
DefaultRowRenderer()
Constructs a new row renderer instance. |
Method Summary | |
---|---|
void |
firePropertyChange(java.lang.String propertyName,
boolean oldValue,
boolean newValue)
Overriden for performance reasons. |
void |
firePropertyChange(java.lang.String propertyName,
byte oldValue,
byte newValue)
Overriden for performance reasons. |
void |
firePropertyChange(java.lang.String propertyName,
char oldValue,
char newValue)
Overriden for performance reasons. |
void |
firePropertyChange(java.lang.String propertyName,
double oldValue,
double newValue)
Overriden for performance reasons. |
void |
firePropertyChange(java.lang.String propertyName,
float oldValue,
float newValue)
Overriden for performance reasons. |
void |
firePropertyChange(java.lang.String propertyName,
long oldValue,
long newValue)
Overriden for performance reasons. |
protected void |
firePropertyChange(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue)
Overriden for performance reasons. |
void |
firePropertyChange(java.lang.String propertyName,
short oldValue,
short newValue)
Overriden for performance reasons. |
java.awt.Color |
getFocusBackground()
Returns the color used for the background when the row is the focus owner. |
java.awt.Color |
getFocusForeground()
Returns the color used for the foreground when the row is the focus owner. |
java.awt.Color |
getLineColor()
Returns the color used for drawing inner lines. |
protected java.awt.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 java.lang.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. |
java.awt.Component |
getRowRendererComponent(RowLayer layer,
java.lang.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. |
protected void |
paintComponent(java.awt.Graphics g)
|
protected void |
paintLines(java.awt.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(java.awt.Color color)
Sets the color used for the background when the row is the focus owner. |
void |
setFocusForeground(java.awt.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(java.awt.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. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, 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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, 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 |
Methods inherited from class java.awt.Container |
---|
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, transferFocusBackward, transferFocusDownCycle, validateTree |
Methods inherited from class java.awt.Component |
---|
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, hide, 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, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected IGanttChartModel model
protected java.lang.Object node
Constructor Detail |
---|
public DefaultRowRenderer()
Method Detail |
---|
public java.awt.Component getRowRendererComponent(RowLayer layer, java.lang.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(java.awt.Graphics g)
paintComponent
in class javax.swing.JComponent
protected void paintLines(java.awt.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 java.awt.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 color
public java.awt.Color getLineColor()
getLineColor(int)
. Subclasses
can override either method to customize the line color.
ILinePolicy
public void setLineColor(java.awt.Color lineColor)
getLineColor(int)
. Subclasses can
override either method to customize the line color.
lineColor
- the lineColor to setprotected IGanttChartModel getModel()
protected java.lang.Object getNode()
protected RowLayer getRowLayer()
public boolean hasFocus()
hasFocus
in class java.awt.Component
protected int getRow()
protected boolean isSelected()
protected ITimeSpan getTimeSpan()
public java.awt.Color getFocusBackground()
public void setFocusBackground(java.awt.Color color)
color
- the focus background color to setpublic java.awt.Color getFocusForeground()
public void setFocusForeground(java.awt.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()
validate
in class java.awt.Container
public void invalidate()
invalidate
in class java.awt.Container
public void revalidate()
revalidate
in class javax.swing.JComponent
public void firePropertyChange(java.lang.String propertyName, boolean oldValue, boolean newValue)
firePropertyChange
in class javax.swing.JComponent
public void firePropertyChange(java.lang.String propertyName, byte oldValue, byte newValue)
firePropertyChange
in class java.awt.Component
public void firePropertyChange(java.lang.String propertyName, char oldValue, char newValue)
firePropertyChange
in class javax.swing.JComponent
public void firePropertyChange(java.lang.String propertyName, double oldValue, double newValue)
firePropertyChange
in class java.awt.Component
public void firePropertyChange(java.lang.String propertyName, float oldValue, float newValue)
firePropertyChange
in class java.awt.Component
public void firePropertyChange(java.lang.String propertyName, long oldValue, long newValue)
firePropertyChange
in class java.awt.Component
protected void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
firePropertyChange
in class java.awt.Component
public void firePropertyChange(java.lang.String propertyName, short oldValue, short newValue)
firePropertyChange
in class java.awt.Component
public void repaint()
repaint
in class java.awt.Component
public void repaint(int x, int y, int width, int height)
repaint
in class java.awt.Component
public void repaint(long tm)
repaint
in class java.awt.Component
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |