|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectuk.ac.ic.doc.automed.editor.DrawVertex
public class DrawVertex
The default implementation of DrawableVertex that the
editor will use to draw any vertex it does not know (or has been
told) to draw otherwise.
| Field Summary | |
|---|---|
protected java.awt.Rectangle |
bounds
|
protected static java.awt.Stroke |
dashedStroke
|
protected Positionable[] |
dependent
|
protected EditorPanel |
ep
|
protected static java.awt.FontMetrics |
fm
|
protected Positionable |
p
|
protected static java.awt.Stroke |
standardStroke
|
protected int |
symbolHeight
|
protected int |
symbolWidth
|
protected java.lang.String |
text
|
protected int |
textHeight
|
protected int |
textWidth
|
static int |
thickness
|
protected static java.awt.Stroke |
thickStroke
|
protected static java.awt.Stroke |
thinStroke
|
protected static int |
xInset
|
protected static int |
yInset
|
protected static java.awt.Point |
zeroOffset
|
| Constructor Summary | |
|---|---|
DrawVertex(EditorPanel ep,
Positionable p)
|
|
DrawVertex(EditorPanel ep,
Positionable p,
Positionable[] dependent)
|
|
| Method Summary | |
|---|---|
java.awt.Rectangle |
getBounds()
Describe the rectangular area within the EditorPanel
where this Drawable vertex is to be painted. |
java.awt.Point |
getCentre()
Describe where the centre of the Drawable visually appears
to a viewer. |
java.awt.Point |
getCentreOffset()
Implements the Drawable |
java.awt.Point |
getConnectionPoint(java.awt.Point other)
Calculate the Point where a DrawableArc connecting
to this DrawableVertex should be drawn to, no |
java.awt.Point |
getConnectionPointMovableCentre(java.awt.Point other)
A more visually pleasing implementation of getConnectionPoint(java.awt.Point)
for use on rectangular Drawables
that allows the centre of the object you are connecting with to be
treated as only loosely defining where the connection point should be
aligned to, such that as the other point moves to the right, so
the centre of the drawable moves a little to the right |
Positionable[] |
getConnectsTo()
|
Positionable |
getPositionable()
Return the Positionable that this Drawable is
providing a graphical representation of. |
static java.awt.Point |
intersectLine(java.awt.Rectangle bounds,
java.awt.Polygon p,
int x1,
int y1,
int x2,
int y2)
Return the Point where a line intersects a Polygon |
void |
paintComponent(java.awt.Graphics2D g)
|
void |
paintSymbol(java.awt.Graphics2D g)
|
void |
paintText(java.awt.Graphics2D g)
|
protected void |
setText(java.lang.String s)
Set the text that will be used in this {link @Drawable}, and record its width and height in textBounds. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static java.awt.FontMetrics fm
public static final int thickness
protected static final java.awt.Stroke thinStroke
protected static final java.awt.Stroke standardStroke
protected static final java.awt.Stroke thickStroke
protected static final java.awt.Stroke dashedStroke
protected static final int xInset
protected static final int yInset
protected java.lang.String text
protected int textWidth
protected int textHeight
protected int symbolWidth
protected int symbolHeight
protected java.awt.Rectangle bounds
protected Positionable p
protected static final java.awt.Point zeroOffset
protected Positionable[] dependent
protected EditorPanel ep
| Constructor Detail |
|---|
public DrawVertex(EditorPanel ep,
Positionable p,
Positionable[] dependent)
public DrawVertex(EditorPanel ep,
Positionable p)
| Method Detail |
|---|
public Positionable getPositionable()
Positionable that this Drawable is
providing a graphical representation of.
getPositionable in interface Drawablepublic Positionable[] getConnectsTo()
getConnectsTo in interface Drawableprotected final void setText(java.lang.String s)
textBounds.
public java.awt.Rectangle getBounds()
DrawableVertexEditorPanel
where this Drawable vertex is to be painted.
getBounds in interface DrawableVertexpublic java.awt.Point getCentreOffset()
Drawable
getCentreOffset in interface DrawableVertexgetBounds(),
where the graphical centre of this
Drawable liespublic java.awt.Point getCentre()
Drawable visually appears
to a viewer.
getCentre in interface DrawableVertexDrawable.public java.awt.Point getConnectionPoint(java.awt.Point other)
DrawableVertexPoint where a DrawableArc connecting
to this DrawableVertex should be drawn to, no
getConnectionPoint in interface DrawableVertexpublic java.awt.Point getConnectionPointMovableCentre(java.awt.Point other)
getConnectionPoint(java.awt.Point)
for use on rectangular Drawables
that allows the centre of the object you are connecting with to be
treated as only loosely defining where the connection point should be
aligned to, such that as the other point moves to the right, so
the centre of the drawable moves a little to the right
public void paintSymbol(java.awt.Graphics2D g)
public void paintText(java.awt.Graphics2D g)
public void paintComponent(java.awt.Graphics2D g)
paintComponent in interface Drawable
public static java.awt.Point intersectLine(java.awt.Rectangle bounds,
java.awt.Polygon p,
int x1,
int y1,
int x2,
int y2)
Point where a line intersects a Polygon
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||