public class ShapeCanvas extends Shape
UNKNOWN_NAME
Constructor and Description |
---|
ShapeCanvas(boolean ispublic,
double x,
double y,
double rotation,
double width,
double height)
Constructs a canvas with specific attributes.
|
ShapeCanvas(double width,
double height)
Constructs a canvas with given width and height, public visibility,
x and y coordinates and rotation set to 0.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the whole canvas (makes it fully transparent).
|
void |
clearRectangle(double x,
double y,
double width,
double height)
Clears a rectangle on the canvas (makes it fully transparent)
|
boolean |
contains(double px,
double py)
Tests if the canvas contains the point with the given coordinates
|
void |
fillCircle(double cx,
double cy,
double radius,
java.awt.Paint color)
Fills a circle with the given color on the canvas, preserving transparency
|
void |
fillRectangle(double x,
double y,
double width,
double height,
java.awt.Paint color)
Fills a rectangle with the given color on the canvas, preserving transparency
|
double |
getHeight()
Returns the height of the canvas.
|
double |
getWidth()
Returns the width of the canvas.
|
void |
postSVGShapeSpecificAttributes(java.util.List<java.lang.String> att,
java.util.List<java.lang.String> val,
boolean publicOnly)
Posts general properties specific to a particular shape class.
|
void |
setGlobalCompositeOperation(java.lang.String type)
Sets the type of composing operation to apply when drawing new shapes,
where type is a string identifying which of the composing or blending mode
operations to use.
|
void |
setHeight(double height)
Sets the height of the canvas.
|
void |
setSize(double width,
double height)
Sets the width and height of the canvas.
|
void |
setWidth(double width)
Sets the width of the canvas.
|
canHandleClick, clone, executeUserAction, findSVGElement, getDrawMode, getGroup, getLevel, getName, getPresentable, getRotation, getScaleX, getScaleY, getSVGId, getX, getY, isJava2DSwingPresentation, isPublic_xjal, isSVGPresentation, isVisible, onAggregatorVisibilityChanged, onClick, randomPointInside, randomPointInside, removeSVGFromOwner, removeSVGImage, resetSVGState, restoreOwner, setLevel, setPos, setPos, setPublic_xjal, setRotation, setScale, setScale, setScaleX, setScaleY, setVisible, setX, setY, updateDynamicProperties, updateDynamicPropertiesStructural, updateSVGProperties
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
initializeInternal, postInitialize
public ShapeCanvas(double width, double height)
width
- the width of the canvasheight
- the height of the canvaspublic ShapeCanvas(boolean ispublic, double x, double y, double rotation, double width, double height)
ispublic
- if true
, the shape is visible on container's presentationx
- the x coordinate of the canvas upper left cornery
- the y coordinate of the canvas upper left cornerrotation
- the rotation of the canvas around Z-axis from +X to +Y, in radianswidth
- the width of the canvasheight
- the height of the canvaspublic double getWidth()
public void setWidth(double width)
width
- the new width of the canvaspublic double getHeight()
public void setHeight(double height)
height
- the new height of the canvaspublic void setSize(double width, double height)
width
- the new width of the canvasheight
- the new height of the canvaspublic boolean contains(double px, double py)
public void setGlobalCompositeOperation(java.lang.String type)
type
- the type of composing to be applied from nowpublic void fillRectangle(double x, double y, double width, double height, java.awt.Paint color)
x
- the x coordinate of the top left corner of the rectangley
- the y coordinate of the top left corner of the rectanglewidth
- the width of the rectangleheight
- the height of the rectanglecolor
- the color or texture to usepublic void fillCircle(double cx, double cy, double radius, java.awt.Paint color)
cx
- the x coordinate of the circle centercy
- the y coordinate of the circle centerradius
- the radius of the circlecolor
- the color or texture to usepublic void clearRectangle(double x, double y, double width, double height)
x
- the x coordinate of the top left corner of the rectangley
- the y coordinate of the top left corner of the rectanglewidth
- the width of the rectangleheight
- the height of the rectanglepublic void clear()
public void postSVGShapeSpecificAttributes(java.util.List<java.lang.String> att, java.util.List<java.lang.String> val, boolean publicOnly)
Shape
postSVGShapeSpecificAttributes
in class Shape
att
- attribute namesval
- attribute valuespublicOnly
- TODOCopyright © AnyLogic North America, LLC. All Rights Reserved.