[]
        
(Showing Draft Content)

Point

Class Point

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

public final class Point extends Object
Represents a point with x- and y-coordinates.

Use this type to store or pass 2D coordinates when working with workbook or chart geometry.


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

    Constructors
    Constructor
    Description
    Initializes a new instance of the Point class with coordinates set to (0, 0).
    Point(double x, double y)
    Initializes a new instance of the Point class with the specified coordinates.
  • Method Summary

    Modifier and Type
    Method
    Description
    final double
    Gets the x-coordinate of this point.
    final double
    Gets the y-coordinate of this point.
    final void
    setX(double value)
    Sets the x-coordinate of this point.
    final void
    setY(double value)
    Sets the y-coordinate of this point.

    Methods inherited from class java.lang.Object

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

    • Point

      public Point()
      Initializes a new instance of the Point class with coordinates set to (0, 0).

      This constructor creates a point at the origin.

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

      public Point(double x, double y)
      Initializes a new instance of the Point class with the specified coordinates.

      This constructor creates a point by setting its horizontal and vertical positions.

      
       Point point = new Point(10, 20);
       double x = point.getX();
       double y = point.getY();
       
      Parameters:
      x - The x-coordinate of the point.
      y - The y-coordinate of the point.
  • Method Details

    • getX

      public final double getX()
      Gets the x-coordinate of this point.

      This method returns the horizontal position stored by the current Point instance.

      
       Point point = new Point(10, 20);
       double x = point.getX();
       
      Returns:
      The x-coordinate of this point.
    • setX

      public final void setX(double value)
      Sets the x-coordinate of this point.

      This method Sets the horizontal position stored by the current Point instance.

      
       Point point = new Point(10, 20);
       point.setX(100.0);
       
      Parameters:
      value - The x-coordinate of this point.
    • getY

      public final double getY()
      Gets the y-coordinate of this point.

      This method returns the vertical position stored by the current Point instance.

      
       Point point = new Point(10, 20);
       double y = point.getY();
       
      Returns:
      The y-coordinate of this point.
    • setY

      public final void setY(double value)
      Sets the y-coordinate of this point.

      This method Sets the vertical position stored by the current Point instance.

      
       Point point = new Point(10, 20);
       point.setY(100.0);
       
      Parameters:
      value - The y-coordinate of this point.