Class PopupOrderedCondChooser

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--java.awt.Frame
                          |
                          +--PopupOrderedCondChooser
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 PopupOrderedCondChooser
extends java.awt.Frame
implements java.awt.event.ActionListener, java.awt.event.WindowListener, java.awt.event.ItemListener

Class PopupOrderedCondChooser - GUI to allow users to create Ordered Condition Lists (OCL), assign conditions, define parameters for OCLs and save within MAExplorer to be used in reports/plots etc. This lets the user create, and edit conditions and properties.

 Description:
 The user is given a list of ordered condition list names. They then 
 select one which causes the listed of conditions to be displayed in the 
 REMAINDER and SELECTED scrollable lists that are assigned to the 
 OrderedCondChooserGUI (upper part of the window). The REMAINDER list of 
 conditions is the list of all conditons less the SELECTED conditions.

 Each oredered condition list 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 ordered condition list, copies the SELECTED condtion to the named 
 condition list using the mjaCondition methods. It also saves the associated 
 parameter (name[],value[]) list for that ordered condition list using the 
 mjaCondition methods.

 New ordered condition lists 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  ordered condition lists are saved.

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

 It contains the following classes:
 1. OclListData contains the active remainder and selected condition data for
    a ordered condition list 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/07/17 20:37:13 $ $Revision: 1.9 $
Author:
G. Thornwall (SAIC), P. Lemkin (NCI), NCI-Frederick, Frederick, MD
See Also:
MAExplorer Home, Serialized Form

Inner Class Summary
(package private)  class PopupOrderedCondChooser.ChoiceList
          Class ChoiceList Allows user to pick an item in a list of items
(package private)  class PopupOrderedCondChooser.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 PopupOrderedCondChooser.CondParamEditForm
          Class CondParamEditForm creates a ScrollPane of the (name,value) parameters for the current condition instance.
(package private)  class PopupOrderedCondChooser.OclListData
          Class OclListData contains the active remainder and selected cond data for a ordered condition instance.
private  class PopupOrderedCondChooser.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 addAnnButton
          add annotation
private  java.awt.Button addOCLButton
          add ordered cond list
private  java.lang.String[] allConditionNames
          list of all condition names
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  java.awt.Panel chooserPanel
          Panel for condition data
private  java.awt.TextField condErrorMsgTf
          error msg display
private  java.awt.Font condFont
          font for conditions
static boolean CONSOLE_FLAG
           
private  PopupOrderedCondChooser.CondParamEditForm cpef
          CondParamEditForm instance
private  java.lang.String curCond
          The current condition name that is selected in the lower OCL list
private  int curCondIdx
          current cond index
private  java.lang.String[] curCondNames
          The current condition list of names
private  java.lang.String curOclListName
          show current condition name
private  java.awt.Label curOclNameLabel
          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 listAllButton
          list all ordered cond lists
private  java.awt.Button listOCLButton
          list order cond
static int LOG_MSG
          Error codes for reportMsg()
private  int maxNbrCond
          Maximum # of Conditions currently in the database.
static int maxPossibleConditions
          max possible conditions
private static int maxPossibleOcl
          maximum possible number of Ordered Lists of Conditions
private static int maxPossibleOCLParam
          maximum possible number of OCL parameters
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  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 nbrOclLists
          number of condition lists
private  int nbrParams
          # of condition parameters
static boolean NEVER
           
private  PopupOrderedCondChooser.OclListData[] oclLd
          List [0:maxPossibleCond-1] of working condition data: name, selected and remainder cond, param form (name,value).
private  java.awt.List oclList
          The working list of conditions for GUI
private  java.awt.Panel oclPanel
          Panel to hold conditions list (LEFT) and Param Editor (RIGHT)
private static PopupOrderedCondChooser oldOCC
          previous instance if not null so can close it before starting new instance.
private  PopupOrderedCondChooserGUI oldPccg
          previous chooser GUI for cond data
private  java.lang.String[] orderedCondListNames
          list of condition names
private  java.awt.Font paramFont
          font for parameter Name and Value
private  java.lang.String[] paramNames
          list [0:nbrOclLists-1] of condition parameter names for CondParamEditForm.
private  PopupOrderedCondChooserGUI pccg
          Ordered chooser GUI for cond data
private  int pccgHeight
          size for PopupOrderedCondChooserGUI
private  int pccgWidth
          size for PopupOrderedCondChooserGUI
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.lang.String[] remCondTmp
          remaining conditions before edit
private  java.awt.Button removeOCLButton
          remove order cond list
private  java.lang.String remTitle
          title of remainder TextArea for PopupOrderedCondChooserGUI
static java.lang.String REVISION
           
private  java.awt.Button rmvAnnButton
          remove annotation
private  java.awt.Button saveButton
          save to MAExplorer
private  boolean saveFlag
          see if saved ok
private  boolean saveReportAsTextFileFlag
          Flag enabled if doing "SaveAs"
private  java.lang.String[] selCondTmp
          selected conditions before edit
private  java.lang.String selTitle
          title of selected TextArea for PopupOrderedCondChooserGUI
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
PopupOrderedCondChooser(MaeJavaAPI mja, PopupOrderedCondChooser oldPCC)
          PopupOrderedCondChooser() - Constructor
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          actionPerformed() - Handle Control panel button clicks
private  void addAllCondForOCL(java.lang.String cond, int newCurIndex)
          addAllCondForOCL() - Place cond data associated with new ordered condition list 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 PopupOrderedCondChooser.
private  java.lang.String[] calcRemCond(java.lang.String condListName, int curIndex)
          calcRemCond() - compute remainder list of condition names (R = DB - Ci) where DB is all of the Conds in the database, and Ci are the Conds in condition Ci.
(package private)  void clearInfo()
          clearInfo() - clear info for the 3 msg areas in the PopupOrderedCondChooser
 void close()
          close() - close this popup
(package private)  int getOCLidxFromName(java.lang.String oclName)
          getOCLidxFromName() - Look up and return index of current ocl.
(package private)  java.lang.String getOCLnameFromIdx(int oclIdx)
          getOCLnameFromIdx() - Look up and return name of current ocl.
private  java.lang.String[] getRemCondData(int index)
          getRemCondData() - get remainder data, locally.
private  java.lang.String[] getRemCondDataFromChooserGUI(int index)
          getRemCondDataFromChooserGUI() - get remainder data from chooserGUI
private  java.lang.String[] getSelCondData(int index)
          getSelCondData() - get Select data, locally.
private  java.lang.String[] getSelCondDataFromChooserGUI(int index)
          getSelCondDataFromChooserGUI() - 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 ocl 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 removeLocalParameter()
          removeLocalParameter() - remove parameter locally for all conditions
 void removeOCLLocally()
          removeOCLLocally() - remove user specified condition locally.
private  void saveAllCondsToMaeState()
          saveAllCondsToMaeState() - save all conditions to MAExplorer state
private  boolean saveCondState(PopupOrderedCondChooser.OclListData[] oclLdList, int nCondLists)
          saveCondState() - saves all conditions and ocl 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 oclLd[] array of ordered condition 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 condName)
          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

maxPossibleOcl

private static int maxPossibleOcl
maximum possible number of Ordered Lists of Conditions

maxPossibleOCLParam

private static int maxPossibleOCLParam
maximum possible number of OCL parameters

maxPossibleConditions

public static int maxPossibleConditions
max possible conditions

oldOCC

private static PopupOrderedCondChooser oldOCC
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

addOCLButton

private java.awt.Button addOCLButton
add ordered cond list

removeOCLButton

private java.awt.Button removeOCLButton
remove order cond list

listOCLButton

private java.awt.Button listOCLButton
list order cond

listAllButton

private java.awt.Button listAllButton
list all ordered cond lists

addAnnButton

private java.awt.Button addAnnButton
add annotation

rmvAnnButton

private java.awt.Button rmvAnnButton
remove annotation

saveButton

private java.awt.Button saveButton
save to MAExplorer

doneButton

private java.awt.Button doneButton
done

cancelButton

private java.awt.Button cancelButton
cancel

pccgWidth

private int pccgWidth
size for PopupOrderedCondChooserGUI

pccgHeight

private int pccgHeight
size for PopupOrderedCondChooserGUI

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

oclList

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

chooserPanel

private java.awt.Panel chooserPanel
Panel for condition data

oclPanel

private java.awt.Panel oclPanel
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

oclLd

private PopupOrderedCondChooser.OclListData[] oclLd
List [0:maxPossibleCond-1] of working condition data: name, selected and remainder cond, param form (name,value).

nbrOclLists

private int nbrOclLists
number of condition lists

cpef

private PopupOrderedCondChooser.CondParamEditForm cpef
CondParamEditForm instance

curCond

private java.lang.String curCond
The current condition name that is selected in the lower OCL list

curCondNames

private java.lang.String[] curCondNames
The current condition list of names

paramNames

private java.lang.String[] paramNames
list [0:nbrOclLists-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 TextArea for PopupOrderedCondChooserGUI

selTitle

private java.lang.String selTitle
title of selected TextArea for PopupOrderedCondChooserGUI

prevCPEFidx

private int prevCPEFidx
previous CondParamEditForm index

curCondIdx

private int curCondIdx
current cond index

allConditionNames

private java.lang.String[] allConditionNames
list of all condition names

orderedCondListNames

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

curOclNameLabel

private java.awt.Label curOclNameLabel
show current condition name

curOclListName

private java.lang.String curOclListName
show current condition name

maxNbrCond

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

remCondTmp

private java.lang.String[] remCondTmp
remaining conditions before edit

selCondTmp

private java.lang.String[] selCondTmp
selected conditions before edit

pccg

private PopupOrderedCondChooserGUI pccg
Ordered chooser GUI for cond data

oldPccg

private PopupOrderedCondChooserGUI oldPccg
previous chooser GUI for cond data
Constructor Detail

PopupOrderedCondChooser

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

initData

void initData()
initData() - initialize the database.
See Also:
getOCLidxFromName(java.lang.String), MJAcondition.getAllCondNames(), MJAcondition.getCurOCL(), MJAcondition.getMaxCondListSize(), MJAcondition.getMaxOrderedCondListSize(), MJAcondition.getNbrOrderedCondLists(), MJAcondition.getOrderedCondListsNames(), MJAcondition.getOrderedCondParamNames(), setupCondData()

setupCondData

public void setupCondData()
setupCondData() - get remainder and selected condition data, & parameters from MJA (indirectly from mae) and set up the oclLd[] array of ordered condition data.
See Also:
MJAcondition.getOrderedCondNamesInCondList(java.lang.String), MJAcondition#getOrederedCondParamValues, calcRemCond(java.lang.String, int), PopupOrderedCondChooser.OclListData, PopupOrderedCondChooser.CondParamEditForm

calcRemCond

private java.lang.String[] calcRemCond(java.lang.String condListName,
                                       int curIndex)
calcRemCond() - compute remainder list of condition names (R = DB - Ci) where DB is all of the Conds in the database, and Ci are the Conds 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 cond names, else null if failed.
See Also:
MJAcondition.getOrderedCondNamesInCondList(java.lang.String)

buildGUI

public void buildGUI()
buildGUI() - build the graphical user interface for PopupOrderedCondChooser.
See Also:
MJAcondition#PopupOrderedCondChooserGUI, MJAcondition#CondParamEditForm, MJAproperty.getReportFontFamily(), PopupOrderedCondChooserGUI.buildPopupOrderedCondChooserGUI(), PopupOrderedCondChooserGUI.setListData(int, int, int, int, java.lang.String[], java.lang.String[]), PopupOrderedCondChooser.CondParamEditForm

addAllCondForOCL

private void addAllCondForOCL(java.lang.String cond,
                              int newCurIndex)
addAllCondForOCL() - Place cond data associated with new ordered condition list into ChooserGUI. Save old cond data, remove cond data and then add new data.
Parameters:
cond - ordered Condition list set to add conditions
newCurIndex - index for data
See Also:
getRemCondData, getSelCondData, MJAcondition.getAllCondNames(), PopupOrderedCondChooserGUI, PopupOrderedCondChooserGUI.buildPopupOrderedCondChooserGUI(), PopupOrderedCondChooserGUI.setListData(int, int, int, int, java.lang.String[], java.lang.String[])

getOCLidxFromName

int getOCLidxFromName(java.lang.String oclName)
getOCLidxFromName() - Look up and return index of current ocl.
Parameters:
oclName - name of ordered condition list
Returns:
index or -1 for none.

getOCLnameFromIdx

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

getRemCondDataFromChooserGUI

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

getSelCondDataFromChooserGUI

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

getSelCondData

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

getRemCondData

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

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

updateInfo

void updateInfo(java.lang.String condName)
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
See Also:
saveCondState(PopupOrderedCondChooser.OclListData[], int)

addNewCondition

private void addNewCondition()
addNewCondition() - add new condition to local chooser database and leave it as the selected condition
See Also:
addAllCondForOCL(java.lang.String, int), PopupOrderedCondChooser.CondParamEditForm, MJAcondition.createNewNamedOrderedCondList(java.lang.String), MJAutil.showMsg1(java.lang.String), PopupOrderedCondChooser.OclListData

removeOCLLocally

public void removeOCLLocally()
removeOCLLocally() - remove user specified condition locally.
See Also:
PopupOrderedCondChooser.CondParamEditForm, PopupOrderedCondChooser.ChoiceList, getOCLnameFromIdx(int), MJAcondtion#setCurOCL

addNewParameter

public void addNewParameter()
addNewParameter() - add a new parameter locally. Popup window for new condition parameter name.
See Also:
PopupOrderedCondChooser.CondParamEditForm.saveData(), PopupOrderedCondChooser.CondParamEditForm, PopupOrderedCondChooser.PopupTextField

removeLocalParameter

public void removeLocalParameter()
removeLocalParameter() - remove parameter locally for all conditions
See Also:
PopupOrderedCondChooser.ChoiceList, PopupOrderedCondChooser.CondParamEditForm.saveData(), PopupOrderedCondChooser.CondParamEditForm, PopupOrderedCondChooser.PopupTextField, PopupOrderedCondChooser.OclListData

clearInfo

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

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent ie)
itemStateChanged() - user clicked on condtion in the ocl 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:
#addAllCondForOcl, PopupOrderedCondChooser.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
See Also:
addNewCondition(), addNewParameter(), PopupOrderedCondChooser.CondDialogBox, MJACondition#popupListOCLReport, removeLocalParameter(), removeOCLLocally(), saveAllCondsToMaeState()

saveCondState

private boolean saveCondState(PopupOrderedCondChooser.OclListData[] oclLdList,
                              int nCondLists)
saveCondState() - saves all conditions and ocl param (N,V) data to MAE via MJAcondition. This replaces the old MAExplorer condition lists with the new ones.
Parameters:
oclLdList - is list of all conditions
condLen - size of oclLdList
See Also:
MJAcondition.createNewCondList(java.lang.String), MJAcondition.getNbrOrderedCondLists(), MJAcondition.getOrderedCondListsNames(), MJAcondition#sOrderedCondList, MJAcondition.removeNamedOrderedCondList(java.lang.String), MJAcondition.setCondParamNames(java.lang.String[]), MJAcondition.setOclParamValue(java.lang.String, java.lang.String[]), MJAcondition.setCondInOrderedCondList(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
See Also:
PopupOrderedCondChooser.CondDialogBox, saveCondState(PopupOrderedCondChooser.OclListData[], int)

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.