|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.dlsc.flexgantt.swing.layer.system.DefaultRelationshipRenderer
public class DefaultRelationshipRenderer
The default relationship renderer draws a multi edge line from the source to the target timeline object. The renderer can be customized to use different line strokes and paints. These differently colored relationship renderers can then be mapped to different types of relationships.
RelationshipLayer.setRelationshipRenderer(Class, IRelationshipRenderer)
Nested Class Summary | |
---|---|
static class |
DefaultRelationshipRenderer.TargetLocation
An enumerator of possible locations that the target object can have relative to the source object. |
Constructor Summary | |
---|---|
DefaultRelationshipRenderer()
Constructs a new relationship renderer. |
Method Summary | |
---|---|
void |
drawRelationship(RelationshipLayer layer,
java.awt.Graphics g,
IRelationship relationship)
Draws a relationship between two timeline objects. |
int |
getArrowSize()
|
int |
getCornerSize()
|
int |
getGap()
|
java.awt.Paint |
getLinePaint()
Returns the default line paint that will be used to draw the lines of a relationship. |
protected java.awt.Paint |
getLinePaint(IRelationship rel,
IGanttChartModel model)
Returns the paint that will be used for drawing the given relationship. |
java.awt.BasicStroke |
getLineStroke()
Returns the default line stroke that will be used to draw the lines of a relationship. |
protected java.awt.Stroke |
getLineStroke(IRelationship rel,
IGanttChartModel model)
Returns the stroke that will be used for drawing the given relationship. |
int |
getOffset()
|
protected void |
paintArrowHead(java.awt.Graphics g,
IRelationship rel,
int x,
int y)
Draws an arrow at the end of the relationship line. |
protected void |
paintRelationshipLine(java.awt.Graphics g,
IRelationship rel,
int[] x,
int[] y)
Draws the relationship by taking the incoming x- and y-coordinates to draw a polyline. |
void |
setArrowSize(int arrowSize)
|
void |
setCornerSize(int cornerSize)
|
void |
setGap(int gap)
|
void |
setLinePaint(java.awt.Paint paint)
Sets the default line paint that will be used to draw the lines of a relationship. |
void |
setLineStroke(java.awt.BasicStroke stroke)
Sets the default line stroke that will be used to draw the lines of a relationship. |
void |
setOffset(int offset)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultRelationshipRenderer()
Method Detail |
---|
public void drawRelationship(RelationshipLayer layer, java.awt.Graphics g, IRelationship relationship)
IRelationshipRenderer
drawRelationship
in interface IRelationshipRenderer
layer
- the relationship layer in which the drawing takes placeg
- the graphics context into which to drawrelationship
- the relationship object in need of renderingprotected void paintRelationshipLine(java.awt.Graphics g, IRelationship rel, int[] x, int[] y)
g
- the graphics context into which to drawrel
- the relationship that gets drawnx
- the x-coordinates array of the liney
- the y-coordinates array of the lineprotected void paintArrowHead(java.awt.Graphics g, IRelationship rel, int x, int y)
g
- the graphics context to use for the drawing operationsrel
- the relationship to drawx
- the starting x coordinatey
- the starting y coordinatepublic java.awt.Paint getLinePaint()
public void setLinePaint(java.awt.Paint paint)
paint
- the paint object that will be used as a default for drawing
the lines of a relationshippublic java.awt.BasicStroke getLineStroke()
public void setLineStroke(java.awt.BasicStroke stroke)
stroke
- the stroke object that will be used as a default for drawing
the lines of a relationshippublic int getArrowSize()
public void setArrowSize(int arrowSize)
arrowSize
- the arrowSize to setpublic int getCornerSize()
public void setCornerSize(int cornerSize)
cornerSize
- the cornerSize to setpublic int getOffset()
public void setOffset(int offset)
offset
- the offset to setpublic int getGap()
public void setGap(int gap)
gap
- the gap to setprotected java.awt.Stroke getLineStroke(IRelationship rel, IGanttChartModel model)
rel
- the relationship for which a stroke gets looked upmodel
- the Gantt chart model to which the relationship belongs
protected java.awt.Paint getLinePaint(IRelationship rel, IGanttChartModel model)
rel
- the relationship for which a paint gets looked upmodel
- the Gantt chart model to which the relationship belongs
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |