com.dlsc.flexgantt.swing.layer.timeline
Class DefaultTimelineObjectRenderer

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by com.dlsc.flexgantt.swing.layer.timeline.DefaultTimelineObjectRenderer
All Implemented Interfaces:
ITimelineObjectRenderer, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible
Direct Known Subclasses:
DefaultActivityObjectRenderer

public class DefaultTimelineObjectRenderer
extends javax.swing.JPanel
implements ITimelineObjectRenderer

The default timeline object renderer implementation draws a bar with rounded corners and fills its background with a smooth gradient paint. The renderer allows the rounded corners to be turned off and the two colors used for filling the gradient background can be changed as well (different colors are supported for selected, focused, or highlighted timeline objects). The renderer also adds a shadow to each timeline object. The offset of this shadow can be changed, too.

Due to the fact that this renderer uses several Java2D features it is not the fastest one that can be written. Less fancy renderers should be even faster. Applications that need to render larger volumes of timeline objects should consider writing their own and slimmed down version of a timeline object renderer.

Since:
1.0
Author:
Dirk Lemmermann
See Also:
LayerContainer.setTimelineObjectRenderer(Class, ITimelineObjectRenderer), Serialized Form

Nested 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
 
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
DefaultTimelineObjectRenderer()
          Constructs a new renderer.
 
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 getActivityFillColor1()
          Returns the first color that will be used for filling the background of the timeline object with a gradient paint.
 java.awt.Color getActivityFillColor2()
          Returns the second color that will be used for filling the background of the timeline object with a gradient paint.
 java.awt.Color getActivityLineColor()
          Returns the line color that will be used for drawing the border of a timeline object if it is an activity (different start and end times).
 int getBarHeight()
          Returns the height that will be used for the bar that will represent an activity timeline object.
 int getDiamondSize()
          Returns the size of the event diamons.
 java.awt.Color getEventFillColor1()
          Returns the first color that will be used for filling the background of the timeline object with a gradient paint in situations where the object is an event (same start and end time).
 java.awt.Color getEventFillColor2()
          Returns the second color that will be used for filling the background of the timeline object with a gradient paint in situations where the object is an event (same start and end time).
 java.awt.Color getEventLineColor()
          Returns the line color that will be used for drawing the border of a timeline object in situations where the object is an event (same start and end time).
 java.awt.Color getFocusFillColor1()
          Returns the first color that will be used for filling the background of the timeline object with a gradient paint in situations where the object has the focus.
 java.awt.Color getFocusFillColor2()
          Returns the second color that will be used for filling the background of the timeline object with a gradient paint in situations where the object has the focus.
 java.awt.Color getFocusLineColor()
          Returns the line color that will be used for drawing the border of a timeline object in situations where the object has the focus.
 java.awt.Color getHighlightFillColor1()
          Returns the first color that will be used for filling the background of the timeline object with a gradient paint in situations where the object is highlighted.
 java.awt.Color getHighlightFillColor2()
          Returns the second color that will be used for filling the background of the timeline object with a gradient paint in situations where the object is highlighted.
 java.awt.Color getHighlightLineColor()
          Returns the line color that will be used for drawing the border of a timeline object in situations where the object is highlighted.
protected  IGanttChartModel getModel()
          Returns the model that provided the currently rendered timeline object.
protected  java.lang.Object getNode()
          Returns the hierarchy (tree) node of the row in which the currently rendered timeline object is located.
 java.awt.Color getParentFillColor1()
          Returns the first background color used for those timeline objects that are parent timeline objects (own children timeline objects).
 java.awt.Color getParentFillColor2()
          Returns the second background color used for those timeline objects that are parent timeline objects (own children timeline objects).
 java.awt.Color getParentLineColor()
          Returns the line color used for those timeline objects that are parent timeline objects (own children timeline objects).
 java.awt.Color getPastFillColor1()
          Returns the first color used for filling the background of an activity when the activity is located in the past (earlier than time now).
 java.awt.Color getPastFillColor2()
          Returns the second color used for filling the background of an activity when the activity is located in the past (earlier than time now).
 java.awt.Color getResizeHandleColor()
          Returns the color used for the resize handles.
 java.awt.Color getSelectionFillColor1()
          Returns the first color that will be used for filling the background of the timeline object with a gradient paint in situations where the object is selected.
 java.awt.Color getSelectionFillColor2()
          Returns the second color that will be used for filling the background of the timeline object with a gradient paint in situations where the object is selected.
 java.awt.Color getSelectionLineColor()
          Sets the line color that will be used for drawing the border of a timeline object in situations where the object is selected.
 java.awt.Color getShadowColor()
          Returns the color that will be used for drawing a shadow below and behind the timeline object.
 int getShadowOffsetX()
          Returns the x offset that will be applied to the shadow of the timeline object.
 int getShadowOffsetY()
          Returns the y offset that will be applied to the shadow of the timeline object.
 float getShadowOpacity()
          Returns the opacity of the shadow that will be rendered below and behind the timeline object.
protected  java.lang.Object getTimelineObject()
          Returns the timeline object that is currently being rendered.
protected  TimelineObjectLayer getTimelineObjectLayer()
          Returns the timeline object layer where the current rendering operation takes place.
 java.awt.Component getTimelineObjectRendererComponent(TimelineObjectLayer layer, java.lang.Object node, java.lang.Object timelineObject, boolean selected, boolean hasFocus, boolean highlighted, int row)
          Returns a component that will be used to renderer the given timeline object.
 java.awt.Insets getTimelineObjectRendererInsets(int x, int y, int width, int height)
          Returns the insets of the object renderer.
 boolean hasFocus()
          Determines whether the currently painted timeline object has the focus or not.
 void invalidate()
          Overriden for performance reasons.
protected  boolean isDurationChangeable()
          Checks the IEditTimelineObjectPolicy to see if the duration of the currently rendered timeline object can be changed.
protected  boolean isEvent()
          Determines whether the currently rendered timeline object represents an event.
 boolean isHighlighted()
          Determines whether the timeline object should be rendered in its highlighted state or not.
 boolean isParent()
          Determines whether the currently rendered timeline object is a parent timeline object, meaning that it contains children timeline objects (also called summary timeline object, compound timeline object).
 boolean isRoundedCorners()
          Determines whether the bars of activity timeline objects will be drawn with rounded corners or not.
protected  boolean isSelected()
          Determines if the rendered timeline object is currently selected.
protected  boolean isStartTimeChangeable()
          Checks the IEditTimelineObjectPolicy to see if the start time of the currently rendered timeline object can be changed.
 boolean isVisualizingPastTime()
          Determines whether the renderer will draw the timeline object differently if the object is located in the past (e.g. gray out).
protected  void paintActivityBorder(java.awt.Graphics g)
          Paints the border of the activity object.
protected  void paintActivityContent(java.awt.Graphics g)
          Renders the timeline object if it is an activity (different start and end time = duration).
protected  void paintActivityFocus(java.awt.Graphics g)
          Adds visual feedback to an activity if it owns the focus.
protected  void paintActivityShadow(java.awt.Graphics g)
          Paints the shadow of the activity object.
protected  void paintComponent(java.awt.Graphics g)
           
protected  void paintEvent(java.awt.Graphics g)
          Renders the timeline object if it is an event (same start and end time).
protected  void paintParent(java.awt.Graphics g)
          Renders the timeline object if it is a parent timeline object, meaning that it contains child timeline objects.
 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 setActivityFillColor1(java.awt.Color color)
          Sets the first color that will be used for filling the background of the timeline object with a gradient paint.
 void setActivityFillColor2(java.awt.Color color)
          Sets the second color that will be used for filling the background of the timeline object with a gradient paint.
 void setActivityLineColor(java.awt.Color color)
          Sets the line color that will be used for drawing the border of a timeline object if it is an activity (different start and end times).
 void setBarHeight(int height)
          Sets the height that will be used for the bar that will represent an activity timeline object.
 void setDiamondSize(int size)
          Sets the size of the event diamonds.
 void setEventFillColor1(java.awt.Color color)
          Sets the first color that will be used for filling the background of the timeline object with a gradient paint in situations where the object is an event (same start and end time).
 void setEventFillColor2(java.awt.Color color)
          Sets the second color that will be used for filling the background of the timeline object with a gradient paint in situations where the object is an event (same start and end time).
 void setEventLineColor(java.awt.Color color)
          Sets the line color that will be used for drawing the border of a timeline object in situations where the object is an event (same start and end time).
 void setFocusFillColor1(java.awt.Color color)
          Sets the first color that will be used for filling the background of the timeline object with a gradient paint in situations where the object has the focus.
 void setFocusFillColor2(java.awt.Color color)
          Sets the second color that will be used for filling the background of the timeline object with a gradient paint in situations where the object has the focus.
 void setFocusLineColor(java.awt.Color color)
          Sets the line color that will be used for drawing the border of a timeline object in situations where the object has the focus.
 void setHighlightFillColor1(java.awt.Color color)
          Sets the first color that will be used for filling the background of the timeline object with a gradient paint in situations where the object is highlighted.
 void setHighlightFillColor2(java.awt.Color color)
          Sets the second color that will be used for filling the background of the timeline object with a gradient paint in situations where the object is highlighted.
 void setHighlightLineColor(java.awt.Color color)
          Sets the line color that will be used for drawing the border of a timeline object in situations where the object is highlighted.
 void setParentFillColor1(java.awt.Color color)
          Sets the first background color used for those timeline objects that are parent timeline objects (own children timeline objects).
 void setParentFillColor2(java.awt.Color color)
          Sets the second background color used for those timeline objects that are parent timeline objects (own children timeline objects).
 void setParentLineColor(java.awt.Color color)
          Sets the line color used for those timeline objects that are parent timeline objects (own children timeline objects).
 void setPastFillColor1(java.awt.Color color)
          Sets the first color used for filling the background of an activity when the activity is located in the past (earlier than time now).
 void setPastFillColor2(java.awt.Color color)
          Sets the second color used for filling the background of an activity when the activity is located in the past (earlier than time now).
 void setResizeHandleColor(java.awt.Color color)
          Sets the color used for the resize handles.
 void setRoundedCorners(boolean b)
          Specifies whether the bars of activity timeline objects will be drawn with rounded corners or not.
 void setSelectionFillColor1(java.awt.Color color)
          Sets the first color that will be used for filling the background of the timeline object with a gradient paint in situations where the object is selected.
 void setSelectionFillColor2(java.awt.Color color)
          Sets the second color that will be used for filling the background of the timeline object with a gradient paint in situations where the object is selected.
 void setSelectionLineColor(java.awt.Color color)
          Sets the line color that will be used for drawing the border of a timeline object in situations where the object is selected.
 void setShadowColor(java.awt.Color color)
          Sets the color that will be used for drawing a shadow below and behind the timeline object.
 void setShadowOffsetX(int offset)
          Sets the x offset that will be applied to the shadow of the timeline object.
 void setShadowOffsetY(int offset)
          Sets the y offset that will be applied to the shadow of the timeline object.
 void setShadowOpacity(float opacity)
          Sets the opacity of the shadow that will be rendered below and behind the timeline object.
 void setVisualizingPastTime(boolean b)
          Specifies whether the renderer will draw the timeline object differently if the object is located in the past (e.g. gray out).
 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
 

Constructor Detail

DefaultTimelineObjectRenderer

public DefaultTimelineObjectRenderer()
Constructs a new renderer.

Since:
1.0
Method Detail

getTimelineObjectRendererComponent

public java.awt.Component getTimelineObjectRendererComponent(TimelineObjectLayer layer,
                                                             java.lang.Object node,
                                                             java.lang.Object timelineObject,
                                                             boolean selected,
                                                             boolean hasFocus,
                                                             boolean highlighted,
                                                             int row)
Description copied from interface: ITimelineObjectRenderer
Returns a component that will be used to renderer the given timeline object.

Specified by:
getTimelineObjectRendererComponent in interface ITimelineObjectRenderer
Parameters:
layer - the layer in which the timeline object will be rendered
node - the tree node that 'owns' the timeline object
timelineObject - the actual timeline object that requires visualization
selected - if TRUE the object is currently selected and the rendering needs to express that
hasFocus - if TRUE the focus is currently on the timeline object and the rendering needs to express that
highlighted - if TRUE the timeline object is highlighted and its appearance needs to vary from its normal appearance (causing a blinking effect)
row - the row in which the object gets drawn
Returns:
the component used for rendering the given object

getTimelineObjectRendererInsets

public java.awt.Insets getTimelineObjectRendererInsets(int x,
                                                       int y,
                                                       int width,
                                                       int height)
Description copied from interface: ITimelineObjectRenderer
Returns the insets of the object renderer. The insets are important if the renderer doesn't use the entire rectangle that it could use (for example a bar that doesn't use the entire height of the row, which is quite common, see also DefaultActivityObjectRenderer).

Specified by:
getTimelineObjectRendererInsets in interface ITimelineObjectRenderer
Parameters:
x - the x-coordinate of the bounds that will be assigned to the renderer component
y - the y-coordinate of the bounds that will be assigned to the renderer component
width - the width of the bounds that will be assigned to the renderer component
height - the height of the bounds that will be assigned to the renderer component
Returns:
the renderers insets (unused space above, below, to the left, to the right)

paintComponent

protected void paintComponent(java.awt.Graphics g)
Overrides:
paintComponent in class javax.swing.JComponent

paintParent

protected void paintParent(java.awt.Graphics g)
Renders the timeline object if it is a parent timeline object, meaning that it contains child timeline objects.

Parameters:
g - the graphics context into which to draw
Since:
1.0

paintActivityFocus

protected void paintActivityFocus(java.awt.Graphics g)
Adds visual feedback to an activity if it owns the focus.

Parameters:
g - the graphics context into which to draw
Since:
1.0

paintEvent

protected void paintEvent(java.awt.Graphics g)
Renders the timeline object if it is an event (same start and end time).

Parameters:
g - the graphics context into which to draw
Since:
1.0

paintActivityContent

protected void paintActivityContent(java.awt.Graphics g)
Renders the timeline object if it is an activity (different start and end time = duration).

Parameters:
g - the graphics context into which to draw
Since:
1.0
See Also:
paintActivityBorder(Graphics), paintActivityShadow(Graphics)

paintActivityShadow

protected void paintActivityShadow(java.awt.Graphics g)
Paints the shadow of the activity object.

Parameters:
g - the graphics context into which to draw
Since:
1.0
See Also:
setShadowOffsetX(int), setShadowOffsetY(int), setShadowOpacity(float)

paintActivityBorder

protected void paintActivityBorder(java.awt.Graphics g)
Paints the border of the activity object.

Parameters:
g - the graphics context into which to draw
Since:
1.0
See Also:
setRoundedCorners(boolean)

getBarHeight

public int getBarHeight()
Returns the height that will be used for the bar that will represent an activity timeline object.

Returns:
the height of the bar
Since:
1.0

setBarHeight

public void setBarHeight(int height)
Sets the height that will be used for the bar that will represent an activity timeline object.

Parameters:
height - the height of the bar
Since:
1.0

getActivityFillColor1

public java.awt.Color getActivityFillColor1()
Returns the first color that will be used for filling the background of the timeline object with a gradient paint.

Returns:
the first fill color for the gradient background
Since:
1.0

setActivityFillColor1

public void setActivityFillColor1(java.awt.Color color)
Sets the first color that will be used for filling the background of the timeline object with a gradient paint.

Parameters:
color - the first fill color for the gradient background
Since:
1.0

getActivityFillColor2

public java.awt.Color getActivityFillColor2()
Returns the second color that will be used for filling the background of the timeline object with a gradient paint.

Returns:
the second fill color for the gradient background
Since:
1.0

setActivityFillColor2

public void setActivityFillColor2(java.awt.Color color)
Sets the second color that will be used for filling the background of the timeline object with a gradient paint.

Parameters:
color - the second fill color for the gradient background
Since:
1.0

getFocusFillColor1

public java.awt.Color getFocusFillColor1()
Returns the first color that will be used for filling the background of the timeline object with a gradient paint in situations where the object has the focus.

Returns:
the first fill color for the gradient background of focused timeline objects
Since:
1.0

setFocusFillColor1

public void setFocusFillColor1(java.awt.Color color)
Sets the first color that will be used for filling the background of the timeline object with a gradient paint in situations where the object has the focus.

Parameters:
color - the first fill color for the gradient background of focused timeline objects
Since:
1.0

getFocusFillColor2

public java.awt.Color getFocusFillColor2()
Returns the second color that will be used for filling the background of the timeline object with a gradient paint in situations where the object has the focus.

Returns:
the second fill color for the gradient background of focused timeline objects
Since:
1.0

setFocusFillColor2

public void setFocusFillColor2(java.awt.Color color)
Sets the second color that will be used for filling the background of the timeline object with a gradient paint in situations where the object has the focus.

Parameters:
color - the second fill color for the gradient background of focused timeline objects
Since:
1.0

getFocusLineColor

public java.awt.Color getFocusLineColor()
Returns the line color that will be used for drawing the border of a timeline object in situations where the object has the focus.

Returns:
the line color for the focused timeline object
Since:
1.0

setFocusLineColor

public void setFocusLineColor(java.awt.Color color)
Sets the line color that will be used for drawing the border of a timeline object in situations where the object has the focus.

Parameters:
color - the line color for the focused timeline object
Since:
1.0

getHighlightFillColor1

public java.awt.Color getHighlightFillColor1()
Returns the first color that will be used for filling the background of the timeline object with a gradient paint in situations where the object is highlighted.

Returns:
the first fill color for the gradient background of highlighted timeline objects
Since:
1.0

setHighlightFillColor1

public void setHighlightFillColor1(java.awt.Color color)
Sets the first color that will be used for filling the background of the timeline object with a gradient paint in situations where the object is highlighted.

Parameters:
color - the first fill color for the gradient background of highlighted timeline objects
Since:
1.0

getHighlightFillColor2

public java.awt.Color getHighlightFillColor2()
Returns the second color that will be used for filling the background of the timeline object with a gradient paint in situations where the object is highlighted.

Returns:
the second fill color for the gradient background of highlighted timeline objects
Since:
1.0

setHighlightFillColor2

public void setHighlightFillColor2(java.awt.Color color)
Sets the second color that will be used for filling the background of the timeline object with a gradient paint in situations where the object is highlighted.

Parameters:
color - the second fill color for the gradient background of highlighted timeline objects
Since:
1.0

getHighlightLineColor

public java.awt.Color getHighlightLineColor()
Returns the line color that will be used for drawing the border of a timeline object in situations where the object is highlighted.

Returns:
the line color for the highlighted timeline object
Since:
1.0

setHighlightLineColor

public void setHighlightLineColor(java.awt.Color color)
Sets the line color that will be used for drawing the border of a timeline object in situations where the object is highlighted.

Parameters:
color - the line color for the highlighted timeline object
Since:
1.0

getActivityLineColor

public java.awt.Color getActivityLineColor()
Returns the line color that will be used for drawing the border of a timeline object if it is an activity (different start and end times).

Returns:
the line color for the activity timeline object
Since:
1.0

setActivityLineColor

public void setActivityLineColor(java.awt.Color color)
Sets the line color that will be used for drawing the border of a timeline object if it is an activity (different start and end times).

Parameters:
color - the line color for the activity timeline object
Since:
1.0

getSelectionFillColor1

public java.awt.Color getSelectionFillColor1()
Returns the first color that will be used for filling the background of the timeline object with a gradient paint in situations where the object is selected.

Returns:
the first fill color for the gradient background of selected timeline objects
Since:
1.0

setSelectionFillColor1

public void setSelectionFillColor1(java.awt.Color color)
Sets the first color that will be used for filling the background of the timeline object with a gradient paint in situations where the object is selected.

Parameters:
color - the first fill color for the gradient background of selected timeline objects
Since:
1.0

getSelectionFillColor2

public java.awt.Color getSelectionFillColor2()
Returns the second color that will be used for filling the background of the timeline object with a gradient paint in situations where the object is selected.

Returns:
the second fill color for the gradient background of selected timeline objects
Since:
1.0

setSelectionFillColor2

public void setSelectionFillColor2(java.awt.Color color)
Sets the second color that will be used for filling the background of the timeline object with a gradient paint in situations where the object is selected.

Parameters:
color - the second fill color for the gradient background of selected timeline objects
Since:
1.0

getSelectionLineColor

public java.awt.Color getSelectionLineColor()
Sets the line color that will be used for drawing the border of a timeline object in situations where the object is selected.

Returns:
the line color for the highlighted timeline object
Since:
1.0

setSelectionLineColor

public void setSelectionLineColor(java.awt.Color color)
Sets the line color that will be used for drawing the border of a timeline object in situations where the object is selected.

Parameters:
color - the line color for the highlighted timeline object
Since:
1.0

getShadowColor

public java.awt.Color getShadowColor()
Returns the color that will be used for drawing a shadow below and behind the timeline object.

Returns:
the color of the shadow
Since:
1.0

setShadowColor

public void setShadowColor(java.awt.Color color)
Sets the color that will be used for drawing a shadow below and behind the timeline object.

Parameters:
color - the color of the shadow
Since:
1.0

getShadowOffsetX

public int getShadowOffsetX()
Returns the x offset that will be applied to the shadow of the timeline object.

Returns:
the x offset of the shadow
Since:
1.0

setShadowOffsetX

public void setShadowOffsetX(int offset)
Sets the x offset that will be applied to the shadow of the timeline object. This value should not exceed a few pixels or otherwise the accuracy of the information shown in the Gantt chart suffers.

Parameters:
offset - the x offset of the shadow
Since:
1.0

getShadowOffsetY

public int getShadowOffsetY()
Returns the y offset that will be applied to the shadow of the timeline object.

Returns:
the y offset of the shadow
Since:
1.0

setShadowOffsetY

public void setShadowOffsetY(int offset)
Sets the y offset that will be applied to the shadow of the timeline object.

Parameters:
offset - the y offset of the shadow
Since:
1.0

getShadowOpacity

public float getShadowOpacity()
Returns the opacity of the shadow that will be rendered below and behind the timeline object. The higher the opacity value the darker the shadow.

Returns:
the shadow opacity
Since:
1.0

setShadowOpacity

public void setShadowOpacity(float opacity)
Sets the opacity of the shadow that will be rendered below and behind the timeline object. The higher the opacity value the darker the shadow.

Parameters:
opacity - the shadow opacity
Since:
1.0

getEventFillColor1

public java.awt.Color getEventFillColor1()
Returns the first color that will be used for filling the background of the timeline object with a gradient paint in situations where the object is an event (same start and end time).

Returns:
the first fill color for the gradient background of timeline objects that are events
Since:
1.0

setEventFillColor1

public void setEventFillColor1(java.awt.Color color)
Sets the first color that will be used for filling the background of the timeline object with a gradient paint in situations where the object is an event (same start and end time).

Parameters:
color - the first fill color for the gradient background of timeline objects that are events
Since:
1.0

getEventFillColor2

public java.awt.Color getEventFillColor2()
Returns the second color that will be used for filling the background of the timeline object with a gradient paint in situations where the object is an event (same start and end time).

Returns:
the second fill color for the gradient background of timeline objects that are events
Since:
1.0

setEventFillColor2

public void setEventFillColor2(java.awt.Color color)
Sets the second color that will be used for filling the background of the timeline object with a gradient paint in situations where the object is an event (same start and end time).

Parameters:
color - the second fill color for the gradient background of timeline objects that are events
Since:
1.0

setEventLineColor

public void setEventLineColor(java.awt.Color color)
Sets the line color that will be used for drawing the border of a timeline object in situations where the object is an event (same start and end time).

Parameters:
color - the line color for the event timeline object
Since:
1.0

getEventLineColor

public java.awt.Color getEventLineColor()
Returns the line color that will be used for drawing the border of a timeline object in situations where the object is an event (same start and end time).

Returns:
the line color for the event timeline object
Since:
1.0

isEvent

protected boolean isEvent()
Determines whether the currently rendered timeline object represents an event.

Returns:
TRUE if the timeline object being rendered is an event
Since:
1.0

isParent

public boolean isParent()
Determines whether the currently rendered timeline object is a parent timeline object, meaning that it contains children timeline objects (also called summary timeline object, compound timeline object).

Returns:
TRUE if the timeline object rendered is a parent timeline object
Since:
1.0

hasFocus

public boolean hasFocus()
Determines whether the currently painted timeline object has the focus or not. To be consistent with the rest of the API this method should have been called isFocused() but the user could get confused with the hasFocus() method of the superclass.

Overrides:
hasFocus in class java.awt.Component
Returns:
TRUE if the currently painted timeline object has the focus
Since:
1.0

getTimelineObjectLayer

protected TimelineObjectLayer getTimelineObjectLayer()
Returns the timeline object layer where the current rendering operation takes place.

Returns:
the timeline object layer
Since:
1.0

getModel

protected IGanttChartModel getModel()
Returns the model that provided the currently rendered timeline object.

Returns:
the data source from which the timeline object originated
Since:
1.0

getNode

protected java.lang.Object getNode()
Returns the hierarchy (tree) node of the row in which the currently rendered timeline object is located.

Returns:
the owning hierarchy (tree) node of the timeline object
Since:
1.0

getTimelineObject

protected java.lang.Object getTimelineObject()
Returns the timeline object that is currently being rendered.

Returns:
the rendered timeline object
Since:
1.0

isSelected

protected boolean isSelected()
Determines if the rendered timeline object is currently selected.

Returns:
TRUE if the timeline object being rendered is selected
Since:
1.0

isHighlighted

public boolean isHighlighted()
Determines whether the timeline object should be rendered in its highlighted state or not. Highlighting is used for making timeline objects stand out visually to indicate to the user that they require his attention. The highlighting flag gets toggled via a thread managed by the LayerContainer. This thread runs whenever at least one timeline object is highlighted.

Returns:
TRUE if the timeline object is highlighted
Since:
1.0
See Also:
LayerContainer.addHighlightedObjects(java.util.Collection), LayerContainer.isHighlighted(com.dlsc.flexgantt.model.gantt.TimelineObjectPath)

isVisualizingPastTime

public boolean isVisualizingPastTime()
Determines whether the renderer will draw the timeline object differently if the object is located in the past (e.g. gray out).

Returns:
TRUE if timeline objects located in the past are drawn in a different way
Since:
1.0

setVisualizingPastTime

public void setVisualizingPastTime(boolean b)
Specifies whether the renderer will draw the timeline object differently if the object is located in the past (e.g. gray out).

Parameters:
b - TRUE timeline objects located in the past will be drawn in a different way
Since:
1.0

isRoundedCorners

public boolean isRoundedCorners()
Determines whether the bars of activity timeline objects will be drawn with rounded corners or not.

Returns:
TRUE if the activity bars will feature rounded corners
Since:
1.0

setRoundedCorners

public void setRoundedCorners(boolean b)
Specifies whether the bars of activity timeline objects will be drawn with rounded corners or not.

Parameters:
b - if TRUE the activity bars will feature rounded corners
Since:
1.0

getResizeHandleColor

public java.awt.Color getResizeHandleColor()
Returns the color used for the resize handles.

Returns:
the handle color
Since:
1.0

setResizeHandleColor

public void setResizeHandleColor(java.awt.Color color)
Sets the color used for the resize handles.

Parameters:
color - the handle color
Since:
1.0

getDiamondSize

public int getDiamondSize()
Returns the size of the event diamons.

Returns:
the diamond size
Since:
1.0

setDiamondSize

public void setDiamondSize(int size)
Sets the size of the event diamonds.

Parameters:
size - the diamond size
Since:
1.0

getParentFillColor1

public java.awt.Color getParentFillColor1()
Returns the first background color used for those timeline objects that are parent timeline objects (own children timeline objects).

Returns:
the first parent background color
Since:
1.0
See Also:
IGanttChartModel.isParentTimelineObject(Object)

setParentFillColor1

public void setParentFillColor1(java.awt.Color color)
Sets the first background color used for those timeline objects that are parent timeline objects (own children timeline objects).

Parameters:
color - the first parent background color
Since:
1.0
See Also:
IGanttChartModel.isParentTimelineObject(Object)

getParentFillColor2

public java.awt.Color getParentFillColor2()
Returns the second background color used for those timeline objects that are parent timeline objects (own children timeline objects).

Returns:
the second parent background color
Since:
1.0
See Also:
IGanttChartModel.isParentTimelineObject(Object)

setParentFillColor2

public void setParentFillColor2(java.awt.Color color)
Sets the second background color used for those timeline objects that are parent timeline objects (own children timeline objects).

Parameters:
color - the second parent background color
Since:
1.0
See Also:
IGanttChartModel.isParentTimelineObject(Object)

getParentLineColor

public java.awt.Color getParentLineColor()
Returns the line color used for those timeline objects that are parent timeline objects (own children timeline objects).

Returns:
the parent line color
Since:
1.0
See Also:
IGanttChartModel.isParentTimelineObject(Object)

setParentLineColor

public void setParentLineColor(java.awt.Color color)
Sets the line color used for those timeline objects that are parent timeline objects (own children timeline objects).

Parameters:
color - the parent line color
Since:
1.0
See Also:
IGanttChartModel.isParentTimelineObject(Object)

getPastFillColor1

public java.awt.Color getPastFillColor1()
Returns the first color used for filling the background of an activity when the activity is located in the past (earlier than time now).

Returns:
the first background color for past activities
Since:
1.0

setPastFillColor1

public void setPastFillColor1(java.awt.Color color)
Sets the first color used for filling the background of an activity when the activity is located in the past (earlier than time now).

Parameters:
color - the first background color for past activities
Since:
1.0

getPastFillColor2

public java.awt.Color getPastFillColor2()
Returns the second color used for filling the background of an activity when the activity is located in the past (earlier than time now).

Returns:
the second background color for past activities
Since:
1.0

setPastFillColor2

public void setPastFillColor2(java.awt.Color color)
Sets the second color used for filling the background of an activity when the activity is located in the past (earlier than time now).

Parameters:
color - the second background color for past activities
Since:
1.0

isStartTimeChangeable

protected boolean isStartTimeChangeable()
Checks the IEditTimelineObjectPolicy to see if the start time of the currently rendered timeline object can be changed. This is important to know when drawing resize handles. These can only be added on the left edge of the eventline object when its duration AND its start time can be changed.

Returns:
TRUE if the start time of the timeline object can be changed
Since:
1.0

isDurationChangeable

protected boolean isDurationChangeable()
Checks the IEditTimelineObjectPolicy to see if the duration of the currently rendered timeline object can be changed. This is important to know when drawing resize handles.

Returns:
TRUE if the duration of the timeline object can be changed
Since:
1.0

validate

public void validate()
Overriden for performance reasons.

Overrides:
validate in class java.awt.Container
Since:
1.0

invalidate

public void invalidate()
Overriden for performance reasons.

Overrides:
invalidate in class java.awt.Container
Since:
1.0

revalidate

public void revalidate()
Overriden for performance reasons.

Overrides:
revalidate in class javax.swing.JComponent
Since:
1.0

firePropertyChange

public void firePropertyChange(java.lang.String propertyName,
                               boolean oldValue,
                               boolean newValue)
Overriden for performance reasons.

Overrides:
firePropertyChange in class javax.swing.JComponent
Since:
1.0

firePropertyChange

public void firePropertyChange(java.lang.String propertyName,
                               byte oldValue,
                               byte newValue)
Overriden for performance reasons.

Overrides:
firePropertyChange in class java.awt.Component
Since:
1.0

firePropertyChange

public void firePropertyChange(java.lang.String propertyName,
                               char oldValue,
                               char newValue)
Overriden for performance reasons.

Overrides:
firePropertyChange in class javax.swing.JComponent
Since:
1.0

firePropertyChange

public void firePropertyChange(java.lang.String propertyName,
                               double oldValue,
                               double newValue)
Overriden for performance reasons.

Overrides:
firePropertyChange in class java.awt.Component
Since:
1.0

firePropertyChange

public void firePropertyChange(java.lang.String propertyName,
                               float oldValue,
                               float newValue)
Overriden for performance reasons.

Overrides:
firePropertyChange in class java.awt.Component
Since:
1.0

firePropertyChange

public void firePropertyChange(java.lang.String propertyName,
                               long oldValue,
                               long newValue)
Overriden for performance reasons.

Overrides:
firePropertyChange in class java.awt.Component
Since:
1.0

firePropertyChange

protected void firePropertyChange(java.lang.String propertyName,
                                  java.lang.Object oldValue,
                                  java.lang.Object newValue)
Overriden for performance reasons.

Overrides:
firePropertyChange in class java.awt.Component
Since:
1.0

firePropertyChange

public void firePropertyChange(java.lang.String propertyName,
                               short oldValue,
                               short newValue)
Overriden for performance reasons.

Overrides:
firePropertyChange in class java.awt.Component
Since:
1.0

repaint

public void repaint()
Overriden for performance reasons.

Overrides:
repaint in class java.awt.Component
Since:
1.0

repaint

public void repaint(int x,
                    int y,
                    int width,
                    int height)
Overriden for performance reasons.

Overrides:
repaint in class java.awt.Component
Since:
1.0

repaint

public void repaint(long tm)
Overriden for performance reasons.

Overrides:
repaint in class java.awt.Component
Since:
1.0