bibliothek.extension.gui.dock.theme
Class BubbleTheme

java.lang.Object
  extended by bibliothek.gui.dock.themes.BasicTheme
      extended by bibliothek.extension.gui.dock.theme.BubbleTheme
All Implemented Interfaces:
DockTheme

public class BubbleTheme
extends BasicTheme

A theme using a lot of eye-candy.

Author:
Benjamin Sigg

Nested Class Summary
private  class BubbleTheme.ButtonGenerator
          Generator to create views for button-actions.
private  class BubbleTheme.CheckGenerator
          Generator to create views for check-actions.
private  class BubbleTheme.DropDownGenerator
          Generator to create views for dropdown-actions.
private  class BubbleTheme.Listener
          A listener to the Controller
private  class BubbleTheme.MenuGenerator
          Generator to create views for menus.
private  class BubbleTheme.RadioGenerator
          Generator to create views for radio-actions.
private  class BubbleTheme.SeparatorGenerator
          Generator to create views for separators.
 
Field Summary
private  java.util.Map<java.lang.String,java.awt.Color> colors
          The colors used by this theme
private  BubbleTheme.Listener listener
          A listener to the DockController
 
Constructor Summary
BubbleTheme()
          Creates a new theme
 
Method Summary
private  java.awt.Color delta(java.awt.Color color, float dh, float ds, float db)
          Moves the hsb-representation of color a little.
 void deriveColors(java.awt.Color active, java.awt.Color inactive, java.awt.Color text, java.awt.Color button, java.awt.Color buttonSelected, java.awt.Color disabled)
          Derives all colors needed in this theme.
 java.awt.Color getColor(java.lang.String key)
          Gets a color for a specified key.
 void install(DockController controller)
          Install this theme at controller.
protected  java.util.Map<java.lang.String,javax.swing.Icon> loadIcons()
          Reads a set of icons which will replace the ordinary icons.
 void setColor(java.lang.String key, java.awt.Color color)
          Stores a color which will be used in the theme.
 void uninstall(DockController controller)
          Uninstalls this theme from controller.
 
Methods inherited from class bibliothek.gui.dock.themes.BasicTheme
getCombiner, getDisplayFactory, getMovingTitleGetter, getPaint, getTitleFactory, setCombiner, setDisplayerFactory, setMovingTitleGetter, setPaint, setTitleFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

colors

private java.util.Map<java.lang.String,java.awt.Color> colors
The colors used by this theme


listener

private BubbleTheme.Listener listener
A listener to the DockController

Constructor Detail

BubbleTheme

public BubbleTheme()
Creates a new theme

Method Detail

deriveColors

public void deriveColors(java.awt.Color active,
                         java.awt.Color inactive,
                         java.awt.Color text,
                         java.awt.Color button,
                         java.awt.Color buttonSelected,
                         java.awt.Color disabled)
Derives all colors needed in this theme.

Parameters:
active - the base color for active titles
inactive - the base color for inactive titles
text - the base color for text
button - the base color for buttons
buttonSelected - the base color for selected buttons
disabled - the base color for disabled elementss

delta

private java.awt.Color delta(java.awt.Color color,
                             float dh,
                             float ds,
                             float db)
Moves the hsb-representation of color a little.

Parameters:
color - the color to change
dh - the delta in hue
ds - the delta in saturisation
db - the delta in brightness
Returns:
the new color

getColor

public java.awt.Color getColor(java.lang.String key)
Gets a color for a specified key.

Parameters:
key - the key of the color
Returns:
the color or null

setColor

public void setColor(java.lang.String key,
                     java.awt.Color color)
Stores a color which will be used in the theme.

Parameters:
key - the key of the color
color - the color to store

install

public void install(DockController controller)
Description copied from interface: DockTheme
Install this theme at controller. The theme may change any properties it likes.

Specified by:
install in interface DockTheme
Overrides:
install in class BasicTheme
Parameters:
controller - the controller

loadIcons

protected java.util.Map<java.lang.String,javax.swing.Icon> loadIcons()
Reads a set of icons which will replace the ordinary icons.

Returns:
the new set of icons

uninstall

public void uninstall(DockController controller)
Description copied from interface: DockTheme
Uninstalls this theme from controller. The theme has to remove all listeners it added.

Specified by:
uninstall in interface DockTheme
Overrides:
uninstall in class BasicTheme
Parameters:
controller - the controller