Class PopupCondChooser

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

public class PopupCondChooser
extends java.awt.Frame
implements java.awt.event.ActionListener, java.awt.event.WindowListener, java.awt.event.ItemListener

Class PopupCondChooser - GUI to allow users to associate conditions with samples, define parameters of conditions and save within MAExplorer to be used in reports/plots etc. This lets the user create, and edit conditions and properties. A condition is an ordered list of HP samples with associated properties. The properties are shared across all conditions but each condition has a different set of values.

 Description:
 The user is given a list of condition names. They then select one which causes
 the listed sample data for that condition to be displayed in the 
 REMAINDER and SELECTED scrollable lists that are assigned to the 
 PopupCondChooserGUI (upper part of the window). The REMAINDER list of samples
 is the list of all HP samples less the SELECTED samples.

 Each condition has a corresponding (right & left) list of parameters which
 are placed into the  * NAME and VALUE paired entries in a scroll pane in the
 lower right.

 Saving a condition, copies the SELECTED samples to the named condition list
 using the mjaCondition methods. It also saves the associated parameter
 (name[],value[]) list for that condition using the mjaCondition methods.

 New conditions may be defined and the SELECTED list is set to empty and the
 associated parameter lists are set to empty.

 New parameters may be defined and are added to the end of the list. Since ALL
 conditions, use the same list of parameter names, then ALL condition parameter
 lists must be extended and saved when the conditions are saved.

 Condition Parameter data is read in (UserStata.java) or uses default values.

 It contains the following classes:
 1. CondData contains the active remainder and selected samples data for
    a condition instance.
 2. CondParamEditForm creates a ScrollPane of the (name,value) parameters
    for the condition instance.
 3. CondDialogBox is a dialog box with with two buttons yesMsg and noMsg that 
    will return true or false when pressed.
 4. PopupTextField is a simple "editor" for adding a string value. 

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/02/20 21:34:57 $ $Revision: $
Author:
G. Thornwall (SAIC), P. Lemkin (NCI), NCI-Frederick, Frederick, MD
See Also:
MAExplorer Home, Serialized Form

Inner Class Summary
(package private)  class PopupCondChooser.ChoiceList
          Class ChoiceList Allows user to pick an item in a list of items
(package private)  class PopupCondChooser.CondData
          Class CondData contains the active remainder and selected samples data for a condition instance.
(package private)  class PopupCondChooser.CondDialogBox
          Class CondDialogBox is a dialog box with with two buttons yesMsg and noMsg that will return true or false when pressed.
(package private)  class PopupCondChooser.CondParamEditForm
          Class CondParamEditForm creates a ScrollPane of the (name,value) parameters for the current condition instance.
(package private)  class PopupCondChooser.PopupTextField
          Class PopupTextField is a simple "editor" for entering a string value.
 
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
private  java.awt.Button addCondButton
          Add condition
private  java.awt.Button addParamButton
          add condition parameter
private  java.lang.String[] allSampleNames
          list of ALL samples in the database
private  java.lang.String banner
          Title banner for the main window
static java.lang.String BANNER
           
private  java.awt.Font buttonFont
          font for buttons
private  java.awt.Button cancelButton
          cancel
private  PopupCondChooser.CondData[] cd
          List [0:maxPossibleCond-1] of working condition data: name, selected and remainder samples, param form (name,value).
private  java.awt.Panel chooserPanel
          Panel for condition data
private  java.awt.TextField condErrorMsgTf
          error msg display
private  java.awt.Font condFont
          font for conditions
private  java.awt.List condList
          The working list of conditions for GUI
private  java.lang.String[] condListNames
          list of condition names
private  java.awt.Panel condPanel
          Panel to hold conditions list (LEFT) and Param Editor (RIGHT)
static boolean CONSOLE_FLAG
           
private  PopupCondChooser.CondParamEditForm cpef
          CondParamEditForm instance
private  java.lang.String curCond
          The current condition name
private  int curCondIdx
          current cond index
private  java.lang.String curCondListName
          show current condition name
private  java.awt.Label curCondNameLabel
          show current condition name
private  java.awt.Color dataBkgrd
          Text data report background color that may be changed
private  java.awt.Color dataColor
          Text data report foreground color that may be changed
private  java.awt.Font dataFont
          font for data used in the Chooser GUI
static java.lang.String DATE
           
static boolean DBUG_FLAG
           
private  java.awt.Button doneButton
          done
static int FATAL_MSG
          Error codes for reportMsg()
private  java.lang.String fontFamily
          Font family from MAExplorer - using mjaProperty.getReportFontFamily()
private  java.awt.Font labelFont
          font for labels
private  java.awt.Button listAllCondButton
          list all condition
private  java.awt.Button listCondButton
          list condition
static int LOG_MSG
          Error codes for reportMsg()
private  int maxNbrSamples
          Maximum # of samples currently in the database.
private static int maxPossibleCond
          maximum possible number of conditions
private static int maxPossibleCondParam
          maximum possible number of Condition parameters
static int maxPossibleSamples
          maximum possible number of hybridized saaples expected
static int MIN_WINDOW_HEIGHT
           
static int MIN_WINDOW_WIDTH
          MIN size of scrollable Canvas
private  MJAcondition mjaCondition
          MaeJavaAPI classes
private  MJAfilter mjaFilter
           
private  MJAproperty mjaProperty
           
private  MJAreport mjaReport
           
private  MJAsample mjaSample
           
private  MJAutil mjaUtil
           
private  java.awt.Color msgBkgrd
          Text message background color that may be changed
private  java.awt.Color msgColor
          Text message foreground color that may be changed
private  java.awt.Font msgFont
          font for title at the top of the main window
private  java.awt.TextField msgTF
          Text message report line
private  int nbrCondLists
          number of condition lists
private  int nbrParams
          # of condition parameters
static boolean NEVER
           
private static PopupCondChooser oldPCC
          previous instance if not null so can close it before starting new instance.
private  PopupCondChooserGUI oldPccgSample
          previous chooser GUI for sample data
private  java.awt.Font paramFont
          font for parameter Name and Value
private  java.lang.String[] paramNames
          list [0:nbrCondLists-1] of condition parameter names for CondParamEditForm.
private  int pccgHeight
          size for PopupCondChooserGUI
private  PopupCondChooserGUI pccgSample
          chooser GUI for sample data
private  int pccgWidth
          size for PopupCondChooserGUI
private  java.awt.TextField pccMsgTxtField1
          msg display 1
private  java.awt.TextField pccMsgTxtField2
          msg display 2
private  java.awt.TextField pccMsgTxtField3
          msg display 3
private  int preferredHeight
          preferred height size of frame
private  int preferredWidth
          preferred width size of frame
private  int prevCPEFidx
          previous CondParamEditForm index
private  java.awt.Button removeCondButton
          remove condition
private  java.lang.String[] remSamplesTmp
          remaining sample names of condition before edit
private  java.lang.String remTitle
          title of remainder samples TextArea for PopupCondChooserGUI
static java.lang.String REVISION
           
private  java.awt.Button rmvParamButton
          remove condition parameter
private  java.awt.Button saveButton
          save
private  boolean saveFlag
          see if saved ok
private  boolean saveReportAsTextFileFlag
          Flag enabled if doing "SaveAs"
private  java.lang.String[] selSamplesTmp
          selected sample names of condition before edit
private  java.lang.String selTitle
          title of selected samples TextArea for PopupCondChooserGUI
private  java.awt.Font titleFont
          font for labels
private  boolean valueChangedFlag
          if something is changed, need to save it so keep track
static java.lang.String VERSION
           
static int WARNING_MSG
          Error codes for reportMsg()
 
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, title, 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
PopupCondChooser(MaeJavaAPI mja, PopupCondChooser oldPCC)
          PopupCondChooser() - Constructor
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          actionPerformed() - Handle Control panel button clicks
private  void addAllSamplesForCond(java.lang.String cond, int newCurIndex)
          addAllSamplesForCond() - Place samples data associated with new condition into ChooserGUI.
private  void addNewCondition()
          addNewCondition() - add new condition to local chooser database and leave it as the selected condition
 void addNewParameter()
          addNewParameter() - add a new parameter locally.
 void buildGUI()
          buildGUI() - build the graphical user interface for PopupCondChooser.
private  java.lang.String[] calcRemSamples(java.lang.String condListName, int curIndex)
          calcRemSamples() - compute remainder list of sample names (R = DB - Ci) where DB is all of the samples in the database, and Ci are the samples in condition Ci.
(package private)  void clearInfo()
          clearInfo() - clear info for the 3 msg areas in the PopupCondChooser
 void close()
          close() - close this popup
(package private)  int getCondIdxFromName(java.lang.String condName)
          getCondIdxFromName() - Look up and return index of current cond.
(package private)  java.lang.String getCondNameFromIdx(int condIdx)
          getCondNameFromIdx() - Look up and return name of current ocl.
private  java.lang.String[] getRemSamplesData(int index)
          getRemSamplesData() - get remainder data, locally.
private  java.lang.String[] getRemSamplesDataFromChooserGUI(int index)
          getRemSamplesDataFromChooserGUI() - get remainder data from chooserGUI
private  int getSampleNbrBySampleName(java.lang.String sampleName)
          getSampleNbrBySampleName() - lookup the sample # by its name
private  java.lang.String[] getSelSamplesData(int index)
          getSelSamplesData() - get Select data, locally.
private  java.lang.String[] getSelSamplesDataFromChooserGUI(int index)
          getSelSamplesDataFromChooserGUI() - get selected data from chooserGUI
 boolean handleEvent(java.awt.Event evt)
          handleEvent() - process special events
(package private)  void initData()
          initData() - initialize the database.
 void itemStateChanged(java.awt.event.ItemEvent ie)
          itemStateChanged() - user clicked on condtion in the condition list, must change CondParamEditForm data, remainder and selected data, save condForm data.
 void paint(java.awt.Graphics g)
          paint() - repaint full scrolled text area.
 void removeConditionLocally()
          removeConditionLocally() - remove user specified condition locally.
 void removeLocalParameter()
          removeLocalParameter() - remove parameter locally for all conditions
private  void saveAllCondsToMaeState()
          saveAllCondsToMaeState() - save all conditions to MAExplorer state
private  boolean saveCondState(PopupCondChooser.CondData[] cdList, int nCondLists)
          saveCondState() - saves all condition sample and param (N,V) data to MAE via MJAcondition.
 void setupCondData()
          setupCondData() - get remainder and selected condition data, & parameters from MJA (indirectly from mae) and set up the cd[] array of conditions data.
 void update(java.awt.Graphics g)
          update() - update window
 void updateCurGene(int mid)
          updateCurGene() - update any data since current gene has changed.
 void updateFilter()
          updateFilter() - update any dependent data since Filter has changed.
(package private)  void updateInfo(java.lang.String sampleName)
          updateInfo() - update the info text fields for selected HP.
 void updateLabels()
          updateLabels() - update any dependent data since global labels have changed.
 void updateSlider()
          updateSlider() - update any dependent data sincea threshold slider has changed.
 void windowActivated(java.awt.event.WindowEvent e)
           
 void windowClosed(java.awt.event.WindowEvent e)
           
 void windowClosing(java.awt.event.WindowEvent e)
          windowClosing() - close down the window.
 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, paintComponents, paintHeavyweightComponents, postsOldMouseEvents, preferredSize, print, printComponents, printHeavyweightComponents, processContainerEvent, proxyEnableEvents, proxyRequestFocus, remove, remove, removeAll, removeContainerListener, setFont, setLayout, 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, 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

DBUG_FLAG

public static final boolean DBUG_FLAG

DATE

public static final java.lang.String DATE

REVISION

public static final java.lang.String REVISION

VERSION

public static final java.lang.String VERSION

BANNER

public static final java.lang.String BANNER

CONSOLE_FLAG

public static final boolean CONSOLE_FLAG

NEVER

public static final boolean NEVER

FATAL_MSG

public static final int FATAL_MSG
Error codes for reportMsg()

WARNING_MSG

public static final int WARNING_MSG
Error codes for reportMsg()

LOG_MSG

public static final int LOG_MSG
Error codes for reportMsg()

MIN_WINDOW_WIDTH

public static final int MIN_WINDOW_WIDTH
MIN size of scrollable Canvas

MIN_WINDOW_HEIGHT

public static final int MIN_WINDOW_HEIGHT

maxPossibleCond

private static int maxPossibleCond
maximum possible number of conditions

maxPossibleCondParam

private static int maxPossibleCondParam
maximum possible number of Condition parameters

maxPossibleSamples

public static int maxPossibleSamples
maximum possible number of hybridized saaples expected

oldPCC

private static PopupCondChooser oldPCC
previous instance if not null so can close it before starting new instance.

mjaCondition

private MJAcondition mjaCondition
MaeJavaAPI classes

mjaFilter

private MJAfilter mjaFilter

mjaProperty

private MJAproperty mjaProperty

mjaReport

private MJAreport mjaReport

mjaUtil

private MJAutil mjaUtil

mjaSample

private MJAsample mjaSample

addCondButton

private java.awt.Button addCondButton
Add condition

removeCondButton

private java.awt.Button removeCondButton
remove condition

listCondButton

private java.awt.Button listCondButton
list condition

listAllCondButton

private java.awt.Button listAllCondButton
list all condition

addParamButton

private java.awt.Button addParamButton
add condition parameter

rmvParamButton

private java.awt.Button rmvParamButton
remove condition parameter

saveButton

private java.awt.Button saveButton
save

doneButton

private java.awt.Button doneButton
done

cancelButton

private java.awt.Button cancelButton
cancel

pccgWidth

private int pccgWidth
size for PopupCondChooserGUI

pccgHeight

private int pccgHeight
size for PopupCondChooserGUI

preferredHeight

private int preferredHeight
preferred height size of frame

preferredWidth

private int preferredWidth
preferred width size of frame

fontFamily

private java.lang.String fontFamily
Font family from MAExplorer - using mjaProperty.getReportFontFamily()

dataFont

private java.awt.Font dataFont
font for data used in the Chooser GUI

buttonFont

private java.awt.Font buttonFont
font for buttons

labelFont

private java.awt.Font labelFont
font for labels

titleFont

private java.awt.Font titleFont
font for labels

msgFont

private java.awt.Font msgFont
font for title at the top of the main window

paramFont

private java.awt.Font paramFont
font for parameter Name and Value

condFont

private java.awt.Font condFont
font for conditions

msgTF

private java.awt.TextField msgTF
Text message report line

msgColor

private java.awt.Color msgColor
Text message foreground color that may be changed

msgBkgrd

private java.awt.Color msgBkgrd
Text message background color that may be changed

dataColor

private java.awt.Color dataColor
Text data report foreground color that may be changed

dataBkgrd

private java.awt.Color dataBkgrd
Text data report background color that may be changed

condList

private java.awt.List condList
The working list of conditions for GUI

chooserPanel

private java.awt.Panel chooserPanel
Panel for condition data

condPanel

private java.awt.Panel condPanel
Panel to hold conditions list (LEFT) and Param Editor (RIGHT)

pccMsgTxtField1

private java.awt.TextField pccMsgTxtField1
msg display 1

pccMsgTxtField2

private java.awt.TextField pccMsgTxtField2
msg display 2

pccMsgTxtField3

private java.awt.TextField pccMsgTxtField3
msg display 3

condErrorMsgTf

private java.awt.TextField condErrorMsgTf
error msg display

banner

private java.lang.String banner
Title banner for the main window

cd

private PopupCondChooser.CondData[] cd
List [0:maxPossibleCond-1] of working condition data: name, selected and remainder samples, param form (name,value).

nbrCondLists

private int nbrCondLists
number of condition lists

cpef

private PopupCondChooser.CondParamEditForm cpef
CondParamEditForm instance

curCond

private java.lang.String curCond
The current condition name

paramNames

private java.lang.String[] paramNames
list [0:nbrCondLists-1] of condition parameter names for CondParamEditForm.

nbrParams

private int nbrParams
# of condition parameters

saveReportAsTextFileFlag

private boolean saveReportAsTextFileFlag
Flag enabled if doing "SaveAs"

saveFlag

private boolean saveFlag
see if saved ok

valueChangedFlag

private boolean valueChangedFlag
if something is changed, need to save it so keep track

remTitle

private java.lang.String remTitle
title of remainder samples TextArea for PopupCondChooserGUI

selTitle

private java.lang.String selTitle
title of selected samples TextArea for PopupCondChooserGUI

prevCPEFidx

private int prevCPEFidx
previous CondParamEditForm index

curCondIdx

private int curCondIdx
current cond index

condListNames

private java.lang.String[] condListNames
list of condition names

curCondNameLabel

private java.awt.Label curCondNameLabel
show current condition name

curCondListName

private java.lang.String curCondListName
show current condition name

maxNbrSamples

private int maxNbrSamples
Maximum # of samples currently in the database. This is the largest size (in # samples) a condition list can be.

allSampleNames

private java.lang.String[] allSampleNames
list of ALL samples in the database

remSamplesTmp

private java.lang.String[] remSamplesTmp
remaining sample names of condition before edit

selSamplesTmp

private java.lang.String[] selSamplesTmp
selected sample names of condition before edit

pccgSample

private PopupCondChooserGUI pccgSample
chooser GUI for sample data

oldPccgSample

private PopupCondChooserGUI oldPccgSample
previous chooser GUI for sample data
Constructor Detail

PopupCondChooser

public PopupCondChooser(MaeJavaAPI mja,
                        PopupCondChooser oldPCC)
PopupCondChooser() - Constructor
Parameters:
mja - interface with MAExplorer via API.
oldPCC - is previous instance if not null
See Also:
initDataAndGUI
Method Detail

initData

void initData()
initData() - initialize the database.
See Also:
MJAcondition.getCondListsNames(), MJAcondition.getCondListsSizes(), MJAcondition.getMaxCondListSize(), MJAcondition.getNbrCondLists(), buildGUI, PopupCondChooser.CondParamEditForm, setupCondData

setupCondData

public void setupCondData()
setupCondData() - get remainder and selected condition data, & parameters from MJA (indirectly from mae) and set up the cd[] array of conditions data.
See Also:
buildGUI(), s@ee MJAcondition#getCondParamValues, MJAcondition.getSampleNamesInCondList(java.lang.String), MJAcondition.getNbrCondLists(), calcRemSamples, PopupCondChooser.CondData, PopupCondChooser.CondParamEditForm

calcRemSamples

private java.lang.String[] calcRemSamples(java.lang.String condListName,
                                          int curIndex)
calcRemSamples() - compute remainder list of sample names (R = DB - Ci) where DB is all of the samples in the database, and Ci are the samples in condition Ci.
Parameters:
condListName - is the condition list Ci name
curIndex - is the index of the current condition to use if not -1
Returns:
list of remainder sample names, else null if failed.
See Also:
MJAcondition.getSampleNamesInCondList(java.lang.String)

buildGUI

public void buildGUI()
buildGUI() - build the graphical user interface for PopupCondChooser.
See Also:
MJAcondition#PopupCondChooserGUI, getCondIdxFromName(java.lang.String), MJAcondition.getCondListsNames(), MJAcondition.getCurCondition(), MJAcondition.getMaxCondListSize(), MJAcondition.getNbrCondLists(), MJAcondition.getSampleNamesInCondList(java.lang.String), buildPopupCondChooserGUI, PopupCondChooser.CondParamEditForm

addAllSamplesForCond

private void addAllSamplesForCond(java.lang.String cond,
                                  int newCurIndex)
addAllSamplesForCond() - Place samples data associated with new condition into ChooserGUI. Save old samples data, remove samples data and then add new data.
Parameters:
cond - Condition set to add samples
newCurIndex - index for data
See Also:
PopupCondChooserGUI.buildPopupCondChooserGUI(), MJAcondition.getAllSampleNamesInDB(), getRemSamplesData, getSelSamplesData, PopupCondChooserGUI

getRemSamplesDataFromChooserGUI

private java.lang.String[] getRemSamplesDataFromChooserGUI(int index)
getRemSamplesDataFromChooserGUI() - get remainder data from chooserGUI
Parameters:
index - which
Returns:
list of remainder data

getSelSamplesDataFromChooserGUI

private java.lang.String[] getSelSamplesDataFromChooserGUI(int index)
getSelSamplesDataFromChooserGUI() - get selected data from chooserGUI
Parameters:
index - which condition index
Returns:
list of selected data

getSelSamplesData

private java.lang.String[] getSelSamplesData(int index)
getSelSamplesData() - get Select data, locally.
Parameters:
index - which condition index
Returns:
list of selected data

getRemSamplesData

private java.lang.String[] getRemSamplesData(int index)
getRemSamplesData() - get remainder data, locally.
Parameters:
index - which condition index
Returns:
list of remainder data

getCondIdxFromName

int getCondIdxFromName(java.lang.String condName)
getCondIdxFromName() - Look up and return index of current cond.
Parameters:
condName - name of condition list
Returns:
index or -1 for none.

getCondNameFromIdx

java.lang.String getCondNameFromIdx(int condIdx)
getCondNameFromIdx() - Look up and return name of current ocl.
Parameters:
oclIdx - of ordered condition list
Returns:
name or null for none.

paint

public void paint(java.awt.Graphics g)
paint() - repaint full scrolled text area.
Overrides:
paint in class java.awt.Container

update

public void update(java.awt.Graphics g)
update() - update window
Overrides:
update in class java.awt.Container
Parameters:
g - is graphics context

getSampleNbrBySampleName

private int getSampleNbrBySampleName(java.lang.String sampleName)
getSampleNbrBySampleName() - lookup the sample # by its name
Parameters:
sampleName - is the sample number tolookup
Returns:
the index if found, else return -1

updateInfo

void updateInfo(java.lang.String sampleName)
updateInfo() - update the info text fields for selected HP. If the sample does not exist in the database, then it is a NO-OP.
Parameters:
sampleName - is the sample number to be displayed
See Also:
Component.repaint()

saveAllCondsToMaeState

private void saveAllCondsToMaeState()
saveAllCondsToMaeState() - save all conditions to MAExplorer state

addNewCondition

private void addNewCondition()
addNewCondition() - add new condition to local chooser database and leave it as the selected condition

removeConditionLocally

public void removeConditionLocally()
removeConditionLocally() - remove user specified condition locally.
See Also:
getCondNameFromIdx(int), MJAcondition.setCurCondition(java.lang.String)

addNewParameter

public void addNewParameter()
addNewParameter() - add a new parameter locally. Popup window for new condition parameter name.

removeLocalParameter

public void removeLocalParameter()
removeLocalParameter() - remove parameter locally for all conditions

clearInfo

void clearInfo()
clearInfo() - clear info for the 3 msg areas in the PopupCondChooser

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent ie)
itemStateChanged() - user clicked on condtion in the condition list, must change CondParamEditForm data, remainder and selected data, save condForm data.
Specified by:
itemStateChanged in interface java.awt.event.ItemListener
Parameters:
ie - ItemEvent
See Also:
addAllSamplesForCond, PopupCondChooser.CondParamEditForm.saveData()

handleEvent

public boolean handleEvent(java.awt.Event evt)
handleEvent() - process special events
Overrides:
handleEvent in class java.awt.Component
Parameters:
evt - is special events

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed() - Handle Control panel button clicks
Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - is ActionEvent

saveCondState

private boolean saveCondState(PopupCondChooser.CondData[] cdList,
                              int nCondLists)
saveCondState() - saves all condition sample and param (N,V) data to MAE via MJAcondition. This replaces the old MAExplorer condition lists with the new ones.
Parameters:
cdList - is list of all conditions
condLen - size of cdList
See Also:
MJAcondition.createNewCondList(java.lang.String), MJAcondition.setCondParamNames(java.lang.String[]), MJAcondition.setCondParamValue(java.lang.String, java.lang.String[]), MJAcondition.setSamplesInCondList(java.lang.String, java.lang.String[], int)

close

public void close()
close() - close this popup

windowClosing

public void windowClosing(java.awt.event.WindowEvent e)
windowClosing() - close down the window.
Specified by:
windowClosing in interface java.awt.event.WindowListener
Parameters:
e - Window Event

windowOpened

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

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

updateCurGene

public void updateCurGene(int mid)
updateCurGene() - update any data since current gene has changed. This is invoked from the PopupRegistry
Parameters:
mid - is the MID (Master Gene ID) that is the new current gene.

updateFilter

public void updateFilter()
updateFilter() - update any dependent data since Filter has changed. This is invoked from the PopupRegistry

updateSlider

public void updateSlider()
updateSlider() - update any dependent data sincea threshold slider has changed. This is invoked from the PopupRegistry.

updateLabels

public void updateLabels()
updateLabels() - update any dependent data since global labels have changed. This is invoked from the PopupRegistry.