public class DefaultRelationshipRenderer extends Object implements IRelationshipRenderer
RelationshipLayer.setRelationshipRenderer(Class, IRelationshipRenderer)
Constructor and Description |
---|
DefaultRelationshipRenderer()
Constructs a new relationship renderer.
|
DefaultRelationshipRenderer(PathCalculator calculator)
Constructs a new relationship renderer.
|
Modifier and Type | Method and Description |
---|---|
GeneralPath |
drawRelationship(RelationshipLayer layer,
Graphics g,
IRelationship relationship,
boolean focused,
boolean selected)
Draws a relationship between two timeline objects.
|
int |
getArrowSize() |
Paint |
getFocusedLinePaint()
Returns the paint used for drawing the relationship when it is focused.
|
BasicStroke |
getFocusedLineStroke()
Returns the stroke used for drawing the relationship when it is focused.
|
Paint |
getLinePaint()
Returns the default line paint that will be used to draw the lines of a
relationship.
|
BasicStroke |
getLineStroke()
Returns the default line stroke that will be used to draw the lines of a
relationship.
|
protected IGanttChartModel |
getModel()
Returns the model to which the relationship belongs.
|
IRelationship |
getRelationship()
Returns the currently drawn relationship object.
|
Paint |
getSelectedLinePaint()
Returns the paint used for drawing the relationship when it is selected.
|
BasicStroke |
getSelectedLineStroke()
Returns the stroke used for drawing the relationship when it is selected.
|
protected boolean |
isFocused()
Returns true if the currently rendered relationship is focused.
|
protected boolean |
isSelected()
Returns true if the currently rendered relationship is selected.
|
protected void |
paintArrowHead(Graphics g,
IRelationship rel,
int x,
int y)
Draws an arrow at the end of the relationship line.
|
protected void |
paintRelationshipPath(Graphics g,
IRelationship rel,
GeneralPath path)
Performs the actual drawing of the relationship line based on the path
that was calculated by the
drawRelationship(RelationshipLayer, Graphics, IRelationship, boolean, boolean)
method via the path calculator object. |
void |
setArrowSize(int arrowSize) |
void |
setFocusedLinePaint(Paint paint)
Sets the paint used for drawing the relationship when it is focused.
|
void |
setFocusedLineStroke(BasicStroke stroke)
Sets the stroke used for drawing the relationship when it is focused.
|
void |
setLinePaint(Paint paint)
Sets the default line paint that will be used to draw the lines of a
relationship.
|
void |
setLineStroke(BasicStroke stroke)
Sets the default line stroke that will be used to draw the lines of a
relationship.
|
void |
setSelectedLinePaint(Paint paint)
Sets the paint used for drawing the relationship when it is selected.
|
void |
setSelectedLineStroke(BasicStroke stroke)
Sets the stroke used for drawing the relationship when it is selected.
|
public DefaultRelationshipRenderer(PathCalculator calculator)
calculator
- the calculator used to compute the path to drawpublic DefaultRelationshipRenderer()
public GeneralPath drawRelationship(RelationshipLayer layer, Graphics g, IRelationship relationship, boolean focused, boolean selected)
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 renderingfocused
- signals whether the mouse currently hovers over the
relationshipselected
- signals whether the relationship is currently selectedprotected void paintRelationshipPath(Graphics g, IRelationship rel, GeneralPath path)
drawRelationship(RelationshipLayer, Graphics, IRelationship, boolean, boolean)
method via the path calculator object.g
- the graphics context into which to draw the relationshiprel
- the relationship model objectpath
- the path that was calculated by the path calculatorprotected void paintArrowHead(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 Paint getLinePaint()
public void setLinePaint(Paint paint)
paint
- the paint object that will be used as a default for drawing
the lines of a relationshippublic BasicStroke getLineStroke()
public void setLineStroke(BasicStroke stroke)
stroke
- the stroke object that will be used as a default for drawing
the lines of a relationshippublic Paint getSelectedLinePaint()
public void setSelectedLinePaint(Paint paint)
paint
- the selection paintpublic Paint getFocusedLinePaint()
public void setFocusedLinePaint(Paint paint)
paint
- the focused paintpublic BasicStroke getFocusedLineStroke()
public void setFocusedLineStroke(BasicStroke stroke)
stroke
- the focused strokepublic BasicStroke getSelectedLineStroke()
public void setSelectedLineStroke(BasicStroke stroke)
stroke
- the selection strokepublic int getArrowSize()
public void setArrowSize(int arrowSize)
arrowSize
- the arrowSize to setprotected boolean isSelected()
protected boolean isFocused()
protected IGanttChartModel getModel()
public IRelationship getRelationship()
Copyright © 2006–2020 Dirk Lemmermann Software & Consulting. All rights reserved.