Package adams.gui.application
Class AbstractApplicationFrame
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- java.awt.Window
-
- java.awt.Frame
-
- javax.swing.JFrame
-
- adams.gui.core.BaseFrame
-
- adams.gui.core.AbstractFrameWithOptionHandling
-
- adams.gui.application.AbstractApplicationFrame
-
- All Implemented Interfaces:
Destroyable
,LoggingSupporter
,RestartableApplication
,OptionHandler
,DatabaseConnectionHandler
,DatabaseConnectionProvider
,DatabaseConnectionUser
,HomeRelocator
,DatabaseConnectionChangeListener
,RemoteScriptingEngineHandler
,ImageObserver
,MenuContainer
,Serializable
,Accessible
,RootPaneContainer
,WindowConstants
- Direct Known Subclasses:
Main
public abstract class AbstractApplicationFrame extends AbstractFrameWithOptionHandling implements DatabaseConnectionHandler, DatabaseConnectionChangeListener, RestartableApplication, RemoteScriptingEngineHandler
Abstract frame class for applications.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
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
Fields Modifier and Type Field Description protected String
m_ApplicationTitle
the title of the application.protected ApplicationMenu
m_AppMenu
the application menu in use.protected HashSet<Child>
m_Children
contains the child frames/windows (title <-> object).protected AbstractDatabaseConnection
m_DbConn
the global database connection.protected PlaceholderDirectory[]
m_DocumentationDirectories
the directories containing PDF documentation.protected boolean
m_EnableRestart
whether the application can be restarted (through Launcher class).protected boolean
m_InitFinished
whether initialization has finished.protected Logger
m_Logger
the logger to use.protected LoggingLevel
m_LoggingLevel
the logging level.protected JMenu
m_MenuWindows
the "windows" menu.protected boolean
m_MinimalWindow
whether to not maximize the main window.protected RemoteScriptingEngine
m_RemoteScriptingEngine
the remote command scripting engine.protected String
m_RemoteScriptingEngineCmdLine
the commandline of the remote scripting engine to use at startup time.protected Set<RemoteScriptingEngineUpdateListener>
m_RemoteScriptingEngineUpdateListeners
the listeners for changes to the remote scripting engine.protected ScriptingLogPanel
m_ScriptingLogPanel
the scripting log panel.protected AbstractApplicationFrame
m_Self
the frame itself.protected BaseString[]
m_StartUps
the menu items (classnames with further parameters) to start up immediately.protected UserMode
m_UserMode
the user mode - determines what menu entries to display.-
Fields inherited from class adams.gui.core.AbstractFrameWithOptionHandling
m_Home, m_OptionManager
-
Fields inherited from class adams.gui.core.BaseFrame
m_MaximizationFixWindowListener, m_UISettingsApplied, m_UISettingsPrefix, m_UISettingsStored, m_UseMaximizationFix
-
Fields 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 adams.core.management.RestartableApplication
FLAG_ENABLE_RESTART, OPTION_ENABLE_RESTART
-
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
-
-
Constructor Summary
Constructors Constructor Description AbstractApplicationFrame()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addChildFrame(ChildFrame c)
adds the given child frame to the list of frames.void
addRemoteScriptingEngine(RemoteScriptingEngine value)
Adds the scripting engine to execute.void
addRemoteScriptingEngineUpdateListener(RemoteScriptingEngineUpdateListener l)
Adds the listener for remote scripting engine changes.String
applicationTitleTipText()
Returns the tip text for this property.protected void
buildWindowsMenu()
creates the menu of currently open windows.void
close()
Closes the application down.protected void
closeApplication()
Closes the application.protected void
closeChildren()
Closes all children frames.boolean
containsWindow(Class windowClass)
checks, whether an instance of the given window class is already in the Window list.boolean
containsWindow(String title)
checks, whether a window with the given title is already in the Window list.static ChildFrame
createChildFrame(AbstractApplicationFrame owner, String title, Component c, Dimension size, String icon)
creates a frame and returns it.protected ChildFrame
createChildFrame(String title, Component c, Dimension size, String icon)
creates a frame and returns it.protected Handler
createLogHandler()
Returns the log handler to use.protected JMenuBar
createMenuBar()
Creates the menu bar.void
createTitle(String title)
creates and displays the title.void
databaseConnectionStateChanged(DatabaseConnectionChangeEvent e)
A change in the database connection occurred.void
defineOptions()
Adds options to the internal list of options.String
documentationDirectoriesTipText()
Returns the tip text for this property.String
enableRestartTipText()
Returns the tip text for this property.protected void
finishInit()
finishes the initialization, by setting size/location.static AbstractApplicationFrame
forCommandLine(String cmdline)
Instantiates the application frame from the given commandline (i.e., classname and optional options).static AbstractApplicationFrame
forName(String classname, String[] options)
Instantiates the application frame with the given options.String
getApplicationTitle()
Returns the currently set application title.ApplicationMenu
getAppMenu()
Returns the menu generator.AbstractDatabaseConnection
getDatabaseConnection()
Returns the currently used database connection object, can be null.protected abstract String
getDefaultApplicationTitle()
Returns the default title of the application.protected abstract AbstractDatabaseConnection
getDefaultDatabaseConnection()
Returns the default database connection.PlaceholderDirectory[]
getDocumentationDirectories()
Returns the currently set directories with PDF documentation.boolean
getEnableRestart()
Returns whether to enable the restart through the Launcher.static String
getHostnamePrefix()
Returns the hostname prefix for windows.Logger
getLogger()
Returns the logger in use.LoggingLevel
getLoggingLevel()
Returns the logging level.protected abstract String
getMenuLayoutFile()
Returns the filename that stores the menu layout.boolean
getMinimalWindow()
Returns whether the main window uses minimal size or gets extended to the full width of the screen.RemoteScriptingEngine
getRemoteScriptingEngine()
Returns the current scripting engine if any.String
getRemoteScriptingEngineCmdLine()
Returns the commandline of the remote scripting engine to execute at startup time.ScriptingLogPanel
getScriptingLogPanel()
Returns the scripting log panel instance.BaseString[]
getStartUps()
Returns the currently set menu items to immediately start up.UserMode
getUserMode()
Returns the current user mode - determines what menu entries are being displayed.Child
getWindow(Class windowClass)
returns the first instance of the given window class, null if none can be found.Child
getWindow(String title)
returns the first window with the given title, null if none can be found.Iterator<Child>
getWindowList()
returns all currently open frames.protected void
initGUI()
initializes the GUI.protected void
initialize()
Initializes the members.protected void
initializeLogger()
Initializes the logger.static String
insertHostnamePrefix(String title)
Injects the hostname, if possible, into the title for the window.protected void
insertMenuItem(JMenu menu, JMenuItem menuitem)
insert the menu item in a sorted fashion.protected void
insertMenuItem(JMenu menu, JMenuItem menuitem, int startIndex)
insert the menu item in a sorted fashion.String
loggingLevelTipText()
Returns the tip text for this property.String
minimalWindowTipText()
Returns the tip text for this property.void
minimizeWindows()
minimizes all windows.void
notifyRemoteScriptingEngineUpdateListeners(RemoteScriptingEngineUpdateEvent e)
Notifies all listeners of remote scripting engine changes.String
remoteScriptingEngineCmdLineTipText()
Returns the tip text for this property.boolean
removeChildFrame(Container c)
tries to remove the child frame, it returns true if it could do such.void
removeRemoteScriptingEngine(RemoteScriptingEngine value)
Removes the scripting engine (and stops it).void
removeRemoteScriptingEngineUpdateListener(RemoteScriptingEngineUpdateListener l)
Removes the listener for remote scripting engine changes.void
restoreWindows()
restores all windows.static AbstractApplicationFrame
runApplication(Class env, Class app, String[] options)
Runs the application from the commandline.void
setApplicationTitle(String value)
Sets the application title to use.void
setDatabaseConnection(AbstractDatabaseConnection value)
Sets the database connection object to use.void
setDocumentationDirectories(PlaceholderDirectory[] value)
Sets the currently set directories with PDF documentation.void
setEnableRestart(boolean value)
Sets whether to enable the restart through the Launcher.void
setLoggingLevel(LoggingLevel value)
Sets the logging level.protected void
setLookAndFeel()
Sets the look'n'feel.void
setMinimalWindow(boolean value)
Sets whether the main window uses minimal size or gets extended to the full width of the screen.void
setRemoteScriptingEngine(RemoteScriptingEngine value)
Sets the scripting engine to execute.void
setRemoteScriptingEngineCmdLine(String value)
Sets the commandline of the remote scripting engine to execute at startup time.protected void
setSizeAndLocation()
Sets the size and location of the main window.void
setStartUps(BaseString[] value)
Sets the menu items to start up immediately.void
setUserMode(UserMode value)
Sets the user mode - determines what menu entries are being displayed.void
setVisible(boolean b)
Shows or hides this component depending on the value of parameter b.boolean
showWindow(Child c)
brings child frame to the top.boolean
showWindow(Class windowClass)
brings the first frame to the top that is of the specified window class.protected void
startUpMenuItems()
Starts up any menu items that were defined.String
startUpsTipText()
Returns the tip text for this property.String
toCommandLine()
Returns the commandline string.String
userModeTipText()
Returns the tip text for this property.void
windowListChanged()
is called when window list changed somehow (add or remove).-
Methods inherited from class adams.gui.core.AbstractFrameWithOptionHandling
cleanUpOptions, destroy, getHome, getOptionManager, homeTipText, newOptionManager, performInitialization, reset, runFrame, setHome
-
Methods inherited from class adams.gui.core.BaseFrame
afterHide, afterShow, applyUISettings, beforeHide, beforeShow, forName, getUISettingsApplied, getUISettingsPrefix, isLoggingEnabled, runFrame, setBounds, setLocationRelativeTo, setUISettingsPrefix, setUISettingsPrefix, storeUISettings
-
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, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setMinimumSize, setModalExclusionType, setSize, setSize, setType, 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 adams.core.Destroyable
destroy
-
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, getOptionManager
-
-
-
-
Field Detail
-
m_Self
protected AbstractApplicationFrame m_Self
the frame itself.
-
m_Children
protected HashSet<Child> m_Children
contains the child frames/windows (title <-> object).
-
m_MenuWindows
protected JMenu m_MenuWindows
the "windows" menu.
-
m_ScriptingLogPanel
protected ScriptingLogPanel m_ScriptingLogPanel
the scripting log panel.
-
m_DbConn
protected AbstractDatabaseConnection m_DbConn
the global database connection.
-
m_ApplicationTitle
protected String m_ApplicationTitle
the title of the application.
-
m_LoggingLevel
protected LoggingLevel m_LoggingLevel
the logging level.
-
m_UserMode
protected UserMode m_UserMode
the user mode - determines what menu entries to display.
-
m_MinimalWindow
protected boolean m_MinimalWindow
whether to not maximize the main window.
-
m_EnableRestart
protected boolean m_EnableRestart
whether the application can be restarted (through Launcher class).
-
m_StartUps
protected BaseString[] m_StartUps
the menu items (classnames with further parameters) to start up immediately.
-
m_DocumentationDirectories
protected PlaceholderDirectory[] m_DocumentationDirectories
the directories containing PDF documentation.
-
m_AppMenu
protected ApplicationMenu m_AppMenu
the application menu in use.
-
m_InitFinished
protected boolean m_InitFinished
whether initialization has finished.
-
m_Logger
protected Logger m_Logger
the logger to use.
-
m_RemoteScriptingEngineCmdLine
protected String m_RemoteScriptingEngineCmdLine
the commandline of the remote scripting engine to use at startup time.
-
m_RemoteScriptingEngine
protected RemoteScriptingEngine m_RemoteScriptingEngine
the remote command scripting engine.
-
m_RemoteScriptingEngineUpdateListeners
protected Set<RemoteScriptingEngineUpdateListener> m_RemoteScriptingEngineUpdateListeners
the listeners for changes to the remote scripting engine.
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractFrameWithOptionHandling
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initialize
in classBaseFrame
-
initializeLogger
protected void initializeLogger()
Initializes the logger.
Default implementation uses the class name.- Overrides:
initializeLogger
in classBaseFrame
-
getLogger
public Logger getLogger()
Returns the logger in use.- Specified by:
getLogger
in interfaceLoggingSupporter
- Overrides:
getLogger
in classBaseFrame
- Returns:
- the logger
-
getDefaultDatabaseConnection
protected abstract AbstractDatabaseConnection getDefaultDatabaseConnection()
Returns the default database connection.- Returns:
- the default database connection
-
getDefaultApplicationTitle
protected abstract String getDefaultApplicationTitle()
Returns the default title of the application.- Returns:
- the default title
-
setLoggingLevel
public void setLoggingLevel(LoggingLevel value)
Sets the logging level.- Parameters:
value
- the level
-
getLoggingLevel
public LoggingLevel getLoggingLevel()
Returns the logging level.- Returns:
- the level
-
loggingLevelTipText
public String loggingLevelTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getApplicationTitle
public String getApplicationTitle()
Returns the currently set application title.- Returns:
- the current title
-
setApplicationTitle
public void setApplicationTitle(String value)
Sets the application title to use.- Parameters:
value
- the title to use
-
applicationTitleTipText
public String applicationTitleTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setUserMode
public void setUserMode(UserMode value)
Sets the user mode - determines what menu entries are being displayed.- Parameters:
value
- the user mode
-
getUserMode
public UserMode getUserMode()
Returns the current user mode - determines what menu entries are being displayed.- Returns:
- the user mode
-
userModeTipText
public String userModeTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setMinimalWindow
public void setMinimalWindow(boolean value)
Sets whether the main window uses minimal size or gets extended to the full width of the screen.- Parameters:
value
- true if minimal size
-
getMinimalWindow
public boolean getMinimalWindow()
Returns whether the main window uses minimal size or gets extended to the full width of the screen.- Returns:
- true if minimal size
-
minimalWindowTipText
public String minimalWindowTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getStartUps
public BaseString[] getStartUps()
Returns the currently set menu items to immediately start up.- Returns:
- the menu items (incl. further parameters)
-
setStartUps
public void setStartUps(BaseString[] value)
Sets the menu items to start up immediately.- Parameters:
value
- the menu items (incl. further parameters)
-
startUpsTipText
public String startUpsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getDocumentationDirectories
public PlaceholderDirectory[] getDocumentationDirectories()
Returns the currently set directories with PDF documentation.- Returns:
- the directories
-
setDocumentationDirectories
public void setDocumentationDirectories(PlaceholderDirectory[] value)
Sets the currently set directories with PDF documentation.- Parameters:
value
- the menu items (incl. further parameters)
-
documentationDirectoriesTipText
public String documentationDirectoriesTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setEnableRestart
public void setEnableRestart(boolean value)
Sets whether to enable the restart through the Launcher.- Specified by:
setEnableRestart
in interfaceRestartableApplication
- Parameters:
value
- true if to enable restart via Launcher class
-
getEnableRestart
public boolean getEnableRestart()
Returns whether to enable the restart through the Launcher.- Specified by:
getEnableRestart
in interfaceRestartableApplication
- Returns:
- true if restart is enabled
-
enableRestartTipText
public String enableRestartTipText()
Returns the tip text for this property.- Specified by:
enableRestartTipText
in interfaceRestartableApplication
- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setRemoteScriptingEngineCmdLine
public void setRemoteScriptingEngineCmdLine(String value)
Sets the commandline of the remote scripting engine to execute at startup time.- Parameters:
value
- the commandline, use empty string if not to use one
-
getRemoteScriptingEngineCmdLine
public String getRemoteScriptingEngineCmdLine()
Returns the commandline of the remote scripting engine to execute at startup time.- Returns:
- the commandline, empty string it not to use one
-
remoteScriptingEngineCmdLineTipText
public String remoteScriptingEngineCmdLineTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
addRemoteScriptingEngineUpdateListener
public void addRemoteScriptingEngineUpdateListener(RemoteScriptingEngineUpdateListener l)
Adds the listener for remote scripting engine changes.- Specified by:
addRemoteScriptingEngineUpdateListener
in interfaceRemoteScriptingEngineHandler
- Parameters:
l
- the listener
-
removeRemoteScriptingEngineUpdateListener
public void removeRemoteScriptingEngineUpdateListener(RemoteScriptingEngineUpdateListener l)
Removes the listener for remote scripting engine changes.- Specified by:
removeRemoteScriptingEngineUpdateListener
in interfaceRemoteScriptingEngineHandler
- Parameters:
l
- the listener
-
notifyRemoteScriptingEngineUpdateListeners
public void notifyRemoteScriptingEngineUpdateListeners(RemoteScriptingEngineUpdateEvent e)
Notifies all listeners of remote scripting engine changes.- Parameters:
e
- the event to send
-
setLookAndFeel
protected void setLookAndFeel()
Sets the look'n'feel.
-
finishInit
protected void finishInit()
finishes the initialization, by setting size/location.- Overrides:
finishInit
in classBaseFrame
-
createLogHandler
protected Handler createLogHandler()
Returns the log handler to use.- Returns:
- the handler
-
setSizeAndLocation
protected void setSizeAndLocation()
Sets the size and location of the main window.
-
closeChildren
protected void closeChildren()
Closes all children frames.
-
closeApplication
protected void closeApplication()
Closes the application.
-
close
public void close()
Closes the application down.
-
getMenuLayoutFile
protected abstract String getMenuLayoutFile()
Returns the filename that stores the menu layout.- Returns:
- the filename
-
getAppMenu
public ApplicationMenu getAppMenu()
Returns the menu generator.- Returns:
- the menu generator
-
createMenuBar
protected JMenuBar createMenuBar()
Creates the menu bar.- Returns:
- the generated menu bar
-
createChildFrame
protected ChildFrame createChildFrame(String title, Component c, Dimension size, String icon)
creates a frame and returns it.- Parameters:
title
- the title of the framec
- the component to place, can be nullsize
- the size of the frame, ignored if -1 and -1icon
- the icon to use, null for default- Returns:
- the generated frame
-
createChildFrame
public static ChildFrame createChildFrame(AbstractApplicationFrame owner, String title, Component c, Dimension size, String icon)
creates a frame and returns it.- Parameters:
owner
- the ownertitle
- the title of the framec
- the component to place, can be nullsize
- the size of the frame, ignored if -1 and -1icon
- the icon to use, null for default- Returns:
- the generated frame
-
insertMenuItem
protected void insertMenuItem(JMenu menu, JMenuItem menuitem)
insert the menu item in a sorted fashion.- Parameters:
menu
- the menu to add the item tomenuitem
- the menu item to add
-
insertMenuItem
protected void insertMenuItem(JMenu menu, JMenuItem menuitem, int startIndex)
insert the menu item in a sorted fashion.- Parameters:
menu
- the menu to add the item tomenuitem
- the menu item to addstartIndex
- the index in the menu to start with (0-based)
-
createTitle
public void createTitle(String title)
creates and displays the title.- Parameters:
title
- the additional part of the title
-
addChildFrame
public void addChildFrame(ChildFrame c)
adds the given child frame to the list of frames.- Parameters:
c
- the child frame to add
-
removeChildFrame
public boolean removeChildFrame(Container c)
tries to remove the child frame, it returns true if it could do such.- Parameters:
c
- the child frame to remove- Returns:
- true if the child frame could be removed
-
showWindow
public boolean showWindow(Child c)
brings child frame to the top.- Parameters:
c
- the frame to activate- Returns:
- true if frame was activated
-
showWindow
public boolean showWindow(Class windowClass)
brings the first frame to the top that is of the specified window class.- Parameters:
windowClass
- the class to display the first child for- Returns:
- true, if a child was found and brought to front
-
getWindowList
public Iterator<Child> getWindowList()
returns all currently open frames.- Returns:
- an iterator over all currently open frame
-
getWindow
public Child getWindow(Class windowClass)
returns the first instance of the given window class, null if none can be found.- Parameters:
windowClass
- the class to retrieve the first instance for- Returns:
- null, if no instance can be found
-
getWindow
public Child getWindow(String title)
returns the first window with the given title, null if none can be found.- Parameters:
title
- the title to look for- Returns:
- null, if no instance can be found
-
containsWindow
public boolean containsWindow(Class windowClass)
checks, whether an instance of the given window class is already in the Window list.- Parameters:
windowClass
- the class to check for an instance in the current window list- Returns:
- true if the class is already listed in the Window list
-
containsWindow
public boolean containsWindow(String title)
checks, whether a window with the given title is already in the Window list.- Parameters:
title
- the title to check for in the current window list- Returns:
- true if a window with the given title is already listed in the Window list
-
minimizeWindows
public void minimizeWindows()
minimizes all windows.
-
restoreWindows
public void restoreWindows()
restores all windows.
-
windowListChanged
public void windowListChanged()
is called when window list changed somehow (add or remove).
-
buildWindowsMenu
protected void buildWindowsMenu()
creates the menu of currently open windows.
-
setVisible
public void setVisible(boolean b)
Shows or hides this component depending on the value of parameter b.- Overrides:
setVisible
in classBaseFrame
- Parameters:
b
- if true, shows this component; otherwise, hides this component
-
getDatabaseConnection
public AbstractDatabaseConnection getDatabaseConnection()
Returns the currently used database connection object, can be null.- Specified by:
getDatabaseConnection
in interfaceDatabaseConnectionProvider
- Returns:
- the current object
-
setDatabaseConnection
public void setDatabaseConnection(AbstractDatabaseConnection value)
Sets the database connection object to use.- Specified by:
setDatabaseConnection
in interfaceDatabaseConnectionHandler
- Parameters:
value
- the object to use
-
databaseConnectionStateChanged
public void databaseConnectionStateChanged(DatabaseConnectionChangeEvent e)
A change in the database connection occurred.- Specified by:
databaseConnectionStateChanged
in interfaceDatabaseConnectionChangeListener
- Parameters:
e
- the event
-
startUpMenuItems
protected void startUpMenuItems()
Starts up any menu items that were defined.- See Also:
m_StartUps
-
getScriptingLogPanel
public ScriptingLogPanel getScriptingLogPanel()
Returns the scripting log panel instance.- Returns:
- the panel
-
addRemoteScriptingEngine
public void addRemoteScriptingEngine(RemoteScriptingEngine value)
Adds the scripting engine to execute. Doesn't stop any running engines.- Specified by:
addRemoteScriptingEngine
in interfaceRemoteScriptingEngineHandler
- Parameters:
value
- the engine to add
-
removeRemoteScriptingEngine
public void removeRemoteScriptingEngine(RemoteScriptingEngine value)
Removes the scripting engine (and stops it). Doesn't stop any running engines.- Specified by:
removeRemoteScriptingEngine
in interfaceRemoteScriptingEngineHandler
- Parameters:
value
- the engine to remove
-
setRemoteScriptingEngine
public void setRemoteScriptingEngine(RemoteScriptingEngine value)
Sets the scripting engine to execute. Any running engine is stopped first.- Specified by:
setRemoteScriptingEngine
in interfaceRemoteScriptingEngineHandler
- Parameters:
value
- the engine to use, null to turn off scripting
-
getRemoteScriptingEngine
public RemoteScriptingEngine getRemoteScriptingEngine()
Returns the current scripting engine if any.- Specified by:
getRemoteScriptingEngine
in interfaceRemoteScriptingEngineHandler
- Returns:
- the engine in use, null if none running
-
toCommandLine
public String toCommandLine()
Returns the commandline string.- Specified by:
toCommandLine
in interfaceOptionHandler
- Overrides:
toCommandLine
in classAbstractFrameWithOptionHandling
- Returns:
- the commandline
-
getHostnamePrefix
public static String getHostnamePrefix()
Returns the hostname prefix for windows.- Returns:
- the prefix, null if not available
-
insertHostnamePrefix
public static String insertHostnamePrefix(String title)
Injects the hostname, if possible, into the title for the window.- Parameters:
title
- the title to update- Returns:
- the updated title
-
runApplication
public static AbstractApplicationFrame runApplication(Class env, Class app, String[] options)
Runs the application from the commandline.- Parameters:
env
- the environment class to useapp
- the application frame classoptions
- the commandline options- Returns:
- the instantiated frame, null in case of an error or invocation of help
-
forName
public static AbstractApplicationFrame forName(String classname, String[] options)
Instantiates the application frame with the given options.- Parameters:
classname
- the classname of the application frame to instantiateoptions
- the options for the application frame- Returns:
- the instantiated application frame or null if an error occurred
-
forCommandLine
public static AbstractApplicationFrame forCommandLine(String cmdline)
Instantiates the application frame from the given commandline (i.e., classname and optional options).- Parameters:
cmdline
- the classname (and optional options) of the application frame to instantiate- Returns:
- the instantiated application frame or null if an error occurred
-
-