|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsimtools.shapes.AbstractShape
simtools.shapes.LabelShape
public class LabelShape
This class enables to display strings on one line with a left or right or center position versus an anchor
Nested Class Summary |
---|
Nested classes/interfaces inherited from class simtools.shapes.AbstractShape |
---|
AbstractShape.AbstractShapePropertiesNames |
Field Summary | |
---|---|
protected static java.awt.font.FontRenderContext |
_frch
|
protected static java.awt.geom.AffineTransform |
_trv
|
protected int |
anchorSide
|
static int |
CENTER
|
static int |
CENTERDOWN
|
static int |
CENTERUP
|
protected java.awt.Font |
font
|
static int |
LEFT
|
static int |
LEFTDOWN
|
static int |
LEFTUP
|
static int |
RIGHT
|
static int |
RIGHTDOWN
|
static int |
RIGHTUP
|
protected java.lang.String |
text
|
protected boolean |
vertical
|
Fields inherited from class simtools.shapes.AbstractShape |
---|
_h, _ox, _oy, _propertyNames, _w, _x, _y, ANTI_ALIASING, currentDialogBox, FONT_NAMES, listeners, REFRESH_PERIOD |
Constructor Summary | |
---|---|
LabelShape(java.lang.String s,
int ox,
int oy,
int anchorSide,
boolean vertical)
Creates a new label |
Method Summary | |
---|---|
void |
draw(java.awt.Graphics2D g)
Draws the label |
static void |
draw(java.awt.Graphics2D g,
LabelShape[] l)
Draws a set of label and assume they share the same direction |
protected void |
drawText(java.awt.Graphics2D g,
int x,
int y,
int w,
int h)
Draws the text in the rectangle specified, presupposing it is correct and match the graphics transform. |
int |
getAnchorSide()
|
int |
getSide()
Gets the text side wrt the anchor |
java.lang.String |
getString()
Gets the text string |
java.lang.String |
getText()
|
boolean |
isVertical()
|
void |
setAnchorSide(int anchorSide)
|
void |
setBounds(java.awt.Font f)
Computes the shape bounds |
void |
setSide(int s)
Sets the text side wrt the anchor |
void |
setString(java.lang.String s)
Sets the text string |
void |
setText(java.lang.String text)
|
void |
setVertical(boolean vertical)
|
Methods inherited from class simtools.shapes.AbstractShape |
---|
addListener, cloneShape, contains, contains, contains, contains, getAnchor, getBounds, getBounds2D, getInnerProperties, getMax, getMaxTranslated, getMin, getPathIterator, getPathIterator, getPropertyNames, getPropertyValue, intersects, intersects, notifyChange, notifyChange, refresh, removeListener, setAnchor, setAnchor, setProperties, setPropertyValue, translate, wipeOff |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.awt.geom.AffineTransform _trv
protected static final java.awt.font.FontRenderContext _frch
public static final int LEFT
public static final int RIGHT
public static final int CENTER
public static final int LEFTUP
public static final int RIGHTUP
public static final int CENTERUP
public static final int LEFTDOWN
public static final int RIGHTDOWN
public static final int CENTERDOWN
protected int anchorSide
protected boolean vertical
protected java.lang.String text
protected java.awt.Font font
Constructor Detail |
---|
public LabelShape(java.lang.String s, int ox, int oy, int anchorSide, boolean vertical)
s
- the string to displayox
- the anchor x positionoy
- the anchor y positionanchorSide
- the text postion wrt the anchor (LEFT, CENTER, ...)vertical
- true if string is vertically displayedMethod Detail |
---|
public java.lang.String getText()
public void setText(java.lang.String text)
text
- public int getAnchorSide()
public void setAnchorSide(int anchorSide)
anchorSide
- public boolean isVertical()
public void setVertical(boolean vertical)
vertical
- public void setSide(int s)
s
- the new sidepublic int getSide()
public void setString(java.lang.String s)
s
- the new stringpublic java.lang.String getString()
public void setBounds(java.awt.Font f)
f
- the font to be usedpublic void draw(java.awt.Graphics2D g)
draw
in class AbstractShape
g
- the graphics contextpublic static void draw(java.awt.Graphics2D g, LabelShape[] l)
g
- the graphics contextl
- the labelsprotected void drawText(java.awt.Graphics2D g, int x, int y, int w, int h)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |