|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.dlsc.flexgantt.swing.layer.AbstractLayer com.dlsc.flexgantt.swing.layer.timeline.TimelineObjectLayer
public class TimelineObjectLayer
The timeline object layer is responsible for rendering the timeline objects
returned by the Gantt chart model. The layer container will create one
instance of a timeline object layer for each layer defined by the model.
Timeline objects get rendered by the layer via the help of so-called timeline
object renderers (see 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
Field Summary |
---|
Fields inherited from class com.dlsc.flexgantt.swing.layer.AbstractLayer |
---|
alpha, changeSupport, ganttChart, layerContainer, PROPERTY_ALPHA, PROPERTY_VISIBLE |
Constructor Summary | |
---|---|
TimelineObjectLayer(LayerContainer lc,
ILayer layer)
Constructs a new timeline object layer. |
Method Summary | |
---|---|
java.util.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(java.awt.event.MouseEvent evt)
Returns the object bounds for the timeline object found at the location of the given mouse event. |
ObjectBounds |
getObjectBoundsAt(java.awt.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. |
void |
mouseClicked(java.awt.event.MouseEvent e)
|
void |
mouseDragged(java.awt.event.MouseEvent e)
|
void |
mouseEntered(java.awt.event.MouseEvent e)
|
void |
mouseExited(java.awt.event.MouseEvent e)
|
void |
mouseMoved(java.awt.event.MouseEvent e)
|
void |
mousePressed(java.awt.event.MouseEvent e)
|
void |
mouseReleased(java.awt.event.MouseEvent e)
|
protected void |
paintLayer(java.awt.Graphics g)
|
void |
setDebuggingObjectBounds(boolean debug)
Specifies whether the layer will draw red rectangles showing the individual object bounds of the timeline objects. |
void |
setVisible(boolean b)
Specifies whether the layer is visible or not. |
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. |
Methods inherited from class com.dlsc.flexgantt.swing.layer.AbstractLayer |
---|
addPropertyChangeListener, getAlpha, getDateline, getEventline, getGanttChart, getLayerContainer, getLayerPolicyProvider, getModel, getName, getStartRow, getTimeAt, getTimeline, getTimeLocation, getToolTipText, getTreeTable, getTreeTablePolicyProvider, isVisible, removePropertyChangeListener, repaint, repaint, repaint, setAlpha |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TimelineObjectLayer(LayerContainer lc, ILayer layer)
lc
- the parent layer containerlayer
- the model layer that will be visualized by the UI layerMethod Detail |
---|
public void tearDown()
AbstractLayer
tearDown
in class AbstractLayer
public void setVisible(boolean b)
AbstractLayer
setVisible
in class AbstractLayer
b
- if TRUE the layer will be visibleAbstractLayer.isVisible()
public ObjectBounds getObjectBounds(TimelineObjectPath path)
path
- the path for which to return the bounds
public ObjectBounds getObjectBoundsAt(java.awt.event.MouseEvent evt)
evt
- the mouse event for which to return object bounds
public ObjectBounds getObjectBoundsAt(java.awt.Point p)
p
- the location within the layer
public ObjectBounds getObjectBoundsAt(int x, int y)
x
- the x-coordinate of the location to checky
- the y-coordinate of the location to check
public java.util.Collection<ObjectBounds> getAllObjectBoundsAt(int x, int y)
x
- the x-coordinate of the location to checky
- the y-coordinate of the location to check
protected void paintLayer(java.awt.Graphics g)
paintLayer
in class AbstractLayer
public ITimeSpan getTimeSpanUsed()
AbstractLayer
TimeSpan.UNDEFINED
.
getTimeSpanUsed
in class AbstractLayer
public void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved
in interface java.awt.event.MouseMotionListener
public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
public void valueChanged(TimelineObjectSelectionEvent evt)
ITimelineObjectLayerSelectionListener
TimelineObjectLayer
changes.
valueChanged
in interface ITimelineObjectLayerSelectionListener
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)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |