|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container java.awt.Window java.awt.Frame Seg2Dgel.Sg2reportPopup
class Sg2reportPopup
Class Sg2reportPopup creates and displays 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 Open2Dprot Mozilla and Legal files are available on http://open2dprot.sourceforge.net/
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.awt.Frame |
---|
java.awt.Frame.AccessibleAWTFrame |
Nested classes/interfaces inherited from class java.awt.Window |
---|
java.awt.Window.AccessibleAWTWindow |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
boolean |
cancelFlag
pressed sog. |
private Seg2Dgel |
cs
instance of the main class |
boolean |
doneFlag
pressed sog. |
java.awt.Menu |
editMenu
"Edit" pull down Menu list |
private java.awt.Button |
editOptionsButton
button for "Set startup options" button |
java.awt.Menu |
fileMenu
"File" pull down Menu list |
java.awt.Menu |
helpMenu
"Help" pull down Menu list |
(package private) java.awt.MenuBar |
mbar
menu bar for the frame |
(package private) static java.awt.CheckboxMenuItem |
miVMaddHistCB
"Add histogram to Image Viewer" checkbox |
MenuSupport |
ms
Menu support functions using Hashtables to tack what is active |
java.lang.String[] |
newArgv
new switch options |
java.io.FileWriter |
oFile
File to flush and close on "Kill program" if it is not null |
java.lang.String |
poTitle
popup options title |
java.awt.Menu |
quantifyMenu
"Quantify" pull down Menu list |
boolean |
reanalyzeFlag
pressed sog. |
private java.lang.String |
reportFile
|
private java.awt.Button |
resegmentButton
button for "Segment" button |
(package private) java.lang.String |
savedMsg
message after Saved Txt into file |
(package private) static long |
serialVersionUID
frame id |
boolean |
setNewDefaultFlag
pressed sog. |
private java.awt.Button |
showImagesButton
button for "Image viewer" button |
boolean |
showStatusFlag
|
Sg2showImage |
sig
popup Image viewer GUI |
PopupOptions |
sog
popup options GUI |
private java.awt.Label |
statusLineLabel
Status line label |
boolean |
stopFlag
|
private java.awt.Button |
stopSegmentationButton
stop segmenting button only active if segmenting |
boolean[] |
swOptCBvalue
The swOptcCBvalue[0:nData-1] is used by the Sg2reportPopup that in turn may call Sg2optionsPopup. |
java.lang.String[] |
swOptData
The swOptData[0:(3*nData)-1] is used by the Sg2reportPopup that in turn may call Sg2optionsPopup. |
java.lang.String[] |
swOptValue
The swOptValue[0:nData-1] is used by the Sg2reportPopup that in turn may call Sg2optionsPopup. |
private java.awt.TextArea |
textarea
Text area GUI for main report |
private int |
textAreaFontSize
font size |
private java.lang.String |
textFontFamily
Text area font family |
private java.lang.String |
textReport
copy of text in textArea |
(package private) java.lang.String |
title
string for title of frame |
java.awt.Menu |
viewMenu
"View" pull down Menu list |
Fields inherited from class java.awt.Frame |
---|
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
Sg2reportPopup(Seg2Dgel cs,
java.lang.String programName,
java.lang.String textReport,
int nRows,
int nCols,
java.lang.String title,
java.lang.String reportFile,
boolean showStatusFlag)
Sg2reportPopup() - Constructor. |
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
actionPerformed() - Handle button clicks |
private void |
addMenuTree(java.awt.Frame f,
java.awt.MenuBar mbar)
addMenuTree() - create pull down menus in menu bar |
void |
appendTextMsg(java.lang.String newText)
appendTextMsg() - append text in popup window |
void |
cleanKillApplication()
cleanKillApplication() - close the file if needed and do a clean kill of the application |
void |
clearText()
clearText() - clear text in popup window |
void |
close()
close() - close this popup and reset flags if needed |
java.lang.String |
getReportText()
getReportText() - get the text from the Report popup window |
boolean |
getStopStatus()
getStopStatus() - get the stop processing flag set by pressing the "Stop segmentation" button |
void |
itemStateChanged(java.awt.event.ItemEvent e)
itemStateChanged() - handle item state changed events NOTE: need to implement radio groups here since AWT only implements radio groups for Checkboxes, and CheckboxMenuItems. |
void |
positionReportWindow()
positionReportWindow() - position report window on the screen |
void |
quit()
quit() - closing down the window, get rid of the frame. |
void |
setEnableButtons(boolean flag)
setEnableButtons() - by the flag |
void |
setEnableMenus(boolean flag)
setEnableMenus() - by the flag |
void |
setOutFileToCloseOnKill(java.io.FileWriter oFile)
setOutFileToCloseOnKill() - set the show/hide popup status |
void |
setSaveAsFile(java.lang.String reportFile)
setSaveAsFile() - set SaveAs file default file name |
void |
setShow(boolean showStatusFlag)
setShow() - set the show/hide popup status |
private boolean |
showPopupOptionWindow(java.lang.String poTitle)
showPopupOptionWindow() - popup options window using the Sg2OptionsPopup GUI. |
void |
updateReportStatusLine(java.lang.String msg)
updateReportStatusLine() - clear text in popup window |
void |
updateText(java.lang.String newText)
updateText() - update text in popup window |
void |
updateTitle(java.lang.String title)
updateTitle() - update title in popup window |
boolean |
waitForUserClose()
waitForUserClose)() wait for user to press "Close" application. |
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, finalize, getAccessibleContext, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, paramString, remove, removeNotify, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated |
Methods inherited from class java.awt.Window |
---|
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationByPlatform, setLocationRelativeTo, show, toBack, toFront |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate, validateTree |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, 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, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.awt.MenuContainer |
---|
getFont, postEvent |
Field Detail |
---|
static final long serialVersionUID
private Seg2Dgel cs
java.lang.String title
java.awt.MenuBar mbar
public java.awt.Menu fileMenu
public java.awt.Menu editMenu
public java.awt.Menu viewMenu
public java.awt.Menu quantifyMenu
public java.awt.Menu helpMenu
public MenuSupport ms
static java.awt.CheckboxMenuItem miVMaddHistCB
java.lang.String savedMsg
private java.lang.String textReport
private java.lang.String reportFile
private java.awt.TextArea textarea
private int textAreaFontSize
private java.lang.String textFontFamily
private java.awt.Button editOptionsButton
private java.awt.Button resegmentButton
private java.awt.Button showImagesButton
private java.awt.Button stopSegmentationButton
private java.awt.Label statusLineLabel
public boolean showStatusFlag
public boolean stopFlag
public java.io.FileWriter oFile
public PopupOptions sog
public java.lang.String[] newArgv
public java.lang.String poTitle
public java.lang.String[] swOptData
public boolean[] swOptCBvalue
public java.lang.String[] swOptValue
public Sg2showImage sig
public boolean setNewDefaultFlag
public boolean reanalyzeFlag
public boolean doneFlag
public boolean cancelFlag
Constructor Detail |
---|
public Sg2reportPopup(Seg2Dgel cs, java.lang.String programName, java.lang.String textReport, int nRows, int nCols, java.lang.String title, java.lang.String reportFile, boolean showStatusFlag)
sg2
- is an instance of the main classprogramName
- name of the programtextReport
- is initial text string for buffer.nRows
- is maximum size of windownCols,
- is maximum size of windowtitle
- of the windowString
- reportFile is default SAVE AS .txt file.Default
"Seg2Dprot-Report.txt"showStatusFlag
- to show (true), hide(false).Method Detail |
---|
private void addMenuTree(java.awt.Frame f, java.awt.MenuBar mbar)
f
- is framembar
- is MenuBarpublic void setEnableButtons(boolean flag)
flag
- to set enable buttonspublic void setEnableMenus(boolean flag)
flag
- to set enable menuspublic void positionReportWindow()
public void setOutFileToCloseOnKill(java.io.FileWriter oFile)
oFile
- to flush and close if use Kill command.public void setShow(boolean showStatusFlag)
showStatusFlag
- to show (true), hide(false).public boolean getStopStatus()
public void updateReportStatusLine(java.lang.String msg)
msg
- to displaypublic void clearText()
public java.lang.String getReportText()
public void updateText(java.lang.String newText)
newText
- is string to copy into text windowpublic void appendTextMsg(java.lang.String newText)
newText
- is string to append into text windowpublic void updateTitle(java.lang.String title)
title
- is new title.public void setSaveAsFile(java.lang.String reportFile)
title
- is new title.public void close()
public void cleanKillApplication()
private boolean showPopupOptionWindow(java.lang.String poTitle)
This uses a new instance of the data contained in data created by cs.ini.initSwitchOptionsData(). The data is: cs.switchOptData[0:(3*nData)-1] is used by the Sg2reportPopup that in turn may call Sg2optionsPopup. It contains triples of (optionPrompt, guiBuilderSpec, helpStr) data. If the prompt data has a "-", then make a CheckBox (swOptcCBvalue), else it is a Label with the prompt data. If the user data is not null, then make a TextField with this user (swOptValue) data on the right else make an empty Label. cs.switchOptCBvalue[0:nData-1] is used by the Sg2reportPopup that in turn may call Sg2optionsPopup. It contains boolean values of switch data use for Checkboxes. cs.switchOptValue[0:nData-1] is used by the Sg2reportPopup that in turn may call Sg2optionsPopup. It contains String text values of associated switch data arguments.
poTitle
- for popup options GUI
public boolean waitForUserClose()
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
e
- is action evetpublic void quit()
close()
public void itemStateChanged(java.awt.event.ItemEvent e)
itemStateChanged
in interface java.awt.event.ItemListener
e
- is ItemEventpublic void windowClosing(java.awt.event.WindowEvent e)
windowClosing
in interface java.awt.event.WindowListener
e
- is window closing eventclose()
public void windowOpened(java.awt.event.WindowEvent e)
windowOpened
in interface java.awt.event.WindowListener
public void windowActivated(java.awt.event.WindowEvent e)
windowActivated
in interface java.awt.event.WindowListener
public void windowClosed(java.awt.event.WindowEvent e)
windowClosed
in interface java.awt.event.WindowListener
public void windowDeactivated(java.awt.event.WindowEvent e)
windowDeactivated
in interface java.awt.event.WindowListener
public void windowDeiconified(java.awt.event.WindowEvent e)
windowDeiconified
in interface java.awt.event.WindowListener
public void windowIconified(java.awt.event.WindowEvent e)
windowIconified
in interface java.awt.event.WindowListener
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |