|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jpicedt.graphic.view.ArrowView
public abstract class ArrowView
A class implementing a view for the arrow attribute. 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).
Nested Class Summary | |
---|---|
static class |
ArrowView.CircleCentered
|
static class |
ArrowView.CircleFlushed
|
static class |
ArrowView.Direction
|
static class |
ArrowView.DiskCentered
|
static class |
ArrowView.DiskFlushed
|
static class |
ArrowView.DoubleHead
|
static class |
ArrowView.DoubleReverseHead
|
static class |
ArrowView.Head
|
static class |
ArrowView.Pencil
|
static class |
ArrowView.ReverseHead
|
static class |
ArrowView.RoundedBracket
|
static class |
ArrowView.SquareBracket
|
static class |
ArrowView.TBarCentered
|
static class |
ArrowView.TBarFlushed
|
Field Summary | |
---|---|
protected double |
globalScaleLength
|
protected double |
globalScaleWidth
|
protected float |
lineWidth
|
Constructor Summary | |
---|---|
ArrowView(PicAttributeSet set)
Configure the parameters of this arrow (size, scale, inset, ...) from the given attribute set, aka view/model synchronization. |
Method Summary | |
---|---|
static Map<StyleConstants.ArrowStyle,ImageIcon> |
createArrowIcons(ArrowView.Direction direction)
build icons for e.g. |
static ArrowView |
createArrowView(StyleConstants.ArrowStyle arrow,
PicAttributeSet set)
Return a View for the given arrow style. |
abstract ArrowView.Pencil |
getPencil()
whether we call g.draw() or g.fill() |
abstract Shape |
getShape()
|
static void |
main(String[] arg)
|
void |
paint(Graphics2D g)
Paints this arrow. |
void |
paint(Graphics2D g,
double locX,
double locY,
PicVector dir)
Updates then paints this arrow. |
void |
paint(Graphics2D g,
PicPoint loc,
PicVector dir)
Updates then paints this arrow. |
abstract void |
updateShape(double locX,
double locY,
PicVector dir)
To be called when the geometry of the hosting Element changed. |
void |
updateShape(PicPoint loc,
PicVector dir)
To be called when the geometry of the hosting Element changed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected double globalScaleWidth
protected double globalScaleLength
protected float lineWidth
Constructor Detail |
---|
public ArrowView(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.
Method Detail |
---|
public void paint(Graphics2D g, PicPoint loc, PicVector dir)
g
- graphic contextloc
- 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 locX, double locY, PicVector dir)
g
- graphic contextlocX
- 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 void paint(Graphics2D g)
g
- graphic contextpublic abstract void updateShape(double locX, double locY, PicVector dir)
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 void updateShape(PicPoint loc, PicVector dir)
public abstract ArrowView.Pencil getPencil()
public abstract Shape getShape()
public static ArrowView createArrowView(StyleConstants.ArrowStyle arrow, PicAttributeSet set)
public static Map<StyleConstants.ArrowStyle,ImageIcon> createArrowIcons(ArrowView.Direction direction)
direction
- specifies arrow direction, LEFT
for left
arrow, RIGHT
for right arrowpublic static void main(String[] arg)
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |