|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.cosylab.gui.components.gauger.ScaleTransform com.cosylab.gui.components.gauger.LinearHorizontalTransform
public class LinearHorizontalTransform
This transform defines shape of horizontal linear gauger. It imposes constraints on minimum and maximum sizes and defines borders, as well as position of value label.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.cosylab.gui.components.gauger.ScaleTransform |
---|
ScaleTransform.ArcSegment, ScaleTransform.LineSegment, ScaleTransform.RectangleSegment, ScaleTransform.ScaleSegment |
Constructor Summary | |
---|---|
LinearHorizontalTransform()
|
Method Summary | |
---|---|
void |
mapUVtoXY(java.awt.geom.Point2D scaleSpace,
java.awt.geom.Point2D cartesianSpace)
Converts point in scale space to point in gauger space. |
void |
mapXYtoUV(java.awt.geom.Point2D cartesianSpace,
java.awt.geom.Point2D scaleScape)
Not implemented. |
int |
measureTick(java.awt.Graphics g,
double x,
java.lang.String text)
Calculates tick label width when rendered. |
double |
scaleHeight(double u)
Returns scale height at relative horizontal position. |
double |
scaleWidth(double v)
Returns width of scale at relative vertical position. |
void |
setParameters(int w,
int h,
int marginX,
int marginY,
int tickOffset)
Sets the dimensions of this scale and calculates internal parameters. |
Methods inherited from class com.cosylab.gui.components.gauger.ScaleTransform |
---|
addSegment, getAngle, getLabelPosition, getSegment, getSegmentCount, isPolar, mapUVtoXY, mapUVtoXY, setLabelPosition, setPolar |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LinearHorizontalTransform()
Method Detail |
---|
public void setParameters(int w, int h, int marginX, int marginY, int tickOffset)
setParameters
in class ScaleTransform
w
- int Gauger width.h
- int Gauger height.marginX
- int Horizontal margin from border in pixels.marginY
- int Vertical margin from border in pixels.tickOffset
- int Minimum offset of first and last tick from scale
in pixels.ScaleTransform#setParameters(int, int, int, int)
public void mapUVtoXY(java.awt.geom.Point2D scaleSpace, java.awt.geom.Point2D cartesianSpace)
mapUVtoXY
in class ScaleTransform
scaleSpace
- PointDouble Point in scale space.cartesianSpace
- Point Point in gauger space.ScaleTransform#mapUVtoXY(PointDouble, Point)
public void mapXYtoUV(java.awt.geom.Point2D cartesianSpace, java.awt.geom.Point2D scaleScape)
cartesianSpace
- PointscaleScape
- PointDoubleScaleTransform#maxXYtoUV(Point, PointDouble)
public double scaleWidth(double v)
scaleWidth
in class ScaleTransform
v
- double Relative vertical position in range 0.0 to 1.0
ScaleTransform.scaleWidth(double)
public double scaleHeight(double u)
scaleHeight
in class ScaleTransform
u
- double Relative horizontal position in range 0.0 to 1.0.
ScaleTransform.scaleHeight(double)
public int measureTick(java.awt.Graphics g, double x, java.lang.String text)
measureTick
in class ScaleTransform
g
- Graphics Context to render to.x
- double Relative value of tick position.text
- String Text to render.
ScaleTransform.measureTick(Graphics,
double, String)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |