com.levigo.util.swing
Class AbstractPropertyGeometryFrame

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by com.levigo.util.swing.AbstractGeometryFrame
                          extended by com.levigo.util.swing.AbstractPropertyGeometryFrame
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants

public abstract class AbstractPropertyGeometryFrame
extends AbstractGeometryFrame

This class is an enhanced version of its super class AbstractGeometryFrame. It provides fully implemented services to read, save and restore its location, size and frame state from/into a preset properties preference store. To enable the frame geometry functionality a properties preference store has to be defined preferably before any frame will be created. Use therefore the AbstractGeometryFrame.setPreferenceStore(PreferenceStore) method. This should be done just once by the integrator preferably at startup time. If no properties store is set, instances of this class behaves like a normal JFrame.

Furthermore developers might use this class to define a unique window icon and to install common UI settings.

This class provides just the re-/storing of frame geometries in/of a given properties preference store. The physically saving process, eg. into a file or database or into whatever, have to be triggered by the integrator, may be at application shutdown or whenever a frame will be closed.

Author:
Carolin Koehler
See Also:
PropertiesPreferenceStore, 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
 
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 com.levigo.util.swing.AbstractGeometryFrame
WINDOW_ICON
 
Fields inherited from class javax.swing.JFrame
accessibleContext, EXIT_ON_CLOSE, 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 javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
AbstractPropertyGeometryFrame()
          Constructor for AbstractPropertyGeometryFrame.
AbstractPropertyGeometryFrame(String title)
          Constructor for AbstractPropertyGeometryFrame.
 
Method Summary
 void addNotify()
           
static boolean isAdjustGeometryEnabled()
          Returns whether adjusting of frames geometry into current graphics environment is enabled This behavior is only supported if the restoring of frame geometry is enabled.
 boolean isGeometryRestored()
          Returns whether frames geometry could be restored from given properties preferences.
static boolean isRestoreGeometryEnabled()
          Returns whether re-/storing of frames geometry is enabled
 void removeNotify()
           
 void restoreGeometry()
          Restore the frame geometry (size, location) from the preferences, if enabled and an approbate properties preference store is set.
 void saveGeometry()
          Save the frame geometry into the properties preference store.
static void setAdjustGeometryEnabled(boolean doAdjustGeometry)
          Sets whether adjusting of frames geometry into current graphics environment is enabled
static void setRestoreGeometryEnabled(boolean doRestoreGeometry)
          Sets whether re-/storing of frames geometry is enabled.
 void show()
          Deprecated.  
 
Methods inherited from class com.levigo.util.swing.AbstractGeometryFrame
getActiveFrame, getActiveFrames, getActiveFrames, getActiveFramesinZOrder, getAuxiliaryWindowIcon, getDefaultLocation, getDefaultSize, getFrameID, getFrameType, getPreferenceStore, getRecentlyFocusedFrame, getWindowIcon, hide, isExistingFrameAt, processWindowEvent, putAuxiliaryWindowIcon, setPreferenceStore, setRecentlyFocusedFrame, setWindowIcon
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
 
Methods inherited from class java.awt.Frame
getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setVisible, 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, transferFocusBackward, 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, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, 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, isOpaque, 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, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, 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
 

Constructor Detail

AbstractPropertyGeometryFrame

public AbstractPropertyGeometryFrame(String title)
Constructor for AbstractPropertyGeometryFrame.

Parameters:
title - The title of the frame

AbstractPropertyGeometryFrame

public AbstractPropertyGeometryFrame()
Constructor for AbstractPropertyGeometryFrame.

Method Detail

saveGeometry

public void saveGeometry()
Save the frame geometry into the properties preference store. This method will be called each time the frame becomes invisible. The physically saving process, eg. into a file or database or into whatever, have to be triggered by the integrator, may be at application shutdown or whenever a frame will be closed.

Hint: If the geometry re-storing ability is disabled or no preference store is set, this method does nothing.

Specified by:
saveGeometry in class AbstractGeometryFrame
See Also:
AbstractGeometryFrame.setPreferenceStore(PreferenceStore), isRestoreGeometryEnabled(), setRestoreGeometryEnabled(boolean)

restoreGeometry

public void restoreGeometry()
Restore the frame geometry (size, location) from the preferences, if enabled and an approbate properties preference store is set.

Specified by:
restoreGeometry in class AbstractGeometryFrame

addNotify

public void addNotify()
Overrides:
addNotify in class Frame
See Also:
Frame.addNotify()

removeNotify

public void removeNotify()
Overrides:
removeNotify in class Frame
See Also:
Frame.removeNotify()

show

@Deprecated
public void show()
Deprecated. 

Overrides:
show in class AbstractGeometryFrame
See Also:
AbstractGeometryFrame.show()

isGeometryRestored

public boolean isGeometryRestored()
Returns whether frames geometry could be restored from given properties preferences. The value of this flag will be updated each time this frame restore its geometry.

Returns:
flag if frames geometry could be restored

isRestoreGeometryEnabled

public static boolean isRestoreGeometryEnabled()
Returns whether re-/storing of frames geometry is enabled

Returns:
boolean

setRestoreGeometryEnabled

public static void setRestoreGeometryEnabled(boolean doRestoreGeometry)
Sets whether re-/storing of frames geometry is enabled. This behavior is only supported if the restoring of frame geometry is enabled.

Parameters:
doRestoreGeometry -

isAdjustGeometryEnabled

public static boolean isAdjustGeometryEnabled()
Returns whether adjusting of frames geometry into current graphics environment is enabled This behavior is only supported if the restoring of frame geometry is enabled.

Returns:
boolean

setAdjustGeometryEnabled

public static void setAdjustGeometryEnabled(boolean doAdjustGeometry)
Sets whether adjusting of frames geometry into current graphics environment is enabled

Parameters:
doAdjustGeometry -


Copyright © 1995-2020 levigo holding gmbh. All Rights Reserved.