physicon.graphLib
Class GraphContextBase
java.lang.Object
|
+--physicon.graphLib.GraphContextBase
- Direct Known Subclasses:
- LinearGraphContext
- public abstract class GraphContextBase
- extends java.lang.Object
abstract point converter
this class must convert points from one graphic system to another
There are two coordinate systems associated with each graphical
object and with container also.
I "Global" is the system connected with Container. Pixels are used
draw in this system.
II "Local" is the system connected with Graph Object. Logical units
are used in this system.
Field Summary |
static java.awt.Point |
zeroPt
|
Method Summary |
java.awt.Point |
getOffset()
|
java.awt.Point |
getZeroPoint()
|
DoublePoint |
gp2lp(java.awt.Point _pt)
converts point from Global to Local coordinate system |
abstract double |
gp2lpX(int _x,
int _y)
|
abstract double |
gp2lpY(int _x,
int _y)
|
java.awt.Point |
lp2gp(DoublePoint _dpt)
converts point from Local to Global coordinate system |
abstract int |
lp2gpX(double _x,
double _y)
Coordinate Conversion |
abstract int |
lp2gpY(double _x,
double _y)
|
double |
lpINgpX(DoublePoint _dpt)
Returns the number of local (double) points
per global (int) point in the vicinity of the
given point |
double |
lpINgpY(DoublePoint _dpt)
|
abstract void |
scale(double _xRatio,
double _yRatio)
Must scale the picture by the given ratio |
void |
setOffset(java.awt.Point _pt)
|
abstract void |
setScale(double lxINgx,
double lyINgy)
|
void |
setZeroPoint(java.awt.Point _zp)
|
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
zeroPt
public static final java.awt.Point zeroPt
GraphContextBase
public GraphContextBase()
- Constructor
lp2gpX
public abstract int lp2gpX(double _x,
double _y)
- Coordinate Conversion
lp2gpY
public abstract int lp2gpY(double _x,
double _y)
gp2lp
public DoublePoint gp2lp(java.awt.Point _pt)
- converts point from Global to Local coordinate system
- Parameters:
_pt
- Point in Global coordinate system
gp2lpX
public abstract double gp2lpX(int _x,
int _y)
gp2lpY
public abstract double gp2lpY(int _x,
int _y)
lp2gp
public java.awt.Point lp2gp(DoublePoint _dpt)
- converts point from Local to Global coordinate system
- Parameters:
_dpt
- Point in Local coordinate system
setZeroPoint
public void setZeroPoint(java.awt.Point _zp)
getZeroPoint
public java.awt.Point getZeroPoint()
lpINgpX
public double lpINgpX(DoublePoint _dpt)
- Returns the number of local (double) points
per global (int) point in the vicinity of the
given point
- Parameters:
_dpt
- - the given point
lpINgpY
public double lpINgpY(DoublePoint _dpt)
scale
public abstract void scale(double _xRatio,
double _yRatio)
- Must scale the picture by the given ratio
- Parameters:
_xRatio
- - scaling ratio by the x axis_yRatio
- - scaling ratio by the y axis
setScale
public abstract void setScale(double lxINgx,
double lyINgy)
setOffset
public final void setOffset(java.awt.Point _pt)
getOffset
public final java.awt.Point getOffset()