Package dialog
Class TabbedGUI
java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
dialog.TabbedGUI
- All Implemented Interfaces:
ActionListener
,ImageObserver
,MenuContainer
,Serializable
,Runnable
,EventListener
,Accessible
,RootPaneContainer
,WindowConstants
- Direct Known Subclasses:
TemplateGUI
Abstract class for graphical user interfaces with tabbed panes.
- Since:
- 2007.02.12
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JFrame
JFrame.AccessibleJFrame
Nested classes/interfaces inherited from class java.awt.Frame
Frame.AccessibleAWTFrame
Nested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow, Window.Type
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DomainsPanel
the domains determination tabprotected JButton
the execution buttonprotected util.Executor
the executor for an object or an external programprotected FormatPanel
the data format tabprotected int
the index of the executed tabprotected boolean
whether started as an independent programprotected PrintStream
the stream to write progress messages toprotected Component
the owner of this dialog boxprotected JTabbedPane
the pane for the dialog tabsprotected long
the start time for the executionprotected JTextField
the status line (for messages)protected TerminalPanel
the terminal output tabFields inherited from class javax.swing.JFrame
accessibleContext, 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 java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
actionPerformed
(ActionEvent event) Process an event from the executor.addDomainsTab
(int mode) Add a domain determination tab.addDomainsTab
(String title, int mode) Add a domain determination tab.Add a data format tab.addFormatTab
(int mode) Add a data format tab.addFormatTab
(String title, int mode) Add a data format tab.Add an empty dialog tab.void
addTab
(String title, DialogPanel panel) Add a dialog tab.addTerminalTab
(String title) Add a terminal output tab.protected void
Create the basic graphical user interface.protected String[]
Create a command to determine attribute domains.protected util.Executable
Create a domain finder object.protected abstract util.Executor
createExecutor
(int i) Create the executor for a dialog tab.protected void
editDomains
(JTextField text) Edit domain descriptions.protected void
editFile
(JTextField text) Edit a text file.protected String
Get the result message of a determination of domains.Get the domains determination tab.protected JFileChooser
Get the file chooser.protected File
getFileName
(JTextField text) Get a file name and store it in a text field.protected File
getFileName
(JTextField text, String title) Get a file name and store it in a text field.Get the data format tab.Get the message text (status line) of the window.getPath()
Get the path to the external programs.protected String
Get the result message on successful termination.getTab
(int index) Get the tab at a given index.Get the terminal tab.protected void
Convenience function for the constructors of child classes.protected abstract void
loadConfig
(File file) Load a configuration file and set the input fields.protected int
readInt
(FileReader reader) Read an integer value (from the configuration file).protected String
readLine
(FileReader reader) Read a line (of the configuration file).abstract void
run()
Create the user interface.protected abstract void
saveConfig
(File file) Save a configuration filevoid
selectTab
(int index) Set the selected dialog tab.void
setDataFile
(File file) Set the data file.void
setDomainsFile
(File file) Set the domains file.void
setFormat
(FormatPanel fmt) set the data format.void
setMessage
(String msg) Set the message text (status line) of the window.void
Set the path to the external programs.void
setTestFile
(File file) Set the test file.protected void
showTable
(JTextField text) Show a data table (to be read from a file).protected static String[]
Shrink a command to a given length.protected void
start()
Execute the current dialog tab.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, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
Methods inherited from class java.awt.Window
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
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, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, 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, 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, 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, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, 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 Details
-
owner
the owner of this dialog box -
isprog
protected boolean isprogwhether started as an independent program -
pane
the pane for the dialog tabs -
format
the data format tab -
domains
the domains determination tab -
terminal
the terminal output tab -
status
the status line (for messages) -
exec
the execution button -
executor
protected util.Executor executorthe executor for an object or an external program -
index
protected int indexthe index of the executed tab -
start
protected long startthe start time for the execution -
log
the stream to write progress messages to
-
-
Constructor Details
-
TabbedGUI
protected TabbedGUI()Constructor.- Since:
- 2023.07.30 (Christian Borgelt)
-
-
Method Details
-
init
Convenience function for the constructors of child classes.- Parameters:
owner
- the owner of this dialog boxisprog
- whether started as a separate program- Since:
- 2007.02.10 (Christian Borgelt)
-
run
public abstract void run()Create the user interface.Following the recommendations in the Java tutorial, the user interface is created in the "run" method, which is invoked from the event queue, in order to avoid problems with threads.
-
base
Create the basic graphical user interface.- Parameters:
title
- the title of the dialog box- Since:
- 2007.02.10 (Christian Borgelt)
-
addTab
Add a dialog tab.- Parameters:
title
- the title of the dialog tab to addpanel
- the dialog tab to add- Since:
- 2007.07.26 (Christian Borgelt)
-
addTab
Add an empty dialog tab.- Parameters:
title
- the title of the dialog tab to add- Returns:
- the added empty dialog tab
- Since:
- 2007.07.26 (Christian Borgelt)
-
getTab
Get the tab at a given index.- Parameters:
index
- the index of the tab to get- Returns:
- the tab with the given index
- Since:
- 2007.07.24 (Christian Borgelt)
-
addFormatTab
Add a data format tab.- Returns:
- the created data format tab
- Since:
- 2007.07.26 (Christian Borgelt)
-
addFormatTab
Add a data format tab.- Parameters:
mode
- the mode of the format tab- Returns:
- the created data format tab
- Since:
- 2007.07.26 (Christian Borgelt)
-
addFormatTab
Add a data format tab.- Parameters:
title
- the title of the format tabmode
- the mode of the format tab- Returns:
- the created data format tab
- Since:
- 2007.07.26 (Christian Borgelt)
-
getFormatTab
Get the data format tab.- Returns:
- the created data format tab
- Since:
- 2007.07.24 (Christian Borgelt)
-
addDomainsTab
Add a domain determination tab.- Parameters:
mode
- the mode of the domains tab- Returns:
- the created domains determination tab
- Since:
- 2007.07.26 (Christian Borgelt)
-
addDomainsTab
Add a domain determination tab.- Parameters:
title
- the title of the domains tabmode
- the mode of the domains tab- Returns:
- the created domains determination tab
- Since:
- 2007.07.26 (Christian Borgelt)
-
getDomainsTab
Get the domains determination tab.- Returns:
- the created domains determination tab
- Since:
- 2007.07.24 (Christian Borgelt)
-
addTerminalTab
Add a terminal output tab.- Parameters:
title
- the title of the domains tab- Returns:
- the created terminal output tab
- Since:
- 2014.10.22 (Christian Borgelt)
-
getTerminalTab
Get the terminal tab.- Returns:
- the created terminal output tab
- Since:
- 2014.10.22 (Christian Borgelt)
-
selectTab
public void selectTab(int index) Set the selected dialog tab.- Parameters:
index
- the index of the tab to select- Since:
- 2007.07.26 (Christian Borgelt)
-
setFormat
set the data format.- Parameters:
fmt
- the format panel to set the format from- Since:
- 2007.07.26 (Christian Borgelt)
-
setDomainsFile
Set the domains file.- Parameters:
file
- the domains file to set- Since:
- 2007.07.24 (Christian Borgelt)
-
setDataFile
Set the data file.- Parameters:
file
- the data file to set- Since:
- 2007.07.24 (Christian Borgelt)
-
setTestFile
Set the test file.- Parameters:
file
- the test file to set- Since:
- 2007.07.24 (Christian Borgelt)
-
getMessage
Get the message text (status line) of the window.- Returns:
- the displayed message
- Since:
- 2007.07.26 (Christian Borgelt)
-
setMessage
Set the message text (status line) of the window.- Parameters:
msg
- the message to display- Since:
- 2007.03.12 (Christian Borgelt)
-
getFileChooser
Get the file chooser.- Returns:
- the file chooser
- Since:
- 2007.02.12 (Christian Borgelt)
-
getFileName
Get a file name and store it in a text field.- Parameters:
text
- the text field in which to store the file name- Returns:
- the selected file or
null
if cancelled - Since:
- 2007.02.12 (Christian Borgelt)
-
getFileName
Get a file name and store it in a text field.- Parameters:
text
- the text field in which to store the file nametitle
- the title of the file chooser dialog- Returns:
- the selected file or
null
if cancelled - Since:
- 2007.07.26 (Christian Borgelt)
-
showTable
Show a data table (to be read from a file).- Parameters:
text
- the text field containing the file name- Since:
- 2007.02.12 (Christian Borgelt)
-
editDomains
Edit domain descriptions.- Parameters:
text
- the text field containing the file name- Since:
- 2007.07.24 (Christian Borgelt)
-
editFile
Edit a text file.- Parameters:
text
- the text field containing the file name- Since:
- 2007.02.12 (Christian Borgelt)
-
getPath
Get the path to the external programs.- Returns:
- the path to the external programs
- Since:
- 2007.02.11 (Christian Borgelt)
-
setPath
Set the path to the external programs.- Parameters:
path
- the path to the external programs- Since:
- 2004.05.25 (Christian Borgelt)
-
createDomainsCmd
Create a command to determine attribute domains.The command is built according to the settings in the "domains" tab of this tabbed user interface.
- Returns:
- a command to determine attribute domains
- Since:
- 2004.05.25 (Christian Borgelt)
-
createDomainsObj
protected util.Executable createDomainsObj()Create a domain finder object.The domain finder is configured according to the settings in the "domains" tab of this tabbed user interface.
- Returns:
- a domain finder object
- Since:
- 2007.05.08 (Christian Borgelt)
-
createExecutor
protected abstract util.Executor createExecutor(int i) Create the executor for a dialog tab.- Parameters:
i
- the index of the dialog tab- Returns:
- the executor for the
i
-th dialog tab - Since:
- 2007.05.03 (Christian Borgelt)
-
start
protected void start()Execute the current dialog tab.- Since:
- 2007.02.12 (Christian Borgelt)
-
getResultMsg
Get the result message on successful termination.- Returns:
- the result message
- Since:
- 2007.02.10 (Christian Borgelt)
-
getDomainsMsg
Get the result message of a determination of domains.- Returns:
- the result message of a determination of domains
- Since:
- 2007.07.27 (Christian Borgelt)
-
actionPerformed
Process an event from the executor.- Specified by:
actionPerformed
in interfaceActionListener
- Parameters:
event
- the event to process- Since:
- 2007.02.12 (Christian Borgelt)
-
readLine
Read a line (of the configuration file).- Parameters:
reader
- the reader to read from- Returns:
- the line read
- Throws:
IOException
- if an i/o error occurs or no line could be read- Since:
- 2007.02.24 (Christian Borgelt)
-
readInt
Read an integer value (from the configuration file).- Parameters:
reader
- the reader to read from- Returns:
- the integer value read
- Throws:
IOException
- if an i/o error occurs or no field could be read- Since:
- 2006.07.13 (Christian Borgelt)
-
loadConfig
Load a configuration file and set the input fields.- Parameters:
file
- the file to load the configuration from- Since:
- 2006.07.13 (Christian Borgelt)
-
saveConfig
Save a configuration file- Parameters:
file
- the file to save the current configuration to- Since:
- 2006.07.13 (Christian Borgelt)
-
shrinkCmd
Shrink a command to a given length.- Parameters:
cmd
- the command to shrinkn
- the number of arguments- Returns:
- the shrunk command
- Since:
- 2007.02.16 (Christian Borgelt)
-