|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--y.view.Arrow
Defines a class for arrows, which are usually seen at the end of edges. There are several arrow types predefined.
It is also possible to create custom arrows which then can be used
system-wide like predefined arrows.
For this to work one has to register a new arrow via
Arrow.addCustomArrow(String name, Shape shape, Color fillColor)
.
The given shape defines the
shape of the arrow. The arrow head should be at shape coordinate (0,0)
and the tail somewhere on (x,0), where x < 0.
the arrow can now be retrieved via
Arrow.getCustomArrow(String name)
.
Field Summary | |
static byte |
CUSTOM_TYPE
Arrow type constant that describes a custom arrow type. |
static Arrow |
DELTA
A unicolored arrow that has the shape of a triangle. |
static byte |
DELTA_TYPE
Arrow type constant that describes arrow Arrow.DELTA . |
static Arrow |
DIAMOND
A unicolored arrow that has the shape of a diamond. |
static byte |
DIAMOND_TYPE
Arrow type constant that describes arrow Arrow.DIAMOND . |
static Arrow |
NONE
An arrow that does not have a graphical representation. |
static byte |
NONE_TYPE
Arrow type constant that describes arrow Arrow.NONE . |
static Arrow |
SHORT
An arrow that is short and broad. |
static byte |
SHORT_TYPE
Arrow type constant that describes arrow Arrow.SHORT |
static Arrow |
STANDARD
A unicolored arrow that has the shape of a triangle with impressed bottom side. |
static byte |
STANDARD_TYPE
Arrow type constant that describes arrow Arrow.STANDARD . |
static Arrow |
WHITE_DELTA
An arrow that has the shape of a triangle. |
static byte |
WHITE_DELTA_TYPE
Arrow type constant that describes arrow Arrow.WHITE_DELTA . |
static Arrow |
WHITE_DIAMOND
An arrow that has the shape of a diamond. |
static byte |
WHITE_DIAMOND_TYPE
Arrow type constant that describes arrow Arrow.WHITE_DIAMOND . |
Method Summary | |
static Arrow |
addCustomArrow(String name,
Shape shape,
Color fillColor)
Adds a new custom arrow with the given name to the set of available custom arrows. |
static Vector |
availableArrows()
Returns a vector of all available arrows, i.e. all built in types and all added custom types. |
static Arrow |
getArrow(byte type)
Returns the arrow described by the given arrow type specifier. |
static Arrow |
getCustomArrow(String name)
Returns the custom arrow that was added under the given name. |
String |
getCustomName()
If this arrow is a custom arrow it's custom name will be returned. |
Shape |
getShape()
Returns the shape of this arrow. |
byte |
getType()
Returns the type of this arrow. |
void |
paint(Graphics2D g,
AffineTransform t)
Paints an affine transform of this arrow. |
void |
paint(Graphics2D g,
double x,
double y,
double dx,
double dy)
Paints the arrow at a specific position in a specific direction. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static Arrow NONE
public static Arrow STANDARD
public static Arrow DELTA
public static Arrow WHITE_DELTA
public static Arrow DIAMOND
public static Arrow SHORT
public static Arrow WHITE_DIAMOND
public static final byte CUSTOM_TYPE
public static final byte NONE_TYPE
Arrow.NONE
.
public static final byte STANDARD_TYPE
Arrow.STANDARD
.
public static final byte DELTA_TYPE
Arrow.DELTA
.
public static final byte WHITE_DELTA_TYPE
Arrow.WHITE_DELTA
.
public static final byte DIAMOND_TYPE
Arrow.DIAMOND
.
public static final byte WHITE_DIAMOND_TYPE
Arrow.WHITE_DIAMOND
.
public static final byte SHORT_TYPE
Arrow.SHORT
Method Detail |
public static Arrow addCustomArrow(String name, Shape shape, Color fillColor)
The arrow head should be at shape coordinate (0,0) and the tail somewhere on (x,0), where x < 0.
public static Arrow getCustomArrow(String name)
public static Vector availableArrows()
public static Arrow getArrow(byte type)
type
- one of Arrow.NONE_TYPE
, Arrow.STANDARD_TYPE
,
Arrow.DELTA_TYPE
, Arrow.WHITE_DELTA_TYPE
, Arrow.DIAMOND_TYPE
,
Arrow.WHITE_DIAMOND_TYPE
.public byte getType()
public String getCustomName()
null
will be returned.
public Shape getShape()
public void paint(Graphics2D g, double x, double y, double dx, double dy)
public void paint(Graphics2D g, AffineTransform t)
t
- The affine trasform being applied to the arrow before
painting.
|
© Copyright 2000-2003, yWorks GmbH. All rights reserved. 2003 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |