Package jmri.beans
Contains JMRI classes related to supporting JavaBeans and
PropertyChangeListener
s. The classes in this package can
be broadly separated into five purposes:
- Implementing the
PropertyChangeSupport
listener management API - The PropertyChangeSupport API provides mechanisms for managing property
change listeners and for sending property change notifications.
PropertyChangeProvider
is an interface that ensures implementations implement the basic methods allowing a listener to be added or removed and for a listener to listen to all changes or only to specific changes. Subclasses of PropertyChangeProvider in this package, principallyBean
andPropertyChangeSupport
, provide simple concrete implementations of that interface that can be built upon. - Implementing the
VetoableChangeSupport
listener management API - The VetoableChangeSupport API provides mechanisms for managing property
change listeners that can veto a property change and for sending property
change notifications that can be vetoed.
VetoableChangeProvider
is an interface that ensures implementations implement the basic methods allowing a listener to be added or removed and for a listener to listen to all changes or only to specific changes. Subclasses of VetoableChangeProvider in this package, principallyConstrainedBean
,ConstrainedArbitraryBean
, andVetoableChangeSupport
provide simple concrete implementations of that interface that can be built upon. - Implementing support for arbitrary properties
- A number of JMRI objects support the addition of user-defined properties
that are unknown until runtime. These properties can be added, changed, or
removed by user-defined scripts or other means.
ArbitraryPropertySupport
is an interface that ensures implementations implement the basic methods for adding, removing, changing, and discovering those properties. Subclasses of ArbitraryPropertySupport in this package, principallyArbitraryBean
andConstrainedArbitraryBean
, provide simple concrete implementations of that interface that can be built upon. - Provide basic implementations of specific types of Beans
-
Identifiable
andMutableIdentifiable
provide interfaces for a identity property.PreferencesBean
provides a bean with methods for handling properties related to the JMRI preferences mechanisms.
- Extend
Beans
introspection tools BeanUtil
provides support for setting, getting, and discovering JMRI arbitrary properties.
-
Interface Summary Interface Description BeanInterface Simple interface for basic methods that implement JMRI Bean handling methods.Identifiable An Object that has an identity property that is not publicly mutable (it may be indirectly mutated).MutableIdentifiable An object that has a publicly mutable identity property.PropertyChangeFirer Interface that defines the methods needed to fire property changes.PropertyChangeProvider A set of methods that would need to be implemented to ensure the implementing class provides a complete external interface for property changes.SilenceablePropertyChangeProvider Sometimes an external object needs to be able to mute property changes to prevent bottlenecks in constrained systems (e.g. when reading a file that may add a large number of Turnouts or Sensors to JMRI's internal representation of the model railroad).VetoableChangeFirer Interface that defines the methods needed to fire vetoable property changes.VetoableChangeProvider A set of methods that would need to be implemented to ensure the implementing class provides a complete external interface for vetoable property changes. -
Class Summary Class Description ArbitraryBean Generic implementation ofBeanInterface
with a complete implementation ofPropertyChangeSupport
and support for arbitrary properties defined at runtime.ArbitraryPropertySupport Provide support for converging the Arbitrary* classes with the non-arbitrary versions of those classes so that the Arbitrary* version can extend the non-arbitrary class.Bean Generic implementation ofBeanInterface
with a complete implementation ofPropertyChangeSupport
.BeanUtil JMRI-specific tools for the introspection of JavaBean properties.ConstrainedArbitraryBean A Bean with support forVetoableChangeListener
s.ConstrainedBean A Bean with support forVetoableChangeListener
s.PreferencesBean Bean that implements some common code for preferences objects.PropertyChangeSupport Implementation ofPropertyChangeSupport
that can be extended by classes that would normally need to implement the methods of PropertyChangeSupport independently.SwingPropertyChangeListener If constructed withSwingPropertyChangeListener(listener, true)
this subclass ofPropertyChangeListener
ensures listener is only ever notified on the Event Dispatch Thread.UnboundArbitraryBean Generic implementation ofBeanInterface
that supports arbitrary properties defined at runtime.UnboundBean Generic implementation ofBeanInterface
without support for arbitrary properties defined at runtime.VetoableChangeSupport Implementation ofPropertyChangeSupport
andVetoableChangeSupport
that can be extended by classes that would normally need to implement the methods of PropertyChangeSupport and VetoableChangeSupport independently.