[]
        
首页
开发者学堂
文档
论坛
市场
生态机会
活动
立即试用
(Showing Draft Content)

Point

Class Point

java.lang.Object
com.grapecity.documents.excel.Point

public final class Point extends Object
表示具有 x 坐标和 y 坐标的点。

处理工作簿或图表几何信息时,可使用此类型存储或传递二维坐标。

示例:


 Point point = new Point(10, 20);
 double x = point.getX();
 double y = point.getY();
 
  • Constructor Summary

    Constructors
    Constructor
    Description
    使用设置为 (0, 0) 的坐标初始化 Point 类的新实例。
    Point(double x, double y)
    使用指定坐标初始化 Point 类的新实例。
  • Method Summary

    Modifier and Type
    Method
    Description
    final double
    获取此点的 x 坐标。
    final double
    获取此点的 y 坐标。
    final void
    setX(double value)
    设置此点的 x 坐标。
    final void
    setY(double value)
    设置此点的 y 坐标。

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Point

      public Point()
      使用设置为 (0, 0) 的坐标初始化 Point 类的新实例。

      此构造函数在原点创建一个点。

      
       Point point = new Point();
       double x = point.getX();
       double y = point.getY();
       
    • Point

      public Point(double x, double y)
      使用指定坐标初始化 Point 类的新实例。

      此构造函数通过设置水平和垂直位置来创建一个点。

      
       Point point = new Point(10, 20);
       double x = point.getX();
       double y = point.getY();
       
      Parameters:
      x - 点的 x 坐标。
      y - 点的 y 坐标。
  • Method Details

    • getX

      public final double getX()
      获取此点的 x 坐标。

      此方法返回当前 Point 实例存储的水平位置。

      
       Point point = new Point(10, 20);
       double x = point.getX();
       
      Returns:
      此点的 x 坐标。
    • setX

      public final void setX(double value)
      设置此点的 x 坐标。

      此方法设置当前 Point 实例存储的水平位置。

      
       Point point = new Point(10, 20);
       point.setX(100.0);
       
      Parameters:
      value - 此点的 x 坐标。
    • getY

      public final double getY()
      获取此点的 y 坐标。

      此方法返回当前 Point 实例存储的垂直位置。

      
       Point point = new Point(10, 20);
       double y = point.getY();
       
      Returns:
      此点的 y 坐标。
    • setY

      public final void setY(double value)
      设置此点的 y 坐标。

      此方法设置当前 Point 实例存储的垂直位置。

      
       Point point = new Point(10, 20);
       point.setY(100.0);
       
      Parameters:
      value - 此点的 y 坐标。