Package com.anylogic.engine.presentation
- java.lang.Object
- com.anylogic.engine.presentation.Shape
- com.anylogic.engine.presentation.ShapeSVG
- All Implemented Interfaces:
com.anylogic.engine.internal.Child
,Locatable2D
,AggregatableAnimationElement
,HasLevel
,LevelElement
,SVGElement
,UsdElement
,Serializable
,Cloneable
public class ShapeSVG extends Shape
A custom SVG image rendered from the SVG XML provided by the user as a String object.
- Author:
- AnyLogic North America, LLC https://anylogic.com
- See Also:
- Serialized Form
Constructor | Description |
---|---|
ShapeSVG() |
Creates an empty SVG image with default properties: public,
located at (0,0) and not rotated.
|
ShapeSVG |
Creates an SVG image with specific properties
|
ShapeSVG |
Creates an SVG image with default properties: public,
located at (0,0) and not rotated.
|
Modifier and Type | Method | Description |
---|---|---|
boolean | contains |
Test if the shape contains the point with the given coordinates
(relative to this shape's container, i.e.
|
String | getSVG() |
Returns the current SVG image (XML format) or null
|
void | removeSVG() |
Removes SVG image (same effect as setting it to null).
|
void | setSVG |
Sets the new SVG image
|
canHandleClick, clone, executeUserAction, findSVGElement, getDrawMode, getGroup, getLevel, getName, getOrGenerateUSDId, getPresentable, getRotation, getScaleX, getScaleY, getSVGId, getUsdVersion, getX, getY, isJava2DSwingPresentation, isPublic_xjal, isSVGPresentation, isVisible, isVisibleCurrently, onAggregatorVisibilityChanged, onClick, postSVGShapeSpecificAttributes, randomPointInside, randomPointInside, removeSVGFromOwner, removeSVGImage, resetSVGState, restoreOwner, setChangedUsdVersion, setLevel, setNextChangedUsdVersion, setPos, setPos, setPublic_xjal, setRotation, setScale, setScale, setScaleX, setScaleY, setVisible, setX, setY, updateDynamicProperties, updateDynamicPropertiesStructural, updateSVGProperties
public ShapeSVG()
Creates an empty SVG image with default properties: public,
located at (0,0) and not rotated.
public ShapeSVG(String svg)
Creates an SVG image with default properties: public,
located at (0,0) and not rotated.
public ShapeSVG(boolean ispublic, double x, double y, double rotation, String svg)
Creates an SVG image with specific properties
- Parameters:
ispublic
- iftrue
, the shape is visible on container's presentationx
- the x coordinate of the SVG image upper left cornery
- the y coordinate of the SVG image upper left cornerrotation
- the rotation of the SVG image around Z-axis from +X to +Y, in radianssvg
- the SVG image (XML format)
public String getSVG()
Returns the current SVG image (XML format) or null
- Returns:
- the SVG image in XML format or null
public void setSVG(String svg)
Sets the new SVG image
- Parameters:
svg
- the new SVG image in XML format or null for no image
public void removeSVG()
Removes SVG image (same effect as setting it to null).
public boolean contains(double px, double py)
Description copied from class:
Shape