DESY ACOP Beans Home

com.cosylab.gui.components.gauger
Class LinearVerticalTransform

java.lang.Object
  extended by com.cosylab.gui.components.gauger.ScaleTransform
      extended by com.cosylab.gui.components.gauger.LinearVerticalTransform

public class LinearVerticalTransform
extends ScaleTransform

Defines vertical linear transform.

Version:
$id$
Author:
Ales Pucelj

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
LinearVerticalTransform()
           
 
Method Summary
 void mapUVtoXY(java.awt.geom.Point2D scaleSpace, java.awt.geom.Point2D cartesianSpace)
          Maps the point specified with (u, v) coordinates in the scale space to cartesian space with coordinates (x, y).
 void mapXYtoUV(java.awt.geom.Point2D cartesianSpace, java.awt.geom.Point2D scaleScape)
           
 int measureTick(java.awt.Graphics g, double x, java.lang.String text)
          Measues the width of tick label.
 double scaleHeight(double u)
          Returns the height of scale in pixels at the specified location u in the scale space.
 double scaleWidth(double v)
          Returns the width of scale in pixels at the specified location v in the scale space.
 void setParameters(int w, int h, int marginX, int marginY, int tickOffset)
          Sets the component parameters for this transformation.
 
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

LinearVerticalTransform

public LinearVerticalTransform()
Method Detail

setParameters

public void setParameters(int w,
                          int h,
                          int marginX,
                          int marginY,
                          int tickOffset)
Description copied from class: ScaleTransform
Sets the component parameters for this transformation.

Specified by:
setParameters in class ScaleTransform
Parameters:
w - width of the component that will display this transformation
h - height of the component that will display this transformation
marginX - not used
marginY - not used
tickOffset - space between the edge of the scale and the first tick
See Also:
ScaleTransform.setParameters(int, int, int, int, int)

mapUVtoXY

public void mapUVtoXY(java.awt.geom.Point2D scaleSpace,
                      java.awt.geom.Point2D cartesianSpace)
Description copied from class: ScaleTransform
Maps the point specified with (u, v) coordinates in the scale space to cartesian space with coordinates (x, y). (u, v) values must be in [0..1] range, the (x, y) points will be in (0..w-1, 0..h-1) range.

Specified by:
mapUVtoXY in class ScaleTransform
Parameters:
scaleSpace - point in scale space
cartesianSpace - point in cartesian space
See Also:
ScaleTransform#mapUVtoXY(PointDouble, Point)

mapXYtoUV

public void mapXYtoUV(java.awt.geom.Point2D cartesianSpace,
                      java.awt.geom.Point2D scaleScape)
See Also:
ScaleTransform#maxXYtoUV(Point, PointDouble)

scaleWidth

public double scaleWidth(double v)
Description copied from class: ScaleTransform
Returns the width of scale in pixels at the specified location v in the scale space. Although the scale for v is only defined in the range [0..1], this value can generaly return even values outside this range, although this is not guaranteed.

Specified by:
scaleWidth in class ScaleTransform
Returns:
Width of scale in pixels.
See Also:
ScaleTransform.scaleWidth(double)

scaleHeight

public double scaleHeight(double u)
Description copied from class: ScaleTransform
Returns the height of scale in pixels at the specified location u in the scale space. Although the scale for u is only defined in the range [0..1], this value can generaly return even values outside this range, although this is not guaranteed.

Specified by:
scaleHeight in class ScaleTransform
Returns:
Height of scale in pixels.
See Also:
ScaleTransform.scaleHeight(double)

measureTick

public int measureTick(java.awt.Graphics g,
                       double x,
                       java.lang.String text)
Description copied from class: ScaleTransform
Measues the width of tick label.

Specified by:
measureTick in class ScaleTransform
Parameters:
g - Graphic context.
x - Relative position of tick.
text - Tick label.
Returns:
Width of label in pixels.
See Also:
ScaleTransform.measureTick(Graphics, double, String)


Copyright © 2010. All Rights Reserved.