public class RelationshipLayer extends AbstractSystemLayer implements MouseListener, MouseMotionListener, IRelationshipSelectionModelListener, IGanttChartModelListener, PropertyChangeListener
IGanttChartModel.getRelationships()alpha, changeSupport, ganttChart, layerContainer, PROPERTY_ALPHA, PROPERTY_VISIBLE| Constructor and Description |
|---|
RelationshipLayer(LayerContainer lc)
Constructs a new relationship layer.
|
| Modifier and Type | Method and Description |
|---|---|
void |
deleteSelectedRelationships()
Deletes all currently selected relationships.
|
void |
ganttChartChanged(GanttChartModelEvent evt)
Callback method that gets invoked whenever change occures in the Gantt
chart model that is being observed by the listener.
|
IRelationshipRenderer |
getRelationshipRenderer(Class cl)
Returns a renderer for drawing a relationship.
|
Map<Class<? extends IRelationship>,IRelationshipRenderer> |
getRelationshipRendererMap()
Returns the renderer map used by this layer.
|
List<IRelationship> |
getRelationshipsAt(int x,
int y)
Returns all relationships that can be found at the given coordinate.
|
Collection<IRelationship> |
getSelectedRelationships()
Returns all currently selected relationships.
|
IRelationshipSelectionModel |
getSelectionModel()
Returns the relationship selection model used by the layer to track the
currently selected relationships.
|
boolean |
isDebugRelationshipBounds()
Returns a flag used for debugging the rendering of the relationships.
|
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) |
protected void |
paintRelationship(Graphics g,
int w,
int h,
IRelationship relationship,
IGanttChartModel model)
Paints the given relationship object.
|
void |
propertyChange(PropertyChangeEvent evt) |
void |
setDebugRelationshipBounds(boolean debug)
Sets a flag used for debugging the rendering of the relationships.
|
void |
setRelationshipRenderer(Class<? extends IRelationship> relationshipType,
IRelationshipRenderer renderer)
Maps the implementation of a relationship renderer to a class definition.
|
void |
setRelationshipRendererMap(Map<Class<? extends IRelationship>,IRelationshipRenderer> map)
Sets the renderer map used by this layer.
|
void |
setSelectionModel(IRelationshipSelectionModel model)
Sets a new selection model to be used by the relationship layer to track
the currently selected relationships.
|
void |
valueChanged(RelationshipSelectionEvent evt)
Callback method that gets invoked when the selection within the observed
RelationshipLayer changes. |
addPropertyChangeListener, getAlpha, getDateline, getEventline, getGanttChart, getHeight, getLayerContainer, getLayerPolicyProvider, getModel, getName, getStartRow, getTimeAt, getTimeline, getTimeLocation, getTimeSpanUsed, getToolTipText, getTreeTable, getTreeTablePolicyProvider, getWidth, removePropertyChangeListener, repaint, repaint, repaint, setAlpha, setVisible, tearDownpublic RelationshipLayer(LayerContainer lc)
lc - the owning layer containerpublic IRelationshipSelectionModel getSelectionModel()
public void setSelectionModel(IRelationshipSelectionModel model)
model - the new selection modelpublic boolean isVisible()
AbstractLayerisVisible in class AbstractLayerAbstractLayer.setVisible(boolean)protected void paintLayer(Graphics g)
paintLayer in class AbstractLayerprotected void paintRelationship(Graphics g, int w, int h, IRelationship relationship, IGanttChartModel model)
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 relationshippublic void setRelationshipRenderer(Class<? extends IRelationship> relationshipType, IRelationshipRenderer renderer)
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 typeDefaultRelationshipRenderer,
getRelationshipRenderer(Class)public IRelationshipRenderer getRelationshipRenderer(Class cl)
cl - the relationship object type in need of renderingsetRelationshipRenderer(Class, IRelationshipRenderer),
DefaultRelationshipRendererpublic List<IRelationship> getRelationshipsAt(int x, int y)
x - the x locationy - the y locationpublic void setDebugRelationshipBounds(boolean debug)
debug - if TRUE the relationships will be drawn with debug informationpublic boolean isDebugRelationshipBounds()
public void mouseClicked(MouseEvent e)
mouseClicked in interface MouseListenerpublic 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 mouseDragged(MouseEvent e)
mouseDragged in interface MouseMotionListenerpublic void mouseMoved(MouseEvent e)
mouseMoved in interface MouseMotionListenerpublic void valueChanged(RelationshipSelectionEvent evt)
IRelationshipSelectionModelListenerRelationshipLayer changes.valueChanged in interface IRelationshipSelectionModelListenerevt - the event with detailed information about the change that
occuredpublic Collection<IRelationship> getSelectedRelationships()
IRelationshipSelectionModel.getSelection().public void deleteSelectedRelationships()
public void ganttChartChanged(GanttChartModelEvent evt)
IGanttChartModelListenerganttChartChanged in interface IGanttChartModelListenerevt - the event object describing the change that took place in the
Gantt chart modelpublic void propertyChange(PropertyChangeEvent evt)
propertyChange in interface PropertyChangeListenerpublic Map<Class<? extends IRelationship>,IRelationshipRenderer> getRelationshipRendererMap()
public void setRelationshipRendererMap(Map<Class<? extends IRelationship>,IRelationshipRenderer> map)
map - the new renderer mapCopyright © 2006–2020 Dirk Lemmermann Software & Consulting. All rights reserved.