DESY ACOP Beans Home

com.cosylab.gui.components.gauger
Class PolarTransform

java.lang.Object
  extended by com.cosylab.gui.components.gauger.ScaleTransform
      extended by com.cosylab.gui.components.gauger.PolarTransform
Direct Known Subclasses:
PolarFullTransform, PolarHorizontalTransform, PolarVerticalTransform

public abstract class PolarTransform
extends ScaleTransform

Base class for polar transforms. All polar transforms will be rendered using scale in the shape of arc.

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
 
Field Summary
protected  double alpha
           
protected  java.awt.geom.Point2D centre
           
protected  int height
           
protected  double r
           
protected  double R
           
protected  double span
           
protected  double tickOffset
           
 
Constructor Summary
PolarTransform()
           
 
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
 

Field Detail

centre

protected java.awt.geom.Point2D centre

R

protected double R

r

protected double r

alpha

protected double alpha

span

protected double span

height

protected int height

tickOffset

protected double tickOffset
Constructor Detail

PolarTransform

public PolarTransform()
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

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

mapXYtoUV

public void mapXYtoUV(java.awt.geom.Point2D cartesianSpace,
                      java.awt.geom.Point2D scaleScape)

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.

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.

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.