Package org.vaadin.firitin.element.svg
Class GElement
java.lang.Object
com.vaadin.flow.dom.Node<com.vaadin.flow.dom.Element>
com.vaadin.flow.dom.Element
org.vaadin.firitin.element.svg.SvgElement
org.vaadin.firitin.element.svg.SvgGraphicsElement
org.vaadin.firitin.element.svg.GElement
- All Implemented Interfaces:
Serializable
A typed Java API for the SVG
<g> (group) element.
The <g> element is a container used to group other SVG elements.
Transformations applied to the <g> element are performed on its
child elements. Attributes applied to the <g> element are inherited
by its children.
Groups are useful for:
- Applying transformations to multiple elements at once
- Applying common styles to multiple elements
- Organizing complex drawings into logical parts
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.vaadin.firitin.element.svg.SvgGraphicsElement
SvgGraphicsElement.LineCap, SvgGraphicsElement.LineJoinNested classes/interfaces inherited from class org.vaadin.firitin.element.svg.SvgElement
SvgElement.PreserveAspectRatio -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd(SvgElement... children) Appends child elements to this group.Creates a rotation animation and appends it to this group.Creates a scale animation and appends it to this group.Creates a translation animation and appends it to this group.Methods inherited from class org.vaadin.firitin.element.svg.SvgGraphicsElement
clearTransform, clipPath, clipPathRW, fill, fill, fill, fill, fill, fillOpacity, fillOpacityRW, fillRW, fillRW, fillRW, fillRW, fillRW, marker, markerEnd, markerEndRW, markerMid, markerMidRW, markerRW, markerStart, markerStartRW, mask, maskRW, matrix, matrixRW, noFill, noFillRW, noStroke, noStrokeRW, opacity, opacityRW, rotate, rotate, rotateRW, rotateRW, scale, scale, scaleRW, scaleRW, skewX, skewXRW, skewY, skewYRW, stroke, stroke, stroke, stroke, stroke, strokeDasharray, strokeDasharray, strokeDasharrayRW, strokeDasharrayRW, strokeDashoffset, strokeDashoffsetRW, strokeLinecap, strokeLinecapRW, strokeLinejoin, strokeLinejoinRW, strokeMiterlimit, strokeMiterlimitRW, strokeOpacity, strokeOpacityRW, strokeRW, strokeRW, strokeRW, strokeRW, strokeRW, strokeWidth, strokeWidth, strokeWidthRW, strokeWidthRW, transform, transformRW, translate, translateRW, translateX, translateXRW, translateY, translateYRWMethods inherited from class org.vaadin.firitin.element.svg.SvgElement
emptySvgRoot, flushPendingAttributes, getOuterHTML, getPendingOrAttribute, getStyle, height, height, id, preserveAspectRatio, preserveAspectRatio, scheduleBeforeClientResponse, setAttribute, setWriteOnlyAttribute, size, size, viewBox, width, widthMethods inherited from class com.vaadin.flow.dom.Element
addAttachListener, addDetachListener, addEventListener, addPropertyChangeListener, addPropertyChangeListener, as, attachShadow, bindAttribute, bindProperty, bindText, callJsFunction, callJsFunction, createText, executeJs, executeJs, get, get, getAttribute, getAttributeNames, getChild, getChildCount, getChildren, getClassList, getComponent, getParent, getProperty, getProperty, getProperty, getProperty, getProperty, getPropertyBean, getPropertyBean, getPropertyNames, getPropertyRaw, getSelf, getShadowRoot, getTag, getText, getTextRecursively, getThemeList, hasAttribute, hasProperty, isEnabled, isTextNode, isVisible, removeAttribute, removeFromParent, removeFromTree, removeFromTree, removeProperty, scrollIntoView, scrollIntoView, setAttribute, setAttribute, setAttribute, setEnabled, setProperty, setProperty, setProperty, setPropertyBean, setPropertyJson, setPropertyList, setPropertyMap, setText, setVisible, toStringMethods inherited from class com.vaadin.flow.dom.Node
accept, appendChild, appendChild, appendVirtualChild, appendVirtualChild, ensureChildHasParent, equals, getNode, getParentNode, getStateProvider, hashCode, indexOfChild, insertChild, insertChild, isVirtualChild, removeAllChildren, removeChild, removeChild, removeChild, removeVirtualChild, removeVirtualChild, setChild
-
Constructor Details
-
GElement
public GElement()
-
-
Method Details
-
add
Appends child elements to this group.- Parameters:
children- the elements to add- Returns:
- this element for method chaining
-
animateTranslate
Creates a translation animation and appends it to this group.This animates the entire group and all its children. Example usage:
group.animateTranslate() .translateFromTo(0, 0, 100, 50) .dur(Duration.ofSeconds(2)) .beginElement();- Returns:
- the animation element for further configuration
-
animateRotate
Creates a rotation animation and appends it to this group.This animates the entire group and all its children. Example usage:
group.animateRotate() .rotateFromTo(0, 360, 50, 50) // rotate around center (50,50) .dur(Duration.ofSeconds(2)) .beginElement();- Returns:
- the animation element for further configuration
-
animateScale
Creates a scale animation and appends it to this group.This animates the entire group and all its children. Example usage:
group.animateScale() .scaleFromTo(1, 2) // scale from 1x to 2x .dur(Duration.ofSeconds(1)) .beginElement();- Returns:
- the animation element for further configuration
-