com.dlsc.flexgantt.swing.layer.system

## Class DatelineLayer

- java.lang.Object
- - com.dlsc.flexgantt.swing.layer.AbstractLayer
  - - com.dlsc.flexgantt.swing.layer.system.AbstractSystemLayer
    - - com.dlsc.flexgantt.swing.layer.system.DatelineLayer

- All Implemented Interfaces:
    PropertyChangeListener, EventListener

      public class DatelineLayer
      extends AbstractSystemLayer
      implements PropertyChangeListener

  The dateline layer visualizes the time span that currently has the focus in the dateline so that the user can more easily identify the timeline objects that intersect with this span. The focused time span is the time span between two major or minor grid locations, depending on whether the mouse cursor hovers over the upper or the lower part of the dateline. The dateline layer will draw a semi-transparent rectangle from the top to the bottom of the layer container. The transparency of the rectangle can be controlled with the layer's alpha value. The layer will draw the same rectangle when the user performs a time span selection in the dateline.

  The layer also draws vertical lines at the beginning and the end of the currently used horizon.

  Since:
    1.0
  Version:
    $Revision: 1.8 $
  Author:
    Dirk Lemmermann

- - ### Field Summary

    - ### Fields inherited from class com.dlsc.flexgantt.swing.layer.AbstractLayer

      `alpha, changeSupport, ganttChart, layerContainer, PROPERTY_ALPHA, PROPERTY_VISIBLE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DatelineLayer(LayerContainer lc)` Constructs a new dateline layer.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Paint` | `getFocusedTimeSpanFillPaint()` Returns the paint object used for filling the focused time span rectangle.
    `Paint` | `getFocusedTimeSpanLinePaint()` Returns the paint object used for drawing the lines of the focused time span rectangle.
    `boolean` | `isFocusedTimeVisible()` Determines whether the focused time span will be shown or not.
    `boolean` | `isHorizonLimitsVisible()` Determines if the visual indicators for the bounds of the dateline horizon will be shown by the layer or not.
    `protected void` | `paintHorizonLimits(ITimeSpan horizon, Graphics g)` Draws the visual feedback for the horizon used by the `Dateline`.
    `protected void` | `paintLayer(Graphics g)`
    `void` | `propertyChange(PropertyChangeEvent evt)`
    `void` | `setFocusedTimeSpanFillPaint(Paint fillPaint)` Sets the paint object used for filling the focused time span rectangle.
    `void` | `setFocusedTimeSpanLinePaint(Paint color)` Sets the paint object used for drawing the lines of the focused time span rectangle.
    `void` | `setFocusedTimeVisible(boolean visible)` Specifies whether the focused time span will be shown or not.
    `void` | `setHorizonLimitsVisible(boolean visible)` Specifies whether the visual indicators for the bounds of the dateline horizon will be shown by the layer or not.

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

      `addPropertyChangeListener, getAlpha, getDateline, getEventline, getGanttChart, getHeight, getLayerContainer, getLayerPolicyProvider, getModel, getName, getStartRow, getTimeAt, getTimeline, getTimeLocation, getTimeSpanUsed, getToolTipText, getTreeTable, getTreeTablePolicyProvider, getWidth, isVisible, removePropertyChangeListener, repaint, repaint, repaint, setAlpha, setVisible, tearDown`

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

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

- - ### Constructor Detail

    - #### DatelineLayer

          public DatelineLayer(LayerContainer lc)

      Constructs a new dateline layer.
      Parameters:
        `lc` - the layer container to which the layer belongs
      Since:
        1.0

  - ### Method Detail

    - #### paintLayer

          protected void paintLayer(Graphics g)

      Overrides:
        `paintLayer` in class `AbstractLayer`

    - #### paintHorizonLimits

          protected void paintHorizonLimits(ITimeSpan horizon,
                                            Graphics g)

      Draws the visual feedback for the horizon used by the `Dateline`. The area before and after the horizon becomes grayed out by this method, which fills the area with a two dot texture.
      Parameters:
        `horizon` - the horizon of the `Dateline`
        `g` - the graphics context into which to draw
      Since:
        1.1.1

    - #### propertyChange

          public void propertyChange(PropertyChangeEvent evt)

      Specified by:
        `propertyChange` in interface `PropertyChangeListener`

    - #### getFocusedTimeSpanFillPaint

          public Paint getFocusedTimeSpanFillPaint()

      Returns the paint object used for filling the focused time span rectangle.
      Returns:
        the paint used for filling the focused time span rectangle
      Since:
        1.0

    - #### setFocusedTimeSpanFillPaint

          public void setFocusedTimeSpanFillPaint(Paint fillPaint)

      Sets the paint object used for filling the focused time span rectangle.
      Parameters:
        `fillPaint` - the paint used for filling the focused time span rectangle
      Since:
        1.0

    - #### getFocusedTimeSpanLinePaint

          public Paint getFocusedTimeSpanLinePaint()

      Returns the paint object used for drawing the lines of the focused time span rectangle.
      Returns:
        the focused time span line paint
      Since:
        1.0

    - #### setFocusedTimeSpanLinePaint

          public void setFocusedTimeSpanLinePaint(Paint color)

      Sets the paint object used for drawing the lines of the focused time span rectangle.
      Parameters:
        `color` - the focused time span line paint
      Since:
        1.0

    - #### isFocusedTimeVisible

          public boolean isFocusedTimeVisible()

      Determines whether the focused time span will be shown or not.
      Returns:
        TRUE if the focused time span gets shown
      Since:
        1.0

    - #### setFocusedTimeVisible

          public void setFocusedTimeVisible(boolean visible)

      Specifies whether the focused time span will be shown or not.
      Parameters:
        `visible` - if TRUE the focused time span gets shown
      Since:
        1.0

    - #### isHorizonLimitsVisible

          public boolean isHorizonLimitsVisible()

      Determines if the visual indicators for the bounds of the dateline horizon will be shown by the layer or not.
      Returns:
        TRUE if the indicators are visible
      Since:
        1.1.1

    - #### setHorizonLimitsVisible

          public void setHorizonLimitsVisible(boolean visible)

      Specifies whether the visual indicators for the bounds of the dateline horizon will be shown by the layer or not.
      Parameters:
        `visible` - if TRUE the indicators will be shown
      Since:
        1.1.1

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