|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.vecmath.Tuple2d
javax.vecmath.Point2d
optics.graphics.Label2D
public class Label2D
Class to implement a Label on a Daigram2D
| Field Summary |
|---|
| Fields inherited from class javax.vecmath.Tuple2d |
|---|
x, y |
| Constructor Summary | |
|---|---|
Label2D(double x,
double y,
String s)
Form a label at a specific location and default colour set by {#link Colour.TextColour}. |
|
Label2D(double x,
double y,
String s,
Color c)
Form a label at a specific location and Colour. |
|
Label2D(Point2d p,
String s)
Form a label at a specific location and Colour. |
|
Label2D(Point2d p,
String s,
Color c)
Form a label at a specific location and Colour. |
|
Label2D(String s)
Form a label with specified String with default (0,0) location. |
|
Label2D(String s,
Color c)
Form a label with specifed colour and defaults (0,0) location. |
|
| Method Summary | |
|---|---|
void |
draw(Graphics2D g)
Method draw the String on the diagram |
Rectangle2D |
getBounds()
Method to get the bounds, being the label location |
String |
getText()
Method to get the current String |
void |
setText(String s)
Method to set the text of the label |
| Methods inherited from class javax.vecmath.Point2d |
|---|
distance, distanceL1, distanceLinf, distanceSquared |
| Methods inherited from class javax.vecmath.Tuple2d |
|---|
absolute, absolute, add, add, clamp, clamp, clampMax, clampMax, clampMin, clampMin, clone, epsilonEquals, equals, equals, get, getX, getY, hashCode, interpolate, interpolate, negate, negate, scale, scale, scaleAdd, scaleAdd, set, set, set, set, setX, setY, sub, sub, toString |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Label2D(double x,
double y,
String s,
Color c)
x - the x locationy - the y locations - the label textc - the colour
public Label2D(Point2d p,
String s,
Color c)
p - the label locations - the label textc - the colour
public Label2D(String s,
Color c)
s - the label textc - the colour
public Label2D(double x,
double y,
String s)
x - the x locationy - the y locations - the label text
public Label2D(Point2d p,
String s)
p - the location.s - the label textpublic Label2D(String s)
s - the label String.| Method Detail |
|---|
public String getText()
String the test Stringpublic void setText(String s)
s - the text String.public Rectangle2D getBounds()
getBounds in interface Diagram2DComponentRectange2D.Float the label box.public void draw(Graphics2D g)
draw in interface Diagram2DComponentg - the Graphics2D object.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||