Package com.storedobject.svg
Class Group
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
Canvas
Represents a group element in the SVG structure. The
Group class is used to manage and
organize a collection of child Node elements, allowing for their collective manipulation
and rendering in an SVG format. It provides functionality to add, remove, and iterate through child
elements, as well as to build the group into its final SVG representation.- Author:
- Syam
- See Also:
-
Field Summary
Fields inherited from class com.storedobject.svg.AbstractGroup
children -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidInserts a childNodeat the specified position within the group's list of children.voidAdds a childNodeto the group.voidclear()Removes all childNodeelements from this group.Node<?> getChildAt(int index) Retrieves the childNodeat the specified index within the group's list of children.voidRemoves a childNodefrom the group.Methods inherited from class com.storedobject.svg.AbstractGroup
children, compute, innerContentMethods inherited from class com.storedobject.svg.Node
attributes, copy, createDocument, equals, escapeXml, extraContent, 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
-
Group
public Group()Default constructor for theGroupclass. Initializes a new instance of theGroupelement with the SVG tag "g". This constructor sets up the base structure required for managing and organizing a collection of childNodeelements in the SVG structure.
-
-
Method Details
-
add
-
add
Inserts a childNodeat the specified position within the group's list of children. If the providedchildnode is non-null, it will be added at the specified index.- Parameters:
index- the position at which thechildshould be inserted; must be a valid index.child- theNodeto be inserted; must not be null.
-
remove
-
clear
public void clear()Removes all childNodeelements from this group. This method clears the internal list of child nodes managed by the group, leaving it empty. It is commonly used to reset the group to a clean state. -
getChildAt
Retrieves the childNodeat the specified index within the group's list of children. If the provided index is out of bounds, this method returnsnull.
-