Package jmri.jmrit.logixng
Interface LogixNG
-
- All Superinterfaces:
Base
,java.lang.Comparable<NamedBean>
,NamedBean
,PropertyChangeProvider
- All Known Implementing Classes:
DefaultLogixNG
public interface LogixNG extends Base, NamedBean
LogixNG.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jmri.jmrit.logixng.Base
Base.PrintTreeSettings, Base.RunnableWithBase, Base.RunnableWithBaseThrowException
-
Nested classes/interfaces inherited from interface jmri.NamedBean
NamedBean.BadNameException, NamedBean.BadSystemNameException, NamedBean.BadUserNameException, NamedBean.DisplayOptions, NamedBean.DuplicateSystemNameException
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PROPERTY_ENABLED
static java.lang.String
PROPERTY_INLINE
-
Fields inherited from interface jmri.jmrit.logixng.Base
PRINT_LINE_NUMBERS_FORMAT, PROPERTY_CHILD_COUNT, PROPERTY_CHILD_REORDER, PROPERTY_LAST_RESULT_CHANGED, PROPERTY_SOCKET_CONNECTED, PROPERTY_SOCKET_DISCONNECTED, SEPARATOR, SOCKET_CONNECTED, SOCKET_DISCONNECTED
-
Fields inherited from interface jmri.NamedBean
DISPLAY_NAME_FORMAT, INCONSISTENT, PROPERTY_STATE, QUOTED_NAME_FORMAT, UNKNOWN
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
activate()
Activates this LogixNG.boolean
addConditionalNG(ConditionalNG conditionalNG)
Add a child ConditionalNG to the parent LogixNG.void
clearStartup()
Clear the startup flag.void
deleteConditionalNG(ConditionalNG conditionalNG)
Delete a ConditionalNG from this LogixNG.void
execute()
Execute all ConditionalNGs if the LogixNG is enabled and activated.void
execute(boolean allowRunDelayed)
Execute all ConditionalNGs if the LogixNG is enabled and activated.void
execute(boolean allowRunDelayed, boolean isStartup)
Execute all ConditionalNGs if the LogixNG is enabled and activated.ConditionalNG
getConditionalNG(int order)
Returns the conditionalNG that will calculate in the specified order.ConditionalNG
getConditionalNG(java.lang.String systemName)
Get a ConditionalNG belonging to this LogixNG.java.lang.String
getConditionalNG_SystemName(int index)
Set the system name for the conditionalNG at the specified position in this listConditionalNG
getConditionalNGByUserName(java.lang.String userName)
Get a ConditionalNG belonging to this LogixNG.InlineLogixNG
getInlineLogixNG()
Get the InlineLogixNG that owns this LogixNG, if the LogixNG is inline.int
getNumConditionalNGs()
Get number of ConditionalNGs for this LogixNG.boolean
isActivated()
Is this item active?boolean
isEnabled()
Determines whether this LogixNG is enabled.boolean
isInline()
Determines whether this LogixNG is inline or not.boolean
isStartup()
Determines whether this LogixNG is currently during startup.void
setActive(boolean active)
Activates/deactivates this LogixNG.void
setConditionalNG_SystemName(int index, java.lang.String systemName)
Set the system name for the conditionalNG at the specified position in this listvoid
setEnabled(boolean enable)
Set whenether this LogixNG is enabled or disabled.void
setInline(boolean inline)
Sets whether this LogixNG is inline or not.void
setInlineLogixNG(InlineLogixNG inlineLogixNG)
Set the InlineLogixNG that owns this LogixNG, if the LogixNG is inline.void
swapConditionalNG(int nextInOrder, int row)
Move 'row' to 'nextInOrder' and shift all between 'nextInOrder' and 'row' up one position.-
Methods inherited from interface jmri.jmrit.logixng.Base
addPropertyChangeListener, addPropertyChangeListener, deepCopyChildren, dispose, doSocketOperation, existsInTree, forEntireTree, forEntireTreeWithException, getCategory, getChild, getChildCount, getComment, getConditionalNG, getDeepCopy, getListenerRef, getListenerRefs, getListenerRefsIncludingChildren, getLogixNG, getLongDescription, getLongDescription, getModule, getNumPropertyChangeListeners, getParent, getPropertyChangeListenersByReference, getRoot, getShortDescription, getShortDescription, getSystemName, getUsageDetail, getUsageTree, getUserName, hasChild, isActive, isSocketOperationAllowed, printTree, printTree, printTree, printTree, printTree, registerListeners, setComment, setParent, setParentForAllChildren, setup, setUserName, unregisterListeners, updateListenerRef, vetoableChange
-
Methods inherited from interface jmri.NamedBean
addPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, compareTo, describeState, dispose, getBeanType, getComment, getDisplayName, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListenersByReference, getPropertyKeys, getRecommendedToolTip, getState, getSystemName, getUsageReport, getUserName, removeProperty, setComment, setProperty, setState, setUserName, toString, updateListenerRef, vetoableChange
-
Methods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
-
-
-
Field Detail
-
PROPERTY_ENABLED
static final java.lang.String PROPERTY_ENABLED
- See Also:
- Constant Field Values
-
PROPERTY_INLINE
static final java.lang.String PROPERTY_INLINE
- See Also:
- Constant Field Values
-
-
Method Detail
-
clearStartup
void clearStartup()
Clear the startup flag.
-
isStartup
boolean isStartup()
Determines whether this LogixNG is currently during startup.- Returns:
- true if the LogixNG is currently during startup, false otherwise
-
setInline
void setInline(boolean inline)
Sets whether this LogixNG is inline or not.- Parameters:
inline
- true if the LogixNG is inline, false otherwise
-
isInline
boolean isInline()
Determines whether this LogixNG is inline or not.- Returns:
- true if the LogixNG is inline, false otherwise
-
setInlineLogixNG
void setInlineLogixNG(InlineLogixNG inlineLogixNG)
Set the InlineLogixNG that owns this LogixNG, if the LogixNG is inline.- Parameters:
inlineLogixNG
- the InlineLogixNG that owns this LogixNG, if the LogixNG is inline.
-
getInlineLogixNG
InlineLogixNG getInlineLogixNG()
Get the InlineLogixNG that owns this LogixNG, if the LogixNG is inline.- Returns:
- the InlineLogixNG
-
setEnabled
void setEnabled(boolean enable)
Set whenether this LogixNG is enabled or disabled.This method must call registerListeners() / unregisterListeners() and also call execute() if enable is true.
- Parameters:
enable
- true if this LogixNG should be enabled, false otherwise
-
isEnabled
boolean isEnabled()
Determines whether this LogixNG is enabled.
-
activate
void activate()
Activates this LogixNG.This method is called by the LogixNG manager during initialization of the LogixNGs.
-
setActive
void setActive(boolean active)
Activates/deactivates this LogixNG.This method is used by the LogixNG action EnableLogixNG to temporary activate or deactivate a LogixNG.
- Parameters:
active
- true if activate, false if deactivate
-
getConditionalNG_SystemName
java.lang.String getConditionalNG_SystemName(int index)
Set the system name for the conditionalNG at the specified position in this list- Parameters:
index
- index of the element to set the system name- Returns:
- the system name
-
setConditionalNG_SystemName
void setConditionalNG_SystemName(int index, java.lang.String systemName)
Set the system name for the conditionalNG at the specified position in this list- Parameters:
index
- index of the element to set the system namesystemName
- the new system name
-
getNumConditionalNGs
int getNumConditionalNGs()
Get number of ConditionalNGs for this LogixNG.- Returns:
- the number of conditionals
-
swapConditionalNG
void swapConditionalNG(int nextInOrder, int row)
Move 'row' to 'nextInOrder' and shift all between 'nextInOrder' and 'row' up one position. Requiresrow > nextInOrder
.- Parameters:
nextInOrder
- target order for ConditionalNG at rowrow
- position of ConditionalNG to move
-
getConditionalNG
ConditionalNG getConditionalNG(int order)
Returns the conditionalNG that will calculate in the specified order. This is also the order the ConditionalNG is listed in the Add/Edit LogixNG dialog. If 'order' is greater than the number of ConditionalNGs for this LogixNG, null is returned.- Parameters:
order
- order in which the ConditionalNG calculates- Returns:
- the conditionalNG or null
-
addConditionalNG
boolean addConditionalNG(ConditionalNG conditionalNG)
Add a child ConditionalNG to the parent LogixNG.The first part handles adding conditionalNGs to the LogixNG list during file loading.
The second part handles normal additions using the GUI, Logix imports or tests.
- Parameters:
conditionalNG
- The ConditionalNG object.- Returns:
- true if the ConditionalNG was added, false otherwise.
-
getConditionalNG
ConditionalNG getConditionalNG(java.lang.String systemName)
Get a ConditionalNG belonging to this LogixNG.- Parameters:
systemName
- The name of the ConditionalNG object.- Returns:
- the ConditionalNG object or null if not found.
-
getConditionalNGByUserName
ConditionalNG getConditionalNGByUserName(java.lang.String userName)
Get a ConditionalNG belonging to this LogixNG.- Parameters:
userName
- The name of the ConditionalNG object.- Returns:
- the ConditionalNG object or null if not found.
-
deleteConditionalNG
void deleteConditionalNG(ConditionalNG conditionalNG)
Delete a ConditionalNG from this LogixNG.Note: Since each LogixNG must have at least one ConditionalNG, the last ConditionalNG will not be deleted.
Returns An array of names used in an error message explaining why ConditionalNG should not be deleted.
- Parameters:
conditionalNG
- The ConditionalNG to delete
-
isActivated
boolean isActivated()
Is this item active? This method returns true if the the LogixNG is active but not enabled, while the methodBase.isActive()
only returns true if the LogixNG is both active and enabled.- Returns:
- true if active, false otherwise.
-
execute
void execute()
Execute all ConditionalNGs if the LogixNG is enabled and activated.
-
execute
void execute(boolean allowRunDelayed)
Execute all ConditionalNGs if the LogixNG is enabled and activated.- Parameters:
allowRunDelayed
- true if it's ok to run delayed, false otherwise
-
execute
void execute(boolean allowRunDelayed, boolean isStartup)
Execute all ConditionalNGs if the LogixNG is enabled and activated.- Parameters:
allowRunDelayed
- true if it's ok to run delayed, false otherwiseisStartup
- true if startup, false otherwise
-
-