Class ShowStringPopup

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

class ShowStringPopup
extends java.awt.Frame
implements java.awt.event.ActionListener, java.awt.event.WindowListener

The class creates and displays a scrollable string text area in a popup window. Various control buttons are also provided at the bottom of the window that are dependent on the type of text area being displayed.

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 14:53:03 $ $Revision: 1.4 $
Author:
P. Lemkin (NCI), G. Thornwall (SAIC), NCI-Frederick, Frederick, MD
See Also:
MAExplorer Home, Serialized Form

Inner classes inherited from class java.awt.Frame
java.awt.Frame.AccessibleAWTFrame
 
Inner classes inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.AWTTreeLock
 
Field Summary
(package private)  boolean alertOK
          Flag: set true if popupName is "ALERT"
private  java.awt.Button allGenesPlotButton
          multipurpose button that toggles between: "Go 'Cluster gene counts' " for "allGenes" (cluster counts) and "Go 'Cluster single genes'" for "singleGene" (similar genes).
private  java.lang.String defTxtFile
           
private  int fntSize
          font size
private  MAExplorer mae
          link to global MAExplorer nstance
private  MenuBarFrame mbf
          link to global instance
private  int mode
          mode of operation used in creating this window.
private  int nCols
          # of character cols to show
private  int nRows
          # of character rows to show
private static boolean OPTIMIZE_WINDOW_WIDTH
          if optimized window with by shrinking # of buttons/row in controlPanel to OPTIMUM_BUTTONS_PER_ROW
private static int OPTIMUM_BUTTONS_PER_ROW
          if optimize # buttons/row
private  int optReportMode
          Optional Report mode if > 0
(package private)  java.lang.String popupName
          ARG: name for PopupRegistry
(package private)  int popupPropertyBits
          ARG: property bits of window for PopupRegistry
private  java.awt.Button saveAsButton
          "SaveAs" .txt button
(package private)  java.lang.String savedMsg
          message after Saved Txt into file
private  java.awt.TextArea textarea
          Text area GUI for main report
private  java.lang.String textReport
          copy of text in textArea
 
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
(package private) ShowStringPopup(MAExplorer mae, java.lang.String inputStr, int nRows, int nCols, java.lang.String fontSize, java.lang.String title, int optReportMode, int optMode, java.lang.String popupName, int popupPropertyBits, java.lang.String defTxtFile)
          ShowStringPopup() - Constructor.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          actionPerformed() - Handle button clicks
(package private)  void changeGeneButton(java.lang.String newLabel, java.lang.String newCmd, int optReportMode)
          changeGeneButton() - change gene label
(package private)  void close(boolean keepFlags)
          close() - close this popup and reset flags if needed
private  boolean saveAsTxtFile(java.lang.String oTxtFileName)
          saveAsTxtFile() - save textReport data in .txt file oTxtFileName
(package private)  void updateCurGene(int mid)
          updateCurGene() - update string report if current gene changed and this type of string report requires it.
(package private)  void updateFilter(GeneList ml)
          updateFilter() - update string report if Filter changed and this type of string report requires it.
(package private)  void updateLabels()
          updateLabels() - update string report if labels changed and this type of string report requires it.
(package private)  void updateSlider()
          updateSlider() - update string report if Slider changed and this type of string report requires it.
(package private)  void updateText(java.lang.String textReport)
          updateText() - update text in popup window
(package private)  void updateTitle(java.lang.String titleMsg)
          updateTitle() - update popup window title
 void windowActivated(java.awt.event.WindowEvent e)
           
 void windowClosed(java.awt.event.WindowEvent e)
           
 void windowClosing(java.awt.event.WindowEvent e)
          windowClosing() - closing down the window, get rid of the frame.
 void windowDeactivated(java.awt.event.WindowEvent e)
           
 void windowDeiconified(java.awt.event.WindowEvent e)
           
 void windowIconified(java.awt.event.WindowEvent e)
           
 void windowOpened(java.awt.event.WindowEvent e)
           
 
Methods inherited from class java.awt.Frame
, addNotify, addToFrameList, constructComponentName, finalize, getAccessibleContext, getCursorType, getFrames, getIconImage, getMenuBar, getState, getTitle, initIDs, isResizable, paramString, postProcessKeyEvent, readObject, remove, removeFromFrameList, removeNotify, setCursor, setIconImage, setMenuBar, setResizable, setState, setTitle, writeObject
 
Methods inherited from class java.awt.Window
addOwnedWindow, addWindowListener, adjustListeningChildren, applyResourceBundle, applyResourceBundle, connectOwnedWindow, dispatchEventImpl, dispose, eventEnabled, getFocusOwner, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, hide, isActive, isShowing, nextFocus, ownedInit, pack, postEvent, postWindowEvent, preProcessKeyEvent, processEvent, processWindowEvent, removeOwnedWindow, removeWindowListener, resetGC, setCursor, setFocusOwner, setWarningString, show, toBack, toFront, transferFocus
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyOrientation, checkGD, countComponents, createChildHierarchyEvents, createHierarchyEvents, deliverEvent, dispatchEventToSelf, doLayout, findComponentAt, findComponentAt, findComponentAt, getAccessibleAt, getAccessibleChild, getAccessibleChildrenCount, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents_NoClientCode, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getMouseEventTarget, getPreferredSize, getWindow, insets, invalidate, invalidateTree, isAncestorOf, layout, lightweightPaint, lightweightPrint, list, list, locate, minimumSize, numListening, paint, paintComponents, paintHeavyweightComponents, postsOldMouseEvents, preferredSize, print, printComponents, printHeavyweightComponents, processContainerEvent, proxyEnableEvents, proxyRequestFocus, remove, remove, removeAll, removeContainerListener, setFont, setLayout, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, areInputMethodsEnabled, bounds, checkImage, checkImage, checkWindowClosingException, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAccessibleIndexInParent, getAccessibleStateSet, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen_NoTreeLock, getLocationOnScreen, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getSize, getToolkitImpl, getTreeLock, getWidth, getWindowForObject, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isEnabledImpl, isFocusTraversable, isLightweight, isOpaque, isRecursivelyVisible, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

mae

private MAExplorer mae
link to global MAExplorer nstance

mbf

private MenuBarFrame mbf
link to global instance

OPTIMIZE_WINDOW_WIDTH

private static final boolean OPTIMIZE_WINDOW_WIDTH
if optimized window with by shrinking # of buttons/row in controlPanel to OPTIMUM_BUTTONS_PER_ROW

OPTIMUM_BUTTONS_PER_ROW

private static final int OPTIMUM_BUTTONS_PER_ROW
if optimize # buttons/row

popupName

java.lang.String popupName
ARG: name for PopupRegistry

popupPropertyBits

int popupPropertyBits
ARG: property bits of window for PopupRegistry

allGenesPlotButton

private java.awt.Button allGenesPlotButton
multipurpose button that toggles between: "Go 'Cluster gene counts' " for "allGenes" (cluster counts) and "Go 'Cluster single genes'" for "singleGene" (similar genes).

saveAsButton

private java.awt.Button saveAsButton
"SaveAs" .txt button

savedMsg

java.lang.String savedMsg
message after Saved Txt into file

textReport

private java.lang.String textReport
copy of text in textArea

defTxtFile

private java.lang.String defTxtFile

textarea

private java.awt.TextArea textarea
Text area GUI for main report

optReportMode

private int optReportMode
Optional Report mode if > 0

fntSize

private int fntSize
font size

nRows

private int nRows
# of character rows to show

nCols

private int nCols
# of character cols to show

alertOK

boolean alertOK
Flag: set true if popupName is "ALERT"

mode

private int mode
mode of operation used in creating this window. Used in how we close the window
Constructor Detail

ShowStringPopup

ShowStringPopup(MAExplorer mae,
                java.lang.String inputStr,
                int nRows,
                int nCols,
                java.lang.String fontSize,
                java.lang.String title,
                int optReportMode,
                int optMode,
                java.lang.String popupName,
                int popupPropertyBits,
                java.lang.String defTxtFile)
ShowStringPopup() - Constructor. Display String in textArea
Parameters:
mae - instance of MAExplorer
inputStr - is initial text string for buffer
nRows - is maximum size of window
nCols, - is maximum size of window
fontSize - is null or "8pt", "10pt", or "12pt"
title -  
optReportMode - if not 0, add extra buttons
optMode - save the mode for closing
popupName - for PopupRegistry
popupPropertyBits - for PopupRegistry
String - defTxtFile is default SAVE AS .txt file
See Also:
PopupRegistry.addPopupWindowToReg(ShowPlotPopup, java.lang.String, int), PopupRegistry.removePopupByKey(java.lang.String), Util.cvFontS2I(java.lang.String)
Method Detail

updateText

void updateText(java.lang.String textReport)
updateText() - update text in popup window
Parameters:
textReport - is string to copy into text window

updateTitle

void updateTitle(java.lang.String titleMsg)
updateTitle() - update popup window title
Parameters:
textMsg - is title message

changeGeneButton

void changeGeneButton(java.lang.String newLabel,
                      java.lang.String newCmd,
                      int optReportMode)
changeGeneButton() - change gene label
Parameters:
newLabel - for Gene button
newCmd - to assign to the button
optReportMode - to assign to new command

close

void close(boolean keepFlags)
close() - close this popup and reset flags if needed
Parameters:
keepFlags - will prevent flags from being reset
See Also:
Component.repaint(), PopupRegistry.removePopupByKey(java.lang.String)

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed() - Handle button clicks
Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - is action evet
See Also:
ClusterGenes.saveKmeansClustersAsGeneSets(), ClusterGenes.sortKmeansClusterList(GeneList, GeneList), ClusterGenes.updateKmeansClusters(), GeneBitSet.updateListGeneBitSets(), EventMenu.promptFileName(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, boolean, boolean), EventMenu.setClusterDisplayState(java.awt.CheckboxMenuItem, boolean), FileIO.writeFileToDisk(java.lang.String, java.lang.String), Filter.computeWorkingGeneList(), GeneGeneDist.calcNormGeneVectors(GeneList, int), HierClustNode, PopupRegistry.updateCurGene(int, int, java.lang.Object), Report, ShowExprProfilesPopup, Component.repaint(), ShowPlotPopup, StateScrollers.regenerateScrollers(boolean), Util.rmvFinalSubDirectory(java.lang.String, java.lang.String, boolean), Util.saveCmdHistory(java.lang.String), Util.showMsg(java.lang.String), changeGeneButton(java.lang.String, java.lang.String, int), saveAsTxtFile(java.lang.String)

saveAsTxtFile

private boolean saveAsTxtFile(java.lang.String oTxtFileName)
saveAsTxtFile() - save textReport data in .txt file oTxtFileName
Parameters:
oTxtFileName - is the full path of the file to write
Returns:
true if succeed

windowClosing

public void windowClosing(java.awt.event.WindowEvent e)
windowClosing() - closing down the window, get rid of the frame.
Specified by:
windowClosing in interface java.awt.event.WindowListener
Parameters:
e - is window closing event
See Also:
close(boolean)

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

void updateCurGene(int mid)
updateCurGene() - update string report if current gene changed and this type of string report requires it.
Parameters:
mid - is the new Master Gene ID of the current gene
See Also:
Component.repaint()

updateFilter

void updateFilter(GeneList ml)
updateFilter() - update string report if Filter changed and this type of string report requires it.
Parameters:
ml - is the gene list to update now that filter has changed.

updateSlider

void updateSlider()
updateSlider() - update string report if Slider changed and this type of string report requires it.

updateLabels

void updateLabels()
updateLabels() - update string report if labels changed and this type of string report requires it.
See Also:
Component.repaint()