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

public class ClipPathElement extends SvgElement
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 via getAttribute().
  • RW methods (e.g., clipPathUnitsRW()) - Use traditional setAttribute() which stores values on the server for later retrieval.
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Clip path unit options.

    Nested classes/interfaces inherited from class org.vaadin.firitin.element.svg.SvgElement

    SvgElement.PreserveAspectRatio
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    Creates a clip path with the given ID.
  • Method Summary

    Modifier and Type
    Method
    Description
    add(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 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, toString

    Methods 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

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ClipPathElement

      public ClipPathElement()
    • ClipPathElement

      public ClipPathElement(String id)
      Creates a clip path with the given ID.
      Parameters:
      id - the ID for referencing this clip path
  • Method Details

    • clipPathUnits

      public ClipPathElement clipPathUnits(ClipPathElement.ClipPathUnits units)
      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

      public ClipPathElement clipPathUnitsRW(ClipPathElement.ClipPathUnits units)
      Sets the coordinate system for the clip path contents (read-write).
      Parameters:
      units - the clip path units
      Returns:
      this element for method chaining
    • add

      public ClipPathElement add(SvgElement... shapes)
      Adds shape elements to this clip path.
      Parameters:
      shapes - the shape elements that define the clipping region
      Returns:
      this element for method chaining