Class SliderState

java.lang.Object
  extended by SliderState

public class SliderState
extends java.lang.Object

Class State contains the sliders state for an ImageScroller instance.

This work was produced by Peter Lemkin of the National Cancer Institute, an agency of the United States Government. As a work of the United States Government there is no associated copyright. It is offered as open source software under the Mozilla Public License (version 1.1) subject to the limitations noted in the accompanying LEGAL file. This notice must be included with the code. The Flicker Mozilla and Legal files are available on http://open2dprot.sourceforge.net/Flicker

Version:
$Date$ $Revision$
Author:
P. Lemkin (LECB/NCI), G. Thornwall (SAIC), Frederick, MD
See Also:
Flicker Home

Field Summary
 int angle
          GUI state: degrees 3D perspective xform
 int bkgrdCircleRadius
          NOT a GUI slider.
 int brightness
          GUI state: contrast in [MIN_BRIGHTNESS:MAX_BRIGHTNESS]
 int contrast
          GUI state: contrast in [MIN_CONTRAST:MAX_CONTRAST]
static int DEF_ANGLE
          rotation angle 10 degrees
static int DEF_BRIGHTNESS
          default brightness
static int DEF_CONTRAST
          default contrast
static int DEF_ESCALE
          default eScale 20 percent
static int DEF_THRESHOLD1
          MIN gray
static int DEF_THRESHOLD2
          MAX gray
static int DEF_ZOOM
          default zoom X magnificationAWT
static int DEF_ZOOM_MAG_SCR
          default zoomMag X magnification scroller value
static int DEF_ZSCALE
          default zScale 5 percent
 int delay
          opt.
 int eScale
          GUI state: scale factor for image sharpening xform
private static Flicker flk
           
 int magnificationAWT
          GUI state: zoom mangification in range [1X:MAX_ZOOM]
static int MAX_ANGLE
          max degrees
static int MAX_BRIGHTNESS
          max brightness baseline
static int MAX_CONTRAST
          max constrast x 0.10 slope
static int MAX_ESCALE
          max eScale percent
static int MAX_THRESHOLD1
          max GRAY threshold 1
static int MAX_THRESHOLD2
          max GRAY threshold 2
static int MAX_ZOOM
          max X magnificationAWT
static int MAX_ZOOM_MAG_SCR
          max zoomMag (zoom/dezoom) X magnification mapped to [-1/10X : 10X]
static float MAX_ZOOM_MAG_VAL
          max zoomMag value (zoom/dezoom) X magnification
static int MAX_ZSCALE
          max zScale percent
 int measCircleRadius
          GUI state radius of circle mask size used for flk.measCircleRadius
static int MIN_ANGLE
          min degrees
static int MIN_BRIGHTNESS
          min brightness baseline
static int MIN_CONTRAST
          min constrast x 0.10 slope
static int MIN_ESCALE
          min eScale percent
static int MIN_THRESHOLD1
          min GRAY threshold 1
static int MIN_THRESHOLD2
          min GRAY threshold 2
static int MIN_ZOOM
          min X magnificationAWT
static int MIN_ZOOM_MAG_SCR
          min zoomMag (zoom/dezoom) X magnification mapped to [-1/10X : 10X]
static float MIN_ZOOM_MAG_VAL
          min zoomMag value (zoom/dezoom) X magnification
static int MIN_ZSCALE
          min zScale percent
 java.lang.String name
           
 int threshold1
          GUI state: lower bound threshold for grayscale slicing
 int threshold2
          GUI state: upper bound threshold for grayscale slicing
private static Util util
           
 int zoomMagScr
          GUI scroller state: dezoom and zoom magnification in range [MIN_ZOOM_MAG_SCR : MAX_ZOOM_MAG_SCR]
 float zoomMagVal
          GUI magnification state: dezoom and zoom magnification in range [MIN_ZOOM_MAG_VAL : MAX_ZOOM_MAG_VAL]
 int zScale
          GUI state: % grayscale factor 3D xform
 
Constructor Summary
SliderState()
          SliderState() - constructor
 
Method Summary
 SliderState clone(SliderState src)
          clone() - clone a copy of the src SliderState
private  boolean copy(SliderState src, SliderState dst)
          copy() - copy src SliderState to dst SliderState
static java.lang.String cvtZoomMagScr2Str(int zmScr)
          cvtZoomMagScr2Str() - convert a zoomMag scroller value to a prettyprint string with 2 digits.
static float cvtZoomMagScr2ZoomMagVal(int zmScr)
          cvtZoomMagScr2ZoomMagVal() - convert a zoomMag scroller value to a zoom mag value.
 java.lang.String getStateStr(ImageData iData, java.lang.String fileName)
          getStateStr() - get this scroller state as a string
 void init(Flicker flicker, java.lang.String name)
          init() - set state to default values.
 void readState(java.lang.String iName)
          readState() - Read scroller state from .flk startup state file.
private  void reset()
          reset() - reset state to default values.
 void writeState(java.lang.String iName, java.lang.StringBuffer sBuf)
          writeState() - Write this scroller state to string buffer sBuf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

flk

private static Flicker flk

util

private static Util util

MAX_ZSCALE

public static final int MAX_ZSCALE
max zScale percent

See Also:
Constant Field Values

MIN_ZSCALE

public static final int MIN_ZSCALE
min zScale percent

See Also:
Constant Field Values

MAX_ANGLE

public static final int MAX_ANGLE
max degrees

See Also:
Constant Field Values

MIN_ANGLE

public static final int MIN_ANGLE
min degrees

See Also:
Constant Field Values

MAX_ESCALE

public static final int MAX_ESCALE
max eScale percent

See Also:
Constant Field Values

MIN_ESCALE

public static final int MIN_ESCALE
min eScale percent

See Also:
Constant Field Values

MAX_BRIGHTNESS

public static final int MAX_BRIGHTNESS
max brightness baseline

See Also:
Constant Field Values

MIN_BRIGHTNESS

public static final int MIN_BRIGHTNESS
min brightness baseline

See Also:
Constant Field Values

MAX_CONTRAST

public static final int MAX_CONTRAST
max constrast x 0.10 slope

See Also:
Constant Field Values

MIN_CONTRAST

public static final int MIN_CONTRAST
min constrast x 0.10 slope

See Also:
Constant Field Values

MAX_THRESHOLD1

public static final int MAX_THRESHOLD1
max GRAY threshold 1

See Also:
Constant Field Values

MIN_THRESHOLD1

public static final int MIN_THRESHOLD1
min GRAY threshold 1

See Also:
Constant Field Values

MAX_THRESHOLD2

public static final int MAX_THRESHOLD2
max GRAY threshold 2

See Also:
Constant Field Values

MIN_THRESHOLD2

public static final int MIN_THRESHOLD2
min GRAY threshold 2

See Also:
Constant Field Values

MAX_ZOOM

public static final int MAX_ZOOM
max X magnificationAWT

See Also:
Constant Field Values

MIN_ZOOM

public static final int MIN_ZOOM
min X magnificationAWT

See Also:
Constant Field Values

MAX_ZOOM_MAG_SCR

public static final int MAX_ZOOM_MAG_SCR
max zoomMag (zoom/dezoom) X magnification mapped to [-1/10X : 10X]

See Also:
Constant Field Values

MIN_ZOOM_MAG_SCR

public static final int MIN_ZOOM_MAG_SCR
min zoomMag (zoom/dezoom) X magnification mapped to [-1/10X : 10X]

See Also:
Constant Field Values

MAX_ZOOM_MAG_VAL

public static final float MAX_ZOOM_MAG_VAL
max zoomMag value (zoom/dezoom) X magnification

See Also:
Constant Field Values

MIN_ZOOM_MAG_VAL

public static final float MIN_ZOOM_MAG_VAL
min zoomMag value (zoom/dezoom) X magnification

See Also:
Constant Field Values

DEF_ANGLE

public static final int DEF_ANGLE
rotation angle 10 degrees

See Also:
Constant Field Values

DEF_ZSCALE

public static final int DEF_ZSCALE
default zScale 5 percent

See Also:
Constant Field Values

DEF_ESCALE

public static final int DEF_ESCALE
default eScale 20 percent

See Also:
Constant Field Values

DEF_CONTRAST

public static final int DEF_CONTRAST
default contrast

See Also:
Constant Field Values

DEF_BRIGHTNESS

public static final int DEF_BRIGHTNESS
default brightness

See Also:
Constant Field Values

DEF_THRESHOLD2

public static final int DEF_THRESHOLD2
MAX gray

See Also:
Constant Field Values

DEF_THRESHOLD1

public static final int DEF_THRESHOLD1
MIN gray

See Also:
Constant Field Values

DEF_ZOOM

public static final int DEF_ZOOM
default zoom X magnificationAWT

See Also:
Constant Field Values

DEF_ZOOM_MAG_SCR

public static final int DEF_ZOOM_MAG_SCR
default zoomMag X magnification scroller value

See Also:
Constant Field Values

name

public java.lang.String name

threshold1

public int threshold1
GUI state: lower bound threshold for grayscale slicing


threshold2

public int threshold2
GUI state: upper bound threshold for grayscale slicing


angle

public int angle
GUI state: degrees 3D perspective xform


brightness

public int brightness
GUI state: contrast in [MIN_BRIGHTNESS:MAX_BRIGHTNESS]


contrast

public int contrast
GUI state: contrast in [MIN_CONTRAST:MAX_CONTRAST]


delay

public int delay
opt. image delay if flickering


eScale

public int eScale
GUI state: scale factor for image sharpening xform


magnificationAWT

public int magnificationAWT
GUI state: zoom mangification in range [1X:MAX_ZOOM]


zScale

public int zScale
GUI state: % grayscale factor 3D xform


zoomMagScr

public int zoomMagScr
GUI scroller state: dezoom and zoom magnification in range [MIN_ZOOM_MAG_SCR : MAX_ZOOM_MAG_SCR]


measCircleRadius

public int measCircleRadius
GUI state radius of circle mask size used for flk.measCircleRadius


bkgrdCircleRadius

public int bkgrdCircleRadius
NOT a GUI slider. This is the last (C-B) measurement take using the current flk.measCircleRadius at the time. We keep this here since the value is dependent on the image - NOT the global value.


zoomMagVal

public float zoomMagVal
GUI magnification state: dezoom and zoom magnification in range [MIN_ZOOM_MAG_VAL : MAX_ZOOM_MAG_VAL]

Constructor Detail

SliderState

public SliderState()
SliderState() - constructor

Method Detail

init

public void init(Flicker flicker,
                 java.lang.String name)
init() - set state to default values.

Parameters:
flicker - is instance of Flicker
name - of the SliderState

reset

private void reset()
reset() - reset state to default values.


clone

public SliderState clone(SliderState src)
clone() - clone a copy of the src SliderState

Parameters:
src - SliderState to clone
Returns:
the cloned SliderState instance

copy

private boolean copy(SliderState src,
                     SliderState dst)
copy() - copy src SliderState to dst SliderState

Parameters:
src - SliderState to copy
dst - SliderState that we copy to
Returns:
true if succeed

readState

public void readState(java.lang.String iName)
readState() - Read scroller state from .flk startup state file.

Parameters:
iName - of the image to read (e.g., "I1", or "I2")

writeState

public void writeState(java.lang.String iName,
                       java.lang.StringBuffer sBuf)
writeState() - Write this scroller state to string buffer sBuf

Parameters:
iName - of the image to read (e.g., "I1", or "I2")
sBuf - is the string buffer to write to.

getStateStr

public java.lang.String getStateStr(ImageData iData,
                                    java.lang.String fileName)
getStateStr() - get this scroller state as a string

Parameters:
iData - is the image data to use
fileName - associated with the iData
Returns:
state string

cvtZoomMagScr2Str

public static java.lang.String cvtZoomMagScr2Str(int zmScr)
cvtZoomMagScr2Str() - convert a zoomMag scroller value to a prettyprint string with 2 digits.

Parameters:
zmScr - is zoomMag scroller value to convert to 2 digit mag string
Returns:
converted string

cvtZoomMagScr2ZoomMagVal

public static float cvtZoomMagScr2ZoomMagVal(int zmScr)
cvtZoomMagScr2ZoomMagVal() - convert a zoomMag scroller value to a zoom mag value. Compute this by mapping the scroller range [MIN_ZOOM_MAG : MAX_ZOOM_MAG] to the value range [MIN_ZOOM_MAG_VAL : MAX_ZOOM_MAG_VAL] by solving the linear equation and then interpolating the value.

Parameters:
zmScr - is the zoomMag integer scroller value in the range of [MIN_ZOOM_MAG : MAX_ZOOM_MAG] to convert
Returns:
converted value in the magnification domain