|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--com.jfimagine.jfgraph.geom.JFPoint
JFPoint class. A class used to represent a point in the plane with double coordinates.
Attention: Here we used a clockwise quadrant system. And the first quadrant is under right bottom corner.
| Constructor Summary | |
JFPoint()
Constructor for JFPoint. |
|
JFPoint(double x,
double y)
Constructor for JFPoint. |
|
JFPoint(JFPoint pnt)
Constructor for JFPoint. |
|
| Method Summary | |
java.lang.Object |
clone()
Creates a new object of the same class and with the same contents as this object. |
boolean |
contains(double x,
double y,
double pickOffset)
Test if a point is close to this point. |
boolean |
contains(JFPoint pnt,
double pickOffset)
Test if a point is close to this point. |
double |
distance(double x,
double y)
Get the distance from this point to a specific point(use x & y coordiates for instead). |
double |
distance(JFPoint pnt)
Get the distance from this point to a specific point. |
boolean |
equals(double x,
double y,
boolean analog)
Determines whether or not this point equals the coordinates given. |
boolean |
equals(java.lang.Object obj)
Determines whether or not two objects are equal. |
boolean |
equals(java.lang.Object obj,
boolean analog)
Determines whether or not two objects are equal. |
void |
flipBy(double baseY)
Reverse this point by a y coordinate. |
static JFPoint |
getMiddleUprightPoint(JFPoint startPoint,
JFPoint endPoint,
double offset,
boolean clockwise)
Get a point that is on the middle upright line of the line from start point to end point, the point will has a specified offset according to upright foot,and according to clockwise term. |
double |
getSlope(double x,
double y)
Get the slope of the line from this point to specified point. |
double |
getSlope(JFPoint pnt)
Get the slope of the line from this point to specified point. |
double |
getX()
Get x coordiate of this point. |
double |
getY()
Get y coordiate of this point. |
int |
hashCode()
Returns the hashcode for this Object. |
boolean |
isValid()
Test if this point has valid values. |
boolean |
middleOf(double x1,
double y1,
double x2,
double y2)
Test if current point is at the position between other two points. |
boolean |
middleOf(JFPoint point1,
JFPoint point2)
Test if current point is at the position between other two points. |
JFPoint |
midPoint(double x,
double y)
Get the middle point between this point and a specific point(use x & y coordiates for instead). |
JFPoint |
midPoint(JFPoint pnt)
Get the middle point between this point and a specific point |
void |
mirrorBy(double baseX)
Mirror this point by a x coordinate. |
void |
moveBy(double x,
double y)
Move this point by specific x and y coordinates. |
JFPoint |
nearPoint(double slope,
double dist,
JFPoint refPoint,
boolean direction)
Get a point on the line with specified slope, and with specified distance to this point, and also under same direction with specified reference point. |
JFPoint |
nearPoint(JFPoint pnt,
double dist)
Get a point on the line from this point to specified point, close to this point and with the given distance. |
JFPoint |
nearPoint(JFPoint pnt,
double dist,
boolean allowExtend)
Get a point on the line from this point to specified point, close to this point and with the given distance. |
void |
rotateBy(double baseX,
double baseY,
double theta)
Rotate this point by a specified point and an angle theta. |
void |
rotateBy(JFPoint pnt,
double theta)
Rotate this point by a specified point and an angle theta. |
void |
scaleBy(double baseX,
double baseY,
double scale)
Scale this point by a point, and specified scale. |
void |
scaleBy(double baseX,
double baseY,
double xScale,
double yScale)
Scale this point by a point, and specified scale. |
void |
scaleBy(JFPoint pnt,
double scale)
Scale this point by a point, and specified scale. |
void |
setValue(double x,
double y)
Set value of current JFPoint. |
void |
setValue(JFPoint pnt)
Set value of current JFPoint. |
void |
setX(double val)
Set x coordiate of this point. |
void |
setY(double val)
Set y coordiate of this point. |
java.lang.String |
toString()
Convert this object to String |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public JFPoint()
public JFPoint(double x,
double y)
x - X coordiate.y - Y coordiate.public JFPoint(JFPoint pnt)
pnt - A JFPoint.| Method Detail |
public double getX()
public void setX(double val)
val - A new x coordiate.public double getY()
public void setY(double val)
val - A new y coordiate.public void setValue(JFPoint pnt)
public void setValue(double x,
double y)
public boolean isValid()
public boolean contains(JFPoint pnt,
double pickOffset)
pnt - A point to be measured.pickOffset - An analog offset for 'pick' this line.
public boolean contains(double x,
double y,
double pickOffset)
pickOffset - An analog offset for 'pick' this line.
public double distance(JFPoint pnt)
pnt - An end point to measure distance.
public double distance(double x,
double y)
x - X coordiate of an end point to measure distance.y - Y coordiate of an end point to measure distance.
public JFPoint midPoint(JFPoint pnt)
pnt - An end point to get middle point.
public JFPoint midPoint(double x,
double y)
x - X coordiate of an end point to measure distance.y - Y coordiate of an end point to measure distance.
public boolean middleOf(JFPoint point1,
JFPoint point2)
point1 - First point.point2 - Second point.
public boolean middleOf(double x1,
double y1,
double x2,
double y2)
public JFPoint nearPoint(JFPoint pnt,
double dist)
pnt - An end point to decide a line.dist - A distance from the wanted point to this point.
public JFPoint nearPoint(JFPoint pnt,
double dist,
boolean allowExtend)
pnt - An end point to decide a line.dist - A distance from the wanted point to this point.allowExtend - Allow extend the line to get a near point.
public JFPoint nearPoint(double slope,
double dist,
JFPoint refPoint,
boolean direction)
slope - A slope of specified line that accross this point.dist - A distance from the wanted point to this point.refPoint - A reference point.direction - Direction that the vector from this point to wanted point according to the vector from this point to reference point.
public static JFPoint getMiddleUprightPoint(JFPoint startPoint,
JFPoint endPoint,
double offset,
boolean clockwise)
startPoint - The start point of this arc.endPoint - The end point of this arc.offset - The distance of the point shifts from upright foot.clockwise - if the result point is on clockwise side of the vector from start pointn to end point. False default.
public double getSlope(JFPoint pnt)
pnt - An end point of line to get slope.
public double getSlope(double x,
double y)
public void moveBy(double x,
double y)
x - X coordiate to moveby.y - Y coordiate to moveby.
public void rotateBy(JFPoint pnt,
double theta)
pnt - A rotate center point.theta - A rotate angle.
public void rotateBy(double baseX,
double baseY,
double theta)
theta - A rotate angle.public void mirrorBy(double baseX)
baseX - A mirror base x coordinate.public void flipBy(double baseY)
baseY - A flip base y coordinate.
public void scaleBy(JFPoint pnt,
double scale)
pnt - A scale reference point.scale - A scale value.
public void scaleBy(double baseX,
double baseY,
double scale)
scale - A scale value.
public void scaleBy(double baseX,
double baseY,
double xScale,
double yScale)
xScale - A scale value in x coordinate.yScale - A scale value in y coordinate.public java.lang.String toString()
toString in class java.lang.Object
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in class java.lang.Objectjava.lang.CloneNotSupportedExceptionpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - an object to be compared with this object
public boolean equals(java.lang.Object obj,
boolean analog)
obj - an object to be compared with this objectanalog - True if use integer type to compare two points,False use double.
public boolean equals(double x,
double y,
boolean analog)
analog - True if use integer type to compare two points,False use double.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||