Class StateScrollers

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--java.awt.Frame
                          |
                          +--StateScrollers
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, java.awt.event.AdjustmentListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.awt.event.MouseListener, java.io.Serializable, java.awt.event.WindowListener

class StateScrollers
extends java.awt.Frame
implements java.awt.event.AdjustmentListener, java.awt.event.ActionListener, java.awt.event.WindowListener, java.awt.event.MouseListener

The class builds a popup window dynamic grid of threshold parameter scrollers. This constitutes a set of state scrollers popup "control panel". Scrollers are associated with data filters which use the threshold. If a filter becomes active or inactive, then the scroller panel is regenerated and the panel will added or dropped to reflect the changes. The regenerated is invoked by EventMenu when the data filter is enabled or disabled.

There is no DONE button handler since users do not kill the window, but rather when it is killed when the associated Filter is disabled.

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 MAExplorer Mozilla and Legal files are available on http://maexplorer.sourceforge.net/.

Version:
$Date: 2003/03/03 16:15:19 $ $Revision: 1.16 $
Author:
P. Lemkin (NCI), G. Thornwall (SAIC), NCI-Frederick, Frederick, MD
See Also:
MAExplorer Home, EventMenu, Filter, Serialized Form

Inner classes inherited from class java.awt.Frame
java.awt.Frame.AccessibleAWTFrame
 
Inner classes inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.AWTTreeLock
 
Field Summary
(package private)  java.awt.Button adjustAllButton
          pop down current mode and popup adjust all sliders
(package private)  boolean allowPopdownOnWindowClosing
          Flag: allow popdown if orig.
(package private)  java.awt.Button applyButton
          Apply the parameters to the data filters.
(package private)  java.awt.Color bgColor
          optional background color ...
private  Config cfg
          link to global Config instance
private  int DEFAULT_PANEL_HEIGHT
          default height size of state scroller panel
private  int DEFAULT_PANEL_WIDTH
          default width size of state scroller panel
(package private)  java.awt.Button doneButton
          pop down (hide) the box - only in adjust all scrollers mode.
(package private)  boolean doRepaint
           
private  int gridCol
          size of grid for panel
private  int GRIDCOL
          size of grid for panel
private  int gridRow
          size of grid for panel
(package private) static int idxClusterDist
          index for clusterDist threshold for cluster distance clustering
(package private) static int idxCR1
          index for CR1 Cy(3/5) ratio value lower bound
(package private) static int idxCR2
          index for CR2 Cy(3/5) ratio value upper bound
(package private) static int idxCZ1
          index for CZ1 Cy(3/5) zscore value lower bound
(package private) static int idxCZ2
          index for CZ2 Cy(3/5) zscore value upper bound
(package private) static int idxdetValueSpotThr
          index for continuous threshold of Spot Detection values
(package private) static int idxDiffXY
          index for Diff(HP-X,HP-Y) intensity differerence threshold
(package private) static int idxNbrClusters
          index for # of clusters threshold for K-means clustering
(package private) static int idxPctOK
          index for Percent SI OK (SI AT_LEAST/AT_MOST) QualCheck threshold
(package private) static int idxPvalue
          index for p-value threshold value
(package private) static int idxQualThr
          index for qualType continuous threshold of QualCheck values
(package private) static int idxR1
          index for R1 ratio HP-X/HP-Y value lower bound
(package private) static int idxR2
          index for R2 ratio HP-X/HP-Y value upper bound
(package private) static int idxRadius
          index for Radius for drawing spots in the pseudo array
(package private) static int idxSI1
          index for Spot SI1 intensity value lower bound
(package private) static int idxSI2
          index for Spot SI2 intensity value upper bound
(package private) static int idxSpot_CV
          index for spot Coefficient of Variation threshold value
(package private) static int idxT1
          index for I1 (T1) HP intensity value lower bound
(package private) static int idxT2
          index for I2 (T2) HP intensity value upper bound
(package private) static int idxZ1
          index for Z1 zscore value of (HP-X - HP-Y) lower bound
(package private) static int idxZ2
          index for Z2 zscore value of (HP-X - HP-Y) upper bound
(package private)  boolean isVisible
          Flag: if StateScroller GUI is visible
(package private)  java.awt.Panel lowerControlPanel
          holds buttons, textAreas, etc for state scroller GUI
private  MAExplorer mae
          link to global MAExplorer instance
(package private)  java.awt.TextArea mouseoverTA
          mouseover TextArea
(package private)  java.awt.Font newFontLbl
          font type for labels
(package private) static int nSB
          # of entries in sbName[] tables
(package private)  java.awt.Panel pgrid
          holds the Scrollbar (SB) panels
private  int pnlHeight
          panel size height
private  int pnlWidth
          panel size Width
private  int PREFERRED_PANEL_HEIGHT
          max width size of state scroller panel
private  int PREFERRED_PANEL_WIDTH
          max height size of state scroller panel
(package private)  boolean runClusterAnalysis
           
(package private)  boolean runFilter
           
(package private)  boolean runImageOptimizer
           
(package private)  boolean runKmeansClusterAnalysis
           
(package private)  boolean[] sbActive
          Flags: true if scroll bars are active
(package private)  java.awt.Scrollbar[] sbBar
          list of scroll bars
(package private)  float[] sbCurValue
          current & initial (STATE) values of scrollbar
(package private)  int[] sbGTidx
          corresponding GT scroller integer bounds
(package private)  java.awt.Label[] sbLblName
          label of Name to left of scrollbar
(package private)  java.awt.Label[] sbLblValue
          label of Values to right of scrollbar
(package private)  float[] sbLowerBound
          Note: lower bounds in STATE space
(package private)  int[] sbLTidx
          corresponding LT scroller integer bounds
(package private) static java.lang.String[] sbMouseMsg
          messages for mouseover of label
(package private) static java.lang.String[] sbName
          list of state scroller label names
(package private)  boolean[] sbNonLinearScale
          Flags for using a nonlinear vernier in the SCROLLER CONTROLs
(package private)  int[] sbPrecision
          # of digits in scroller value labels
(package private)  int[] sbSize
          size of scale in Scroller space
(package private)  float[] sbUpperBound
          Note: upper bounds in STATE space
private  java.awt.Point scrPos
          Normal position for showing selected state.
(package private) static int TA_COLS
          size of mouseover TextArea
(package private) static int TA_ROWS
          size of mouseover TextArea
(package private)  java.lang.String title
          holds title string for state scroller GUI
(package private)  java.awt.Label titleLabel
          Label for title
(package private)  boolean useAllScrollersFlag
          Flag: force all scrollers to appear even if not used...
(package private)  int[] useFilterCounters
          # of filters dependent on each slider.
private  Util util
          link to global Util instance
 
Fields inherited from class java.awt.Frame
base, CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, frameSerializedDataVersion, HAND_CURSOR, icon, ICONIFIED, mbManagement, menuBar, MOVE_CURSOR, N_RESIZE_CURSOR, nameCounter, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, ownedWindows, resizable, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, serialVersionUID, state, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR, weakThis
 
Fields inherited from class java.awt.Window
active, dbg, focusMgr, inputContext, inputContextLock, OPENED, ownedWindowList, showWithParent, warningString, windowListener, windowSerializedDataVersion
 
Fields inherited from class java.awt.Container
component, containerListener, containerSerializedDataVersion, dispatcher, layoutMgr, listeningBoundsChildren, listeningChildren, maxSize, ncomponents, printing, printingThreads
 
Fields inherited from class java.awt.Component
accessibleContext, actionListenerK, adjustmentListenerK, appContext, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, changeSupport, componentListener, componentListenerK, componentOrientation, componentSerializedDataVersion, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, graphicsConfig, hasFocus, height, hierarchyBoundsListener, hierarchyBoundsListenerK, hierarchyListener, hierarchyListenerK, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, metrics, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, name, nameExplicitlySet, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, privateKey, RIGHT_ALIGNMENT, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowClosingException, windowListenerK, x, y
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
(package private) StateScrollers(MAExplorer mae, java.lang.String title)
          StateScrollers() - constructor to build the GUI with pop up menus
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          actionPerformed() - Handle button clicks
(package private)  boolean addScroller(java.lang.String scrollBarName)
          addScroller() - add a particular scroller by scroller name
 void adjustmentValueChanged(java.awt.event.AdjustmentEvent e)
          adjustmentValueChanged() - handle scroller state changed events
(package private)  void adjustRatioOrZscoreCounters()
          adjustRatioOrZscoreCounters() - adjust any sliders that depend on being in Zscore mode This is ONLY called when mae.isZscoreFlag is changed.
(package private)  void clearActiveScrollers()
          clearActiveScrollers() - clear list of all active scrollers
(package private)  void clearPostProcessingFlags()
          clearPostProcessingFlags() - clear special post-processing flags that are then set by particular scroller changes
(package private)  void createStateScrollers()
          createStateScrollers() - build the grid panel of popup scrollers
(package private)  int cvRatioToScrollValue(float rValF)
          cvRatioToScrollValue() - convert state ratio to ratio-scroller value
(package private)  float cvScrollToStateValue(int idx, int sbVal)
          cvScrollToStateValue() - cvt scrollbar value to (float) STATE value
(package private)  double cvScrollValueToRatio(int val, int size)
          cvScrollValueToRatio() - convert ratio-scroller value to ratio STATE value
(package private)  int cvStateToScrollValue(int idx, float stVal)
          cvStateToScrollValue() - convert STATE value to scrollbar current value.
 java.awt.Dimension getPreferredSize_DEPRICATED()
          getPreferredSize() - get the preferred size
private  void initPreloads()
          initPreloads() - setup the preloaded arrays of filter names, values and range gang-scroll option.
(package private)  void initUserFilterScrollerCounters()
          initUserFilterScrollerCounters() - initialize scroller use counters based on the State flags.
(package private)  int lookupScrollerIdx(java.lang.String scrollBarName)
          lookupScrollerIdx() - lookup a particular scroller index
 void mouseClicked(java.awt.event.MouseEvent me)
           
 void mouseEntered(java.awt.event.MouseEvent me)
          mouseEntered() - put mouse over data in MouseOver text area
 void mouseExited(java.awt.event.MouseEvent me)
          mouseExited() - clear mouseover text area.
 void mouseMoved(java.awt.event.MouseEvent me)
           
 void mousePressed(java.awt.event.MouseEvent me)
           
 void mouseReleased(java.awt.event.MouseEvent me)
           
(package private)  int nbrActiveScrollers()
          nbrActiveScrollers() - return the number of active scrollers and copy scaled scroller data to the state variables.
(package private)  int nbrActiveScrollersUseCounters()
          nbrActiveScrollersUseCounters() - return the number of active scrollers and copy scaled scroller data to the state variables.
(package private)  void popdownScrollers()
          popdownScrollers() - close down the window using dispose
(package private)  void regenerateScrollers(boolean popupAllScrollersFlag)
          regenerateScrollers() - regenerate scroller window
(package private)  boolean reRunClusterAnalysis()
          reRunClusterAnalysis() - rerun cluster analysis after changed state.
(package private)  boolean reRunImageOptimizer()
          reRunImageOptimizer() - rerun pseudoarray image optimization after changed state.
(package private)  boolean rmvScroller(java.lang.String scrollBarName)
          rmvScroller() - remove a particular scroller by scroller name
(package private)  void setEnablePopupScrollbars(boolean showIt)
          setEnablePopupScrollbars() - hide or show popup all scrollbars
(package private)  void setRangeMaps()
          setRangeMaps() - set norm dependent scrollers based normalization method.
(package private)  void setRangeMapsFromState()
          setRangeMapsFromState() - set normalization dependent scrollers based on norm.
(package private)  boolean setThresholdValueBySliderIdx(int idx, float value)
          setThresholdValueBySliderIdx() - set slider threshold value by slider index
(package private)  boolean setUseAllScrollersFlag(boolean newFlag)
          setUseAllScrollersFlag() - set the state to display all scrollers by flag.
(package private)  boolean updateFilterScrollerUseCounter(java.lang.String scrollBarName, boolean addFlag)
          updateFilterScrollerUseCounter() - "add" or "remove" use of a particular scroller by scroller name.
 void windowActivated(java.awt.event.WindowEvent e)
           
 void windowClosed(java.awt.event.WindowEvent e)
           
 void windowClosing(java.awt.event.WindowEvent e)
          windowClosing() - close the window - don't allow unless doing ALL scrollers.
 void windowDeactivated(java.awt.event.WindowEvent e)
           
 void windowDeiconified(java.awt.event.WindowEvent e)
           
 void windowIconified(java.awt.event.WindowEvent e)
           
 void windowOpened(java.awt.event.WindowEvent e)
           
 
Methods inherited from class java.awt.Frame
, addNotify, addToFrameList, constructComponentName, finalize, getAccessibleContext, getCursorType, getFrames, getIconImage, getMenuBar, getState, getTitle, initIDs, isResizable, paramString, postProcessKeyEvent, readObject, remove, removeFromFrameList, removeNotify, setCursor, setIconImage, setMenuBar, setResizable, setState, setTitle, writeObject
 
Methods inherited from class java.awt.Window
addOwnedWindow, addWindowListener, adjustListeningChildren, applyResourceBundle, applyResourceBundle, connectOwnedWindow, dispatchEventImpl, dispose, eventEnabled, getFocusOwner, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, hide, isActive, isShowing, nextFocus, ownedInit, pack, postEvent, postWindowEvent, preProcessKeyEvent, processEvent, processWindowEvent, removeOwnedWindow, removeWindowListener, resetGC, setCursor, setFocusOwner, setWarningString, show, toBack, toFront, transferFocus
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyOrientation, checkGD, countComponents, createChildHierarchyEvents, createHierarchyEvents, deliverEvent, dispatchEventToSelf, doLayout, findComponentAt, findComponentAt, findComponentAt, getAccessibleAt, getAccessibleChild, getAccessibleChildrenCount, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents_NoClientCode, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getMouseEventTarget, getPreferredSize, getWindow, insets, invalidate, invalidateTree, isAncestorOf, layout, lightweightPaint, lightweightPrint, list, list, locate, minimumSize, numListening, paint, paintComponents, paintHeavyweightComponents, postsOldMouseEvents, preferredSize, print, printComponents, printHeavyweightComponents, processContainerEvent, proxyEnableEvents, proxyRequestFocus, remove, remove, removeAll, removeContainerListener, setFont, setLayout, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, areInputMethodsEnabled, bounds, checkImage, checkImage, checkWindowClosingException, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAccessibleIndexInParent, getAccessibleStateSet, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen_NoTreeLock, getLocationOnScreen, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getSize, getToolkitImpl, getTreeLock, getWidth, getWindowForObject, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isEnabledImpl, isFocusTraversable, isLightweight, isOpaque, isRecursivelyVisible, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

mae

private MAExplorer mae
link to global MAExplorer instance

cfg

private Config cfg
link to global Config instance

util

private Util util
link to global Util instance

TA_ROWS

static final int TA_ROWS
size of mouseover TextArea

TA_COLS

static final int TA_COLS
size of mouseover TextArea

DEFAULT_PANEL_WIDTH

private final int DEFAULT_PANEL_WIDTH
default width size of state scroller panel

DEFAULT_PANEL_HEIGHT

private final int DEFAULT_PANEL_HEIGHT
default height size of state scroller panel

PREFERRED_PANEL_HEIGHT

private final int PREFERRED_PANEL_HEIGHT
max width size of state scroller panel

PREFERRED_PANEL_WIDTH

private final int PREFERRED_PANEL_WIDTH
max height size of state scroller panel

GRIDCOL

private final int GRIDCOL
size of grid for panel

scrPos

private java.awt.Point scrPos
Normal position for showing selected state. If showing all states, then move Vert position to near top

sbName

static java.lang.String[] sbName
list of state scroller label names

nSB

static final int nSB
# of entries in sbName[] tables

sbMouseMsg

static java.lang.String[] sbMouseMsg
messages for mouseover of label

idxSI1

static final int idxSI1
index for Spot SI1 intensity value lower bound

idxSI2

static final int idxSI2
index for Spot SI2 intensity value upper bound

idxT1

static final int idxT1
index for I1 (T1) HP intensity value lower bound

idxT2

static final int idxT2
index for I2 (T2) HP intensity value upper bound

idxR1

static final int idxR1
index for R1 ratio HP-X/HP-Y value lower bound

idxR2

static final int idxR2
index for R2 ratio HP-X/HP-Y value upper bound

idxZ1

static final int idxZ1
index for Z1 zscore value of (HP-X - HP-Y) lower bound

idxZ2

static final int idxZ2
index for Z2 zscore value of (HP-X - HP-Y) upper bound

idxCR1

static final int idxCR1
index for CR1 Cy(3/5) ratio value lower bound

idxCR2

static final int idxCR2
index for CR2 Cy(3/5) ratio value upper bound

idxCZ1

static final int idxCZ1
index for CZ1 Cy(3/5) zscore value lower bound

idxCZ2

static final int idxCZ2
index for CZ2 Cy(3/5) zscore value upper bound

idxPvalue

static final int idxPvalue
index for p-value threshold value

idxSpot_CV

static final int idxSpot_CV
index for spot Coefficient of Variation threshold value

idxRadius

static final int idxRadius
index for Radius for drawing spots in the pseudo array

idxClusterDist

static final int idxClusterDist
index for clusterDist threshold for cluster distance clustering

idxNbrClusters

static final int idxNbrClusters
index for # of clusters threshold for K-means clustering

idxDiffXY

static final int idxDiffXY
index for Diff(HP-X,HP-Y) intensity differerence threshold

idxPctOK

static final int idxPctOK
index for Percent SI OK (SI AT_LEAST/AT_MOST) QualCheck threshold

idxQualThr

static final int idxQualThr
index for qualType continuous threshold of QualCheck values

idxdetValueSpotThr

static final int idxdetValueSpotThr
index for continuous threshold of Spot Detection values

allowPopdownOnWindowClosing

boolean allowPopdownOnWindowClosing
Flag: allow popdown if orig. window closing

doRepaint

boolean doRepaint

runImageOptimizer

boolean runImageOptimizer

runClusterAnalysis

boolean runClusterAnalysis

runKmeansClusterAnalysis

boolean runKmeansClusterAnalysis

runFilter

boolean runFilter

sbSize

int[] sbSize
size of scale in Scroller space

sbUpperBound

float[] sbUpperBound
Note: upper bounds in STATE space

sbLowerBound

float[] sbLowerBound
Note: lower bounds in STATE space

sbCurValue

float[] sbCurValue
current & initial (STATE) values of scrollbar

sbLTidx

int[] sbLTidx
corresponding LT scroller integer bounds

sbGTidx

int[] sbGTidx
corresponding GT scroller integer bounds

sbPrecision

int[] sbPrecision
# of digits in scroller value labels

sbNonLinearScale

boolean[] sbNonLinearScale
Flags for using a nonlinear vernier in the SCROLLER CONTROLs

useFilterCounters

int[] useFilterCounters
# of filters dependent on each slider. Each filter that requires that slider will increment the counter when it is enabled and decrement the counter when it is disabled.

title

java.lang.String title
holds title string for state scroller GUI

lowerControlPanel

java.awt.Panel lowerControlPanel
holds buttons, textAreas, etc for state scroller GUI

doneButton

java.awt.Button doneButton
pop down (hide) the box - only in adjust all scrollers mode. Normally, can only pop it down if there are NO associated data Filters.

applyButton

java.awt.Button applyButton
Apply the parameters to the data filters. Only in adjust all scrollers mode. Normally, automatically apply it by calling the data filters if not adjusting all scrollers mode.

adjustAllButton

java.awt.Button adjustAllButton
pop down current mode and popup adjust all sliders

mouseoverTA

java.awt.TextArea mouseoverTA
mouseover TextArea

titleLabel

java.awt.Label titleLabel
Label for title

sbLblName

java.awt.Label[] sbLblName
label of Name to left of scrollbar

sbLblValue

java.awt.Label[] sbLblValue
label of Values to right of scrollbar

sbBar

java.awt.Scrollbar[] sbBar
list of scroll bars

sbActive

boolean[] sbActive
Flags: true if scroll bars are active

pgrid

java.awt.Panel pgrid
holds the Scrollbar (SB) panels

bgColor

java.awt.Color bgColor
optional background color ...

newFontLbl

java.awt.Font newFontLbl
font type for labels

useAllScrollersFlag

boolean useAllScrollersFlag
Flag: force all scrollers to appear even if not used...

isVisible

boolean isVisible
Flag: if StateScroller GUI is visible

pnlWidth

private int pnlWidth
panel size Width

pnlHeight

private int pnlHeight
panel size height

gridCol

private int gridCol
size of grid for panel

gridRow

private int gridRow
size of grid for panel
Constructor Detail

StateScrollers

StateScrollers(MAExplorer mae,
               java.lang.String title)
StateScrollers() - constructor to build the GUI with pop up menus
Parameters:
mae - is MAExplorer instance
title - is the title for the state scroller popup window
See Also:
initPreloads()
Method Detail

getPreferredSize_DEPRICATED

public java.awt.Dimension getPreferredSize_DEPRICATED()
getPreferredSize() - get the preferred size
Returns:
window size

initPreloads

private void initPreloads()
initPreloads() - setup the preloaded arrays of filter names, values and range gang-scroll option. [TODO] Note: the ranges may be gotten from the .mae state file. In particular, the following are normalization and state dependent: sbUpperBound[], sbLowerBound[], sbCurValue[] The solution is to save these bounds in the state as well (what a pain!) or to recalculate them (also a pain...).
See Also:
setRangeMaps()

setUseAllScrollersFlag

boolean setUseAllScrollersFlag(boolean newFlag)
setUseAllScrollersFlag() - set the state to display all scrollers by flag.
Parameters:
newFlag - is the value to set the all scrollers flag to.
Returns:
the previous value

createStateScrollers

void createStateScrollers()
createStateScrollers() - build the grid panel of popup scrollers
See Also:
Util.cvf2s(float, int), cvStateToScrollValue(int, float)

clearActiveScrollers

void clearActiveScrollers()
clearActiveScrollers() - clear list of all active scrollers

lookupScrollerIdx

int lookupScrollerIdx(java.lang.String scrollBarName)
lookupScrollerIdx() - lookup a particular scroller index
Parameters:
scrollBarName - is the name of the scroller to lookup by name
Returns:
-1 if failed, else an index >= 0 if successful;

addScroller

boolean addScroller(java.lang.String scrollBarName)
addScroller() - add a particular scroller by scroller name
Parameters:
scrollBarName - is the name of the scroller to add by name
Returns:
true if successful;

rmvScroller

boolean rmvScroller(java.lang.String scrollBarName)
rmvScroller() - remove a particular scroller by scroller name
Parameters:
scrollBarName - is the name of the scroller to remove by name
Returns:
true if successful

updateFilterScrollerUseCounter

boolean updateFilterScrollerUseCounter(java.lang.String scrollBarName,
                                       boolean addFlag)
updateFilterScrollerUseCounter() - "add" or "remove" use of a particular scroller by scroller name. This method is called both by the EventMenu handlers when the Filter flags change and by plugins via the MJA.
Parameters:
scrollBarName - is the name of the scroller to update by name in sbName[0:nSB-1]
addFlag - to add a counter if true else remove a counter if false
Returns:
true if successful

adjustRatioOrZscoreCounters

void adjustRatioOrZscoreCounters()
adjustRatioOrZscoreCounters() - adjust any sliders that depend on being in Zscore mode This is ONLY called when mae.isZscoreFlag is changed. This is called if Zscore mode is CHANGED while ratio mode is still active.

initUserFilterScrollerCounters

void initUserFilterScrollerCounters()
initUserFilterScrollerCounters() - initialize scroller use counters based on the State flags.
 1. called from EventMenu handlers when change the flags
 2. plugins will modify counters separately through other calls.

setEnablePopupScrollbars

void setEnablePopupScrollbars(boolean showIt)
setEnablePopupScrollbars() - hide or show popup all scrollbars
Parameters:
showIt - flag to hide or show popup state scrollers

cvScrollToStateValue

float cvScrollToStateValue(int idx,
                           int sbVal)
cvScrollToStateValue() - cvt scrollbar value to (float) STATE value
 If using a log scale, then
        stVal = alpha*(sbValue**2)+beta,
 where: alpha = (ub-lb)/(sbSize**2-1),
        beta  = ( (ub+lb)-alpha*(sbSize**2+1) )/2.
Parameters:
idx - is the index of the scroller to convert
sbVal - is the scroller space value of the scroller to convert
Returns:
value in state space
See Also:
cvScrollValueToRatio(int, int)

cvStateToScrollValue

int cvStateToScrollValue(int idx,
                         float stVal)
cvStateToScrollValue() - convert STATE value to scrollbar current value.
 If using a log scale, then
      ubMlbRange= (ub-lb),
      stMlbVal= (sbMax -stVal -lb),
      r= (stMlbVal / ubMlbRange),
      rLog= r*log(sbMax+1.0),
      sbVal= sbMax - (exp(rLog) - 1.0).
Parameters:
idx - is the index of the scroller to convert
stVal - is the space space value of the scroller to convert
Returns:
value in scroller space
See Also:
cvRatioToScrollValue(float)

cvRatioToScrollValue

int cvRatioToScrollValue(float rValF)
cvRatioToScrollValue() - convert state ratio to ratio-scroller value
Parameters:
rValF - is the ratio scroller value
Returns:
value

cvScrollValueToRatio

double cvScrollValueToRatio(int val,
                            int size)
cvScrollValueToRatio() - convert ratio-scroller value to ratio STATE value
Parameters:
val - is the ratio scroller value
size - is the max size of the val range.
Returns:
value

clearPostProcessingFlags

void clearPostProcessingFlags()
clearPostProcessingFlags() - clear special post-processing flags that are then set by particular scroller changes

reRunImageOptimizer

boolean reRunImageOptimizer()
reRunImageOptimizer() - rerun pseudoarray image optimization after changed state. If it succeeds, the caller needs to do a global repaint.
Returns:
true if succeed, in which case the caller needs to repaint.

reRunClusterAnalysis

boolean reRunClusterAnalysis()
reRunClusterAnalysis() - rerun cluster analysis after changed state. If it succeeds, the caller needs to do a global repaint.
Returns:
true if succeed, in which case the caller needs to repaint.
See Also:
ClusterGenes, ClusterGenes.updateKmeansClusters(), PopupRegistry.updateCurGene(int, int, java.lang.Object)

adjustmentValueChanged

public void adjustmentValueChanged(java.awt.event.AdjustmentEvent e)
adjustmentValueChanged() - handle scroller state changed events
Specified by:
adjustmentValueChanged in interface java.awt.event.AdjustmentListener
See Also:
Filter.computeWorkingGeneList(), Component.repaint(), Util.cvf2s(float, int), clearPostProcessingFlags(), cvScrollToStateValue(int, int), cvStateToScrollValue(int, float), reRunImageOptimizer(), reRunClusterAnalysis(), setThresholdValueBySliderIdx(int, float)

setThresholdValueBySliderIdx

boolean setThresholdValueBySliderIdx(int idx,
                                     float value)
setThresholdValueBySliderIdx() - set slider threshold value by slider index
Parameters:
idx - is the index of the slider value in the sbName[]
Returns:
false if invalid index, true if valid index. Need to check additional flags that may be set here.
Side effects: one or more flags may be set including: runFilter, runImageOptimizer, runClusterAnalysis, runKmeansClusterAnalysis
Note the flags should be cleared BEFORE calling this method.
See Also:
clearPostProcessingFlags()

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed() - Handle button clicks
Specified by:
actionPerformed in interface java.awt.event.ActionListener
See Also:
clearActiveScrollers(), popdownScrollers()

popdownScrollers

void popdownScrollers()
popdownScrollers() - close down the window using dispose

nbrActiveScrollers

int nbrActiveScrollers()
nbrActiveScrollers() - return the number of active scrollers and copy scaled scroller data to the state variables.
Returns:
# of active scrollers

nbrActiveScrollersUseCounters

int nbrActiveScrollersUseCounters()
nbrActiveScrollersUseCounters() - return the number of active scrollers and copy scaled scroller data to the state variables. This is based on the user counters being > 0.
Returns:
# of active scrollers

regenerateScrollers

void regenerateScrollers(boolean popupAllScrollersFlag)
regenerateScrollers() - regenerate scroller window
Parameters:
popupAllScrollersFlag - will popup a window with ALL scrollers active
See Also:
addScroller(java.lang.String), clearActiveScrollers(), createStateScrollers(), nbrActiveScrollers(), popdownScrollers()

setRangeMaps

void setRangeMaps()
setRangeMaps() - set norm dependent scrollers based normalization method.
See Also:
setRangeMapsFromState()

setRangeMapsFromState

void setRangeMapsFromState()
setRangeMapsFromState() - set normalization dependent scrollers based on norm. method.
See Also:
MaHybridSample.scaleIntensData(float)

windowClosing

public void windowClosing(java.awt.event.WindowEvent e)
windowClosing() - close the window - don't allow unless doing ALL scrollers.
Specified by:
windowClosing in interface java.awt.event.WindowListener
See Also:
Util.cvf2s(float, int), Util.saveCmdHistory(java.lang.String), Util.showMsg1(java.lang.String, java.awt.Color, java.awt.Color), Util.showMsg2(java.lang.String), Util.showMsg3(java.lang.String), clearActiveScrollers(), popdownScrollers()

windowActivated

public void windowActivated(java.awt.event.WindowEvent e)
Specified by:
windowActivated in interface java.awt.event.WindowListener

windowClosed

public void windowClosed(java.awt.event.WindowEvent e)
Specified by:
windowClosed in interface java.awt.event.WindowListener

windowDeactivated

public void windowDeactivated(java.awt.event.WindowEvent e)
Specified by:
windowDeactivated in interface java.awt.event.WindowListener

windowDeiconified

public void windowDeiconified(java.awt.event.WindowEvent e)
Specified by:
windowDeiconified in interface java.awt.event.WindowListener

windowIconified

public void windowIconified(java.awt.event.WindowEvent e)
Specified by:
windowIconified in interface java.awt.event.WindowListener

windowOpened

public void windowOpened(java.awt.event.WindowEvent e)
Specified by:
windowOpened in interface java.awt.event.WindowListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent me)
mouseEntered() - put mouse over data in MouseOver text area
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent me)
mouseExited() - clear mouseover text area.
Specified by:
mouseExited in interface java.awt.event.MouseListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent me)

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent me)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent me)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent me)
Specified by:
mouseReleased in interface java.awt.event.MouseListener