Logo Search packages:      
Sourcecode: libjgoodies-binding-java version File versions

com::jgoodies::binding::tutorial::AlbumPresentationModel Class Reference

Inheritance diagram for com::jgoodies::binding::tutorial::AlbumPresentationModel:

com::jgoodies::binding::PresentationModel com::jgoodies::binding::beans::Model com::jgoodies::binding::beans::Observable com::jgoodies::binding::tutorial::manager::BufferedAlbumPresentationModel

List of all members.


Detailed Description

In addition to its superclass this class provides a bound read-only property composerEnabled that is true if and only if the underlying Album is non-null and classical. This property is intended to be used by a variety of presentation properties, not just a component's enabled state. You can enable or disable a composer presentation, or switch a composer field's editable property, or to hide and show a larger composer editor section.

I've added the composerEnabled property primarily for learning and demonstration purposes. And I wanted to closely follow the example used in Martin Fowler's description of the Presentation Model pattern. This example shows how "raw" domain object properties can be aggregated or filtered by the presentation model layer for use in the presentation layer. In cases where there's a direct mapping between a raw property and the aggregated property used in the UI, it may be easier to observe the raw property. But if this mapping becomes more complex an aggregated property is recommended.

Note that a UI that buffers the classical property cannot use composerEnabled but requires a separate aggregated property, for example bufferedComposerEnabled. To keep this code close to Fowler's original, I've implemented this feature in a subclass, see com.jgoodies.binding.tutorial.manager.BufferedAlbumPresentationModel. The buffered composer enabled property is an example where the eager property aggregation adds overhead and complexity, and it may turn out that using the buffered classical property would be easier to understand.

Author:
Karsten Lentzsch
Version:
Revision
1.9

See also:
com.jgoodies.binding.tutorial.manager.BufferedAlbumPresentationModel

Definition at line 73 of file AlbumPresentationModel.java.


Public Member Functions

synchronized void addBeanPropertyChangeListener (String propertyName, PropertyChangeListener listener)
synchronized void addBeanPropertyChangeListener (PropertyChangeListener listener)
final synchronized void addPropertyChangeListener (String propertyName, PropertyChangeListener listener)
final synchronized void addPropertyChangeListener (PropertyChangeListener listener)
final synchronized void addVetoableChangeListener (String propertyName, VetoableChangeListener listener)
final synchronized void addVetoableChangeListener (VetoableChangeListener listener)
void afterBeanChange (Object oldBean, Object newBean)
 AlbumPresentationModel (Album album)
void beforeBeanChange (Object oldBean, Object newBean)
Object getBean ()
ValueModel getBeanChannel ()
synchronized
PropertyChangeListener[] 
getBeanPropertyChangeListeners (String propertyName)
synchronized
PropertyChangeListener[] 
getBeanPropertyChangeListeners ()
ComponentValueModel getBufferedComponentModel (String propertyName)
BufferedValueModel getBufferedModel (String propertyName, String getterName, String setterName)
BufferedValueModel getBufferedModel (String propertyName)
Object getBufferedValue (String propertyName)
ComponentValueModel getComponentModel (String propertyName)
AbstractValueModel getModel (String propertyName, String getterName, String setterName)
AbstractValueModel getModel (String propertyName)
final synchronized
PropertyChangeListener[] 
getPropertyChangeListeners (String propertyName)
final synchronized
PropertyChangeListener[] 
getPropertyChangeListeners ()
ValueModel getTriggerChannel ()
Object getValue (String propertyName)
final synchronized
VetoableChangeListener[] 
getVetoableChangeListeners (String propertyName)
final synchronized
VetoableChangeListener[] 
getVetoableChangeListeners ()
boolean isBuffering ()
boolean isChanged ()
boolean isComposerEnabled ()
void observeChanged (ValueModel valueModel)
void observeChanged (Object bean, String propertyName)
void release ()
synchronized void removeBeanPropertyChangeListener (String propertyName, PropertyChangeListener listener)
synchronized void removeBeanPropertyChangeListener (PropertyChangeListener listener)
final synchronized void removePropertyChangeListener (String propertyName, PropertyChangeListener listener)
final synchronized void removePropertyChangeListener (PropertyChangeListener listener)
final synchronized void removeVetoableChangeListener (String propertyName, VetoableChangeListener listener)
final synchronized void removeVetoableChangeListener (VetoableChangeListener listener)
void resetChanged ()
void retractInterestFor (ValueModel valueModel)
void retractInterestFor (Object bean, String propertyName)
void setBean (Object newBean)
void setBufferedValue (String propertyName, Object newValue)
void setTriggerChannel (ValueModel newTriggerChannel)
void setValue (String propertyName, Object newValue)
void setVetoableValue (String propertyName, Object newValue) throws PropertyVetoException
void triggerCommit ()
void triggerFlush ()

Static Public Attributes

static final String PROPERTYNAME_AFTER_BEAN = "afterBean"
static final String PROPERTYNAME_BEAN = "bean"
static final String PROPERTYNAME_BEFORE_BEAN = "beforeBean"
static final String PROPERTYNAME_BUFFERING = "buffering"
static final String PROPERTYNAME_CHANGED = "changed"
static final String PROPERTYNAME_COMPOSER_ENABLED = "composerEnabled"
static final String PROPERTYNAME_TRIGGERCHANNEL = "triggerChannel"

Protected Member Functions

BeanAdapter createBeanAdapter (ValueModel beanChannel)
final boolean equals (Object o1, Object o2)
final void fireMultiplePropertiesChanged ()
final void firePropertyChange (String propertyName, long oldValue, long newValue)
final void firePropertyChange (String propertyName, int oldValue, int newValue)
final void firePropertyChange (String propertyName, float oldValue, float newValue)
final void firePropertyChange (String propertyName, double oldValue, double newValue)
final void firePropertyChange (String propertyName, boolean oldValue, boolean newValue)
final void firePropertyChange (String propertyName, Object oldValue, Object newValue, boolean checkIdentity)
final void firePropertyChange (String propertyName, Object oldValue, Object newValue)
final void firePropertyChange (PropertyChangeEvent event)
final void fireVetoableChange (String propertyName, long oldValue, long newValue) throws PropertyVetoException
final void fireVetoableChange (String propertyName, float oldValue, float newValue) throws PropertyVetoException
final void fireVetoableChange (String propertyName, int oldValue, int newValue) throws PropertyVetoException
final void fireVetoableChange (String propertyName, double oldValue, double newValue) throws PropertyVetoException
final void fireVetoableChange (String propertyName, boolean oldValue, boolean newValue) throws PropertyVetoException
final void fireVetoableChange (String propertyName, Object oldValue, Object newValue) throws PropertyVetoException
final void fireVetoableChange (PropertyChangeEvent event) throws PropertyVetoException
void setChanged (boolean newValue)

Private Member Functions

void initEventHandling ()

Classes

class  ClassicalChangeHandler

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index