public class TimelineObjectLayer extends AbstractLayer implements MouseListener, MouseMotionListener, ITimelineObjectSelectionListener
ITimelineObjectRenderer).
The timeline object layer uses its alpha value to determine the transparency
of the timeline objects that it renders. This feature is especially useful in
situations where timeline objects overlap each other (then again, consider
using inner lines, see ILinePolicy).
Each timeline object layer uses its own selection model to keep track of the currently selected timeline objects. Applications need to register listeners with these selection models for every layer that they are interested in.
Timeline object layers are capable of returning ObjectBounds for
timeline objects. These bounds contain various information about the object
itself, its location, the layer it is on and the model it belongs to.
IGanttChartModel.getLayers(),
ILayerFactoryalpha, changeSupport, ganttChart, layerContainer, PROPERTY_ALPHA, PROPERTY_VISIBLE| Constructor and Description |
|---|
TimelineObjectLayer(LayerContainer lc,
ILayer layer)
Constructs a new timeline object layer.
|
| Modifier and Type | Method and Description |
|---|---|
Collection<ObjectBounds> |
getAllObjectBoundsAt(int x,
int y)
Returns the object bounds for all timeline objects found at the
given coordinate.
|
ILayer |
getLayer()
Returns the model layer visualized by the timeline object layer.
|
ObjectBounds |
getObjectBounds(TimelineObjectPath path)
Returns the object bounds for the given timeline object (path).
|
ObjectBounds |
getObjectBoundsAt(int x,
int y)
Returns the object bounds for the timeline object found at the given
coordinate.
|
ObjectBounds |
getObjectBoundsAt(int x,
int y,
int proximity)
Returns the object bounds for the timeline object found at the given
coordinate.
|
ObjectBounds |
getObjectBoundsAt(MouseEvent evt)
Returns the object bounds for the timeline object found at the location
of the given mouse event.
|
ObjectBounds |
getObjectBoundsAt(Point p)
Returns the object bounds for the timeline object found at the given
location.
|
ITimeSpan |
getTimeSpanUsed()
Returns the time span that is used by the layer.
|
boolean |
isDebuggingObjectBounds()
Determines whether the layer will draw red rectangles showing the
individual object bounds of the timeline objects.
|
boolean |
isVisible()
Determines whether the layer is currently visible or not.
|
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 |
paintLayer(Graphics g) |
void |
setDebuggingObjectBounds(boolean debug)
Specifies whether the layer will draw red rectangles showing the
individual object bounds of the timeline objects.
|
void |
tearDown()
Performs tear down operations when the layer is no longer needed
(removing listeners, etc...).
|
void |
valueChanged(TimelineObjectSelectionEvent evt)
Callback method that gets invoked when the selection within the observed
TimelineObjectLayer changes. |
addPropertyChangeListener, getAlpha, getDateline, getEventline, getGanttChart, getHeight, getLayerContainer, getLayerPolicyProvider, getModel, getName, getStartRow, getTimeAt, getTimeline, getTimeLocation, getToolTipText, getTreeTable, getTreeTablePolicyProvider, getWidth, removePropertyChangeListener, repaint, repaint, repaint, setAlpha, setVisiblepublic TimelineObjectLayer(LayerContainer lc, ILayer layer)
lc - the parent layer containerlayer - the model layer that will be visualized by the UI layerpublic boolean isVisible()
AbstractLayerisVisible in class AbstractLayerAbstractLayer.setVisible(boolean)public void tearDown()
AbstractLayertearDown in class AbstractLayerpublic ObjectBounds getObjectBounds(TimelineObjectPath path)
path - the path for which to return the boundspublic ObjectBounds getObjectBoundsAt(MouseEvent evt)
evt - the mouse event for which to return object boundspublic ObjectBounds getObjectBoundsAt(Point p)
p - the location within the layerpublic ObjectBounds getObjectBoundsAt(int x, int y)
x - the x-coordinate of the location to checky - the y-coordinate of the location to checkpublic ObjectBounds getObjectBoundsAt(int x, int y, int proximity)
x - the x-coordinate of the location to checky - the y-coordinate of the location to checkproximity - controls whether to find objects that are within the proximity
of the given location, objects that are "close enough"public Collection<ObjectBounds> getAllObjectBoundsAt(int x, int y)
x - the x-coordinate of the location to checky - the y-coordinate of the location to checkprotected void paintLayer(Graphics g)
paintLayer in class AbstractLayerpublic ITimeSpan getTimeSpanUsed()
AbstractLayerTimeSpan.UNDEFINED.getTimeSpanUsed in class AbstractLayerpublic void mouseMoved(MouseEvent e)
mouseMoved in interface MouseMotionListenerpublic void mouseDragged(MouseEvent e)
mouseDragged in interface MouseMotionListenerpublic void mouseEntered(MouseEvent e)
mouseEntered in interface MouseListenerpublic void mouseExited(MouseEvent e)
mouseExited in interface MouseListenerpublic void mousePressed(MouseEvent e)
mousePressed in interface MouseListenerpublic void mouseReleased(MouseEvent e)
mouseReleased in interface MouseListenerpublic void mouseClicked(MouseEvent e)
mouseClicked in interface MouseListenerpublic void valueChanged(TimelineObjectSelectionEvent evt)
ITimelineObjectSelectionListenerTimelineObjectLayer changes.valueChanged in interface ITimelineObjectSelectionListenerevt - the event with detailed information about the change that
occuredpublic ILayer getLayer()
public boolean isDebuggingObjectBounds()
ITimelineObjectRenderer.getTimelineObjectRendererInsets(int, int,
int, int)public void setDebuggingObjectBounds(boolean debug)
debug - if TRUE the layer draws the object boundsITimelineObjectRenderer.getTimelineObjectRendererInsets(int, int,
int, int)Copyright © 2006–2020 Dirk Lemmermann Software & Consulting. All rights reserved.