Package jmri.beans
Contains JMRI classes related to supporting JavaBeans and
PropertyChangeListeners. The classes in this package can
be broadly separated into five purposes:
- Implementing the
PropertyChangeSupportlistener management API - The PropertyChangeSupport API provides mechanisms for managing property
change listeners and for sending property change notifications.
PropertyChangeProvideris 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, principallyBeanandPropertyChangeSupport, provide simple concrete implementations of that interface that can be built upon. - Implementing the
VetoableChangeSupportlistener 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.
VetoableChangeProvideris 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, andVetoableChangeSupportprovide 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.
ArbitraryPropertySupportis an interface that ensures implementations implement the basic methods for adding, removing, changing, and discovering those properties. Subclasses of ArbitraryPropertySupport in this package, principallyArbitraryBeanandConstrainedArbitraryBean, provide simple concrete implementations of that interface that can be built upon. - Provide basic implementations of specific types of Beans
-
IdentifiableandMutableIdentifiableprovide interfaces for a identity property.PreferencesBeanprovides a bean with methods for handling properties related to the JMRI preferences mechanisms.
- Extend
Beansintrospection tools BeanUtilprovides 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 ofBeanInterfacewith a complete implementation ofPropertyChangeSupportand 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 ofBeanInterfacewith a complete implementation ofPropertyChangeSupport.BeanUtil JMRI-specific tools for the introspection of JavaBean properties.ConstrainedArbitraryBean A Bean with support forVetoableChangeListeners.ConstrainedBean A Bean with support forVetoableChangeListeners.PreferencesBean Bean that implements some common code for preferences objects.PropertyChangeSupport Implementation ofPropertyChangeSupportthat can be extended by classes that would normally need to implement the methods of PropertyChangeSupport independently.SwingPropertyChangeListener If constructed withSwingPropertyChangeListener(listener, true)this subclass ofPropertyChangeListenerensures listener is only ever notified on the Event Dispatch Thread.UnboundArbitraryBean Generic implementation ofBeanInterfacethat supports arbitrary properties defined at runtime.UnboundBean Generic implementation ofBeanInterfacewithout support for arbitrary properties defined at runtime.VetoableChangeSupport Implementation ofPropertyChangeSupportandVetoableChangeSupportthat can be extended by classes that would normally need to implement the methods of PropertyChangeSupport and VetoableChangeSupport independently.