java.awt.geom

Class Point2D.Double

Enclosing Class:
Point2D
Implemented Interfaces:
Cloneable

public static class Point2D.Double
extends Point2D

The Double class defines a point specified in double precision.

Nested Class Summary

Nested classes/interfaces inherited from class java.awt.geom.Point2D

Point2D.Double, Point2D.Float

Field Summary

double
x
The X coordinate of this Point2D.
double
y
The Y coordinate of this Point2D.

Constructor Summary

Double()
Constructs and initializes a Point2D with coordinates (0, 0).
Double(double x, double y)
Constructs and initializes a Point2D with the specified coordinates.

Method Summary

double
getX()
Returns the X coordinate of this Point2D in double precision.
double
getY()
Returns the Y coordinate of this Point2D in double precision.
void
setLocation(double x, double y)
Sets the location of this Point2D to the specified double coordinates.
String
toString()
Returns a String that represents the value of this Point2D.

Methods inherited from class java.awt.geom.Point2D

clone, distance, distance, distance, distanceSq, distanceSq, distanceSq, equals, getX, getY, hashCode, setLocation, setLocation

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Details

x

public double x
The X coordinate of this Point2D.
Since:
1.2

y

public double y
The Y coordinate of this Point2D.
Since:
1.2

Constructor Details

Double

public Double()
Constructs and initializes a Point2D with coordinates (0, 0).
Since:
1.2
Usages and Demos :

View More Examples of Double()
   1:             point.y-=m_grabPoint1.y;
   2:             Point2D graphPoint=new Point2D.Double();
   3:             m_graphPane.screenToGraphPoint(point,graphPoint);
   4:             
   5:             EntityNode entityNode=(EntityNode) m_draggedNode;

View Full Code Here
   1:   public GrapheInteractionSuiviSouris(BGraphe _g) {
   2:     p_= new Point2D.Double();
   3:     g_= _g;
   4:   }

View Full Code Here
   1:         if (aDstPoint == null) {
   2:             aDstPoint = new Point2D.Double();
   3:         }
   4:         aDstPoint.setLocation(locateX(), locateY());
   5:         return aDstPoint;

View Full Code Here
   1:         if(destPt==null)
   2:             destPt = new Point2D.Double();
   3:         destPt.setLocation(srcPt.getX(), srcPt.getY());
   4:         return destPt;
   5:     }

View Full Code Here
   1:         glyphs = font.createGlyphVector(frc, latin1Chars);
   2:         Point2D.Double zero = new Point2D.Double();
   3:         for (int i = 0; i < latin1Chars.length; i++) {
   4:             glyphs.setGlyphPosition(i, zero);
   5:         }

View Full Code Here

Double

public Double(double x,
              double y)
Constructs and initializes a Point2D with the specified coordinates.
Parameters:
Since:
1.2
Usages and Demos :

View More Examples of Double(double x,double y)
   1:         for ( int i = 0 ; i < nnbr; ++i) {
   2:             Point2D dp0 = new Point2D.Double(this.mNbrs[i].x-this.mP.x, this.mNbrs[i].y-this.mP.y); 
   3:             double dz0 = this.mNbrs[i].z - this.mP.z; 
   4:         ...
   5:             for ( int j = i + 1 ; j <= this.mNbrs.length - 1; ++j) {
   6:                 Point2D dp1 = new Point2D.Double(this.mNbrs[j].x-this.mP.x, this.mNbrs[j].y-this.mP.y); 
   7:                 double delta_c = AlgoPoint2D.cross(dp0,dp1); 
   8:         ...
   9:         }
  10:         this.mGradXY = new Point2D.Double(-a / c, -b / c);
  11:     }

View Full Code Here
   1:         
   2:         corners[0]=new Point2D.Double(-90, 360);
   3:         ...
   4:         corners[1]=new Point2D.Double(90.0, 360);
   5:         ...
   6:         corners[2]=new Point2D.Double(90.0, 0);
   7:         return corners;

View Full Code Here
   1: 
   2:     corners[0]=new Point2D.Double(-5.0, 360+phiWrap);
   3:         ...
   4:     corners[1]=new Point2D.Double(5.0, 360+phiWrap);
   5:         ...
   6:     corners[2]=new Point2D.Double(5.0, 0);
   7:     return corners;

View Full Code Here
   1:         final Line line = new Line();
   2:         line.setLine(new Point2D.Double(-2, 2), new Point2D.Double(8, 22));
   3:         assertEquals("slope", 2, line.getSlope(), EPS);
   4:         ...
   5: 
   6:         line.setLine(new Point2D.Double(-2, 2), new Point2D.Double(8, 2));
   7:         assertEquals("slope", 0, line.getSlope(), EPS);
   8:         assertTrue  ("x0", Double.isInfinite(line.getX0()));
   9:         assertEquals("y0",    2, line.getY0(),    EPS);

View Full Code Here
   1:         
   2:         return new Point2D.Double(-360.0*temp,-5.0);
   3:     }
   4:         ...
   5:         Point2D.Double[] corners = new Point2D.Double[3];
   6:         corners[0]=new Point2D.Double(-360.0*0.6,-5-0.5*50);
   7:         ...
   8:         corners[1]=new Point2D.Double(360.0, -5-0.5*50);
   9:         corners[2]=new Point2D.Double(360.0, 5);

View Full Code Here

Method Details

getX

public double getX()
Returns the X coordinate of this Point2D in double precision.
Overrides:
getX in interface Point2D
Returns:
the X coordinate of this Point2D.
Since:
1.2

getY

public double getY()
Returns the Y coordinate of this Point2D in double precision.
Overrides:
getY in interface Point2D
Returns:
the Y coordinate of this Point2D.
Since:
1.2

setLocation

public void setLocation(double x,
                        double y)
Sets the location of this Point2D to the specified double coordinates.
Overrides:
setLocation in interface Point2D
Parameters:
Since:
1.2

toString

public String toString()
Returns a String that represents the value of this Point2D.
Overrides:
toString in interface Object
Returns:
a string representation of this Point2D.
Since:
1.2