Class EllipseElement

java.lang.Object
com.vaadin.flow.dom.Node<com.vaadin.flow.dom.Element>
com.vaadin.flow.dom.Element
All Implemented Interfaces:
Serializable

public class EllipseElement extends SvgGraphicsElement
A typed Java API for the SVG <ellipse> element.

The <ellipse> element is a basic SVG shape that draws ellipses, defined by a center point and two radii (horizontal and vertical).

Write-Only vs Read-Write Methods

This class provides two variants for each attribute setter:

  • Default methods (e.g., cx(), cy()) - Use an optimized write-only approach. Attribute values are NOT stored on the server and cannot be retrieved via getAttribute().
  • RW methods (e.g., cxRW(), cyRW()) - Use traditional setAttribute() which stores values on the server for later retrieval.
See Also:
  • Constructor Details

    • EllipseElement

      public EllipseElement()
  • Method Details

    • cx

      public EllipseElement cx(double cx)
      Sets the x-axis coordinate of the center of the ellipse.

      Uses write-only optimization. Use cxRW(double) if you need to read the value back.

      Parameters:
      cx - the x coordinate of the center in user units
      Returns:
      this element for method chaining
    • cx

      public EllipseElement cx(String cx)
      Sets the x-axis coordinate of the center of the ellipse with a unit or percentage.

      Uses write-only optimization. Use cxRW(String) if you need to read the value back.

      Parameters:
      cx - the x coordinate of the center (e.g., "50", "50%", "10px")
      Returns:
      this element for method chaining
    • cxRW

      public EllipseElement cxRW(double cx)
      Sets the x-axis coordinate of the center of the ellipse (read-write).
      Parameters:
      cx - the x coordinate of the center in user units
      Returns:
      this element for method chaining
    • cxRW

      public EllipseElement cxRW(String cx)
      Sets the x-axis coordinate of the center of the ellipse with a unit or percentage (read-write).
      Parameters:
      cx - the x coordinate of the center (e.g., "50", "50%", "10px")
      Returns:
      this element for method chaining
    • cy

      public EllipseElement cy(double cy)
      Sets the y-axis coordinate of the center of the ellipse.

      Uses write-only optimization. Use cyRW(double) if you need to read the value back.

      Parameters:
      cy - the y coordinate of the center in user units
      Returns:
      this element for method chaining
    • cy

      public EllipseElement cy(String cy)
      Sets the y-axis coordinate of the center of the ellipse with a unit or percentage.

      Uses write-only optimization. Use cyRW(String) if you need to read the value back.

      Parameters:
      cy - the y coordinate of the center (e.g., "50", "50%", "10px")
      Returns:
      this element for method chaining
    • cyRW

      public EllipseElement cyRW(double cy)
      Sets the y-axis coordinate of the center of the ellipse (read-write).
      Parameters:
      cy - the y coordinate of the center in user units
      Returns:
      this element for method chaining
    • cyRW

      public EllipseElement cyRW(String cy)
      Sets the y-axis coordinate of the center of the ellipse with a unit or percentage (read-write).
      Parameters:
      cy - the y coordinate of the center (e.g., "50", "50%", "10px")
      Returns:
      this element for method chaining
    • rx

      public EllipseElement rx(double rx)
      Sets the radius of the ellipse on the x axis.

      Uses write-only optimization. Use rxRW(double) if you need to read the value back.

      Parameters:
      rx - the horizontal radius in user units
      Returns:
      this element for method chaining
    • rx

      public EllipseElement rx(String rx)
      Sets the radius of the ellipse on the x axis with a unit or percentage.

      Uses write-only optimization. Use rxRW(String) if you need to read the value back.

      Parameters:
      rx - the horizontal radius (e.g., "50", "25%", "10px")
      Returns:
      this element for method chaining
    • rxRW

      public EllipseElement rxRW(double rx)
      Sets the radius of the ellipse on the x axis (read-write).
      Parameters:
      rx - the horizontal radius in user units
      Returns:
      this element for method chaining
    • rxRW

      public EllipseElement rxRW(String rx)
      Sets the radius of the ellipse on the x axis with a unit or percentage (read-write).
      Parameters:
      rx - the horizontal radius (e.g., "50", "25%", "10px")
      Returns:
      this element for method chaining
    • ry

      public EllipseElement ry(double ry)
      Sets the radius of the ellipse on the y axis.

      Uses write-only optimization. Use ryRW(double) if you need to read the value back.

      Parameters:
      ry - the vertical radius in user units
      Returns:
      this element for method chaining
    • ry

      public EllipseElement ry(String ry)
      Sets the radius of the ellipse on the y axis with a unit or percentage.

      Uses write-only optimization. Use ryRW(String) if you need to read the value back.

      Parameters:
      ry - the vertical radius (e.g., "50", "25%", "10px")
      Returns:
      this element for method chaining
    • ryRW

      public EllipseElement ryRW(double ry)
      Sets the radius of the ellipse on the y axis (read-write).
      Parameters:
      ry - the vertical radius in user units
      Returns:
      this element for method chaining
    • ryRW

      public EllipseElement ryRW(String ry)
      Sets the radius of the ellipse on the y axis with a unit or percentage (read-write).
      Parameters:
      ry - the vertical radius (e.g., "50", "25%", "10px")
      Returns:
      this element for method chaining
    • pathLength

      public EllipseElement pathLength(double pathLength)
      Sets the total length for the ellipse's path in user units.

      This value is used to calibrate the browser's distance calculations with those of the author, by scaling all distance computations using the ratio pathLength / (computed value of path length).

      Uses write-only optimization. Use pathLengthRW(double) if you need to read the value back.

      Parameters:
      pathLength - the total path length in user units
      Returns:
      this element for method chaining
    • pathLengthRW

      public EllipseElement pathLengthRW(double pathLength)
      Sets the total length for the ellipse's path in user units (read-write).
      Parameters:
      pathLength - the total path length in user units
      Returns:
      this element for method chaining
    • center

      public EllipseElement center(double cx, double cy)
      Convenience method to set the center position (cx, cy) at once.

      Uses write-only optimization. Use centerRW(double, double) if you need to read the values back.

      Parameters:
      cx - the x coordinate of the center in user units
      cy - the y coordinate of the center in user units
      Returns:
      this element for method chaining
    • center

      public EllipseElement center(String cx, String cy)
      Convenience method to set the center position with strings (supports units/percentages).

      Uses write-only optimization. Use centerRW(String, String) if you need to read the values back.

      Parameters:
      cx - the x coordinate of the center (e.g., "50%")
      cy - the y coordinate of the center (e.g., "50%")
      Returns:
      this element for method chaining
    • centerRW

      public EllipseElement centerRW(double cx, double cy)
      Convenience method to set the center position (cx, cy) at once (read-write).
      Parameters:
      cx - the x coordinate of the center in user units
      cy - the y coordinate of the center in user units
      Returns:
      this element for method chaining
    • centerRW

      public EllipseElement centerRW(String cx, String cy)
      Convenience method to set the center position with strings (read-write).
      Parameters:
      cx - the x coordinate of the center (e.g., "50%")
      cy - the y coordinate of the center (e.g., "50%")
      Returns:
      this element for method chaining
    • radii

      public EllipseElement radii(double rx, double ry)
      Convenience method to set both radii at once.

      Uses write-only optimization. Use radiiRW(double, double) if you need to read the values back.

      Parameters:
      rx - the horizontal radius in user units
      ry - the vertical radius in user units
      Returns:
      this element for method chaining
    • radii

      public EllipseElement radii(String rx, String ry)
      Convenience method to set both radii with strings (supports units/percentages).

      Uses write-only optimization. Use radiiRW(String, String) if you need to read the values back.

      Parameters:
      rx - the horizontal radius (e.g., "50%")
      ry - the vertical radius (e.g., "25%")
      Returns:
      this element for method chaining
    • radiiRW

      public EllipseElement radiiRW(double rx, double ry)
      Convenience method to set both radii at once (read-write).
      Parameters:
      rx - the horizontal radius in user units
      ry - the vertical radius in user units
      Returns:
      this element for method chaining
    • radiiRW

      public EllipseElement radiiRW(String rx, String ry)
      Convenience method to set both radii with strings (read-write).
      Parameters:
      rx - the horizontal radius (e.g., "50%")
      ry - the vertical radius (e.g., "25%")
      Returns:
      this element for method chaining