com.jgoodies.uifextras.laf
Class LafChoiceModel

java.lang.Object
  extended by com.jgoodies.binding.beans.Model
      extended by com.jgoodies.uifextras.laf.LafChoiceModel
All Implemented Interfaces:
com.jgoodies.binding.beans.Observable, Serializable

public final class LafChoiceModel
extends com.jgoodies.binding.beans.Model

A model for choosing a LookAndFeel and color theme. Provides two lists with selection: one for the available LookConfiguration instances, another for the themes associated with the selected LookConfiguration.

This whole model operates on a clone of the ExtUIManager's LookConfigurations, held in a BeanAdapter's bean channel. If this model's trigger channel changes to true, this LookConfigurations is set to the ExtUIManager, which will update the app's user interface. If the trigger indicates a flush, the LookConfigurations is read (and copied) again from the ExtUIManager.

Implementation Note: We could potentially use the configurationSelection's selectionHolder as bean channel for the themeListHolder and the themeSelectionHolder. This would work fine, if we would have no other listeners observing changes in the configurationSelection. But we observe this selection with a ConfigurationChangeHandler. Since we need to handle changes in the configuration selection in a known order, we cannot rely on the automatic updates. Therefore this implementation sets the new bean for the selectedConfigurationAdapter "by hand" in the ConfigurationChangeHandler, to ensure the order we want.

Version:
$Revision: 1.4 $
Author:
Karsten Lentzsch
See Also:
LafChoiceView, SelectionInList, Serialized Form

Field Summary
static String PROPERTYNAME_SELECTED_CONFIGURATION
          The name of the bound read-only property that is intended to indicate changes in the selected configuration.
 
Constructor Summary
LafChoiceModel(com.jgoodies.binding.value.ValueModel triggerChannel)
          Constructs a LookAndFeelChoiceModel using the given trigger.
 
Method Summary
 com.jgoodies.binding.list.SelectionInList getConfigurationSelection()
          Returns the list of LookConfiguration instances with a single selection.
 com.jgoodies.uif.laf.LookConfiguration getSelectedConfiguration()
          Returns the currently selected LookConfiguration.
 com.jgoodies.binding.list.SelectionInList getThemeSelection()
          Returns the list of themes associated with the currently selected LookConfiguration plus the selected theme.
 
Methods inherited from class com.jgoodies.binding.beans.Model
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, equals, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, fireMultiplePropertiesChanged, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getPropertyChangeListeners, getPropertyChangeListeners, getVetoableChangeListeners, getVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTYNAME_SELECTED_CONFIGURATION

public static final String PROPERTYNAME_SELECTED_CONFIGURATION
The name of the bound read-only property that is intended to indicate changes in the selected configuration.

See Also:
getSelectedConfiguration(), Constant Field Values
Constructor Detail

LafChoiceModel

public LafChoiceModel(com.jgoodies.binding.value.ValueModel triggerChannel)
Constructs a LookAndFeelChoiceModel using the given trigger. First sets up the list with selection of the LookConfiguration instances. These are adapted from the LookConfigurations by means of a BeanAdapter. In a second step the list with selection of color themes is initialized much like the LookConfigurations instances.

Parameters:
triggerChannel - changes to Boolean.TRUE or Boolean.FALSE to indicate a commit or flush event
Method Detail

getConfigurationSelection

public com.jgoodies.binding.list.SelectionInList getConfigurationSelection()
Returns the list of LookConfiguration instances with a single selection.

Returns:
the selection of LookConfiguration instances.

getThemeSelection

public com.jgoodies.binding.list.SelectionInList getThemeSelection()
Returns the list of themes associated with the currently selected LookConfiguration plus the selected theme.

Returns:
the selection of themes associated with the current LookConfiguration

getSelectedConfiguration

public com.jgoodies.uif.laf.LookConfiguration getSelectedConfiguration()
Returns the currently selected LookConfiguration.

Returns:
the currently selected LookConfiguration.


Copyright © 2000-2008 JGoodies Karsten Lentzsch. All Rights Reserved.