Class MainWindow

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by dirk_krause.jtools.ApplicationFrame
                          extended by MainWindow
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.WindowListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants

public class MainWindow
extends dirk_krause.jtools.ApplicationFrame
implements java.awt.event.ActionListener

The main window.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
 
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.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static java.lang.String[] actionCmd
          Keyword to set up buttons and menu items
protected  javax.swing.JButton bDir
          Button to change directory.
protected  javax.swing.JButton bExit
          Button to exit the application.
protected  javax.swing.JButton bOpt
          Button to change options to tracecc.
protected  javax.swing.JButton bRun
          Button to run the tracecc command.
protected  MainWindow.DropHandler dh
          DropHandler instance.
protected  dirk_krause.jtools.GuiDialog guid
          Dialog to set up GUI.
static java.lang.String helpFileName
          File name for online help.
protected  dirk_krause.jtools.HelpWindow hw
          Window to show version information and help.
static java.lang.String[] iconFileNames
          File names for icons in the button bar.
protected  boolean isRunning
          Flag to indicate whether or not a background thread is running
protected  javax.swing.JLabel lDir
          Label to show the current working directory.
static java.lang.String licenseTerms
          License terms.
protected  javax.swing.JLabel lSta
          Label to show the program status.
protected  dirk_krause.jtools.LogWindow lw
          Window to show log text (command output).
protected  javax.swing.JMenuItem miDir
          Menu item to choose directory.
protected  javax.swing.JMenuItem miExit
          Menu item to exit the application.
protected  javax.swing.JMenuItem miGui
          Menu item to set up GUI.
protected  javax.swing.JMenuItem miHlp
          Menu item to show help text.
protected  javax.swing.JMenuItem miLic
          Menu item to show version and license information.
protected  javax.swing.JMenuItem miOpt
          Menu item to set options.
protected  javax.swing.JMenuItem miPck
          Menu item to pack window.
protected  javax.swing.JMenuItem miRun
          Menu item to run the tracecc command.
protected  javax.swing.JMenuItem miWeb
          Menu item to launch web browser.
protected  java.awt.Color myG
          Color to show the program status in green while the application is idle.
protected  java.awt.Color myR
          Color to show the program status in red while the application is busy.
protected  dirk_krause.jtools.SizeTracker stDir
          Size tracker for directory label.
protected  TraceccController tc
          Controller keeping options for tracecc.
static java.lang.String[] theTexts
          Keywords to set up GUI elements
protected  TraceccOptionsDialog tod
          Dialog to set up options to tracecc.
static java.lang.String[] toolTipTexts
          Texts for tooltips.
 
Fields inherited from class javax.swing.JFrame
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
 
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 javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
MainWindow(dirk_krause.jtools.GuiController c, TraceccController t)
          Constructor.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Reaction on mouseclicks
protected  void chooseDirectory()
          Choose a new directory for tracecc.
 void cleanup(boolean isLast)
          Cleanup procedure.
protected  javax.swing.JPanel createInnerPanel()
          Create the inner panel (real window panel).
protected  javax.swing.ImageIcon findImageForName(java.lang.String n)
          Search for an icon image.
protected  dirk_krause.jtools.GuiDialog getGuid()
          Get the GUI options dialog.
protected  dirk_krause.jtools.HelpWindow getHelpWindow()
          Get the help window.
protected  dirk_krause.jtools.LogWindow getLogWindow()
          Get the log window.
protected  boolean getRunning()
          Check whether or not a background task is running.
protected  TraceccController getTc()
          Get the tracecc controller.
protected  TraceccOptionsDialog getTod()
          Get the dialog to set tracecc options.
protected  boolean haveGuid()
          Check whether or not there already is a GUI options dialog.
protected  boolean haveHelpWindow()
          Check whether or not there already is a help window.
protected  boolean haveLogWindow()
          Check whether or not we already have a log window.
protected  boolean haveTod()
          Check whether or not there already is a tracecc options dialog.
protected  dirk_krause.jtools.GuiDialog internalGetGuid()
          Synchronized request for GUI dialog.
protected  dirk_krause.jtools.HelpWindow internalGetHelpWindow()
          Get the help window.
protected  dirk_krause.jtools.LogWindow internalGetLogWindow()
          Get the log window.
protected  TraceccOptionsDialog internalGetTod()
          Get the dialog to set tracecc options.
protected  void internalSetGuid(dirk_krause.jtools.GuiDialog d)
          Synchronized set GUI dialog.
protected  void internalSetHelpWindow(dirk_krause.jtools.HelpWindow h)
          Set the help window.
protected  void internalSetLogWindow(dirk_krause.jtools.LogWindow l)
          Set the log window.
protected  void internalSetTod(TraceccOptionsDialog d)
          Save the tracecc options dialog.
 void positionLogWindow()
          Choose a non-modal position for the log window.
protected  void resetGuid()
          Mark the current GUI options dialog as not longer being used.
protected  void resetHelpWindow()
          Mark the help window as not longer being used.
protected  void resetLogWindow()
          Mark the log window as not longer being used.
protected  void resetTod()
          Mark existing tracecc options dialog as not longer being used.
 void retrieveDefaults()
          Retrieve default settings.
 void runProgram()
          Run tracecc.
 void saveDefaults()
          Save default settings.
protected  void setRunning(boolean b)
          Set the flag to indicate whether or not a background task is running.
protected  void setStatus(int t, java.awt.Color c, boolean fromAwtThread)
          Set a new status.
protected  javax.swing.JToolBar setupButtonBar()
          Set up the button bar.
protected  void setupMenuBar()
          Set up the menu bar.
protected  void showGuiSetupDialog()
          Show the GUI options dialog.
 
Methods inherited from class dirk_krause.jtools.ApplicationFrame
getGuic, restorePosition, windowActivated, windowClosed, windowClosing, windowDeactivated, windowDeiconified, windowIconified, windowOpened
 
Methods inherited from class javax.swing.JFrame
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
 
Methods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, 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, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setVisible, show, toBack, toFront
 
Methods inherited from class java.awt.Container
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, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, 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, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, 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, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

guid

protected dirk_krause.jtools.GuiDialog guid
Dialog to set up GUI.


tc

protected TraceccController tc
Controller keeping options for tracecc.


tod

protected TraceccOptionsDialog tod
Dialog to set up options to tracecc.


lw

protected dirk_krause.jtools.LogWindow lw
Window to show log text (command output).


hw

protected dirk_krause.jtools.HelpWindow hw
Window to show version information and help.


isRunning

protected boolean isRunning
Flag to indicate whether or not a background thread is running


miDir

protected javax.swing.JMenuItem miDir
Menu item to choose directory.


miOpt

protected javax.swing.JMenuItem miOpt
Menu item to set options.


miRun

protected javax.swing.JMenuItem miRun
Menu item to run the tracecc command.


miExit

protected javax.swing.JMenuItem miExit
Menu item to exit the application.


miGui

protected javax.swing.JMenuItem miGui
Menu item to set up GUI.


miPck

protected javax.swing.JMenuItem miPck
Menu item to pack window.


miLic

protected javax.swing.JMenuItem miLic
Menu item to show version and license information.


miHlp

protected javax.swing.JMenuItem miHlp
Menu item to show help text.


miWeb

protected javax.swing.JMenuItem miWeb
Menu item to launch web browser.


bDir

protected javax.swing.JButton bDir
Button to change directory.


bOpt

protected javax.swing.JButton bOpt
Button to change options to tracecc.


bRun

protected javax.swing.JButton bRun
Button to run the tracecc command.


bExit

protected javax.swing.JButton bExit
Button to exit the application.


lDir

protected javax.swing.JLabel lDir
Label to show the current working directory.


lSta

protected javax.swing.JLabel lSta
Label to show the program status.


myR

protected java.awt.Color myR
Color to show the program status in red while the application is busy.


myG

protected java.awt.Color myG
Color to show the program status in green while the application is idle.


stDir

protected dirk_krause.jtools.SizeTracker stDir
Size tracker for directory label.


licenseTerms

public static final java.lang.String licenseTerms
License terms.

See Also:
Constant Field Values

theTexts

public static final java.lang.String[] theTexts
Keywords to set up GUI elements


actionCmd

public static final java.lang.String[] actionCmd
Keyword to set up buttons and menu items


iconFileNames

public static final java.lang.String[] iconFileNames
File names for icons in the button bar.


toolTipTexts

public static final java.lang.String[] toolTipTexts
Texts for tooltips.


helpFileName

public static final java.lang.String helpFileName
File name for online help.

See Also:
Constant Field Values

dh

protected MainWindow.DropHandler dh
DropHandler instance.

Constructor Detail

MainWindow

public MainWindow(dirk_krause.jtools.GuiController c,
                  TraceccController t)
Constructor.

Parameters:
c - A GuiController providing the border setting.
t - A controller for tracecc options.
Method Detail

internalGetTod

protected TraceccOptionsDialog internalGetTod()
Get the dialog to set tracecc options. Create new dialog if necessary.

Returns:
The tracecc options dialog.

internalSetTod

protected void internalSetTod(TraceccOptionsDialog d)
Save the tracecc options dialog.

Parameters:
d - The dialog to save for re-use.

getTod

protected TraceccOptionsDialog getTod()
Get the dialog to set tracecc options. Create new dialog if necessary.


resetTod

protected void resetTod()
Mark existing tracecc options dialog as not longer being used.


haveTod

protected boolean haveTod()
Check whether or not there already is a tracecc options dialog.

Returns:
The test result.

getTc

protected TraceccController getTc()
Get the tracecc controller.

Returns:
The controller.

internalGetLogWindow

protected dirk_krause.jtools.LogWindow internalGetLogWindow()
Get the log window.

Returns:
The log window.

internalSetLogWindow

protected void internalSetLogWindow(dirk_krause.jtools.LogWindow l)
Set the log window.

Parameters:
l - The log window.

getLogWindow

protected dirk_krause.jtools.LogWindow getLogWindow()
Get the log window.

Returns:
The log window.

resetLogWindow

protected void resetLogWindow()
Mark the log window as not longer being used.


haveLogWindow

protected boolean haveLogWindow()
Check whether or not we already have a log window.

Returns:
The test result.

internalGetHelpWindow

protected dirk_krause.jtools.HelpWindow internalGetHelpWindow()
Get the help window.

Returns:
The help window.

internalSetHelpWindow

protected void internalSetHelpWindow(dirk_krause.jtools.HelpWindow h)
Set the help window.

Parameters:
h - The help window.

getHelpWindow

protected dirk_krause.jtools.HelpWindow getHelpWindow()
Get the help window.

Returns:
The help window.

resetHelpWindow

protected void resetHelpWindow()
Mark the help window as not longer being used.


haveHelpWindow

protected boolean haveHelpWindow()
Check whether or not there already is a help window.

Returns:
The test result.

setStatus

protected void setStatus(int t,
                         java.awt.Color c,
                         boolean fromAwtThread)
Set a new status.

Parameters:
t - The index of the text in the theTexts array.
c - The color to use.
fromAwtThread - Flag indicating whether or not we are in the AWT/event thread.

setupMenuBar

protected void setupMenuBar()
Set up the menu bar.


setupButtonBar

protected javax.swing.JToolBar setupButtonBar()
Set up the button bar.

Returns:
The new button bar.

createInnerPanel

protected javax.swing.JPanel createInnerPanel()
Create the inner panel (real window panel).

Returns:
The new panel.

cleanup

public void cleanup(boolean isLast)
Cleanup procedure.

Specified by:
cleanup in class dirk_krause.jtools.ApplicationFrame

haveGuid

protected boolean haveGuid()
Check whether or not there already is a GUI options dialog.

Returns:
The test result.

internalGetGuid

protected dirk_krause.jtools.GuiDialog internalGetGuid()
Synchronized request for GUI dialog.

Returns:
Reference to current GUI dialog (may be null).

internalSetGuid

protected void internalSetGuid(dirk_krause.jtools.GuiDialog d)
Synchronized set GUI dialog.

Parameters:
d - The new GUI dialog.

getGuid

protected dirk_krause.jtools.GuiDialog getGuid()
Get the GUI options dialog.

Returns:
The GUI options dialog.

resetGuid

protected void resetGuid()
Mark the current GUI options dialog as not longer being used.


showGuiSetupDialog

protected void showGuiSetupDialog()
Show the GUI options dialog.


getRunning

protected boolean getRunning()
Check whether or not a background task is running.

Returns:
The test result.

setRunning

protected void setRunning(boolean b)
Set the flag to indicate whether or not a background task is running.

Parameters:
b - The new flag value.

findImageForName

protected javax.swing.ImageIcon findImageForName(java.lang.String n)
Search for an icon image.

Parameters:
n - The file name.
Returns:
The icon image or null.

chooseDirectory

protected void chooseDirectory()
Choose a new directory for tracecc.


retrieveDefaults

public void retrieveDefaults()
Retrieve default settings.


saveDefaults

public void saveDefaults()
Save default settings.


runProgram

public void runProgram()
Run tracecc.


positionLogWindow

public void positionLogWindow()
Choose a non-modal position for the log window.


actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Reaction on mouseclicks

Specified by:
actionPerformed in interface java.awt.event.ActionListener