org.jhotdraw.app.osx
Class OSXPaletteHandler

java.lang.Object
  extended by org.jhotdraw.app.osx.OSXPaletteHandler

public class OSXPaletteHandler
extends java.lang.Object

Hides all registered floating palettes, if none of the registered view windows have focus anymore.

Version:
$Id: OSXPaletteHandler.java 604 2010-01-09 12:00:29Z rawcoder $
Author:
Werner Randelshofer

Field Summary
private  OSXApplication app
           
private  java.awt.event.WindowFocusListener focusHandler
           
private static OSXPaletteHandler instance
           
private  java.util.HashSet<java.awt.Window> palettes
           
private  javax.swing.Timer timer
           
private  java.util.HashMap<java.awt.Window,View> windows
           
 
Constructor Summary
OSXPaletteHandler(OSXApplication app)
          Creates a new instance.
 
Method Summary
 void add(java.awt.Window window, View view)
           
 void addPalette(java.awt.Window palette)
           
 void addWindow(java.awt.Window window)
           
 java.util.Set<java.awt.Window> getPalettes()
           
private  boolean isFocused(java.awt.Window w)
           
private  void maybeHidePalettes()
           
 void remove(java.awt.Window window)
           
 void removePalette(java.awt.Window palette)
           
 void removeWindow(java.awt.Window window)
           
private  void showPalettes()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

palettes

private java.util.HashSet<java.awt.Window> palettes

windows

private java.util.HashMap<java.awt.Window,View> windows

instance

private static OSXPaletteHandler instance

timer

private javax.swing.Timer timer

app

private OSXApplication app

focusHandler

private java.awt.event.WindowFocusListener focusHandler
Constructor Detail

OSXPaletteHandler

public OSXPaletteHandler(OSXApplication app)
Creates a new instance.

Method Detail

add

public void add(java.awt.Window window,
                View view)

remove

public void remove(java.awt.Window window)

addPalette

public void addPalette(java.awt.Window palette)

removePalette

public void removePalette(java.awt.Window palette)

getPalettes

public java.util.Set<java.awt.Window> getPalettes()

showPalettes

private void showPalettes()

isFocused

private boolean isFocused(java.awt.Window w)

maybeHidePalettes

private void maybeHidePalettes()

addWindow

public void addWindow(java.awt.Window window)

removeWindow

public void removeWindow(java.awt.Window window)