|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--auc.simulator.relatcoord.CoordManager
A class responsible for absolute/relative coordinate conversion and manipulation.
| Constructor Summary | |
CoordManager()
Construction, nothing really happens here ... |
|
| Method Summary | |
int |
_dx(int position)
Converts absolute coordinates to relative (x value). |
int |
_dy(int position)
Converts absolute coordinates to relative (y value). |
void |
addCoordManagerListener(CoordManagerListener coordManagerListener)
Adds a coord listener to this coord manager. |
double |
d(double position)
Converts relative coordinates to absolute. |
int |
d(float position)
Converts relative coordinates to absolute. |
int |
d(int position)
Converts relative coordinates to absolute. |
int |
getHeight()
Returns the height of the component whose coords are managed by this coord manager (relative coords). |
java.awt.Point |
getOrigin()
Returns origin for coord management (relative coords). |
java.awt.Point |
getShift()
Returns the shift point of the coord system. |
int |
getSideSize()
Returns the size of the smaller side of the drawing area. |
int |
getWidth()
Returns the width of the component whose coords are managed by this coord manager (relative coords). |
void |
scaleToHeight(int height)
Scales the drawing area so that it would be equal to the specified height. |
void |
scaleToWidth(int width)
Scales the drawing area so that it would be equal to the specified width. |
void |
setOrigin(java.awt.Point origin)
Sets the origin for coord management (relative coords). |
void |
setShift(java.awt.Point shift)
Sets the shift point of the coord system. |
void |
setSideSize(int size)
Set the size of the smaller side of the drawing area. |
java.awt.Point |
updatePointCoords(java.awt.Point p)
Accepts a point in relative coordinates and returns a new point having absolute coordinates. |
Vector2D |
updatePointCoords(Vector2D p)
Accepts a point in relative coordinates and returns a new point having absolute coordinates. |
java.awt.Polygon |
updatePolygonCoords(java.awt.Polygon p)
Accepts a polygon in relative coordinates and returns a new polygon having absolute coordinates. |
java.awt.Rectangle |
updateRectangleCoords(java.awt.Rectangle rect)
Accepts a rectangle in relative coordinates and returns a new rectangle having absolute coordinates. |
void |
updateRelativeCoords(CoordManageable coordProvider)
This method should be called when the size of the coordinate provider (a drawing area) changes and relative coordinates have to be recalculated. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public CoordManager()
| Method Detail |
public void addCoordManagerListener(CoordManagerListener coordManagerListener)
coordManagerListener - listener of the coordinate changes.public void updateRelativeCoords(CoordManageable coordProvider)
coordProvider - drawing area that implements the CoordmManageable interface.public int d(int position)
position - the value of the relative coordinate.public int d(float position)
position - the value of the relative coordinate.public double d(double position)
position - the value of the relative coordinate.public int _dx(int position)
position - the value of the absolute coordinate.public int _dy(int position)
position - the value of the absolute coordinate.public java.awt.Polygon updatePolygonCoords(java.awt.Polygon p)
p - polygon having relative coordinates.public java.awt.Point updatePointCoords(java.awt.Point p)
p - point having relative coordinates.public Vector2D updatePointCoords(Vector2D p)
p - point having relative coordinates.public java.awt.Rectangle updateRectangleCoords(java.awt.Rectangle rect)
rect - rectangle having relative coordinates.public int getHeight()
public int getWidth()
public void setOrigin(java.awt.Point origin)
origin - the origin of the coord system.public java.awt.Point getOrigin()
public void setSideSize(int size)
size - the size of the side.public int getSideSize()
public void setShift(java.awt.Point shift)
shift - the shift point.public java.awt.Point getShift()
public void scaleToWidth(int width)
width - the new width of the drawing area.public void scaleToHeight(int height)
height - the new height of the drawing area.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||