|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.swtlayeredgraph.GraphPoint
public class GraphPoint
Defines a point on the graph defined by a coordinate system. Also provides for getting the coordinates as another coordinate type and converting to other systems.
Constructor Summary | |
---|---|
GraphPoint()
Default constructor. |
|
GraphPoint(CoordinateType type)
Constructor to use specific coordinate type. |
|
GraphPoint(java.lang.Double x,
java.lang.Double y)
Constructor to use specific X & Y coordinates. |
|
GraphPoint(java.lang.Double x,
java.lang.Double y,
CoordinateType type)
Constructor to fully specify point. |
Method Summary | |
---|---|
GraphPoint |
clone()
Creates a deep copy of this object. |
java.lang.Double |
convert(java.lang.Double value,
CoordinateType source,
CoordinateType target)
Converts the passed in value to specified coordinate system. |
void |
convertTo(CoordinateType type)
Converts this coordinate to the specified coordinate system. |
void |
copy(GraphPoint source)
Does a shallow copy from the passed in point. |
boolean |
equals(java.lang.Object other)
|
GraphPoint |
get(CoordinateType type)
Gets a new GraphPoint in the specified system. |
CoordinateType |
getCoordinateType()
Gets the current coordinate system type. |
java.lang.Double |
getX()
Gets the local X value in the current coordinate type. |
java.lang.Double |
getX(CoordinateType type)
Gets the local X value converted to the specified coordinate type. |
java.lang.Double |
getY()
Gets the local Y value in the current coordinate type. |
java.lang.Double |
getY(CoordinateType type)
Gets the local Y value converted to the specified coordinate type. |
int |
hashCode()
Returns the hash code for this point. |
void |
setX(java.lang.Double x)
Sets the X coordinate to the specified value. |
void |
setX(java.lang.Double x,
CoordinateType type)
Sets the X coordinate to the specified value after converting from the specified system. |
void |
setY(java.lang.Double y)
Sets the Y coordinate to the specified value. |
void |
setY(java.lang.Double y,
CoordinateType type)
Sets the Y coordinate to the specified value after converting from the specified system. |
java.lang.String |
toString()
Returns a human readable version of the coordinate. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public GraphPoint()
public GraphPoint(CoordinateType type) throws java.lang.IllegalArgumentException
type
- Type of coordinate to use.
java.lang.IllegalArgumentException
- If type is null.public GraphPoint(java.lang.Double x, java.lang.Double y) throws java.lang.IllegalArgumentException
x
- X coordinate to use.y
- Y coordinate to use.
java.lang.IllegalArgumentException
- if x or y is null.public GraphPoint(java.lang.Double x, java.lang.Double y, CoordinateType type) throws java.lang.IllegalArgumentException
x
- X coordinate to use.y
- Y coordinate to usetype
- Type of coordinate to use
java.lang.IllegalArgumentException
- if x, y or type is null.Method Detail |
---|
public GraphPoint clone()
clone
in class java.lang.Object
public java.lang.Double convert(java.lang.Double value, CoordinateType source, CoordinateType target) throws java.lang.IllegalArgumentException
value
- Coordinate value to convert.source
- Coordinate type of value.destination
- Coordinate type to convert value to.
java.lang.IllegalArgumentException
- if value, source or target is null.public void convertTo(CoordinateType type) throws java.lang.IllegalArgumentException
type
- The system to convert to.
java.lang.IllegalArgumentException
- if type is null.public void copy(GraphPoint source) throws java.lang.IllegalArgumentException
source
- Object to copy values from.
java.lang.IllegalArgumentException
- if source is null.public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public GraphPoint get(CoordinateType type) throws java.lang.IllegalArgumentException
type
- Type of coordinate system to use.
java.lang.IllegalArgumentException
- if type is null.public CoordinateType getCoordinateType()
public java.lang.Double getX()
public java.lang.Double getX(CoordinateType type) throws java.lang.IllegalArgumentException
type
- Coordinate system to use.
java.lang.IllegalArgumentException
- if type is null.public java.lang.Double getY()
public java.lang.Double getY(CoordinateType type) throws java.lang.IllegalArgumentException
type
- Coordinate system to use.
java.lang.IllegalArgumentException
- if type is null.public int hashCode()
hashCode
in class java.lang.Object
public void setX(java.lang.Double x) throws java.lang.IllegalArgumentException
x
- X value to use for new coordinate. It is assumed to be of the
current coordinate system.
java.lang.IllegalArgumentException
- if x is null.public void setX(java.lang.Double x, CoordinateType type) throws java.lang.IllegalArgumentException
x
- The new X coordinate.type
- The system that the X coordinate is currently in.
java.lang.IllegalArgumentException
- if x or type is null.public void setY(java.lang.Double y) throws java.lang.IllegalArgumentException
y
- Y value to use for new coordinate. It is assumed to be of the
current coordinate system.
java.lang.IllegalArgumentException
- if y is null.public void setY(java.lang.Double y, CoordinateType type) throws java.lang.IllegalArgumentException
y
- The new Y coordinate.type
- The system that the Y coordinate is currently in.
java.lang.IllegalArgumentException
- if y or type is null.public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |