Class ClipPathElement
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.ClipPathElement
- All Implemented Interfaces:
Serializable
A typed Java API for the SVG
<clipPath> element.
The <clipPath> element defines a clipping path to be used by the
clip-path property. A clipping path restricts the region to which paint
can be applied. Conceptually, parts of the drawing that lie outside of
the region bounded by the clipping path are not drawn.
Clip paths must be placed inside a <defs> element and referenced
by ID using the clip-path attribute (e.g., clip-path="url(#myClip)").
Write-Only vs Read-Write Methods
This class provides two variants for each attribute setter:
- Default methods (e.g.,
clipPathUnits()) - Use an optimized write-only approach. Attribute values are NOT stored on the server and cannot be retrieved viagetAttribute(). - RW methods (e.g.,
clipPathUnitsRW()) - Use traditionalsetAttribute()which stores values on the server for later retrieval.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumClip path unit options.Nested classes/interfaces inherited from class SvgElement
SvgElement.PreserveAspectRatio -
Constructor Summary
ConstructorsConstructorDescriptionCreates a clip path with the given ID. -
Method Summary
Modifier and TypeMethodDescriptionadd(SvgElement... shapes) Adds shape elements to this clip path.Sets the coordinate system for the clip path contents.Sets the coordinate system for the clip path contents (read-write).Methods inherited from class 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
-
ClipPathElement
public ClipPathElement() -
ClipPathElement
Creates a clip path with the given ID.- Parameters:
id- the ID for referencing this clip path
-
-
Method Details
-
clipPathUnits
Sets the coordinate system for the clip path contents.Uses write-only optimization. Use
clipPathUnitsRW(ClipPathUnits)if you need to read the value back.- Parameters:
units- the clip path units- Returns:
- this element for method chaining
-
clipPathUnitsRW
Sets the coordinate system for the clip path contents (read-write).- Parameters:
units- the clip path units- Returns:
- this element for method chaining
-
add
Adds shape elements to this clip path.- Parameters:
shapes- the shape elements that define the clipping region- Returns:
- this element for method chaining
-