|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjpicedt.graphic.model.Arrow
public class Arrow
A class implementing the arrow attribute. This class acts as a model and a view at the same time. A syncAttributes() method allows for synchronizing the current attribute set with the arrow parameters used by the paint() method.
This class is also a container for predefined arrows (implemented as static inner classes).
Field Summary | |
---|---|
static Arrow |
ARROW_HEAD
|
static Arrow |
CIRCLE_CENTERED
|
static Arrow |
CIRCLE_FLUSHED
|
static Arrow |
DISK_CENTERED
|
static Arrow |
DISK_FLUSHED
|
static Arrow |
DOUBLE_ARROW_HEAD
|
static Arrow |
DOUBLE_REVERSE_ARROW_HEAD
|
protected double |
globalScaleLength
|
protected double |
globalScaleWidth
|
static Arrow |
NONE
|
static Arrow |
REVERSE_ARROW_HEAD
|
static Arrow |
ROUNDED_BRACKET
|
static Arrow |
SQUARE_BRACKET
|
static Arrow |
T_BAR_CENTERED
|
static Arrow |
T_BAR_FLUSHED
|
Constructor Summary | |
---|---|
protected |
Arrow(Arrow src)
|
protected |
Arrow(String name)
|
Method Summary | |
---|---|
Arrow |
copy()
|
static ImageIcon[] |
createArrowIcons(boolean rightArrow)
build icons for e.g. |
static Arrow |
getArrow(int indx)
Returns the Arrow corresponding to the given indx Arrow.NONE if indx > number of arrows |
static int |
getIndex(Arrow arrow)
Returns an integer associated with the given arrow (essentially for JComboxBox's...) |
String |
getName()
Return the name of this arrow. |
static Arrow[] |
getPredefinedArrows()
Returns an array of predefined arrows |
static void |
main(String[] arg)
|
void |
paint(Graphics2D g,
double linewidth,
double locX,
double locY,
PicPoint dir)
Paints this arrow (this implementation does nothing) |
void |
paint(Graphics2D g,
double linewidth,
PicPoint loc,
PicPoint dir)
Paints this arrow. |
void |
syncAttributes(PicAttributeSet set)
Configure the parameters of this arrow (size, scale, inset, ...) from the given attribute set, aka view/model synchronization. |
String |
toString()
Returns a string representation of this Arrow for debugging purpose |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected double globalScaleWidth
protected double globalScaleLength
public static final Arrow NONE
public static final Arrow ARROW_HEAD
public static final Arrow REVERSE_ARROW_HEAD
public static final Arrow DOUBLE_ARROW_HEAD
public static final Arrow DOUBLE_REVERSE_ARROW_HEAD
public static final Arrow T_BAR_CENTERED
public static final Arrow T_BAR_FLUSHED
public static final Arrow SQUARE_BRACKET
public static final Arrow ROUNDED_BRACKET
public static final Arrow CIRCLE_FLUSHED
public static final Arrow CIRCLE_CENTERED
public static final Arrow DISK_FLUSHED
public static final Arrow DISK_CENTERED
Constructor Detail |
---|
protected Arrow(String name)
name
- the name (possibly explicit) of this Arrowprotected Arrow(Arrow src)
Method Detail |
---|
public Arrow copy()
public String getName()
public void syncAttributes(PicAttributeSet set)
Usage: this method should invoked by the view responsible for rendering the drawing, whenever synchronization is needed b/w the view and the model, i.e. whenever at least one attribute value changed.
public static int getIndex(Arrow arrow)
arrow
- one of the predefined Arrow'sspublic static Arrow getArrow(int indx)
public static Arrow[] getPredefinedArrows()
public static ImageIcon[] createArrowIcons(boolean rightArrow)
rightArrow
- false for left arrow, true for right arrowpublic static void main(String[] arg)
public void paint(Graphics2D g, double linewidth, PicPoint loc, PicPoint dir)
g
- graphic contextlinewidth
- current lineWidth of the object this arrow is attached to (in mm)loc
- arrow reference point on the screen (that is, line end-point)dir
- a vector of length 1 indicating the direction of the arrow (see PEToolKit.getDirector...)public void paint(Graphics2D g, double linewidth, double locX, double locY, PicPoint dir)
g
- graphic contextlinewidth
- current lineWidth of the object this arrow is attached to (in mm)locX
- X-coord of arrow reference point on the screen (that is, line end-point)locY
- Y-coord of arrow reference point on the screen (that is, line end-point)dir
- a vector of length 1 indicating the direction of the arrow (see PEToolKit.getDirector...)public String toString()
toString
in class Object
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |