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:
  • 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