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:
ActionListener
,ComponentListener
,WindowListener
,ImageObserver
,MenuContainer
,Serializable
,EventListener
,Accessible
,RootPaneContainer
,WindowConstants
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:
- 01/05/2024
- Author:
- Sven Maerivoet
- 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
Fields inherited from class org.sm.smtools.application.JStandardGUIApplication
fResources, kAutoSizeGUI, kFullScreenGUI, klafMetal, klafMotif, klafNimbus, 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
ConstructorDescriptionJDerivedGUIApplication
(String[] argv) Constructs aJDerivedGUIApplication
object. -
Method Summary
Modifier and TypeMethodDescriptionvoid
protected void
protected String
protected String
protected void
getGUIContentPane
(JPanel contentPane) protected JPanel
protected Image
protected final Dimension
protected JMenu
protected JLabel
protected InputStream
protected String
protected String
protected boolean
protected void
initialiseApplication
(Object[] parameters) protected boolean
protected boolean
static void
The application's entry point.protected boolean
parseApplicationParameter
(int paramNr, String parameter) protected void
Methods inherited from class org.sm.smtools.application.JStandardGUIApplication
abortApplication, addGUIToolBarButton, addGUIToolBarComponent, addGUIToolBarSeparator, beep, componentHidden, componentMoved, componentResized, componentShown, constructGUICheckBoxMenuItem, constructGUICheckBoxMenuItem, constructGUIMenuItem, constructGUIMenuItem, constructGUIRadioButtonMenuItem, constructGUIRadioButtonMenuItem, 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
Constructs aJDerivedGUIApplication
object.- Parameters:
argv
- an array of strings containing the command-line parameters
-
-
Method Details
-
main
The application's entry point.- Parameters:
argv
- an array of strings containing the command-line parameters
-
actionPerformed
- Specified by:
actionPerformed
in interfaceActionListener
- Overrides:
actionPerformed
in classJStandardGUIApplication
- Parameters:
e
- theActionEvent
that is received
-
parseApplicationParameter
- 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:
-
getApplicationResourceArchiveFilename
- Overrides:
getApplicationResourceArchiveFilename
in classJStandardGUIApplication
- Returns:
- the filename of the archive (JAR or ZIP) containing the application's resources
- See Also:
-
getApplicationLocalePrefix
- Overrides:
getApplicationLocalePrefix
in classJStandardGUIApplication
- Returns:
- the path to the location of the application's locale databases
- See Also:
-
initialiseApplication
- Overrides:
initialiseApplication
in classJStandardGUIApplication
- Parameters:
parameters
- an array ofObjects
-
getGUISplashScreenContent
- Overrides:
getGUISplashScreenContent
in classJStandardGUIApplication
- Returns:
- a
JLabel
containing the splash screen's custom content - See Also:
-
getGUISplashScreenSound
- Overrides:
getGUISplashScreenSound
in classJStandardGUIApplication
- Returns:
- the MP3 sound to play during the splash screen
- See Also:
-
getGUIInitialSize
- Overrides:
getGUIInitialSize
in classJStandardGUIApplication
- Returns:
- the GUI's initial size on the screen as a
Dimension
object
-
getGUIIcon
- Overrides:
getGUIIcon
in classJStandardGUIApplication
- Returns:
- the
Image
containing the GUI's icon
-
getGUITitle
- Overrides:
getGUITitle
in classJStandardGUIApplication
- Returns:
- the GUI's window title
-
getGUIContentPane
- Overrides:
getGUIContentPane
in classJStandardGUIApplication
- Parameters:
contentPane
- the GUI's main content pane to modify
-
getGUIToolBarTitle
- Overrides:
getGUIToolBarTitle
in classJStandardGUIApplication
- Returns:
- the GUI's tool bar's title
-
createGUIToolBar
protected void createGUIToolBar()- Overrides:
createGUIToolBar
in classJStandardGUIApplication
-
getGUIMenus
- Overrides:
getGUIMenus
in classJStandardGUIApplication
- Returns:
- an
ArrayList
of menus - See Also:
-
getGUIRightHandMenu
- Overrides:
getGUIRightHandMenu
in classJStandardGUIApplication
- Returns:
- a menu used in the right part of the menubar
- See Also:
-
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
- 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:
-
showGUIAboutBox
protected void showGUIAboutBox()- Overrides:
showGUIAboutBox
in classJStandardGUIApplication
- See Also:
-