Class PdfEllipse

java.lang.Object
cloud.opencode.base.pdf.content.PdfEllipse
All Implemented Interfaces:
PdfElement

public final class PdfEllipse extends Object implements PdfElement
PDF Ellipse Element - Ellipse/Circle graphic PDF 椭圆元素 - 椭圆/圆形图形

Features | 主要功能:

  • Circle and ellipse creation - 圆形和椭圆创建
  • Stroke and fill color configuration - 描边和填充颜色配置
  • Stroke width customization - 描边宽度自定义

Usage Examples | 使用示例:

PdfEllipse circle = PdfEllipse.circle(200, 400, 50)
    .fillColor(PdfColor.BLUE)
    .strokeWidth(2f);

PdfEllipse ellipse = PdfEllipse.of(300, 500, 80, 40);

Security | 安全性:

  • Thread-safe: No — mutable builder pattern - 线程安全: 否 — 可变构建器模式
  • Null-safe: No — callers must ensure non-null values - 空值安全: 否 — 调用方需确保非空值
Since:
JDK 25, opencode-base-pdf V1.0.0
Author:
Leon Soo www.LeonSoo.com
See Also:
  • Method Details

    • circle

      public static PdfEllipse circle(float centerX, float centerY, float radius)
      Creates a circle 创建圆形
      Parameters:
      centerX - center x | 中心点 x
      centerY - center y | 中心点 y
      radius - radius | 半径
      Returns:
      PdfEllipse instance | PdfEllipse 实例
    • of

      public static PdfEllipse of(float centerX, float centerY, float radiusX, float radiusY)
      Creates an ellipse 创建椭圆
      Parameters:
      centerX - center x | 中心点 x
      centerY - center y | 中心点 y
      radiusX - x radius | x 半径
      radiusY - y radius | y 半径
      Returns:
      PdfEllipse instance | PdfEllipse 实例
    • builder

      public static PdfEllipse builder()
      Creates an ellipse builder 创建椭圆构建器
      Returns:
      new PdfEllipse instance | 新 PdfEllipse 实例
    • center

      public PdfEllipse center(float x, float y)
    • radius

      public PdfEllipse radius(float radiusX, float radiusY)
    • radius

      public PdfEllipse radius(float radius)
    • strokeColor

      public PdfEllipse strokeColor(PdfColor color)
    • fillColor

      public PdfEllipse fillColor(PdfColor color)
    • strokeWidth

      public PdfEllipse strokeWidth(float width)
    • getX

      public float getX()
      Description copied from interface: PdfElement
      Gets the x coordinate of this element 获取元素的 x 坐标
      Specified by:
      getX in interface PdfElement
      Returns:
      x coordinate | x 坐标
    • getY

      public float getY()
      Description copied from interface: PdfElement
      Gets the y coordinate of this element 获取元素的 y 坐标
      Specified by:
      getY in interface PdfElement
      Returns:
      y coordinate | y 坐标
    • getCenterX

      public float getCenterX()
    • getCenterY

      public float getCenterY()
    • getRadiusX

      public float getRadiusX()
    • getRadiusY

      public float getRadiusY()
    • getStrokeColor

      public PdfColor getStrokeColor()
    • getFillColor

      public PdfColor getFillColor()
    • getStrokeWidth

      public float getStrokeWidth()
    • isFilled

      public boolean isFilled()
    • isCircle

      public boolean isCircle()