com.dlsc.flexgantt.swing.layer.system
Class RelationshipLayer
java.lang.Object
com.dlsc.flexgantt.swing.layer.AbstractLayer
com.dlsc.flexgantt.swing.layer.system.AbstractSystemLayer
com.dlsc.flexgantt.swing.layer.system.RelationshipLayer
public class RelationshipLayer
- extends AbstractSystemLayer
The relationship layer is reponsible for visualizing the relationships that
might exist between two different timeline objects. Relationships are
visualized by a line that starts at the end of the source object of the
relationship and that ends at the beginning of the target object of the
relationship. An arrow is shown at the end of the line. Due to several
technical constraints the layer always has to render all relationships, hence
the number of relationships shown in a Gantt chart should not be too large.
- Since:
- 1.0
- Author:
- Dirk Lemmermann
- See Also:
IGanttChartModel.getRelationships()
Methods inherited from class com.dlsc.flexgantt.swing.layer.AbstractLayer |
addPropertyChangeListener, getAlpha, getDateline, getEventline, getGanttChart, getLayerContainer, getLayerPolicyProvider, getModel, getName, getStartRow, getTimeAt, getTimeline, getTimeLocation, getTimeSpanUsed, getToolTipText, getTreeTable, getTreeTablePolicyProvider, 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 |
RelationshipLayer
public RelationshipLayer(LayerContainer lc)
- Parameters:
lc
- - Since:
- 1.0
isVisible
public boolean isVisible()
- Description copied from class:
AbstractLayer
- Determines whether the layer is currently visible or not.
- Overrides:
isVisible
in class AbstractLayer
- Returns:
- TRUE if the layer is currently visible
- See Also:
AbstractLayer.setVisible(boolean)
paintLayer
protected void paintLayer(java.awt.Graphics g)
- Overrides:
paintLayer
in class AbstractLayer
paintRelationship
protected void paintRelationship(java.awt.Graphics g,
int w,
int h,
IRelationship relationship,
IGanttChartModel model)
- Paints the given relationship object.
- Parameters:
g
- the graphics context into which to draww
- the total width of the layerh
- the total height of the layerrelationship
- the relationship in need of drawingmodel
- the data source that returned the relationship- Since:
- 1.0
setRelationshipRenderer
public void setRelationshipRenderer(java.lang.Class<? extends IRelationship> relationshipType,
IRelationshipRenderer renderer)
- Maps the implementation of a relationship renderer to a class definition.
- Parameters:
relationshipType
- the type of those relationships that will be rendered with the
given rendererrenderer
- an implementation that will be used to renderer instances of
the given object type- Since:
- 1.0
- See Also:
DefaultRelationshipRenderer
,
getRelationshipRenderer(Class)
getRelationshipRenderer
public IRelationshipRenderer getRelationshipRenderer(java.lang.Class cl)
- Returns a renderer for drawing a relationship. The lookup of the renderer
is based on the type of relationship.
- Parameters:
cl
- the relationship object type in need of rendering
- Returns:
- a matching relationship renderer implementation
- Since:
- 1.0
- See Also:
setRelationshipRenderer(Class, IRelationshipRenderer)
,
DefaultRelationshipRenderer