Class CircleElement

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

public class CircleElement extends SvgGraphicsElement
A typed Java API for the SVG <circle> element.

The <circle> element is a basic SVG shape that draws circles, defined by a center point and a radius.

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

    • CircleElement

      public CircleElement()
  • Method Details

    • cx

      public CircleElement cx(double cx)
      Sets the x-axis coordinate of the center of the circle.

      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 CircleElement cx(String cx)
      Sets the x-axis coordinate of the center of the circle 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 CircleElement cxRW(double cx)
      Sets the x-axis coordinate of the center of the circle (read-write).
      Parameters:
      cx - the x coordinate of the center in user units
      Returns:
      this element for method chaining
    • cxRW

      public CircleElement cxRW(String cx)
      Sets the x-axis coordinate of the center of the circle 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 CircleElement cy(double cy)
      Sets the y-axis coordinate of the center of the circle.

      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 CircleElement cy(String cy)
      Sets the y-axis coordinate of the center of the circle 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 CircleElement cyRW(double cy)
      Sets the y-axis coordinate of the center of the circle (read-write).
      Parameters:
      cy - the y coordinate of the center in user units
      Returns:
      this element for method chaining
    • cyRW

      public CircleElement cyRW(String cy)
      Sets the y-axis coordinate of the center of the circle 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
    • r

      public CircleElement r(double r)
      Sets the radius of the circle.

      A value less than or equal to zero disables rendering of the circle.

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

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

      public CircleElement r(String r)
      Sets the radius of the circle with a unit or percentage.

      A value less than or equal to zero disables rendering of the circle.

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

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

      public CircleElement rRW(double r)
      Sets the radius of the circle (read-write).
      Parameters:
      r - the radius in user units
      Returns:
      this element for method chaining
    • rRW

      public CircleElement rRW(String r)
      Sets the radius of the circle with a unit or percentage (read-write).
      Parameters:
      r - the radius (e.g., "25", "50%", "10px")
      Returns:
      this element for method chaining
    • pathLength

      public CircleElement pathLength(double pathLength)
      Sets the total length for the circle's circumference 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 circumference).

      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 CircleElement pathLengthRW(double pathLength)
      Sets the total length for the circle's circumference in user units (read-write).
      Parameters:
      pathLength - the total path length in user units
      Returns:
      this element for method chaining
    • center

      public CircleElement 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 CircleElement 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 CircleElement 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 CircleElement 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