Class FieldMapGUI

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--java.awt.Frame
                          |
                          +--FieldMapGUI
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.awt.event.MouseListener, java.io.Serializable, java.awt.event.WindowListener

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

GUI wizard for chooser data for FieldMap for GIPO and Quant data field name mapping.

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.

Version:
$Date: 2002/10/14 19:22:30 $ $Revision: 1.7 $
Author:
P. Lemkin (NCI), G. Thornwall (SAIC), B. Stephens(SAIC), NCI-Frederick, Frederick, MD
See Also:
MAExplorer Home, Serialized Form

Inner Class Summary
(package private)  class FieldMapGUI.PopupFieldMapDialog
          This class displays a dialog window containing 2 buttons yes and no to pass the infomormation on - chk flag for what user clicked on no= false; yes= true.
 
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.Panel buttonPanel
          buttons at bottom
private  java.awt.Button cancelButton
          close window & return without data
private  java.awt.Panel centerPanel
          main panel
private  java.awt.Panel choicePanel
          choice lists go here
private  Cvt2Mae cvt
          global links
 boolean dataReadyFlag
          Data that is read when it is ready
 boolean dectectionValueFlag
           
private  java.awt.Button doneButton
          close window & return with data
private  java.awt.Checkbox duplicateChkBox
          for toggle allowing duplicate fields
 boolean duplicateFlag
          duplicate fields flag
private  java.awt.Choice[] fieldChoiceList
          actual Choice list
private  int fieldChoiceListIndex
          choice list is diff size
private  java.lang.String[] fieldChoiceStr
          str to create choice list
private  int fieldIndex
          num of labels & # of choice lists
private  java.awt.Label[] fieldLabelList
          actual label list
private  java.lang.String[] fieldLabelStr
          str to create label list
private  java.awt.Panel fieldsLabelPanel
          labels go here
private  int frameHeight
          frame window size
private  int frameWidth
          frame window size
private  java.awt.Button helpButton
          popup a help window [TODO]
private  java.lang.String helpMsg
          msg display in help window
private  java.awt.Frame helpWindow
          a popup help text window
private  boolean isWinPCflag
          os type flag
private  java.awt.Font labelFont
          main font for labels & choice lists
private  java.lang.String LABELFONT
          font type for labels
private  java.awt.Panel leftPanel
          space on left
 java.lang.String mainTitleStr
          title
private  int MOUSEOVER_FONT_SIZE
          font size of muose over
private  java.awt.Color mouseoverColor
          backgrd color for mouse over
private  java.awt.Font mouseOverFont
          mouseover font
private  java.lang.String MOUSEOVERFONT
          font type for mouseover
private  java.lang.String[] mouseoverList
          holds current mouseover data
private  java.awt.Window mouseoverWindow
          window for mouseover popup
 int numFieldChoiceSelected
          number of FieldChoice selected
private  int[] pickedIndex
          track picked choices, stops duplicates
 int remapMode
          the table we are remaping label name into MAE variable
private  java.awt.Panel rightPanel
          space on rt
 java.lang.String[] rtnDataList
          RETURN data here
private  SetupLayouts sul
          Global setup layouts DB
private  java.awt.TextArea ta
          mouseover TextArea
private  int TA_COLS
          size of mouseover TextArea
private  int TA_ROWS
          size of mouseover TextArea
private  java.awt.Label titleLabel
          main title
private  java.awt.Panel titlePanel
          holds title label
private  java.lang.String unusedStr
          string selected if unused
 
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
FieldMapGUI(Cvt2Mae cvt, java.lang.String[] fieldLabelStr, java.lang.String[] fieldChoiceStr, java.lang.String[] mouseoverList, java.lang.String mainTitleStr, java.lang.String helpMsg, java.lang.String unusedStr, int remapMode)
          FieldMapGUI() - Constructor called from within Cvt2Mae with proper lists.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent ae)
          actionPerformed() - button event handler
private  void cancel()
          cancel() - cancel this assignement
 int findFieldChoiceItem(int itemIdx)
          findFieldChoiceItem() - return pickedIndex if itemIdx is found else -1.
private  int findSelectedField(FieldMap fm, java.awt.Choice fieldChoiceList, int i)
          findSelectedField() - find which item was choosen before.
private  int indexToLongestStr(java.lang.String[] str)
          indexToLongestStr() - find max size of str in array and return its array index (location within array).
 void initFieldMapGUI()
          initFieldMapGUI() - initialize GUI list method
 void initFM()
          initFM() - initialize non-GUI objects
private  boolean isIntensityOrBackground(java.lang.String maeStr)
          isIntensityOrBackground() - test if it is a legal intensity or background MAE Quant names.
 void itemStateChanged(java.awt.event.ItemEvent ie)
          itemStateChanged() - event handler for Choice list.
 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)
           
 boolean saveChoiceData(boolean checkAllFlag)
          saveChoiceData() - check to see if ALL choice lists have been picked by user, if ok, then copy to fm.userXXXFields[].
 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 on PC only.
 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

cvt

private Cvt2Mae cvt
global links

sul

private SetupLayouts sul
Global setup layouts DB

TA_ROWS

private final int TA_ROWS
size of mouseover TextArea

TA_COLS

private final int TA_COLS
size of mouseover TextArea

MOUSEOVER_FONT_SIZE

private final int MOUSEOVER_FONT_SIZE
font size of muose over

LABELFONT

private final java.lang.String LABELFONT
font type for labels

MOUSEOVERFONT

private final java.lang.String MOUSEOVERFONT
font type for mouseover

ta

private java.awt.TextArea ta
mouseover TextArea

fieldChoiceList

private java.awt.Choice[] fieldChoiceList
actual Choice list

fieldLabelList

private java.awt.Label[] fieldLabelList
actual label list

titleLabel

private java.awt.Label titleLabel
main title

fieldChoiceStr

private java.lang.String[] fieldChoiceStr
str to create choice list

fieldLabelStr

private java.lang.String[] fieldLabelStr
str to create label list

fieldChoiceListIndex

private int fieldChoiceListIndex
choice list is diff size

fieldIndex

private int fieldIndex
num of labels & # of choice lists

mainTitleStr

public java.lang.String mainTitleStr
title

mouseoverList

private java.lang.String[] mouseoverList
holds current mouseover data

labelFont

private java.awt.Font labelFont
main font for labels & choice lists

mouseOverFont

private java.awt.Font mouseOverFont
mouseover font

cancelButton

private java.awt.Button cancelButton
close window & return without data

helpButton

private java.awt.Button helpButton
popup a help window [TODO]

doneButton

private java.awt.Button doneButton
close window & return with data

titlePanel

private java.awt.Panel titlePanel
holds title label

centerPanel

private java.awt.Panel centerPanel
main panel

rightPanel

private java.awt.Panel rightPanel
space on rt

leftPanel

private java.awt.Panel leftPanel
space on left

buttonPanel

private java.awt.Panel buttonPanel
buttons at bottom

fieldsLabelPanel

private java.awt.Panel fieldsLabelPanel
labels go here

choicePanel

private java.awt.Panel choicePanel
choice lists go here

mouseoverWindow

private java.awt.Window mouseoverWindow
window for mouseover popup

pickedIndex

private int[] pickedIndex
track picked choices, stops duplicates

mouseoverColor

private java.awt.Color mouseoverColor
backgrd color for mouse over

frameHeight

private int frameHeight
frame window size

frameWidth

private int frameWidth
frame window size

helpWindow

private java.awt.Frame helpWindow
a popup help text window

helpMsg

private java.lang.String helpMsg
msg display in help window

isWinPCflag

private boolean isWinPCflag
os type flag

unusedStr

private java.lang.String unusedStr
string selected if unused

duplicateChkBox

private java.awt.Checkbox duplicateChkBox
for toggle allowing duplicate fields

dataReadyFlag

public boolean dataReadyFlag
Data that is read when it is ready

duplicateFlag

public boolean duplicateFlag
duplicate fields flag

dectectionValueFlag

public boolean dectectionValueFlag

numFieldChoiceSelected

public int numFieldChoiceSelected
number of FieldChoice selected

remapMode

public int remapMode
the table we are remaping label name into MAE variable

rtnDataList

public java.lang.String[] rtnDataList
RETURN data here
Constructor Detail

FieldMapGUI

public FieldMapGUI(Cvt2Mae cvt,
                   java.lang.String[] fieldLabelStr,
                   java.lang.String[] fieldChoiceStr,
                   java.lang.String[] mouseoverList,
                   java.lang.String mainTitleStr,
                   java.lang.String helpMsg,
                   java.lang.String unusedStr,
                   int remapMode)
FieldMapGUI() - Constructor called from within Cvt2Mae with proper lists.
Parameters:
cvt - parent
fieldLabelStr - internal MAE field names array
fieldChoiceStr - external user fields to choose from
mouseoverList - display text when mouse ove
mainTitleStr - title of popup Field GUI
helpMsg - elp msg when press HELP button
unusedStr - string selected if unused
remapMode - the table we are remapaing
See Also:
FieldMapGUI.PopupFieldMapDialog, FieldMapGUI.PopupFieldMapDialog.updatePopupFieldMapDialog(java.lang.String), initFM(), initFieldMapGUI()
Method Detail

initFM

public void initFM()
initFM() - initialize non-GUI objects

initFieldMapGUI

public void initFieldMapGUI()
initFieldMapGUI() - initialize GUI list method
See Also:
CvtGUI.chkReanlyzeButtonState(), FieldMap, FieldMap.isDuplicateEntries(java.lang.String)

findSelectedField

private int findSelectedField(FieldMap fm,
                              java.awt.Choice fieldChoiceList,
                              int i)
findSelectedField() - find which item was choosen before.
Parameters:
fm - FieldMap to use
fieldChoiceList - list of fields in choice list
i - index
Returns:
selected item number else -1 if not picked.

indexToLongestStr

private int indexToLongestStr(java.lang.String[] str)
indexToLongestStr() - find max size of str in array and return its array index (location within array).
Parameters:
str - is the String to analyze
Returns:
array index

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent ie)
itemStateChanged() - event handler for Choice list.
Specified by:
itemStateChanged in interface java.awt.event.ItemListener
Parameters:
ie - ItemEvent
See Also:
UtilCM.logMsg(java.lang.String, java.awt.Color), UtilCM.logMsg2(java.lang.String, java.awt.Color), UtilCM.logMsg3(java.lang.String, java.awt.Color)

findFieldChoiceItem

public int findFieldChoiceItem(int itemIdx)
findFieldChoiceItem() - return pickedIndex if itemIdx is found else -1.
Parameters:
itemIdx -  
Returns:
pickedIndex if itemIdx is found else -1 if not found

isIntensityOrBackground

private boolean isIntensityOrBackground(java.lang.String maeStr)
isIntensityOrBackground() - test if it is a legal intensity or background MAE Quant names. This is used in generating field mapes in saveChoiceData() when user defines the intensity mappings.
Parameters:
maeStr - string to search for
Returns:
true if it is one of the legal intensity or background MAE Quant names

saveChoiceData

public boolean saveChoiceData(boolean checkAllFlag)
saveChoiceData() - check to see if ALL choice lists have been picked by user, if ok, then copy to fm.userXXXFields[].
Parameters:
checkAllFlag - to check all choices
Returns:
true if successful
See Also:
FieldMap.addEntry(java.lang.String, java.lang.String, java.lang.String, java.lang.String), CvtGUI.setEditLayoutEditing(boolean)

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent ae)
actionPerformed() - button event handler
Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
ae - ActionEvent
See Also:
FieldMapGUI.PopupFieldMapDialog

cancel

private void cancel()
cancel() - cancel this assignement

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
Parameters:
me - MouseEvent

mouseExited

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

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

windowClosing

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

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