public class WinGenOpt
extends javax.swing.JFrame
implements java.awt.event.ActionListener, java.awt.event.ItemListener, java.awt.event.WindowListener
This project was carried out at:
and supported by
If you have questions about your rights to use or distribute this software, please contact Berkeley Lab's Technology Transfer Department at TTD@lbl.gov.
NOTICE. This software was developed under partial funding from the U.S. Department of Energy. As such, the U.S. Government has been granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software to reproduce, prepare derivative works, and perform publicly and display publicly. Beginning five (5) years after the date permission to assert copyright is obtained from the U.S. Department of Energy, and subject to any subsequent five (5) year renewals, the U.S. Government is granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software to reproduce, prepare derivative works, distribute copies to the public, perform publicly and display publicly, and to permit others to do so.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
(1) Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
(2) Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
(3) Neither the name of the University of California, Lawrence Berkeley National Laboratory, U.S. Dept. of Energy nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
You are under no obligation whatsoever to provide any bug fixes, patches, or upgrades to the features, functionality or performance of the source code ("Enhancements") to anyone; however, if you choose to make your Enhancements available either publicly, or directly to Lawrence Berkeley National Laboratory, without imposing a separate written license agreement for such Enhancements, then you hereby grant the following license: a non-exclusive, royalty-free perpetual license to install, use, modify, prepare derivative works, incorporate into other computer software, distribute, and sublicense such enhancements or derivative works thereof, in binary and source code form.
javax.swing.JFrame.AccessibleJFrame
java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
Modifier and Type | Field and Description |
---|---|
protected javax.swing.JMenu |
aboutMenu
About menu
|
protected javax.swing.JButton[] |
button
Start button
|
protected static int |
BUTTONCHART |
protected static int |
BUTTONSPLIT |
protected static int |
BUTTONSTART
Button Constants
|
protected static int |
BUTTONSTOP |
protected javax.swing.JMenu |
chartMenu
Chart menu
|
protected javax.swing.JMenuItem |
chartMenu_Change
Chart menu → Change
|
protected int[] |
disOrd
order in which data series are displayed
|
protected javax.swing.JMenu |
fileMenu
File menu
|
protected javax.swing.JMenuItem |
fileMenu_Start
File menu → Start
|
protected javax.swing.JMenuItem |
fileMenu_Stop
File menu → Stop
|
protected GenOpt |
go
GenOpt Object
|
protected LineChart |
lc
LineChart
|
private static java.lang.String |
LS
System dependent line separator
|
protected int |
nDisSer
number of displayed data series
|
protected boolean |
optRuns
flag whether an optimization is currently in progress
|
protected javax.swing.JPanel |
panel
Panel
|
private Preference |
pref
user preference
|
protected ResultManager |
resMan
reference to ResultManager
|
protected javax.swing.JScrollPane |
scTa
scroll pane for the text area
|
protected DataSerie[] |
se
DataSeries
|
private static java.lang.String |
SEELOGFILEFORERROR |
private static long |
serialVersionUID
The serial version number
|
protected javax.swing.JSplitPane |
splPan
Split Pane
|
protected boolean |
splPanHor
flag whether split pane is horizontal or vertical
|
protected FlowTextArea |
ta
text area displaying online result (shell piping)
|
protected javax.swing.JTabbedPane |
tabPan
Tabbed Pane
|
protected javax.swing.JViewport |
taVp
Viewport of the text area
|
protected javax.swing.JToolBar |
toolBar
Toolbar
|
protected javax.swing.JMenu |
windowMenu
Windows menu
|
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
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
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Constructor and Description |
---|
WinGenOpt()
Constructor for WinGenOpt
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent evt)
performs the ActionEvent
|
void |
append(java.lang.String text)
appends text to the text field
|
private void |
buildContainer()
builds the container
|
protected void |
changeDataSeries()
sets the order in which the series are displayed
|
protected void |
exitWinGenOpt()
exits WinGenOpt
|
void |
finalizeOptimization()
finalizes optimization
|
protected java.io.File |
getIniStartUpFile()
gets the initialization startup file
|
java.lang.String |
getSeparator()
gets the separator, as specified in properties.txt
|
private void |
handleThrowable(java.lang.Throwable t)
handles an exception which was thrown by GenOpt
|
void |
initializeSeries(ResultManager res)
initializes the DataSerie
|
boolean |
isDebug()
checks whether we should run in debug mode
|
void |
itemStateChanged(java.awt.event.ItemEvent evt)
performs the ItemEvent if the item state changed
|
static void |
main(java.lang.String[] args)
The main routine
|
void |
printError(java.lang.String text)
prints an error message to the output device
|
private void |
resetDiagramProperties()
reset the diagram properties
|
void |
setNewTrial()
sets a new optimization trial
|
private void |
setupGeneralSplitPane()
sets up the general setting of the split pane
|
private void |
setupHorizontalSplitPane()
sets up the horizontal split pane
|
private void |
setupLineChart()
sets up the line chart
|
private void |
setupMenuBar()
sets up the menu bar
|
private void |
setupProperties()
sets up the properties
|
private void |
setupTextArea()
sets up the text area
|
private void |
setupToolBar()
sets up the tool bar
|
private void |
setupVerticalSplitPane()
sets up the vertical split pane
|
private void |
setupWindow()
sets up the window
|
protected void |
showAboutGenOpt()
displays the about window
|
protected void |
startGenOpt()
Starts GenOpt.
|
protected void |
startGenOpt(java.io.File iniFil)
Starts GenOpt
|
protected int |
stopOptimization()
displays a message box to stop GenOpt, and if the user selects
OK , tells
GenOpt to stop the optimization |
protected void |
updateChart()
updates the online chart
|
void |
windowActivated(java.awt.event.WindowEvent e) |
void |
windowClosed(java.awt.event.WindowEvent e) |
void |
windowClosing(java.awt.event.WindowEvent e) |
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) |
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, toFront
add, add, add, add, add, addContainerListener, 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, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
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, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, 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, 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, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
private static final long serialVersionUID
private static final java.lang.String LS
private static final java.lang.String SEELOGFILEFORERROR
protected static final int BUTTONSTART
protected static final int BUTTONSTOP
protected static final int BUTTONCHART
protected static final int BUTTONSPLIT
protected GenOpt go
protected javax.swing.JPanel panel
protected javax.swing.JScrollPane scTa
protected FlowTextArea ta
protected javax.swing.JViewport taVp
protected javax.swing.JMenu fileMenu
protected javax.swing.JMenuItem fileMenu_Start
protected javax.swing.JMenuItem fileMenu_Stop
protected javax.swing.JToolBar toolBar
protected javax.swing.JButton[] button
protected javax.swing.JMenu chartMenu
protected javax.swing.JMenuItem chartMenu_Change
protected javax.swing.JMenu windowMenu
protected javax.swing.JMenu aboutMenu
protected javax.swing.JTabbedPane tabPan
protected javax.swing.JSplitPane splPan
protected LineChart lc
protected DataSerie[] se
protected int nDisSer
protected int[] disOrd
protected ResultManager resMan
protected boolean optRuns
private Preference pref
protected boolean splPanHor
private void setupProperties()
private void setupWindow()
private void setupMenuBar()
private void setupToolBar()
private void setupTextArea()
private void setupLineChart()
private void setupHorizontalSplitPane()
private void setupVerticalSplitPane()
private void setupGeneralSplitPane()
private void buildContainer()
private void resetDiagramProperties()
protected void changeDataSeries()
public void initializeSeries(ResultManager res)
res
- reference to the result managerpublic void setNewTrial()
protected void updateChart()
public void append(java.lang.String text)
text
- the text to be appendedpublic void actionPerformed(java.awt.event.ActionEvent evt)
actionPerformed
in interface java.awt.event.ActionListener
evt
- the action eventpublic void itemStateChanged(java.awt.event.ItemEvent evt)
itemStateChanged
in interface java.awt.event.ItemListener
evt
- the item eventprotected void startGenOpt()
startGenOpt(File)
to start
the optimization.protected void startGenOpt(java.io.File iniFil)
iniFil
- optimization initialization file.private void handleThrowable(java.lang.Throwable t)
t
- the thrown exceptionprotected void exitWinGenOpt()
protected int stopOptimization()
OK
, tells
GenOpt
to stop the optimization0
if OK has been selected, 1
otherwiseprotected void showAboutGenOpt()
public void printError(java.lang.String text)
text
- the text to be printedpublic void finalizeOptimization()
protected java.io.File getIniStartUpFile()
public java.lang.String getSeparator()
public boolean isDebug()
true
if we run in debug mode, false
otherwisepublic void windowClosed(java.awt.event.WindowEvent e)
windowClosed
in interface java.awt.event.WindowListener
public void windowIconified(java.awt.event.WindowEvent e)
windowIconified
in interface java.awt.event.WindowListener
public void windowOpened(java.awt.event.WindowEvent e)
windowOpened
in interface java.awt.event.WindowListener
public void windowClosing(java.awt.event.WindowEvent e)
windowClosing
in interface java.awt.event.WindowListener
public void windowDeiconified(java.awt.event.WindowEvent e)
windowDeiconified
in interface java.awt.event.WindowListener
public void windowActivated(java.awt.event.WindowEvent e)
windowActivated
in interface java.awt.event.WindowListener
public void windowDeactivated(java.awt.event.WindowEvent e)
windowDeactivated
in interface java.awt.event.WindowListener
public static void main(java.lang.String[] args)