|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdiva.canvas.connector.Arrowhead
public class Arrowhead
An arrowhead that is drawn on the end of a connector. This is a low-level utility class, not a self-contained Figure.
Field Summary | |
---|---|
private boolean |
_filled
Flag that says whether the arrowhead is filled or not. |
private boolean |
_flipped
A flag that says to slip the direction in which the arrowhead is drawn. |
private double |
_length
The arrowhead length, and its x and y components |
private double |
_normal
The normal to the line |
private double |
_originX
x and y-origins |
private double |
_originY
|
private Polygon2D |
_polygon
The shape to draw |
private boolean |
_polygonValid
A flag that says whether the shape is valid |
private java.awt.Stroke |
_stroke
The stroke. |
Constructor Summary | |
---|---|
Arrowhead()
Create a new arrowhead at (0,0). |
|
Arrowhead(double x,
double y,
double normal)
Create a new arrowhead at the given point and with the given normal. |
Method Summary | |
---|---|
java.awt.geom.Rectangle2D |
getBounds()
Get the bounding box of the shape used to draw this connector end. |
void |
getConnection(java.awt.geom.Point2D p)
Get the connection point into the given point |
boolean |
getFlipped()
Get the flag saying to flip the arrowhead. |
double |
getLength()
Get the length. |
void |
getOrigin(java.awt.geom.Point2D p)
Get the origin into the given point. |
boolean |
isFilled()
Test if the blob is filled or not. |
void |
paint(java.awt.Graphics2D g)
Paint the arrow-head. |
void |
reshape()
Recalculate the shape of the decoration. |
void |
setFilled(boolean flag)
Set the flag that determines whether to fill the arrowhead. |
void |
setFlipped(boolean flag)
Set the flag that says the arrowhead is "flipped." |
void |
setLength(double l)
Set the length of the arrowhead. |
void |
setNormal(double angle)
Set the normal of the decoration. |
void |
setOrigin(double x,
double y)
Set the origin of the decoration. |
void |
translate(double x,
double y)
Translate the origin by the given amount. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private boolean _filled
private double _length
private double _originX
private double _originY
private double _normal
private Polygon2D _polygon
private boolean _polygonValid
private boolean _flipped
private java.awt.Stroke _stroke
Constructor Detail |
---|
public Arrowhead()
public Arrowhead(double x, double y, double normal)
Method Detail |
---|
public java.awt.geom.Rectangle2D getBounds()
getBounds
in interface ConnectorEnd
public void getConnection(java.awt.geom.Point2D p)
getConnection
in interface ConnectorEnd
public boolean getFlipped()
public void getOrigin(java.awt.geom.Point2D p)
getOrigin
in interface ConnectorEnd
public double getLength()
public boolean isFilled()
public void paint(java.awt.Graphics2D g)
paint
in interface ConnectorEnd
public void reshape()
public void setNormal(double angle)
setNormal
in interface ConnectorEnd
public void setFilled(boolean flag)
public void setFlipped(boolean flag)
public void setOrigin(double x, double y)
setOrigin
in interface ConnectorEnd
public void setLength(double l)
public void translate(double x, double y)
translate
in interface ConnectorEnd
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |