All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class crw.data2.Conversion2

java.lang.Object
   |
   +----crw.data2.Conversion2

public class Conversion2
extends Object
A class to perform conversion between physical values and screen scales.

Version:
1.0, 1998/10/9
Author:
C. R. Wie

Constructor Index

 o Conversion2()
Default constructor with unity conversion factors.
 o Conversion2(double)
Constructor with specified conversion factors.

Method Index

 o getFillFactor()
Returns the fillfactor.
 o setFactor(int, double)
Conversion factor is caluculated from the screen pixel width and the maximum physical range.
 o setFactor(int, FloatRange)
Sets the conversion factors from the physical value range
 o setFactor(IntRange, FloatRange)
Sets the conversion factors from the physical value range
 o setFillFactor(double)
Sets the fillfactor to a new value.
 o setPhysToScr(double)
Sets the conversion factor from physical to screen.
 o toPhys(int)
Converts to the physical value.
 o toScr(double)
Converts to the screen scale.
 o toScr(double[])
Converts to screen scale for an entire array of physical values.
 o toScr(double[][])
Converts to the screen scale for the entire array.
 o toScr(int)
Converts to the screen pixel scale.
 o toScr(Vector)
Converts to screen pixels for an entire Vector.
 o toScr(Vector, Vector)
Converts to screen pixel scale for an entire Vector, and puts the resulting vector of screen-scales into scr.

Constructors

 o Conversion2
 public Conversion2()
Default constructor with unity conversion factors.

 o Conversion2
 public Conversion2(double toScr)
Constructor with specified conversion factors.

Parameters:
toScr - the physical-to-screen conversion factor.

Methods

 o toScr
 public int toScr(double phys)
Converts to the screen scale.

Parameters:
phys - the physical value to convert to screen scale.
Returns:
the screen pixel size.
 o toScr
 public int[] toScr(double phys[])
Converts to screen scale for an entire array of physical values.

Parameters:
phys - the physical value array.
Returns:
the screen pixel array.
 o toScr
 public Vector toScr(Vector phys)
Converts to screen pixels for an entire Vector.

Parameters:
phys - the Vector that constains the physical values, Double objects.
Returns:
the corresponding Vector of screen scales, Integer objects.
 o toScr
 public int toScr(int phys)
Converts to the screen pixel scale.

Parameters:
phys - the physical value.
Returns:
the screen pixel value.
 o toScr
 public int[][] toScr(double phys[][])
Converts to the screen scale for the entire array.

Parameters:
phys - the physical 2D array.
Returns:
the 2D array of screen values.
 o toScr
 public void toScr(Vector phys,
                   Vector scr)
Converts to screen pixel scale for an entire Vector, and puts the resulting vector of screen-scales into scr.

Parameters:
phys - Vector that constains the physical values. param scr the corresponding Vector of screen scales.
 o toPhys
 public double toPhys(int scr)
Converts to the physical value.

Parameters:
scr - the screen pixel value.
Returns:
the physical double value.
 o setPhysToScr
 public void setPhysToScr(double toScr)
Sets the conversion factor from physical to screen. It also sets the conversion factor for screen-to-physical.

Parameters:
toScr - the new physical-to-screen conversion factor.
 o setFactor
 public void setFactor(int screenWidth,
                       double max)
Conversion factor is caluculated from the screen pixel width and the maximum physical range. Default fill factor is 1.0 (the entire screen width).

Parameters:
screenWidth - the screen width.
max - the maximum range of physical value.
 o setFactor
 public void setFactor(int scrWidth,
                       FloatRange physRange)
Sets the conversion factors from the physical value range

Parameters:
scrWidth - the screen dimension.
physRange - the value range.
 o setFactor
 public void setFactor(IntRange scrRange,
                       FloatRange physRange)
Sets the conversion factors from the physical value range

Parameters:
scrRange - the screen dimension.
physRange - the value range.
 o setFillFactor
 public void setFillFactor(double fillFactor)
Sets the fillfactor to a new value. 0.0 < factor <= 1.0 The conversion factors adjust to the new fillFactor.

Parameters:
fillFactor - the new fillfactor.
 o getFillFactor
 public double getFillFactor()
Returns the fillfactor.

Returns:
the fillfactor.

All Packages  Class Hierarchy  This Package  Previous  Next  Index