de.sciss.gui
Class FloatingPaletteHandler

java.lang.Object
  extended by de.sciss.gui.FloatingPaletteHandler
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener

public class FloatingPaletteHandler
extends java.lang.Object
implements java.awt.event.ActionListener

Regular windows and floating palettes register themselves with a a FloatingPaletteHandler. The handler then takes care of hiding and showing the palettes when the application becomes active or inactive (i.e. one of the regular windows has focus or none of them). The class is closely based on FloatingPaletteHandler14 v2.0 by Werner Randelshofer (Quaqua project).

Version:
0.13, 19-May-08
Author:
Hanns Holger Rutz
Synchronization:
all methods must be called in the Swing thread
Todo:
selecting an item from the right menu bar (e.g. clock) causes a palette flicker

Field Summary
protected  java.util.Set frames
           
protected  javax.swing.Timer timer
           
 
Constructor Summary
FloatingPaletteHandler()
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 void add(AbstractWindow w)
          Registers a project window with the FloatingPaletteHandler.
 void addModalDialog()
           
 AbstractWindow getFocussedWindow()
          Returns the current applicatin window (the window which was the last to gain focus).
static FloatingPaletteHandler getInstance()
           
static FloatingPaletteHandler getInstance(Application app)
           
 void remove(AbstractWindow w)
          Unregisters a project window with the FloatingPaletteHandler.
 void removeModalDialog()
           
protected  void setFocusedWindow(AbstractWindow w)
           
 void setListening(boolean b)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

frames

protected final java.util.Set frames

timer

protected final javax.swing.Timer timer
Constructor Detail

FloatingPaletteHandler

public FloatingPaletteHandler()
Method Detail

getInstance

public static FloatingPaletteHandler getInstance()

getInstance

public static FloatingPaletteHandler getInstance(Application app)

setListening

public void setListening(boolean b)

add

public void add(AbstractWindow w)
Registers a project window with the FloatingPaletteHandler.

When none of the registered windows has focus, the FloatingPaletteHandler hides all registered palette windows. When at least one of the registered windows has focus, the FloatingPaletteHandler shows all registered palette windows.


addModalDialog

public void addModalDialog()

removeModalDialog

public void removeModalDialog()

remove

public void remove(AbstractWindow w)
Unregisters a project window with the FloatingPaletteHandler.


getFocussedWindow

public AbstractWindow getFocussedWindow()
Returns the current applicatin window (the window which was the last to gain focus). Floating palettes may use this method to determine on which window they need to act on.


actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

setFocusedWindow

protected void setFocusedWindow(AbstractWindow w)