Package jmri.jmrit.display
Interface PositionableFactory
- All Known Implementing Classes:
VirtualLcdPositionableFactory
public interface PositionableFactory
A factory for Positionables.
The purpose of this interface is to allow Positionables to be loaded
conditionally, for example if a particular connection type is available,
and to have the code for that Positionable in a package related to that
connection type.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA task to do after the positionable is added to the editor. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPositionable(Editor editor, PositionableFactory.DoAfter doAfter) Add a positionable to the panel.Get the description for this factory.Get an unique identifier for this factory.booleanDetermines whenever this factory enabled.
-
Method Details
-
getIdentifier
Get an unique identifier for this factory. It's recommended that identifiers for connection specific factories begins with the connection type. Example: DCC-EX-VirtualDisplay.- Returns:
- an unique identifier for this factory
-
getDescription
Get the description for this factory.- Returns:
- the description
-
isEnabled
boolean isEnabled()Determines whenever this factory enabled. This method can for example check if a particular connection type is available. This is useful for positionables like DCC-VirtualLCD which are useful only for particular connections.- Returns:
- true if enabled, false otherwise
-
addPositionable
Add a positionable to the panel. The method might show a dialog to let the user configure the positionable.- Parameters:
editor- the editor to which the new positionable should be addeddoAfter- an optional task to run after the positionable is added to the editor, or null if no task is needed
-