Modifier and Type | Field and Description |
---|---|
protected Color |
fillColor |
protected int |
lengthGu |
protected Path2D.Float |
path |
protected Color |
strokeColor |
protected int |
widthGu |
protected double |
x |
protected double |
y |
Constructor and Description |
---|
Arrow() |
Modifier and Type | Method and Description |
---|---|
protected double |
evalEllipseRadius(GraphicEdge edge,
double w,
double h)
Compute the length of a vector along the edge from the ellipse centre to
the intersection between the edge and the ellipse.
|
protected double |
evalTargetRadius(GraphicEdge edge,
GraphMetrics metrics)
Evaluate the position of the arrow to avoid putting it above or under the
target node.
|
void |
renderFill(Graphics2D g,
GraphMetrics metrics)
Render the filled part of the shape.
|
void |
renderStroke(Graphics2D g,
GraphMetrics metrics)
Render the stroke of the shape.
|
void |
setArrowLengthGu(int lengthGu) |
void |
setArrowWidthGu(int widthGu) |
void |
setFillColor(Color color) |
protected void |
setPositionAndShape(GraphicEdge edge,
GraphMetrics metrics) |
protected void |
setShapeAt(double x,
double y,
double dx,
double dy)
Compute the shape of the arrow.
|
void |
setStrokeColor(Color color) |
protected Color strokeColor
protected int lengthGu
protected int widthGu
protected double x
protected double y
protected Path2D.Float path
public Arrow()
public void setArrowLengthGu(int lengthGu)
public void setArrowWidthGu(int widthGu)
public void setFillColor(Color color)
public void setStrokeColor(Color color)
public void renderFill(Graphics2D g, GraphMetrics metrics)
Shape
renderFill
in class Shape
g
- The Swing graphics.public void renderStroke(Graphics2D g, GraphMetrics metrics)
Shape
renderStroke
in class Shape
g
- The Swing graphics.protected void setPositionAndShape(GraphicEdge edge, GraphMetrics metrics)
protected void setShapeAt(double x, double y, double dx, double dy)
x
- Point at which the edge crosses the node shape.y
- Point at which the edge crosses the node shape.dx
- The arrow vector (and length).dy
- The arrow vector (and length).protected double evalTargetRadius(GraphicEdge edge, GraphMetrics metrics)
edge
- The edge.metrics
- The metrics.protected double evalEllipseRadius(GraphicEdge edge, double w, double h)
edge
- The edge representing the vector.w
- The ellipse first radius (width/2).h
- The ellipse second radius (height/2).WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses