com.dlsc.flexgantt.swing.layer.timeline

## Class DefaultActivityObjectRenderer

- java.lang.Object
- - java.awt.Component
  - - java.awt.Container
    - - javax.swing.JComponent
      - - javax.swing.JPanel
        - - com.dlsc.flexgantt.swing.layer.timeline.DefaultTimelineObjectRenderer
          - - com.dlsc.flexgantt.swing.layer.timeline.DefaultActivityObjectRenderer

- All Implemented Interfaces:
    ITimelineObjectRenderer, IRenderer, ImageObserver, MenuContainer, Serializable, Accessible

      public class DefaultActivityObjectRenderer
      extends DefaultTimelineObjectRenderer

  A renderer for timeline objects that implement the `IActivityObject` interface. These activities have an attribute called 'percentage complete' that expresses how much of an activity has been completed. The renderer reads this attribute and fills the background of a standard representation of a timeline object with a special color. The amount filled represents the percentage complete value.
  Since:
    1.0
  Version:
    $Revision: 1.8 $
  Author:
    Dirk Lemmermann
  See Also:
    `LayerContainer.setTimelineObjectRenderer(Class, ITimelineObjectRenderer)`, Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class javax.swing.JPanel

      `JPanel.AccessibleJPanel`

    - ### Nested classes/interfaces inherited from class javax.swing.JComponent

      `JComponent.AccessibleJComponent`

    - ### Nested classes/interfaces inherited from class java.awt.Container

      `Container.AccessibleAWTContainer`

    - ### Nested classes/interfaces inherited from class java.awt.Component

      `Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy`

  - ### Field Summary

    - ### Fields inherited from class javax.swing.JComponent

      `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

      `accessibleContext, 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

    Constructors
    Constructor and Description
    `DefaultActivityObjectRenderer()` Constructs a new renderer and sets its (text) foreground color to BLACK and its font to "Helvetica, BOLD, 9".

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected IActivityObject` | `getActivityObject()` Returns the activity object that is currently being rendered.
    `Color` | `getPercentageFillColor1()` Returns the first fill color used for drawing a gradient in the background of the activity object.
    `Color` | `getPercentageFillColor2()` Returns the second fill color used for drawing a gradient in the background of the activity object.
    `Component` | `getTimelineObjectRendererComponent(TimelineObjectLayer layer, TimelineObjectPath path, boolean selected, boolean hasFocus, boolean highlighted, int row)` Returns a component that will be used to renderer the given timeline object.
    `protected void` | `paintActivityContent(Graphics g)` Overrides the super method in order to fill the background of the bar with a special fill color based on the percentage complete value of the activity timeline object.
    `protected void` | `paintActivityFocus(Graphics g)` Adds visual feedback to an activity if it owns the focus.
    `void` | `setPercentageFillColor1(Color color)` Sets the first fill color used for drawing a gradient in the background of the activity object.
    `void` | `setPercentageFillColor2(Color color)` Sets the second fill color used for drawing a gradient in the background of the activity object.

    - ### Methods inherited from class com.dlsc.flexgantt.swing.layer.timeline.DefaultTimelineObjectRenderer

      `firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getActivityFillColor1, getActivityFillColor2, getActivityLineColor, getBarHeight, getDiamondSize, getEventFillColor1, getEventFillColor2, getEventLineColor, getFocusFillColor1, getFocusFillColor2, getFocusLineColor, getHighlightFillColor1, getHighlightFillColor2, getHighlightLineColor, getModel, getNode, getParentFillColor1, getParentFillColor2, getParentLineColor, getPastFillColor1, getPastFillColor2, getResizeHandleColor, getSelectionFillColor1, getSelectionFillColor2, getSelectionLineColor, getTimelineObject, getTimelineObjectLayer, getTimelineObjectPath, getTimelineObjectRendererInsets, hasFocus, invalidate, isDurationChangeable, isEvent, isGlossy, isHighlighted, isParent, isRoundedCorners, isSelected, isStartTimeChangeable, isVisible, isVisualizingPastTime, paintActivityBorder, paintComponent, paintEvent, paintParent, repaint, repaint, repaint, revalidate, setActivityFillColor1, setActivityFillColor2, setActivityLineColor, setBarHeight, setDiamondSize, setEventFillColor1, setEventFillColor2, setEventLineColor, setFocusFillColor1, setFocusFillColor2, setFocusLineColor, setGlossy, setHighlightFillColor1, setHighlightFillColor2, setHighlightLineColor, setParentFillColor1, setParentFillColor2, setParentLineColor, setPastFillColor1, setPastFillColor2, setResizeHandleColor, setRoundedCorners, setSelectionFillColor1, setSelectionFillColor2, setSelectionLineColor, setVisualizingPastTime, validate`

    - ### 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, 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`

    - ### 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, 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, 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`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### DefaultActivityObjectRenderer

          public DefaultActivityObjectRenderer()

      Constructs a new renderer and sets its (text) foreground color to BLACK and its font to "Helvetica, BOLD, 9".
      Since:
        1.0

  - ### Method Detail

    - #### getTimelineObjectRendererComponent

          public Component getTimelineObjectRendererComponent(TimelineObjectLayer layer,
                                                              TimelineObjectPath path,
                                                              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`
      Overrides:
        `getTimelineObjectRendererComponent` in class `DefaultTimelineObjectRenderer`
      Parameters:
        `layer` - the layer in which the timeline object will be rendered
        `path` - the path to the timeline object that gets rendered
        `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

    - #### paintActivityContent

          protected void paintActivityContent(Graphics g)

      Overrides the super method in order to fill the background of the bar with a special fill color based on the percentage complete value of the activity timeline object.
      Overrides:
        `paintActivityContent` in class `DefaultTimelineObjectRenderer`
      Parameters:
        `g` - the graphics context into which to draw
      Since:
        1.0
      See Also:
        `DefaultTimelineObjectRenderer.paintActivityBorder(Graphics)`

    - #### paintActivityFocus

          protected void paintActivityFocus(Graphics g)

      Description copied from class: `DefaultTimelineObjectRenderer`
      Adds visual feedback to an activity if it owns the focus.
      Overrides:
        `paintActivityFocus` in class `DefaultTimelineObjectRenderer`
      Parameters:
        `g` - the graphics context into which to draw

    - #### getPercentageFillColor1

          public Color getPercentageFillColor1()

      Returns the first fill color used for drawing a gradient in the background of the activity object. The amount of the background that will be filled is based on the percentage complete value of the activity object.
      Returns:
        the first color used for filling the background with a gradient
      Since:
        1.0

    - #### setPercentageFillColor1

          public void setPercentageFillColor1(Color color)

      Sets the first fill color used for drawing a gradient in the background of the activity object. The amount of the background that will be filled is based on the percentage complete value of the activity object.
      Parameters:
        `color` - the first color used for filling the background with a gradient
      Since:
        1.0

    - #### getPercentageFillColor2

          public Color getPercentageFillColor2()

      Returns the second fill color used for drawing a gradient in the background of the activity object. The amount of the background that will be filled is based on the percentage complete value of the activity object.
      Returns:
        the second color used for filling the background with a gradient
      Since:
        1.0

    - #### setPercentageFillColor2

          public void setPercentageFillColor2(Color color)

      Sets the second fill color used for drawing a gradient in the background of the activity object. The amount of the background that will be filled is based on the percentage complete value of the activity object.
      Parameters:
        `color` - the second color used for filling the background with a gradient
      Since:
        1.0

    - #### getActivityObject

          protected IActivityObject getActivityObject()

      Returns the activity object that is currently being rendered.
      Returns:
        the rendered activity object
      Since:
        1.0

Copyright © 2006–2020 Dirk Lemmermann Software & Consulting. All rights reserved.