|
||||||||||
| 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.ShapeLine
public class ShapeLine
Persistent line shape.
| Field Summary |
|---|
| Fields inherited from class com.xj.anylogic.engine.presentation.Shape |
|---|
UNKNOWN_NAME |
| Constructor Summary | |
|---|---|
ShapeLine()
Constructs a line with default attributes. |
|
ShapeLine(boolean ispublic,
double x,
double y,
java.awt.Color color,
double dx,
double dy,
double width,
int style)
Constructs a line with specific attributes. |
|
ShapeLine(boolean ispublic,
double x,
double y,
java.lang.Object color,
double dx,
double dy,
double width,
int style)
Constructs a line with specific attributes. |
|
| Method Summary | |
|---|---|
ShapeLine |
clone()
Creates and returns a copy of this shape (i.e. new shape instance). |
boolean |
contains(double px,
double py)
Always returns false as line has no area and does not contain any point. |
void |
draw(Panel panel,
java.awt.Graphics2D g,
java.awt.geom.AffineTransform xform,
boolean publicOnly)
Draws the line in a given context |
java.awt.Color |
getColor()
Returns the color of the line, or null if line has no color or
has texture (in this case getTexture() should be used instead) |
double |
getDx()
Returns the difference of x coordinates of the line end and start points. |
double |
getDy()
Returns the difference of y coordinates of the line end and start points. |
double |
getEndX()
Returns the x coordinate of the line end point. |
double |
getEndY()
Returns the y coordinate of the line end point. |
double |
getLength()
Returns the length of the line. |
int |
getLineStyle()
Returns the style of the line: ActiveObject. |
double |
getLineWidth()
Returns the width of the line. |
Texture |
getTexture()
Returns the texture of the line, if the line has it |
boolean |
onClickAt(double px,
double py,
boolean publicOnly)
Always returns false as line has no area and does not handle clicks. |
void |
setColor(java.awt.Color color)
Sets the color of the line. |
void |
setDx(double dx)
Sets the difference of x coordinates of the line end and start points. |
void |
setDy(double dy)
Sets the difference of y coordinates of the line end and start points. |
void |
setEndX(double endx)
Sets the x coordinate of the line end point. |
void |
setEndY(double endy)
Sets the y coordinate of the line end point. |
void |
setLineStyle(int style)
Sets the style of the line: ActiveObject. |
void |
setLineWidth(double width)
Sets the width of the line, 0 means thinnest possible |
| 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 |
| Methods inherited from interface com.xj.anylogic.engine.Segment2D |
|---|
getX, getY |
| Constructor Detail |
|---|
public ShapeLine()
public ShapeLine(boolean ispublic,
double x,
double y,
java.awt.Color color,
double dx,
double dy,
double width,
int style)
ispublic - if true, the shape is visible on container's presentationx - the x coordinate of the line start pointy - the y coordinate of the line start pointcolor - color of the linedx - the difference of x coordinates of the line end and start pointsdy - the difference of y coordinates of the line end and start points
public ShapeLine(boolean ispublic,
double x,
double y,
java.lang.Object color,
double dx,
double dy,
double width,
int style)
ispublic - if true, the shape is visible on container's presentationx - the x coordinate of the line start pointy - the y coordinate of the line start pointcolor - color (or Texture) of the linedx - the difference of x coordinates of the line end and start pointsdy - the difference of y coordinates of the line end and start pointswidth - the line widthstyle - the line stroke style (solid, dotted, dashed)| Method Detail |
|---|
public void setColor(java.awt.Color color)
color - the new color, null = do not draw the linepublic java.awt.Color getColor()
null if line has no color or
has texture (in this case getTexture() should be used instead)
public Texture getTexture()
public void setDx(double dx)
dx - the new difference of x coordinates of the line end and start pointspublic double getDx()
getDx in interface Segment2Dpublic void setDy(double dy)
dy - the new difference of y coordinates of the line end and start pointspublic double getDy()
getDy in interface Segment2Dpublic void setEndX(double endx)
endx - the new value of x coordinate of line endpublic double getEndX()
getEndX in interface Segment2Dpublic void setEndY(double endy)
endy - the new value of y coordinate of line endpublic double getEndY()
getEndY in interface Segment2Dpublic double getLength()
public void setLineWidth(double width)
width - the new width of the linepublic double getLineWidth()
public void setLineStyle(int style)
style - the new style of the linepublic int getLineStyle()
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)
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 Shapeg - 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 publicpanel - the panel where the drawing is donepublic ShapeLine clone()
Shape
clone in class Shape
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||