Package org.sm.smtools.application
Class JDerivedGUIApplication
java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
org.sm.smtools.application.JStandardGUIApplication
org.sm.smtools.application.JDerivedGUIApplication
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.awt.event.ComponentListener
,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 final class JDerivedGUIApplication extends JStandardGUIApplication implements java.awt.event.ActionListener
The
JDerivedGUIApplication
class is a demonstration of the SMTools GUI framework.
When this class's main(String[])
method is invoked, the resulting
GUI looks as follows:
Refer to the JStandardGUIApplication
class for further information.
Note that this class cannot be subclassed!
- Version:
- 03/03/2021
- Author:
- Sven Maerivoet
- See Also:
JStandardGUIApplication
, 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, java.awt.Window.Type
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
Fields inherited from class org.sm.smtools.application.JStandardGUIApplication
fResources, kAutoSizeGUI, kFullScreenGUI, klafGTK, klafMac, klafMetal, klafMotif, klafNimbus, klafQuaqua, klafSystem, klafWindows, klafWindowsClassic
Fields inherited from class javax.swing.JFrame
accessibleContext, rootPane, rootPaneCheckingEnabled
Fields inherited from class java.awt.Frame
ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, NORMAL
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 Constructor Description JDerivedGUIApplication(java.lang.String[] argv)
Constructs aJDerivedGUIApplication
object. -
Method Summary
Modifier and Type Method Description void
actionPerformed(java.awt.event.ActionEvent e)
protected void
createGUIToolBar()
protected java.lang.String
getApplicationLocalePrefix()
protected java.lang.String
getApplicationResourceArchiveFilename()
protected void
getGUIContentPane(javax.swing.JPanel contentPane)
protected javax.swing.JPanel
getGUIGlassPane()
protected java.awt.Image
getGUIIcon()
protected java.awt.Dimension
getGUIInitialSize()
protected java.util.ArrayList<javax.swing.JMenu>
getGUIMenus()
protected javax.swing.JMenu
getGUIRightHandMenu()
protected javax.swing.JLabel
getGUISplashScreenContent()
protected java.io.InputStream
getGUISplashScreenSound()
protected java.util.ArrayList<javax.swing.JLabel>
getGUIStatusBarCustomLabels()
protected java.lang.String
getGUITitle()
protected java.lang.String
getGUIToolBarTitle()
protected boolean
hasGUIAboutBox()
protected void
initialiseApplication(java.lang.Object[] parameters)
protected boolean
isGUIClockEnabled()
protected boolean
isGUIStatusBarEnabled()
static void
main(java.lang.String[] argv)
The application's entry point.protected boolean
parseApplicationParameter(int paramNr, java.lang.String parameter)
protected void
showGUIAboutBox()
Methods inherited from class org.sm.smtools.application.JStandardGUIApplication
abortApplication, addGUIToolBarButton, addGUIToolBarComponent, addGUIToolBarSeparator, beep, componentHidden, componentMoved, componentResized, componentShown, constructGUICheckBoxMenuItem, constructGUICheckBoxMenuItem, constructGUIMenuItem, constructGUIMenuItem, constructGUIRadioButtonMenuItem, constructGUIRadioButtonMenuItem, getApplicationRequiredMajorJavaVersion, getApplicationRequiredMinorJavaVersion, getGUIInitialLookAndFeel, getGUIInitialSoundSet, getGUIScreenInsets, getGUIScreenSize, getGUISplashScreen, getGUIStatusBar, getGUISystemSoundsEnabledOnStartup, getGUIToolBarActionMap, getGUIToolBarInputMap, guiLookAndFeelChanged, guiWindowResized, hideGUIMouseCursor, hideGUIToolBar, isGUIMinimiseToSystemTrayAllowed, isGUIRepaintedWhenResizing, isGUIResizable, isGUIToolBarFloatable, loadApplicationRegistry, setGUIDynamicLayout, showApplicationParameterWarning, showGUIDefaultMouseCursor, showGUIToolBar, showGUIWaitMouseCursor, shutdownApplication, 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, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, 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, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, toBack, toFront
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, list, list, paintComponents, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
Methods inherited from class java.awt.Component
add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, 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, hasFocus, imageUpdate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, list, list, list, 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, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.awt.MenuContainer
getFont
-
Constructor Details
-
JDerivedGUIApplication
public JDerivedGUIApplication(java.lang.String[] argv)Constructs aJDerivedGUIApplication
object.- Parameters:
argv
- an array of strings containing the command-line parameters
-
-
Method Details
-
main
public static void main(java.lang.String[] argv)The application's entry point.- Parameters:
argv
- an array of strings containing the command-line parameters
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)- Specified by:
actionPerformed
in interfacejava.awt.event.ActionListener
- Overrides:
actionPerformed
in classJStandardGUIApplication
- Parameters:
e
- theActionEvent
that is received
-
parseApplicationParameter
protected boolean parseApplicationParameter(int paramNr, java.lang.String parameter)- Overrides:
parseApplicationParameter
in classJStandardGUIApplication
- Parameters:
paramNr
- the number of the parameter that is being parsedparameter
- the unmodified parameter as specified on the command-line- Returns:
true
if the parameter was parsed successfully,false
otherwise- See Also:
JStandardGUIApplication.showApplicationParameterWarning(int,String,String)
-
getApplicationResourceArchiveFilename
protected java.lang.String getApplicationResourceArchiveFilename()- Overrides:
getApplicationResourceArchiveFilename
in classJStandardGUIApplication
- Returns:
- the filename of the archive (JAR or ZIP) containing the application's resources
- See Also:
JARResources
-
getApplicationLocalePrefix
protected java.lang.String getApplicationLocalePrefix()- Overrides:
getApplicationLocalePrefix
in classJStandardGUIApplication
- Returns:
- the path to the location of the application's locale databases
- See Also:
I18NL10N
-
initialiseApplication
protected void initialiseApplication(java.lang.Object[] parameters)- Overrides:
initialiseApplication
in classJStandardGUIApplication
- Parameters:
parameters
- an array ofObjects
-
getGUISplashScreenContent
protected javax.swing.JLabel getGUISplashScreenContent()- Overrides:
getGUISplashScreenContent
in classJStandardGUIApplication
- Returns:
- a
JLabel
containing the splash screen's custom content - See Also:
JSplashScreen
-
getGUISplashScreenSound
protected java.io.InputStream getGUISplashScreenSound()- Overrides:
getGUISplashScreenSound
in classJStandardGUIApplication
- Returns:
- the MP3 sound to play during the splash screen
- See Also:
JSplashScreen
,MP3Player
-
getGUIInitialSize
protected final java.awt.Dimension getGUIInitialSize()- Overrides:
getGUIInitialSize
in classJStandardGUIApplication
- Returns:
- the GUI's initial size on the screen as a
Dimension
object
-
getGUIIcon
protected java.awt.Image getGUIIcon()- Overrides:
getGUIIcon
in classJStandardGUIApplication
- Returns:
- the
Image
containing the GUI's icon
-
getGUITitle
protected java.lang.String getGUITitle()- Overrides:
getGUITitle
in classJStandardGUIApplication
- Returns:
- the GUI's window title
-
getGUIContentPane
protected void getGUIContentPane(javax.swing.JPanel contentPane)- Overrides:
getGUIContentPane
in classJStandardGUIApplication
- Parameters:
contentPane
- the GUI's main content pane to modify
-
getGUIToolBarTitle
protected java.lang.String getGUIToolBarTitle()- Overrides:
getGUIToolBarTitle
in classJStandardGUIApplication
- Returns:
- the GUI's tool bar's title
-
createGUIToolBar
protected void createGUIToolBar()- Overrides:
createGUIToolBar
in classJStandardGUIApplication
-
getGUIMenus
protected java.util.ArrayList<javax.swing.JMenu> getGUIMenus()- Overrides:
getGUIMenus
in classJStandardGUIApplication
- Returns:
- an
ArrayList
of menus - See Also:
JStandardGUIApplication.getGUIRightHandMenu()
-
getGUIRightHandMenu
protected javax.swing.JMenu getGUIRightHandMenu()- Overrides:
getGUIRightHandMenu
in classJStandardGUIApplication
- Returns:
- a menu used in the right part of the menubar
- See Also:
JStandardGUIApplication.getGUIMenus()
-
getGUIStatusBarCustomLabels
protected java.util.ArrayList<javax.swing.JLabel> getGUIStatusBarCustomLabels()- Overrides:
getGUIStatusBarCustomLabels
in classJStandardGUIApplication
- Returns:
- an
ArrayList
of custom labels, ornull
if none are provided
-
isGUIStatusBarEnabled
protected boolean isGUIStatusBarEnabled()- Overrides:
isGUIStatusBarEnabled
in classJStandardGUIApplication
- Returns:
- whether or not the status bar should be shown at the bottom of the application's window
-
getGUIGlassPane
protected javax.swing.JPanel getGUIGlassPane()- Overrides:
getGUIGlassPane
in classJStandardGUIApplication
- Returns:
- a constructed glass pane
-
isGUIClockEnabled
protected boolean isGUIClockEnabled()- Overrides:
isGUIClockEnabled
in classJStandardGUIApplication
- Returns:
- whether or not a clock (HH:MM:SS) should be shown at the right of the menubar
-
hasGUIAboutBox
protected boolean hasGUIAboutBox()- Overrides:
hasGUIAboutBox
in classJStandardGUIApplication
- Returns:
- a
boolean
indicating whether or not a custom about box is available - See Also:
JAboutBox
-
showGUIAboutBox
protected void showGUIAboutBox()- Overrides:
showGUIAboutBox
in classJStandardGUIApplication
- See Also:
JAboutBox
-