|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.xj.anylogic.engine.presentation.Shape
com.xj.anylogic.engine.presentation.ShapeText
public class ShapeText
Persistent text shape.
| Field Summary |
|---|
| Fields inherited from class com.xj.anylogic.engine.presentation.Shape |
|---|
UNKNOWN_NAME |
| Constructor Summary | |
|---|---|
ShapeText()
Constructs a text shape with default attributes. |
|
ShapeText(boolean ispublic,
double x,
double y,
double rotation,
java.awt.Color color,
java.lang.String text,
java.awt.Font font,
int alignment)
Constructs a text shape with specific attributes. |
|
| Method Summary | |
|---|---|
ShapeText |
clone()
Creates and returns a copy of this shape (i.e. new shape instance). |
boolean |
contains(double px,
double py)
Test if the shape contains the point with the given coordinates (relative to this shape's container, i.e. in the same system with the coordinates of this shape, x and y) |
void |
draw(Panel panel,
java.awt.Graphics2D g,
java.awt.geom.AffineTransform xform,
boolean publicOnly)
Draws the text in a given context |
int |
getAlignment()
Returns the alignment of the text shape. |
java.awt.Color |
getColor()
Returns the color of the text. |
java.awt.Font |
getFont()
Returns the font of the text shape. |
java.lang.String |
getText()
Returns the text of the text shape. |
boolean |
onClickAt(double px,
double py,
boolean publicOnly)
Tests if the text shape contains the point with the given coordinates and, if yes, executes the shape's reaction on click at that point. |
void |
setAlignment(int alignment)
Sets the alignment of the text shape. |
void |
setColor(java.awt.Color color)
Sets the color of the text. |
void |
setFont(java.awt.Font font)
Sets the font of the text shape. |
void |
setText(java.lang.Object text)
Sets the text of the text shape. |
| Methods inherited from class com.xj.anylogic.engine.presentation.Shape |
|---|
canHandleClick, getGroup, getName, getPresentable, getRotation, getScaleX, getScaleY, getX, getY, isVisible, onClick, restoreOwner, setPos, setRotation, setScale, setScale, setScaleX, setScaleY, setVisible, setX, setY |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ShapeText()
public ShapeText(boolean ispublic,
double x,
double y,
double rotation,
java.awt.Color color,
java.lang.String text,
java.awt.Font font,
int alignment)
ispublic - if true, the shape is visible on container's presentationx - the x coordinate of the beginning of the first line of the texty - the y coordinate of the beginning of the first line of the textrotation - the rotation of the text in radianscolor - color of the texttext - the text displayed by the text shapefont - the font used by the text shapealignment - the alignment of the text shape| Method Detail |
|---|
public void setColor(java.awt.Color color)
color - the new color, null = do not draw the textpublic java.awt.Color getColor()
public void setText(java.lang.Object text)
text - the new text of the text shapepublic java.lang.String getText()
public void setFont(java.awt.Font font)
font - the new font of the text shapepublic java.awt.Font getFont()
public void setAlignment(int alignment)
alignment - the new alignment of the text shape, one of:public int getAlignment()
public boolean onClickAt(double px,
double py,
boolean publicOnly)
onClickAt in class Shapepx - the x coordinate of the clickpy - the y coordinate of the clickpublicOnly - if true, not public shape returns false
public boolean contains(double px,
double py)
Shape
contains in class Shapepx - the x coordinate relative to this shape's containerpy - the y coordinate relative to this shape's container
public void draw(Panel panel,
java.awt.Graphics2D g,
java.awt.geom.AffineTransform xform,
boolean publicOnly)
draw in class Shapepanel - the panel where the drawing is doneg - the graphics where the drawing takes placexform - the "original" transform that must be restored before drawingpublicOnly - if true, the shape is only drawn if it is publicpublic ShapeText clone()
Shape
clone in class Shape
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||