com.dlsc.flexgantt.swing.timeline

## Class Eventline

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

- All Implemented Interfaces:
    IEventlineModelListener, IEventlineSelectionListener, IGridComponent, IDragLayerListener, ILassoLayerListener, MouseListener, MouseMotionListener, ImageObserver, KeyEventDispatcher, MenuContainer, PropertyChangeListener, Serializable, EventListener, Accessible
  Direct Known Subclasses:
    MacEventline, SimpleEventline

      public class Eventline
      extends JPanel
      implements IEventlineModelListener, IEventlineSelectionListener, MouseListener, MouseMotionListener, PropertyChangeListener, IGridComponent, IDragLayerListener, ILassoLayerListener, KeyEventDispatcher

  The eventline is one part of the timeline (the `Dateline` is the other) and responsible for rendering events and activities that are common to all hierarchy nodes (for example company holidays, national holidays, etc...). The eventline uses an `IEventlineModel` as its data source. The objects returned by the model are rendered by `IEventlineObjectRenderer` instances. The eventline is also capable of showing the current system time (time now).
  Since:
    1.0
  Version:
    $Revision: 1.20 $
  Author:
    Dirk Lemmermann
  See Also:
    Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `Eventline.EventlineEditMode` An enumeration of possible editing states that the eventline can be in.

    - ### 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
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `PROPERTY_CREATE_EVENTLNE_OBJECTS_ENABLED` Constant used for property change events that get fired if the eventline object creation mode changes.
    `static String` | `PROPERTY_EVENTLINE_MODEL` Constant used for property change events that get fired if the eventline model changes.
    `static String` | `PROPERTY_EVENTLINE_SELECTION_MODEL` Constant used for property change events that get fired if the eventline selection model changes.
    `static String` | `PROPERTY_POLICY_PROVIDER` Constant used for property change events that get fired if the policy provider changes.
    `static String` | `PROPERTY_TIME_NOW` Constant used for property change events that get fired if the time now variable changes.

    - ### 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
    `Eventline(Timeline timeline, Dateline dateline)` Constructs a new eventline.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addGridComponentListener(IGridComponentListener l)` Adds a listener to the grid component.
    `protected Cursor` | `createEditModeCursor(Eventline.EventlineEditMode mode)` Creates a cursor for the given edit mode.
    `void` | `deleteSelectedEventlineObjects()` Deletes all currently selected eventline objects.
    `boolean` | `dispatchKeyEvent(KeyEvent e)`
    `void` | `dragging(DragLayerEvent evt)` Listener callback method that will be invoked when the user starts, executes or finishes drag and drop operations in the drag layer.
    `void` | `eventlineChanged(EventlineModelEvent evt)` The listener's callback method, which gets called when eventline objects are added, removed or altered.
    `protected void` | `fireGridChanged()` Informs all grid component listeners that the grid used by the eventline has changed.
    `Dateline` | `getDateline()` Returns the `Dateline` sibling component.
    `Eventline.EventlineEditMode` | `getEditMode()` Returns the currently active edit mode.
    `protected Eventline.EventlineEditMode` | `getEditMode(Object eventlineObject, MouseEvent evt)` Returns an eventline edit mode for the given eventline object and mouse event.
    `IEventlineObjectRenderer` | `getEventlineObjectRenderer(Class cl)` Returns an eventline object renderer for an object.
    `Object[]` | `getEventlineObjectsAt(int x, int y)` Returns the eventline objects displayed at the given location.
    `Color` | `getGridColor()` Returns the color used by the dateline to draw its grid lines.
    `String` | `getGridComponentName()` Returns the name of the grid component.
    `IGranularity` | `getGridGranularity()` Returns the granularity used for a virtual grid that gets used during drag & drop operations to make eventline objects snap to specific time points rather than just the current drop location.
    `IGridPolicy` | `getGridPolicy()` Returns the grid policy used by the grid component.
    `int` | `getLookAheadSize()` Returns the number of pixels to add to the current clipping bounds when querying the dateline model for the grid lines.
    `Color` | `getMarkerFillColor1()` Returns the first fill color used for creating the gradient background of the time markers.
    `Color` | `getMarkerFillColor2()` Returns the second fill color used for creating the gradient background of the time markers.
    `IEventlineMenuProvider` | `getMenuProvider()` Returns a menu manager that can be used by the eventline to lookup a popup menu for a specific context where the context is defined by the mouse location, the eventline objects, and the time at the location.
    `IEventlineModel` | `getModel()` Returns the model used by the eventline.
    `IPolicyProvider` | `getPolicyProvider()` Returns the policy provider of the eventline.
    `Dimension` | `getPreferredSize()` Returns the preferred size of the eventline.
    `Map<Class,IEventlineObjectRenderer>` | `getRendererMap()` Returns the map used to store the mappings between eventline object classes and eventline object renderers.
    `int` | `getResizeHandleSize()` Returns the size of the resize handle located on the left and right edge of the eventline objects.
    `Object[]` | `getSelection()` Returns the currently selected eventline objects.
    `Color` | `getSelectionColor()` Returns the color used for selecting a time span in the eventline.
    `IEventlineSelectionModel` | `getSelectionModel()` Returns the selection model used by the eventline.
    `Timeline` | `getTimeline()` Returns the parent timeline container.
    `long` | `getTimeNow()` Returns the time point that is considered to be time now.
    `Object` | `getTopMostEventlineObjectAt(int x, int y)` Returns the eventline object that is on top of all other eventline objects at the given location.
    `boolean` | `isCreateEventlineObjectsEnabled()` Determines whether the eventline generally allows the user to create new eventline objects.
    `boolean` | `isGridAdjustedMouseCursorTime()` Determines whether the time cursor will use the grid settings of the grid component from which the last mouse event originated (default is FALSE).
    `boolean` | `isGridAutomatic()` Determines whether the component is using an automatic grid.
    `boolean` | `isGridControlVisible()` Determines whether the UI component used to control the grid is currently visible or not.
    `boolean` | `isShowingDSTMarkers()` Determines whether the eventline displays special markers, which indicate the begining or end of the daylight savings time (DST).
    `boolean` | `isTimeNowOnTop()` Determines whether the time now marker will be drawn on top of the eventline objects or below.
    `boolean` | `isTimeNowVisible()` Determines whether the time now will be shown with a special marker or not.
    `void` | `lassoChanged(LassoLayerEvent evt)` Listener callback method that will be invoked when the user performs lasso operations in the lasso layer.
    `void` | `mouseClicked(MouseEvent e)`
    `void` | `mouseDragged(MouseEvent e)`
    `void` | `mouseEntered(MouseEvent e)`
    `void` | `mouseExited(MouseEvent e)`
    `void` | `mouseMoved(MouseEvent e)`
    `void` | `mousePressed(MouseEvent e)`
    `void` | `mouseReleased(MouseEvent e)`
    `protected void` | `paintComponent(Graphics g)`
    `protected void` | `paintDSTMarker(Graphics g, GridLine gl)` Paints the DST information provided by the grid line.
    `protected void` | `paintEventlineObject(Graphics g, Object obj, ITimeSpan objSpan)` Draws an eventline object with the given time span.
    `protected void` | `paintEventlineObjects(Graphics g)` Paints the eventline objects in the eventline.
    `protected void` | `paintMarker(Graphics g, int x, String label, boolean leftAligned)` Paints a marker at the given x-coordinate.
    `void` | `propertyChange(PropertyChangeEvent evt)`
    `void` | `removeGridComponentListener(IGridComponentListener l)` Removes a listener from the grid component.
    `void` | `selectAllEventlineObjects()` Selects all objects in the eventline.
    `void` | `selectionChanged(EventlineSelectionModelEvent evt)` Listener callback method that gets invoked whenever eventline objects get added to or removed from the eventline selection model.
    `void` | `setCreateEventlineObjectsEnabled(boolean enabled)` Specifies whether eventline objects can be created interactively by the user.
    `void` | `setEventlineObjectRenderer(Class objectType, IEventlineObjectRenderer renderer)` Maps the implementation of an eventline object renderer to a class definition.
    `void` | `setGridAdjustedMouseCursorTime(boolean adjusted)` Specifies whether the time cursor will use the grid settings of the grid component from which the last mouse event originated (default is FALSE).
    `void` | `setGridAutomatic(boolean auto)` Specifies whether the component is using an automatic grid.
    `void` | `setGridColor(Color color)` Sets the color used by the dateline to draw its grid lines.
    `void` | `setGridControlVisible(boolean b)` Specifies whether the grid control will be visible in the Gantt chart.
    `void` | `setGridGranularity(IGranularity granularity)` Sets the granularity used for a virtual grid that gets used during drag & drop operations to make eventline objects snap to specific time points rather than just the current drop location.
    `void` | `setLookAheadSize(int lookAheadSize)` Specifies the number of pixels to add to the current clipping bounds when querying the dateline model for the grid lines.
    `void` | `setMarkerFillColor1(Color color)` Sets the first fill color used for creating the gradient background of the time markers.
    `void` | `setMarkerFillColor2(Color color)` Sets the second fill color used for creating the gradient background of the time markers.
    `void` | `setMenuProvider(IEventlineMenuProvider provider)` Specifies a menu manager that can be used by the eventline to lookup a popup menu for a specific context where the context is defined by the mouse location, the eventline objects, and the time at the location.
    `void` | `setModel(IEventlineModel model)` Sets a new eventline model on the eventline.
    `void` | `setPolicyProvider(IPolicyProvider provider)` Sets the eventline policy provider.
    `void` | `setRendererMap(Map<Class,IEventlineObjectRenderer> map)` Sets the map used to store the mappings between eventline object classes and eventline object renderers.
    `void` | `setResizeHandleSize(int size)` Sets the size of the resize handle located on the left and right edge of the eventline objects.
    `void` | `setSelectionColor(Color color)` Sets the color used for selecting a time span in the eventline.
    `void` | `setSelectionModel(IEventlineSelectionModel model)` Sets a new selection model to be used by the eventline.
    `void` | `setShowingDSTMarkers(boolean show)` Specifies whether the eventline displays special markers, which indicate the begining or end of the daylight savings time (DST).
    `void` | `setTimeNow(long time)` Sets a new time point to be used as time now.
    `void` | `setTimeNowOnTop(boolean onTop)` Specifies whether the time now marker will be drawn on top of the eventline objects or below.
    `void` | `setTimeNowVisible(boolean visible)` Determines whether or not a special marker will be drawn inside the time line to highlight time now.
    `void` | `tearDown()` Removes the eventline from the keyboard focus manager.

    - ### 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, firePropertyChange, 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, 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, revalidate, 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, invalidate, 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, validate, 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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, 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, hasFocus, 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, repaint, repaint, repaint, 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`

- - ### Field Detail

    - #### PROPERTY_TIME_NOW

          public static final String PROPERTY_TIME_NOW

      Constant used for property change events that get fired if the time now variable changes.
      Since:
        1.0
      See Also:
        `setTimeNow(long)`, Constant Field Values

    - #### PROPERTY_EVENTLINE_MODEL

          public static final String PROPERTY_EVENTLINE_MODEL

      Constant used for property change events that get fired if the eventline model changes.
      Since:
        1.0
      See Also:
        `setModel(IEventlineModel)`, Constant Field Values

    - #### PROPERTY_EVENTLINE_SELECTION_MODEL

          public static final String PROPERTY_EVENTLINE_SELECTION_MODEL

      Constant used for property change events that get fired if the eventline selection model changes.
      Since:
        1.0
      See Also:
        `setSelectionModel(IEventlineSelectionModel)`, Constant Field Values

    - #### PROPERTY_POLICY_PROVIDER

          public static final String PROPERTY_POLICY_PROVIDER

      Constant used for property change events that get fired if the policy provider changes.
      Since:
        1.0
      See Also:
        `setPolicyProvider(IPolicyProvider)`, Constant Field Values

    - #### PROPERTY_CREATE_EVENTLNE_OBJECTS_ENABLED

          public static final String PROPERTY_CREATE_EVENTLNE_OBJECTS_ENABLED

      Constant used for property change events that get fired if the eventline object creation mode changes.
      Since:
        1.0
      See Also:
        `setCreateEventlineObjectsEnabled(boolean)`, Constant Field Values

  - ### Constructor Detail

    - #### Eventline

          public Eventline(Timeline timeline,
                           Dateline dateline)

      Constructs a new eventline. The eventline by default sets a command interceptor for the `DefaultCreateEventlineObjectCommand` class. The interceptor brings up a simple dialog that allows the user to specify very basic settings.
      Parameters:
        `timeline` - the parent timeline container
        `dateline` - the sibling dateline component that lives in the same timeline parent container
      Since:
        1.0
      See Also:
        `AbstractGanttChart.setCommandInterceptor(Class, ICommandInterceptor)`

  - ### Method Detail

    - #### getGridGranularity

          public IGranularity getGridGranularity()

      Returns the granularity used for a virtual grid that gets used during drag & drop operations to make eventline objects snap to specific time points rather than just the current drop location.
      Specified by:
        `getGridGranularity` in interface `IGridComponent`
      Returns:
        the grid granularity
      Since:
        1.0

    - #### getGridComponentName

          public String getGridComponentName()

      Description copied from interface: `IGridComponent`
      Returns the name of the grid component. This is useful for displaying a grid control so that the controls used for the different grid components can be distinguished from each other.
      Specified by:
        `getGridComponentName` in interface `IGridComponent`
      Returns:
        the name of the grid component

    - #### setGridGranularity

          public void setGridGranularity(IGranularity granularity)

      Sets the granularity used for a virtual grid that gets used during drag & drop operations to make eventline objects snap to specific time points rather than just the current drop location.
      Specified by:
        `setGridGranularity` in interface `IGridComponent`
      Parameters:
        `granularity` - the grid granularity
      Since:
        1.0
      See Also:
        `IGridComponent.setGridAutomatic(boolean)`

    - #### setGridAutomatic

          public void setGridAutomatic(boolean auto)

      Description copied from interface: `IGridComponent`
      Specifies whether the component is using an automatic grid. A grid is automatic if it is not based on the grid granularity but on some other granularity of various origin. The dateline, for example, displays a major and a minor time (granularity). The minor granularity can be used for calculating grid locations.
      Specified by:
        `setGridAutomatic` in interface `IGridComponent`
      Parameters:
        `auto` - if TRUE the grid gets calculated automatically and not based on the given grid granularity

    - #### isGridAutomatic

          public boolean isGridAutomatic()

      Description copied from interface: `IGridComponent`
      Determines whether the component is using an automatic grid. A grid is automatic if it is not based on the grid granularity but on some other granularity of various origin. The dateline, for example, displays a major and a minor time (granularity). The minor granularity can be used for calculating grid locations.
      Specified by:
        `isGridAutomatic` in interface `IGridComponent`
      Returns:
        TRUE if the grid gets calculated automatically and not based on the given grid granularity

    - #### setGridControlVisible

          public void setGridControlVisible(boolean b)

      Specifies whether the grid control will be visible in the Gantt chart. Calling this method will cause an event to be fired to all grid component listeners currently attached to the eventline.
      Parameters:
        `b` - if TRUE the control will be shown
      Since:
        1.0
      See Also:
        `IGridComponentListener.gridComponentChanged()`

    - #### isGridControlVisible

          public boolean isGridControlVisible()

      Description copied from interface: `IGridComponent`
      Determines whether the UI component used to control the grid is currently visible or not.
      Specified by:
        `isGridControlVisible` in interface `IGridComponent`
      Returns:
        TRUE if the grid control is visible

    - #### getGridPolicy

          public IGridPolicy getGridPolicy()

      Description copied from interface: `IGridComponent`
      Returns the grid policy used by the grid component. Each component can have its own grid policy, which is used to determine which granularities are supported by the component.
      Specified by:
        `getGridPolicy` in interface `IGridComponent`
      Returns:
        the component's grid policy

    - #### getPolicyProvider

          public IPolicyProvider getPolicyProvider()

      Returns the policy provider of the eventline.
      Returns:
        the eventline policy provider
      Since:
        1.0

    - #### setPolicyProvider

          public void setPolicyProvider(IPolicyProvider provider)

      Sets the eventline policy provider.
      Parameters:
        `provider` - the eventline policy provider
      Since:
        1.0

    - #### getEventlineObjectsAt

          public Object[] getEventlineObjectsAt(int x,
                                                int y)

      Returns the eventline objects displayed at the given location.
      Parameters:
        `x` - the x-coordinate to check for eventline objects
        `y` - the y-coordinate to check for eventline objects
      Returns:
        all eventline objects found at the given location
      Since:
        1.0

    - #### getTopMostEventlineObjectAt

          public Object getTopMostEventlineObjectAt(int x,
                                                    int y)

      Returns the eventline object that is on top of all other eventline objects at the given location. The eventline draws eventline objects from left to right, meaning that those objects will be drawn first that have the earlier start time. The ones starting later will be drawn later and they end up being on top of the earlier ones.
      Parameters:
        `x` - the x-coordinate to check for the top-most eventline object
        `y` - the y-coordinate to check for the top-most eventline object
      Returns:
        the top-most eventline object found at the given location
      Since:
        1.1

    - #### getPreferredSize

          public Dimension getPreferredSize()

      Returns the preferred size of the eventline. The width is not relevant and gets dictated by the width of the `Dateline`. The height gets set to be equivalent to the height of the font used by the eventline plus some extra pixels to create a gap.
      Overrides:
        `getPreferredSize` in class `JComponent`
      See Also:
        `JComponent.getPreferredSize()`

    - #### getModel

          public IEventlineModel getModel()

      Returns the model used by the eventline.
      Returns:
        the data source of the eventline
      Since:
        1.0
      See Also:
        `setModel(IEventlineModel)`

    - #### setModel

          public void setModel(IEventlineModel model)

      Sets a new eventline model on the eventline. The eventline will attach itself as an `IEventlineModelListener` to the new model. Calling this method will cause a property change event to be fired. The name of the event will be equal to `PROPERTY_EVENTLINE_MODEL`.
      Parameters:
        `model` - the new eventline model
      Since:
        1.0
      See Also:
        `getModel()`

    - #### getSelectionModel

          public IEventlineSelectionModel getSelectionModel()

      Returns the selection model used by the eventline. The selection model can be queried for the selection state of each eventline model.
      Returns:
        the eventline selection model
      Since:
        1.0
      See Also:
        `setSelectionModel(IEventlineSelectionModel)`

    - #### setSelectionModel

          public void setSelectionModel(IEventlineSelectionModel model)

      Sets a new selection model to be used by the eventline. The eventline will attach itself an an `IEventlineSelectionListener` to the model. Calling this method will cause a property change event to be fired (event name equals `PROPERTY_EVENTLINE_SELECTION_MODEL`).
      Parameters:
        `model` - the new selection model
      Since:
        1.0

    - #### getTimeline

          public Timeline getTimeline()

      Returns the parent timeline container.
      Returns:
        the parent timeline container
      Since:
        1.0

    - #### getDateline

          public Dateline getDateline()

      Returns the `Dateline` sibling component.
      Returns:
        the dateline that lives in the same timeline container
      Since:
        1.0

    - #### setTimeNowVisible

          public void setTimeNowVisible(boolean visible)

      Determines whether or not a special marker will be drawn inside the time line to highlight time now.
      Parameters:
        `visible` - if TRUE the time now will be shown with a special marker
      Since:
        1.0
      See Also:
        `isTimeNowVisible()`

    - #### isTimeNowVisible

          public boolean isTimeNowVisible()

      Determines whether the time now will be shown with a special marker or not.
      Returns:
        TRUE if the time now will be marked in the eventline
      Since:
        1.0
      See Also:
        `setTimeNowVisible(boolean)`

    - #### setTimeNow

          public void setTimeNow(long time)

      Sets a new time point to be used as time now.
      Parameters:
        `time` - the new time point that will be used as time now
      Since:
        1.0
      See Also:
        `getTimeNow()`

    - #### getTimeNow

          public long getTimeNow()

      Returns the time point that is considered to be time now.
      Returns:
        the time now in milliseconds
      Since:
        1.0
      See Also:
        `setTimeNow(long)`

    - #### getGridColor

          public Color getGridColor()

      Returns the color used by the dateline to draw its grid lines.
      Returns:
        the grid line color
      Since:
        1.0

    - #### setGridColor

          public void setGridColor(Color color)

      Sets the color used by the dateline to draw its grid lines.
      Parameters:
        `color` - the grid line color
      Since:
        1.0

    - #### paintComponent

          protected void paintComponent(Graphics g)

      Overrides:
        `paintComponent` in class `JComponent`

    - #### paintMarker

          protected void paintMarker(Graphics g,
                                     int x,
                                     String label,
                                     boolean leftAligned)

      Paints a marker at the given x-coordinate. Markers are used for such things as time now or the time at the current mouse location.
      Parameters:
        `g` - the graphics context in which to draw the marker
        `x` - the x-coordinate of the marker
        `label` - the label shown to the right of the marker
        `leftAligned` - if TRUE the marker will start at the given x coordinate, otherwise it will end there
      Since:
        1.0

    - #### paintDSTMarker

          protected void paintDSTMarker(Graphics g,
                                        GridLine gl)

      Paints the DST information provided by the grid line.
      Parameters:
        `g` - the graphics context into which to draw
        `gl` - the grid line at which the DST changes
      Since:
        1.1
      See Also:
        `GridLine.getDstChangeType()`

    - #### paintEventlineObjects

          protected void paintEventlineObjects(Graphics g)

      Paints the eventline objects in the eventline.
      Parameters:
        `g` - the graphics context in which to draw
      Since:
        1.0

    - #### paintEventlineObject

          protected void paintEventlineObject(Graphics g,
                                              Object obj,
                                              ITimeSpan objSpan)

      Draws an eventline object with the given time span. This method will lookup an `IEventlineObjectRenderer` implementation, retrieve a renderer component from it and set the component's bounds based on the given time span.
      Parameters:
        `g` - the graphics context into which to draw
        `obj` - the eventline object that gets drawn
        `objSpan` - the time span used by the eventline object
      Since:
        1.0
      See Also:
        `setEventlineObjectRenderer(Class, IEventlineObjectRenderer)`

    - #### getMenuProvider

          public IEventlineMenuProvider getMenuProvider()

      Returns a menu manager that can be used by the eventline to lookup a popup menu for a specific context where the context is defined by the mouse location, the eventline objects, and the time at the location.
      Returns:
        a menu provider for retrieving context-aware popup menus
      Since:
        1.0

    - #### setMenuProvider

          public void setMenuProvider(IEventlineMenuProvider provider)

      Specifies a menu manager that can be used by the eventline to lookup a popup menu for a specific context where the context is defined by the mouse location, the eventline objects, and the time at the location.
      Parameters:
        `provider` - the provider that will be used by the layer container to find a suitable popup menu for a specific context
      Since:
        1.0

    - #### eventlineChanged

          public void eventlineChanged(EventlineModelEvent evt)

      Description copied from interface: `IEventlineModelListener`
      The listener's callback method, which gets called when eventline objects are added, removed or altered.
      Specified by:
        `eventlineChanged` in interface `IEventlineModelListener`
      Parameters:
        `evt` - the event sent by the eventline model.

    - #### mouseClicked

          public void mouseClicked(MouseEvent e)

      Specified by:
        `mouseClicked` in interface `MouseListener`

    - #### mouseEntered

          public void mouseEntered(MouseEvent e)

      Specified by:
        `mouseEntered` in interface `MouseListener`

    - #### mouseExited

          public void mouseExited(MouseEvent e)

      Specified by:
        `mouseExited` in interface `MouseListener`

    - #### mousePressed

          public void mousePressed(MouseEvent e)

      Specified by:
        `mousePressed` in interface `MouseListener`

    - #### mouseReleased

          public void mouseReleased(MouseEvent e)

      Specified by:
        `mouseReleased` in interface `MouseListener`

    - #### mouseDragged

          public void mouseDragged(MouseEvent e)

      Specified by:
        `mouseDragged` in interface `MouseMotionListener`

    - #### mouseMoved

          public void mouseMoved(MouseEvent e)

      Specified by:
        `mouseMoved` in interface `MouseMotionListener`

    - #### getEditMode

          protected Eventline.EventlineEditMode getEditMode(Object eventlineObject,
                                                            MouseEvent evt)

      Returns an eventline edit mode for the given eventline object and mouse event. This method determines what kind of editing operation shall take place when the mouse cursor is at a specific location above the eventline object. For example: a resize (change duration) operation can be executed if the cursor hovers on top of the right edge of the eventline object.
      Parameters:
        `eventlineObject` - the object for which to return an edit mode
        `evt` - the mouse event
      Returns:
        an edit mode for the given eventline object and mouse event
      Since:
        1.0

    - #### getSelection

          public Object[] getSelection()

      Returns the currently selected eventline objects.
      Returns:
        the currently selected eventline objects
      Since:
        1.0
      See Also:
        `IEventlineSelectionModel.getSelection()`

    - #### selectionChanged

          public void selectionChanged(EventlineSelectionModelEvent evt)

      Description copied from interface: `IEventlineSelectionListener`
      Listener callback method that gets invoked whenever eventline objects get added to or removed from the eventline selection model.
      Specified by:
        `selectionChanged` in interface `IEventlineSelectionListener`
      Parameters:
        `evt` - the selection model event with detailed information about the kind of change that happened inside the selection model

    - #### propertyChange

          public void propertyChange(PropertyChangeEvent evt)

      Specified by:
        `propertyChange` in interface `PropertyChangeListener`

    - #### setEventlineObjectRenderer

          public void setEventlineObjectRenderer(Class objectType,
                                                 IEventlineObjectRenderer renderer)

      Maps the implementation of an eventline object renderer to a class definition.
      Parameters:
        `objectType` - the type of those eventline objects that will be rendered with the given renderer
        `renderer` - an implementation that will be used to renderer instances of the given object type
      Since:
        1.0
      See Also:
        `DefaultEventlineObjectRenderer`, `getEventlineObjectRenderer(Class)`

    - #### getEventlineObjectRenderer

          public IEventlineObjectRenderer getEventlineObjectRenderer(Class cl)

      Returns an eventline object renderer for an object. The lookup of the renderer is based on the object type of the given object. This method will return the default eventline object renderer if no other renderer was explicitly assigned to the type or any supertype of the given object.
      Parameters:
        `cl` - the object type in need of rendering
      Returns:
        a matching eventline object renderer implementation
      Since:
        1.0
      See Also:
        `setEventlineObjectRenderer(Class, IEventlineObjectRenderer)`, `DefaultEventlineObjectRenderer`

    - #### getRendererMap

          public Map<Class,IEventlineObjectRenderer> getRendererMap()

      Returns the map used to store the mappings between eventline object classes and eventline object renderers.
      Returns:
        the renderer map
      Since:
        1.0

    - #### setRendererMap

          public void setRendererMap(Map<Class,IEventlineObjectRenderer> map)

      Sets the map used to store the mappings between eventline object classes and eventline object renderers.
      Parameters:
        `map` - the renderer map
      Since:
        1.0

    - #### isCreateEventlineObjectsEnabled

          public boolean isCreateEventlineObjectsEnabled()

      Determines whether the eventline generally allows the user to create new eventline objects. For fine grained control the application can use the `IEditEventlineObjectPolicy`.
      Returns:
        TRUE if the eventline supports the creation of new eventline objects
      Since:
        1.0

    - #### setCreateEventlineObjectsEnabled

          public void setCreateEventlineObjectsEnabled(boolean enabled)

      Specifies whether eventline objects can be created interactively by the user. For more fine grained control whether an eventline object can be created at a specific time the `IEditEventlineObjectPolicy` can be used.
      Parameters:
        `enabled` - if TRUE the user is generally allowed to create new eventline objects
      Since:
        1.0

    - #### addGridComponentListener

          public void addGridComponentListener(IGridComponentListener l)

      Description copied from interface: `IGridComponent`
      Adds a listener to the grid component. The listener will be informed whenever the grid granularity used by the component gets changed.
      Specified by:
        `addGridComponentListener` in interface `IGridComponent`
      Parameters:
        `l` - the grid component listener

    - #### removeGridComponentListener

          public void removeGridComponentListener(IGridComponentListener l)

      Description copied from interface: `IGridComponent`
      Removes a listener from the grid component.
      Specified by:
        `removeGridComponentListener` in interface `IGridComponent`
      Parameters:
        `l` - the grid component listener that gets removed

    - #### fireGridChanged

          protected void fireGridChanged()

      Informs all grid component listeners that the grid used by the eventline has changed.
      Since:
        1.0

    - #### dragging

          public void dragging(DragLayerEvent evt)

      Description copied from interface: `IDragLayerListener`
      Listener callback method that will be invoked when the user starts, executes or finishes drag and drop operations in the drag layer.
      Specified by:
        `dragging` in interface `IDragLayerListener`
      Parameters:
        `evt` - the event describing the drag operation

    - #### lassoChanged

          public void lassoChanged(LassoLayerEvent evt)

      Description copied from interface: `ILassoLayerListener`
      Listener callback method that will be invoked when the user performs lasso operations in the lasso layer.
      Specified by:
        `lassoChanged` in interface `ILassoLayerListener`
      Parameters:
        `evt` - the event describing the lasso operation

    - #### getSelectionColor

          public Color getSelectionColor()

      Returns the color used for selecting a time span in the eventline.
      Returns:
        the time span selection color
      Since:
        1.0

    - #### setSelectionColor

          public void setSelectionColor(Color color)

      Sets the color used for selecting a time span in the eventline.
      Parameters:
        `color` - the time span selection color
      Since:
        1.0

    - #### selectAllEventlineObjects

          public void selectAllEventlineObjects()

      Selects all objects in the eventline. This is a convenience method,which delegates to the selection model.
      Since:
        1.0
      See Also:
        `IEventlineSelectionModel.addSelection(Object)`

    - #### deleteSelectedEventlineObjects

          public void deleteSelectedEventlineObjects()

      Deletes all currently selected eventline objects. This method will create a compound command, which will consist of a number of delete commands.
      Since:
        1.0
      See Also:
        `IEditEventlineObjectPolicy.isDeletable(Object, IEventlineModel)`, `IEditEventlineObjectPolicy.getDeleteCommand(Collection, IEventlineModel)`

    - #### isGridAdjustedMouseCursorTime

          public boolean isGridAdjustedMouseCursorTime()

      Determines whether the time cursor will use the grid settings of the grid component from which the last mouse event originated (default is FALSE). Some applications prefer to have the current grid being reflected by the mouse cursor.
      Returns:
        TRUE if the mouse cursor time will use the grid component's grid settings
      Since:
        1.0

    - #### setGridAdjustedMouseCursorTime

          public void setGridAdjustedMouseCursorTime(boolean adjusted)

      Specifies whether the time cursor will use the grid settings of the grid component from which the last mouse event originated (default is FALSE). Some applications prefer to have the current grid being reflected by the mouse cursor.
      Parameters:
        `adjusted` - if TRUE the mouse cursor time will use the grid component's grid settings
      Since:
        1.0

    - #### createEditModeCursor

          protected Cursor createEditModeCursor(Eventline.EventlineEditMode mode)

      Creates a cursor for the given edit mode. This method uses the `IconRegistry` to lookup the cursor images. The following IDs are being used:
      - `IconId.CURSOR_CHANGE_START_TIME`
      - `IconId.CURSOR_CHANGE_END_TIME`
      - `IconId.CURSOR_MOVE_HORIZONTAL`
      - `IconId.CURSOR_CREATE_EVENTLINE_OBJECTS`
      Parameters:
        `mode` - the eventline edit mode
      Returns:
        a cursor for the edit mode
      Since:
        1.0

    - #### getResizeHandleSize

          public int getResizeHandleSize()

      Returns the size of the resize handle located on the left and right edge of the eventline objects. The handles are used to change the start or end time of an eventline object.
      Returns:
        the size of the resize handle used for editing the eventline object
      Since:
        1.0

    - #### setResizeHandleSize

          public void setResizeHandleSize(int size)

      Sets the size of the resize handle located on the left and right edge of the eventline objects. The handles are used to change the start or end time of an eventline object.
      Parameters:
        `size` - the size of the resize handle used for editing the eventline object
      Since:
        1.0

    - #### getMarkerFillColor1

          public Color getMarkerFillColor1()

      Returns the first fill color used for creating the gradient background of the time markers.
      Returns:
        the first background color
      Since:
        1.0

    - #### setMarkerFillColor1

          public void setMarkerFillColor1(Color color)

      Sets the first fill color used for creating the gradient background of the time markers.
      Parameters:
        `color` - the first background color
      Since:
        1.0

    - #### getMarkerFillColor2

          public Color getMarkerFillColor2()

      Returns the second fill color used for creating the gradient background of the time markers.
      Returns:
        the first background color
      Since:
        1.0

    - #### setMarkerFillColor2

          public void setMarkerFillColor2(Color color)

      Sets the second fill color used for creating the gradient background of the time markers.
      Parameters:
        `color` - the second background color
      Since:
        1.0

    - #### getEditMode

          public Eventline.EventlineEditMode getEditMode()

      Returns the currently active edit mode.
      Returns:
        the edit mode used by the eventline
      Since:
        1.0

    - #### dispatchKeyEvent

          public boolean dispatchKeyEvent(KeyEvent e)

      Specified by:
        `dispatchKeyEvent` in interface `KeyEventDispatcher`

    - #### isTimeNowOnTop

          public boolean isTimeNowOnTop()

      Determines whether the time now marker will be drawn on top of the eventline objects or below.
      Returns:
        TRUE if the time now marker gets drawn on top of the eventline objects
      Since:
        1.0

    - #### setTimeNowOnTop

          public void setTimeNowOnTop(boolean onTop)

      Specifies whether the time now marker will be drawn on top of the eventline objects or below.
      Parameters:
        `onTop` - TRUE if the time now marker gets drawn on top of the eventline objects
      Since:
        1.0

    - #### isShowingDSTMarkers

          public boolean isShowingDSTMarkers()

      Determines whether the eventline displays special markers, which indicate the begining or end of the daylight savings time (DST).
      Returns:
        TRUE if the eventline displays DST markers
      Since:
        1.1

    - #### setShowingDSTMarkers

          public void setShowingDSTMarkers(boolean show)

      Specifies whether the eventline displays special markers, which indicate the begining or end of the daylight savings time (DST).
      Parameters:
        `show` - TRUE if the eventline displays DST markers
      Since:
        1.1

    - #### getLookAheadSize

          public int getLookAheadSize()

      Returns the number of pixels to add to the current clipping bounds when querying the dateline model for the grid lines. Looking ahead to grid lines that are not in the currently visible clip is important in order to ensure that the labels shown next to markers will be rendered when scrolling to the left.
      Returns:
        the number of pixels to look ahead when scrolling and querying for the grid lines
      Since:
        1.1

    - #### setLookAheadSize

          public void setLookAheadSize(int lookAheadSize)

      Specifies the number of pixels to add to the current clipping bounds when querying the dateline model for the grid lines. Looking ahead to grid lines that are not in the currently visible clip is important in order to ensure that the labels shown next to markers will be rendered when scrolling to the left.
      Parameters:
        `lookAheadSize` - the number of pixels to look ahead when scrolling and querying for the grid lines
      Since:
        1.1

    - #### tearDown

          public void tearDown()

      Removes the eventline from the keyboard focus manager.
      Since:
        1.1

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