|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecty.view.Arrow
public final class 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 viaaddCustomArrow(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
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 DELTA. |
static Arrow |
DIAMOND
A unicolored arrow that has the shape of a diamond. |
static byte |
DIAMOND_TYPE
Arrow type constant that describes arrow DIAMOND. |
static Arrow |
NONE
An arrow that does not have a graphical representation. |
static byte |
NONE_TYPE
Arrow type constant that describes arrow NONE. |
static Arrow |
SHORT
An arrow that is short and broad. |
static byte |
SHORT_TYPE
Arrow type constant that describes 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 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 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 WHITE_DIAMOND. |
| Method Summary | |
|---|---|
static Arrow |
addCustomArrow(String name,
Arrow existingArrow,
double clipLength)
Creates, registers and returns a custom arrow that is created using a given arrow but the drawing of the arrow is offset from the corresponding end of the path using the given offset. |
static Arrow |
addCustomArrow(String name,
Drawable drawable)
Adds a new custom arrow with the given name to the set of available custom arrows. |
static Arrow |
addCustomArrow(String name,
Drawable drawable,
double arrowLength,
double clipLength)
Adds a new custom arrow with the given name to the set of available custom arrows. |
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 Arrow |
addCustomArrow(String name,
Shape shape,
Color fillColor,
Stroke lineStroke,
Color lineColor)
Adds a new custom arrow with the given name to the set of available custom arrows. |
static Arrow |
addCustomArrow(String name,
Shape shape,
Color fillColor,
Stroke lineStroke,
Color lineColor,
double arrowLength,
double clipLength)
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. |
double |
getArrowLength()
Returns the "length" of this arrow. |
double |
getClipLength()
Returns the length of the clip that should be applied to the edge's path before attaching the arrow. |
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. |
static double |
getDefaultClipLength()
Returns the statically shared clipLength of all default arrows. |
Shape |
getShape()
Returns the shape of this arrow. |
byte |
getType()
Returns the type of this arrow. |
void |
paint(Graphics2D gfx,
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. |
static void |
setDefaultClipLength(double defaultClipLength)
Sets the statically shared clipLength for all default arrows. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Arrow NONE
public static final Arrow STANDARD
public static final Arrow DELTA
public static final Arrow WHITE_DELTA
public static final Arrow DIAMOND
public static final Arrow SHORT
public static final Arrow WHITE_DIAMOND
public static final byte CUSTOM_TYPE
public static final byte NONE_TYPE
NONE.
public static final byte STANDARD_TYPE
STANDARD.
public static final byte DELTA_TYPE
DELTA.
public static final byte WHITE_DELTA_TYPE
WHITE_DELTA.
public static final byte DIAMOND_TYPE
DIAMOND.
public static final byte WHITE_DIAMOND_TYPE
WHITE_DIAMOND.
public static final byte SHORT_TYPE
SHORT
| Method Detail |
|---|
public static double getDefaultClipLength()
clipLength of all default arrows.
The default is 0.0d.
public static void setDefaultClipLength(double defaultClipLength)
clipLength for all default arrows.
The default is 0.0d.
defaultClipLength - the length of the clip
public static Arrow addCustomArrow(String name,
Shape shape,
Color fillColor)
public static Arrow addCustomArrow(String name,
Arrow existingArrow,
double clipLength)
name - The name to identify the arrow.existingArrow - the existing arrow to wrapclipLength - the clipping length
public static Arrow addCustomArrow(String name,
Shape shape,
Color fillColor,
Stroke lineStroke,
Color lineColor)
public static Arrow addCustomArrow(String name,
Shape shape,
Color fillColor,
Stroke lineStroke,
Color lineColor,
double arrowLength,
double clipLength)
public static Arrow addCustomArrow(String name,
Drawable drawable)
public static Arrow addCustomArrow(String name,
Drawable drawable,
double arrowLength,
double clipLength)
public static Arrow getCustomArrow(String name)
public static Vector availableArrows()
public static Arrow getArrow(byte type)
type - one of NONE_TYPE, STANDARD_TYPE,
DELTA_TYPE, WHITE_DELTA_TYPE, DIAMOND_TYPE,
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 gfx,
AffineTransform t)
t - The affine trasform being applied to the arrow before
painting.public double getArrowLength()
calculation
of the path of an EdgeRealizer to clip the ends of the path by the given value, so that
the drawing of the path does not corrupt the drawing of the Arrow.
public double getClipLength()
0.0d
|
© Copyright 2000-2008, yWorks GmbH. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||