de.sciss.common
Class AppWindow
java.lang.Object
de.sciss.common.AppWindow
- All Implemented Interfaces:
- AbstractWindow
public class AppWindow
- extends java.lang.Object
- implements AbstractWindow
Common functionality for all application windows.
This class provides means for storing and recalling
window bounds in preferences. All subclass windows
will get a copy of the main menubar as well.
- Version:
- 0.71, 01-Aug-08
- Author:
- Hanns Holger Rutz
- Todo:
- tempFloatingTimer could maybe be eliminated
in favour of a simple EventQueue.invokeLater
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
classPrefs
protected java.util.prefs.Preferences classPrefs
jf
protected final SmartJFrame jf
jif
protected final javax.swing.JInternalFrame jif
ownMenuBar
protected final boolean ownMenuBar
borrowMenuBar
protected final boolean borrowMenuBar
wh
protected final BasicWindowHandler wh
bar
protected javax.swing.JMenuBar bar
barBorrower
protected AbstractWindow barBorrower
active
protected boolean active
initialized
protected boolean initialized
tempFloating
protected final boolean tempFloating
tempFloatingTimer
protected javax.swing.Timer tempFloatingTimer
AppWindow
public AppWindow(int flags)
AppWindow
protected AppWindow(java.awt.Dialog wrap)
getWindowHandler
public BasicWindowHandler getWindowHandler()
stringToDimension
protected static java.awt.Dimension stringToDimension(java.lang.String value)
stringToPoint
protected static java.awt.Point stringToPoint(java.lang.String value)
pointToString
protected static java.lang.String pointToString(java.awt.Point value)
dimensionToString
public static java.lang.String dimensionToString(java.awt.Dimension value)
isFloating
public boolean isFloating()
- Specified by:
isFloating
in interface AbstractWindow
lookAndFeelUpdate
public static void lookAndFeelUpdate()
- Updates Swing component tree for all
frames after a look-and-feel change
alwaysPackSize
protected boolean alwaysPackSize()
- Queries whether this frame's bounds
should be packed automatically to the
preferred size independent of
concurrent preference settings
- Returns:
true
, if the frame wishes
to be packed each time a custom setSize()
would be applied in the course of a
preference recall. The default value
of true
can be modified by
subclasses by overriding this method.- See Also:
Window.pack()
restoreVisibility
protected boolean restoreVisibility()
autoUpdatePrefs
protected boolean autoUpdatePrefs()
getPreferredLocation
protected java.awt.geom.Point2D getPreferredLocation()
init
public void init()
- Subclasses should call this
after having constructed their GUI.
Then this method will attach a copy of the main menu
from
root.menuFactory
and
restore bounds from preferences.
- Specified by:
init
in interface AbstractWindow
getClassPrefs
protected java.util.prefs.Preferences getClassPrefs()
addDynamicListening
protected void addDynamicListening(DynamicListening l)
getWindow
public java.awt.Component getWindow()
- Specified by:
getWindow
in interface AbstractWindow
getInsets
public java.awt.Insets getInsets()
- Specified by:
getInsets
in interface AbstractWindow
dispose
public void dispose()
- Frees resources, clears references
- Specified by:
dispose
in interface AbstractWindow
setSize
public void setSize(java.awt.Dimension d)
- Specified by:
setSize
in interface AbstractWindow
getSize
public java.awt.Dimension getSize()
- Specified by:
getSize
in interface AbstractWindow
getBounds
public java.awt.Rectangle getBounds()
- Specified by:
getBounds
in interface AbstractWindow
setBounds
public void setBounds(java.awt.Rectangle r)
- Specified by:
setBounds
in interface AbstractWindow
setLocation
public void setLocation(java.awt.Point p)
- Specified by:
setLocation
in interface AbstractWindow
getLocation
public java.awt.Point getLocation()
- Specified by:
getLocation
in interface AbstractWindow
setPreferredSize
public void setPreferredSize(java.awt.Dimension d)
isActive
public boolean isActive()
- Specified by:
isActive
in interface AbstractWindow
addListener
public void addListener(AbstractWindow.Listener l)
- Specified by:
addListener
in interface AbstractWindow
removeListener
public void removeListener(AbstractWindow.Listener l)
- Specified by:
removeListener
in interface AbstractWindow
toFront
public void toFront()
- Specified by:
toFront
in interface AbstractWindow
setVisible
public void setVisible(boolean b)
- Specified by:
setVisible
in interface AbstractWindow
isVisible
public boolean isVisible()
- Specified by:
isVisible
in interface AbstractWindow
setDefaultCloseOperation
public void setDefaultCloseOperation(int mode)
- Specified by:
setDefaultCloseOperation
in interface AbstractWindow
pack
public void pack()
- Specified by:
pack
in interface AbstractWindow
setTitle
public void setTitle(java.lang.String title)
- Specified by:
setTitle
in interface AbstractWindow
getTitle
public java.lang.String getTitle()
- Specified by:
getTitle
in interface AbstractWindow
getContentPane
public java.awt.Container getContentPane()
- Specified by:
getContentPane
in interface AbstractWindow
setContentPane
public void setContentPane(java.awt.Container c2)
- Specified by:
setContentPane
in interface AbstractWindow
setJMenuBar
public void setJMenuBar(javax.swing.JMenuBar m)
- Specified by:
setJMenuBar
in interface AbstractWindow
getJMenuBar
public javax.swing.JMenuBar getJMenuBar()
- Specified by:
getJMenuBar
in interface AbstractWindow
borrowMenuBar
protected void borrowMenuBar(AbstractWindow aw)
getInputMap
public javax.swing.InputMap getInputMap(int condition)
- Specified by:
getInputMap
in interface AbstractWindow
getActionMap
public javax.swing.ActionMap getActionMap()
- Specified by:
getActionMap
in interface AbstractWindow
getOwnedWindows
public java.awt.Window[] getOwnedWindows()
- Specified by:
getOwnedWindows
in interface AbstractWindow
setFocusTraversalKeysEnabled
public void setFocusTraversalKeysEnabled(boolean enabled)
- Specified by:
setFocusTraversalKeysEnabled
in interface AbstractWindow
setDirty
public void setDirty(boolean dirty)
- Specified by:
setDirty
in interface AbstractWindow
setLocationRelativeTo
public void setLocationRelativeTo(java.awt.Component comp)
- Specified by:
setLocationRelativeTo
in interface AbstractWindow
setUndecorated
public void setUndecorated(boolean b)
- Specified by:
setUndecorated
in interface AbstractWindow
setResizable
public void setResizable(boolean b)
- Specified by:
setResizable
in interface AbstractWindow
isResizable
public boolean isResizable()
- Specified by:
isResizable
in interface AbstractWindow
revalidate
public void revalidate()
- Specified by:
revalidate
in interface AbstractWindow