Package com.storedobject.svg
Class Canvas
- All Implemented Interfaces:
Serializable
A canvas for drawing nodes. It can contain multiple
Node objects.- Author:
- Syam
- See Also:
-
Field Summary
Fields inherited from class com.storedobject.svg.AbstractGroup
children -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringRetrieves a string representation of the node's attributes.Add a clip element.protected StringProvides additional content specific to the node.voidremoveClip(Element clip) Remove a clip element.size(double width, double height) Set the size.Methods inherited from class com.storedobject.svg.AbstractGroup
children, compute, innerContentMethods inherited from class com.storedobject.svg.Node
copy, createDocument, equals, escapeXml, flipHorizontally, flipHorizontallyAroundOrigin, flipVertically, flipVerticallyAroundOrigin, getCoordinates, getId, getMargin, getSvg, hashCode, id, ID, IDValue, moveTo, moveTo, rotate, rotateAround, rotateAround, rotateAroundCenter, scale, scale, scaleHeightTo, scaleTo, scaleWidthTo, toString, toString, transform, translate, translate
-
Constructor Details
-
Canvas
public Canvas()Constructor. -
Canvas
public Canvas(double width, double height) Constructor.- Parameters:
width- Width.height- Height.
-
-
Method Details
-
clip
-
removeClip
-
size
Set the size.- Parameters:
width- Width.height- Height.- Returns:
- Self.
-
extraContent
Description copied from class:NodeProvides additional content specific to the node. This method is intended to be overridden by subclasses to define custom extra content specific to their implementation. By default, it returns null if no additional content is defined.Note: The extra content should be formatted as per SVG standards with appropriate tags. No validation is performed on the extra content.
- Overrides:
extraContentin classNode<Group>- Returns:
- A string representing the extra content of the node, or null if no extra content is defined.
-
attributes
Description copied from class:NodeRetrieves a string representation of the node's attributes. This method is typically overridden by subclasses to provide specific attributes corresponding to the node's state or properties. By default, this method returns null if no attributes are defined.- Overrides:
attributesin classNode<Group>- Returns:
- A string representing the attributes of the node, or null if no attributes are defined.
-