public abstract class MustFrame extends javax.swing.JFrame implements ContextHelp, AppTextResource, java.awt.event.WindowListener, java.awt.event.ComponentListener
javax.swing.JFrame.AccessibleJFrame
java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
Modifier and Type | Field and Description |
---|---|
protected java.awt.Cursor |
defaultCursor |
protected java.awt.Frame |
ownerFrame |
protected java.awt.Cursor |
waitCursor |
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
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
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Constructor and Description |
---|
MustFrame() |
Modifier and Type | Method and Description |
---|---|
abstract boolean |
acceptsClosingDueToInactivity()
Returns true if frame accepts closing due to inactivity.
|
protected boolean |
adjustSizeToPlausibleValue()
Checks whether the width laid out by user is less then the width resulting by pack(),
resizes the frame in this case to the packed value and returns true.
|
static void |
bringToFrontAll()
Brings to front all frames registered as main instance.
|
static void |
closeAll()
Closes all registered frame instances except the main frame (mostly the
menu).
|
static void |
closeAll(boolean respectUserInput)
Closes all registered frame instances except the main frame (mostly the
menu).
|
static void |
closeAllDueToInactivity()
Closes all frames that accept closing due to inactivity.
|
void |
closeInstance()
Closes the instance after reminding size and position of the frame as it
was laid-out by the user.
|
static boolean |
closeMainInstance(java.lang.Class<? extends java.awt.Frame> wishedFrameClass)
Closes the main instance of a frame if allowed.
|
void |
componentHidden(java.awt.event.ComponentEvent e)
Called when component is hidden.
|
void |
componentMoved(java.awt.event.ComponentEvent e)
Called when component is moved.
|
void |
componentResized(java.awt.event.ComponentEvent e)
Called when component is resized.
|
void |
componentShown(java.awt.event.ComponentEvent e)
Called when component is shown.
|
static void |
deiconifyAllExept(MustFrame exceptFrame) |
void |
deregisterAsMainInstance()
Deregisters this frame.
|
void |
destroy()
Destroys the frame.
|
protected void |
finalize() |
protected void |
free()
Frees (releases) references caused by this frame, particularly static
register entries.
|
void |
generalActionBeginnung()
General action at the beginning of proceeding user's interaction.
|
java.lang.String |
getAppResStr(java.lang.String resourceKey)
Returns a text in the corresponding language according to the locale specific resource bundle.
|
MustFrame |
getFrame() |
java.lang.String |
getHelpTarget()
Returns the target of the component's help context
|
java.lang.String |
getHelpTopic()
Returns the topic of the component's help context
|
java.util.Locale |
getLocale() |
static MustFrame |
getOrCreateMainInstance(java.lang.Class<? extends java.awt.Frame> wishedFrameClass)
Returns the main instance of frame class after creating it, if not available.
|
static MustFrame |
getOrCreateMainInstance(java.lang.Class<? extends java.awt.Frame> wishedFrameClass,
java.awt.Frame ownerFrame)
Returns the main instance of frame class after creating it, if not available.
|
protected java.lang.String |
getTranslation(java.lang.String resourceKey)
Returns a text in the corresponding language according to the locale
specific resource bundle of the package.
|
static void |
iconifyAllExept(MustFrame exceptFrame) |
boolean |
isCached()
Returns true if this frame is cached.
|
abstract boolean |
isClosingAllowed(int closeConfirmId)
Returns true if closing of the window is allowed.
|
static boolean |
isClosingAllowedForAllFrames()
Return true if all frames agree to be closed.
|
boolean |
isLaidOut()
Returns true if the frame has already been laid-out.
|
boolean |
isRevivable()
Returns true if the frame may be reused - if it hasn't been destroyed.
|
protected void |
locateInCenter()
Centers the frame on screen.
|
protected void |
logDebug(java.lang.String text)
Logs a message as a debug information.
|
protected void |
logError(java.lang.String text)
Logs a message as an error.
|
protected void |
logError(java.lang.String text,
java.lang.Throwable throwable)
Logs a message as an error.
|
protected void |
logError(java.lang.Throwable throwable)
Logs a message as an error.
|
protected void |
logInfo(java.lang.String text)
Logs a message as information.
|
protected void |
maximizeToBottomAndRight() |
void |
open()
Sets the visibility of the frame and sets the window state to normal if
it is iconified and brings the window to front.
|
protected void |
packAndLocateInCenter()
Packs the frame and centers it.
|
protected void |
packAndLocateInCenterIfNotLaidOut()
Packs the frame and centers it, if it was't already laid-out.
|
protected void |
packIfNotLaidOut()
Packs the frame if it isn't already laid-out by user.
|
protected void |
popupMessage(java.lang.String messageToKeep) |
protected void |
reInitialize()
Called after a main instance of the requested frame class was found to
initialize the appearance.
|
static void |
setDefaultIconImage(java.awt.Image image)
Sets the default icon image for all frames.
|
static void |
setDefaultIconImages(java.util.List<? extends java.awt.Image> icons) |
void |
setHelpContext(java.lang.String helpTopic)
Sets the component's context help.
|
void |
setHelpContext(java.lang.String helpTopic,
java.lang.String helpTarget)
Sets the component's context help.
|
protected void |
setIconImages(java.lang.String[] imageIconNames,
ImageResource imageResource) |
static void |
setLocaleStatically(java.util.Locale locale) |
void |
setTitle(java.lang.String title) |
void |
toFront() |
void |
windowActivated(java.awt.event.WindowEvent e)
Called when window is activated.
|
void |
windowClosed(java.awt.event.WindowEvent e)
Called when window is closed.
|
void |
windowClosing(java.awt.event.WindowEvent e)
Called when window is going to be closed.
|
void |
windowDeactivated(java.awt.event.WindowEvent e)
Called when window is deactivated.
|
void |
windowDeiconified(java.awt.event.WindowEvent e)
Called when window is closed.
|
void |
windowIconified(java.awt.event.WindowEvent e)
Called when window is iconified.
|
void |
windowOpened(java.awt.event.WindowEvent e)
Called when window is opened.
|
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
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setUndecorated
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, 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
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
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, 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, 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, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
protected java.awt.Frame ownerFrame
protected java.awt.Cursor defaultCursor
protected java.awt.Cursor waitCursor
public static void setDefaultIconImage(java.awt.Image image)
image
- the default icon imagepublic static void setDefaultIconImages(java.util.List<? extends java.awt.Image> icons)
public static void setLocaleStatically(java.util.Locale locale)
public static MustFrame getOrCreateMainInstance(java.lang.Class<? extends java.awt.Frame> wishedFrameClass)
wishedFrameClass
- the class of the frame to be retrievedpublic static MustFrame getOrCreateMainInstance(java.lang.Class<? extends java.awt.Frame> wishedFrameClass, java.awt.Frame ownerFrame)
wishedFrameClass
- the class of the frame to be retrievedownerFrame
- the frame, from where the new wished frame is openedpublic static boolean closeMainInstance(java.lang.Class<? extends java.awt.Frame> wishedFrameClass)
wishedFrameClass
- the frame class whose main instance should be closedpublic static boolean isClosingAllowedForAllFrames()
public static void iconifyAllExept(MustFrame exceptFrame)
public static void deiconifyAllExept(MustFrame exceptFrame)
public static void bringToFrontAll()
public static void closeAll()
public static void closeAll(boolean respectUserInput)
public static void closeAllDueToInactivity()
protected void setIconImages(java.lang.String[] imageIconNames, ImageResource imageResource)
public void setTitle(java.lang.String title)
setTitle
in class java.awt.Frame
public void open()
public boolean isRevivable()
destroy()
protected void reInitialize()
public java.util.Locale getLocale()
getLocale
in class java.awt.Window
protected java.lang.String getTranslation(java.lang.String resourceKey)
resourceKey
- the key of the resource to retrievepublic boolean isLaidOut()
WinContr
protected void packIfNotLaidOut()
protected void locateInCenter()
protected void packAndLocateInCenter()
protected void packAndLocateInCenterIfNotLaidOut()
WinContr
protected boolean adjustSizeToPlausibleValue()
protected void maximizeToBottomAndRight()
public MustFrame getFrame()
public void setHelpContext(java.lang.String helpTopic)
helpTopic
- the context help's topichelpTarget
- the context help's targetpublic void setHelpContext(java.lang.String helpTopic, java.lang.String helpTarget)
setHelpContext
in interface ContextHelp
helpTopic
- the context help's topichelpTarget
- the context help's targetpublic java.lang.String getHelpTopic()
getHelpTopic
in interface ContextHelp
public java.lang.String getHelpTarget()
getHelpTarget
in interface ContextHelp
public java.lang.String getAppResStr(java.lang.String resourceKey)
AppTextResource
getAppResStr
in interface AppTextResource
resourceKey
- the key of the resource to retrieveprotected void popupMessage(java.lang.String messageToKeep)
public void generalActionBeginnung()
protected void logDebug(java.lang.String text)
text
- the message to logprotected void logInfo(java.lang.String text)
text
- the message to logprotected void logError(java.lang.Throwable throwable)
throwable
- the exception to logprotected void logError(java.lang.String text)
text
- the message to logprotected void logError(java.lang.String text, java.lang.Throwable throwable)
text
- the message to logthrowable
- the exception to logpublic void componentHidden(java.awt.event.ComponentEvent e)
componentHidden
in interface java.awt.event.ComponentListener
e
- the component eventpublic void componentShown(java.awt.event.ComponentEvent e)
componentShown
in interface java.awt.event.ComponentListener
e
- the component eventpublic void componentMoved(java.awt.event.ComponentEvent e)
componentMoved
in interface java.awt.event.ComponentListener
e
- the component eventpublic void componentResized(java.awt.event.ComponentEvent e)
componentResized
in interface java.awt.event.ComponentListener
e
- the component eventpublic void windowClosing(java.awt.event.WindowEvent e)
windowClosing
in interface java.awt.event.WindowListener
e
- the window eventpublic void windowClosed(java.awt.event.WindowEvent e)
windowClosed
in interface java.awt.event.WindowListener
e
- the window eventpublic void windowOpened(java.awt.event.WindowEvent e)
windowOpened
in interface java.awt.event.WindowListener
e
- the window eventpublic void windowActivated(java.awt.event.WindowEvent e)
windowActivated
in interface java.awt.event.WindowListener
e
- the window eventpublic void windowDeactivated(java.awt.event.WindowEvent e)
windowDeactivated
in interface java.awt.event.WindowListener
e
- the window eventpublic void windowIconified(java.awt.event.WindowEvent e)
windowIconified
in interface java.awt.event.WindowListener
e
- the window eventpublic void windowDeiconified(java.awt.event.WindowEvent e)
windowDeiconified
in interface java.awt.event.WindowListener
e
- the window eventpublic abstract boolean isClosingAllowed(int closeConfirmId)
closeConfirmId
- the ID of the confirmation issue -
a way to avoid multiple question regarding the same issuepublic abstract boolean acceptsClosingDueToInactivity()
public void closeInstance()
public boolean isCached()
public void toFront()
toFront
in class java.awt.Window
public void deregisterAsMainInstance()
public final void destroy()
free()
,
isRevivable()
protected void free()
destroy()
,
isRevivable()
protected final void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
Copyright 1998-2023 Christoph Mueller, Kaerntner Str. 56, D-70469 Stuttgart, Germany, https://www.perpus.de