|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gicentre.treemappa.LocatedObject
public class LocatedObject
Stores a 2D location which can be attached to any object.
Constructor Summary | |
---|---|
LocatedObject(double x,
double y,
java.lang.Comparable obj)
Creates a new location with the given coordinates attached to the given object. |
Method Summary | |
---|---|
int |
compareTo(LocatedObject otherLocation)
Compares this location with the given location. |
java.awt.geom.Point2D |
getLocation()
Reports the coordinates of this object. |
java.lang.Comparable |
getObject()
Reports the object that has been given a location. |
void |
setSortByObject(boolean isObject)
Sets any sorting operation to sort either by object (true) or location (false). |
java.lang.String |
toString()
Reports a textual representation of the located object. |
void |
translate(double tx,
double ty)
Translates the object by the given coordinates. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public LocatedObject(double x, double y, java.lang.Comparable obj)
x
- X-coordinate of location.y
- Y-coordinate of location.obj
- Object with which to attach location.Method Detail |
---|
public void setSortByObject(boolean isObject)
isObject
- Object ordered by object type if true, otherwise by distance from origin.public void translate(double tx, double ty)
tx
- X-coordinate of the translation.ty
- Y-coordinate of the translation.public java.awt.geom.Point2D getLocation()
public java.lang.Comparable getObject()
public int compareTo(LocatedObject otherLocation)
compareTo
in interface java.lang.Comparable<LocatedObject>
otherLocation
- Location with which to make comparison.
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 |