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()
,
ILayerFactory
alpha, 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, setVisible
public TimelineObjectLayer(LayerContainer lc, ILayer layer)
lc
- the parent layer containerlayer
- the model layer that will be visualized by the UI layerpublic boolean isVisible()
AbstractLayer
isVisible
in class AbstractLayer
AbstractLayer.setVisible(boolean)
public void tearDown()
AbstractLayer
tearDown
in class AbstractLayer
public 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 AbstractLayer
public ITimeSpan getTimeSpanUsed()
AbstractLayer
TimeSpan.UNDEFINED
.getTimeSpanUsed
in class AbstractLayer
public void mouseMoved(MouseEvent e)
mouseMoved
in interface MouseMotionListener
public void mouseDragged(MouseEvent e)
mouseDragged
in interface MouseMotionListener
public void mouseEntered(MouseEvent e)
mouseEntered
in interface MouseListener
public void mouseExited(MouseEvent e)
mouseExited
in interface MouseListener
public void mousePressed(MouseEvent e)
mousePressed
in interface MouseListener
public void mouseReleased(MouseEvent e)
mouseReleased
in interface MouseListener
public void mouseClicked(MouseEvent e)
mouseClicked
in interface MouseListener
public void valueChanged(TimelineObjectSelectionEvent evt)
ITimelineObjectSelectionListener
TimelineObjectLayer
changes.valueChanged
in interface ITimelineObjectSelectionListener
evt
- 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–2016 Dirk Lemmermann Software & Consulting. All rights reserved.