|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.geom.Point2D
java.awt.geom.Point2D.Double
net.sf.latexdraw.glib.models.impl.LPoint
class LPoint
Defines a model of a point. This model must be used only to define other models.
It is not a shape. See the LDot class for the shape.
This file is part of LaTeXDraw.
Copyright (c) 2005-2012 Arnaud BLOUIN
LaTeXDraw is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later version.
LaTeXDraw is distributed without any warranty; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
02/13/2008
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.awt.geom.Point2D |
---|
java.awt.geom.Point2D.Double, java.awt.geom.Point2D.Float |
Field Summary | |
---|---|
private static long |
serialVersionUID
|
Fields inherited from class java.awt.geom.Point2D.Double |
---|
x, y |
Constructor Summary | |
---|---|
protected |
LPoint()
Creates a Point2D with coordinates (0, 0). |
protected |
LPoint(double x,
double y)
Creates a Point2D with the specified coordinates. |
protected |
LPoint(IPoint pt)
Creates a point from a IPoint |
Method Summary | |
---|---|
IPoint |
centralSymmetry(IPoint centre)
Gets a point by central symmetry. |
double |
computeAngle(IPoint pt)
Computes the angle of the given point where the calling point is used as the gravity centre. |
double |
computeRotationAngle(IPoint pt1,
IPoint pt2)
Computes the angle of rotation between two points where the calling point is used as the gravity centre. |
double |
distance(IPoint pt)
|
boolean |
equals(IPoint p,
double gap)
Allows to know if the point p is equal to the current point considering a gap. |
IPoint |
getMiddlePoint(IPoint p)
|
IPoint |
horizontalSymmetry(IPoint origin)
Returns horizontally the point. |
IPoint |
rotatePoint(IPoint gravityC,
double theta)
Rotates a point with as reference another point. |
void |
setPoint(double newX,
double newY)
Sets the coordinates of the point. |
void |
setPoint(IPoint pt)
Changes the coordinates of the point. |
void |
setPoint2D(java.awt.geom.Point2D pt)
Defines the current point using the given point. |
void |
setX(double newX)
Sets the X coordinate of the point. |
void |
setY(double newY)
Sets the Y coordinate of the point. |
java.awt.geom.Point2D.Double |
toPoint2D()
|
void |
translate(double tx,
double ty)
Translates the point. |
IPoint |
verticalSymmetry(IPoint origin)
Returns vertically the point. |
IPoint |
zoom(double zoomLevel)
Creates a new point zoomed using the calling points. |
Methods inherited from class java.awt.geom.Point2D.Double |
---|
getX, getY, setLocation, toString |
Methods inherited from class java.awt.geom.Point2D |
---|
clone, distance, distance, distance, distanceSq, distanceSq, distanceSq, equals, hashCode, setLocation |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface net.sf.latexdraw.glib.models.interfaces.IPoint |
---|
distance, getX, getY |
Field Detail |
---|
private static final long serialVersionUID
Constructor Detail |
---|
protected LPoint()
protected LPoint(IPoint pt)
pt
- The IPoint, if null the default value (0,0) will be used.protected LPoint(double x, double y)
x
- The X-coordinate to set.y
- The Y-coordinate to set.Method Detail |
---|
public double computeAngle(IPoint pt)
IPoint
computeAngle
in interface IPoint
pt
- The point used to compute the angle.
public IPoint zoom(double zoomLevel)
IPoint
zoom
in interface IPoint
zoomLevel
- The zoom level.
public double computeRotationAngle(IPoint pt1, IPoint pt2)
IPoint
computeRotationAngle
in interface IPoint
pt1
- The first point.pt2
- The second point.
public IPoint centralSymmetry(IPoint centre)
IPoint
centralSymmetry
in interface IPoint
centre
- The centre of the symmetry.
public IPoint rotatePoint(IPoint gravityC, double theta)
IPoint
rotatePoint
in interface IPoint
gravityC
- The point of reference.theta
- The angle of rotation in radian.
public boolean equals(IPoint p, double gap)
IPoint
equals
in interface IPoint
p
- The point to compare.gap
- The approximation gap.
public IPoint getMiddlePoint(IPoint p)
getMiddlePoint
in interface IPoint
p
- The second point.
public void translate(double tx, double ty)
IPoint
translate
in interface IPoint
tx
- The X translation.ty
- The Y translation.public IPoint horizontalSymmetry(IPoint origin)
IPoint
horizontalSymmetry
in interface IPoint
origin
- The location of the horizontal axe.
public IPoint verticalSymmetry(IPoint origin)
IPoint
verticalSymmetry
in interface IPoint
origin
- The location of the vertical axe.
public void setPoint(double newX, double newY)
IPoint
setPoint
in interface IPoint
newX
- The new X coordinate. Must be valid (not equal too NaN,...).newY
- The new Y coordinate. Must be valid (not equal too NaN,...).public void setX(double newX)
IPoint
setX
in interface IPoint
newX
- The new X coordinate. Must be valid (not equal too NaN,...).public void setY(double newY)
IPoint
setY
in interface IPoint
newY
- The new Y coordinate. Must be valid (not equal too NaN,...).public void setPoint(IPoint pt)
IPoint
setPoint
in interface IPoint
pt
- The new position.public double distance(IPoint pt)
distance
in interface IPoint
pt
- The second point.
public java.awt.geom.Point2D.Double toPoint2D()
toPoint2D
in interface IPoint
public void setPoint2D(java.awt.geom.Point2D pt)
IPoint
setPoint2D
in interface IPoint
pt
- The point 2D to copy.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |