Package jmri.implementation
Class DefaultConditionalAction
java.lang.Object
jmri.implementation.DefaultConditionalAction
- All Implemented Interfaces:
ConditionalAction
The consequent of the antecedent of the conditional proposition. The data for
the action to be taken when a Conditional calculates to True
This is in the implementations package because of a Swing dependence via the times. Java 1.5 or Java 1.6 might make it possible to break that, which will simplify things.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefaultConditionalAction(int option, Conditional.Action type, String name, int actionData, String actionStr) -
Method Summary
Modifier and TypeMethodDescriptiondescription(boolean triggerType) Get an I18N description of the ConditionAction.voiddispose()Dispose this ConditionalAction.booleanintInteger data for action.Get an I18N String to represent the Action Data.static StringgetActionDataString(Conditional.Action t, int data) Get the Action Data String in I18N form.String data for action.getBean()Name of the device or element that is affected.intOptions on when action is taken.getOptionString(boolean type) Get the Option String in I18N format.static StringgetOptionString(int opt, boolean type) Convert consequent option to I18N String.getSound()Get Sound file.getTimer()getType()The consequent device or element type.inthashCode()booleanvoidsetActionData(int actionData) voidsetActionData(String actionData) Set action data from I18N name for it.voidsetActionString(String actionString) Set the Action String.voidsetDeviceName(String deviceName) voidsetListener(ActionListener listener) voidsetOption(int option) Set the Action Option.protected voidSet the sound file.voidvoidSet type from user name for it.voidsetType(Conditional.Action type) voidvoidstatic intstringToActionData(String str) Get action Data from an I18N String.static Conditional.ActionstringToActionType(String str) Get action type from a String.
-
Field Details
-
rbx
-
-
Constructor Details
-
DefaultConditionalAction
public DefaultConditionalAction() -
DefaultConditionalAction
public DefaultConditionalAction(int option, @Nonnull Conditional.Action type, String name, int actionData, String actionStr)
-
-
Method Details
-
equals
-
hashCode
-
getType
The consequent device or element type.- Specified by:
getTypein interfaceConditionalAction- Returns:
- the type
-
setType
- Specified by:
setTypein interfaceConditionalAction
-
setType
Set type from user name for it.- Specified by:
setTypein interfaceConditionalAction- Parameters:
type- name of the type
-
getDeviceName
Name of the device or element that is affected.- Specified by:
getDeviceNamein interfaceConditionalAction- Returns:
- the name
-
setDeviceName
- Specified by:
setDeviceNamein interfaceConditionalAction
-
getNamedBean
- Specified by:
getNamedBeanin interfaceConditionalAction
-
getBean
- Specified by:
getBeanin interfaceConditionalAction
-
getOption
Options on when action is taken.- Specified by:
getOptionin interfaceConditionalAction- Returns:
- the option
-
setOption
Description copied from interface:ConditionalActionSet the Action Option.- Specified by:
setOptionin interfaceConditionalAction- Parameters:
option- the action option number.
-
getActionData
Integer data for action.- Specified by:
getActionDatain interfaceConditionalAction- Returns:
- the data
-
setActionData
- Specified by:
setActionDatain interfaceConditionalAction
-
setActionData
Set action data from I18N name for it.- Specified by:
setActionDatain interfaceConditionalAction- Parameters:
actionData- user name
-
getActionString
String data for action.- Specified by:
getActionStringin interfaceConditionalAction- Returns:
- the action String
-
setActionString
Description copied from interface:ConditionalActionSet the Action String. Any String float values ( delayed Sensor ) should use a . decimal separator.- Specified by:
setActionStringin interfaceConditionalAction- Parameters:
actionString- the action String.
-
getTimer
- Specified by:
getTimerin interfaceConditionalAction
-
setTimer
- Specified by:
setTimerin interfaceConditionalAction
-
isTimerActive
- Specified by:
isTimerActivein interfaceConditionalAction
-
startTimer
- Specified by:
startTimerin interfaceConditionalAction
-
stopTimer
- Specified by:
stopTimerin interfaceConditionalAction
-
getListener
- Specified by:
getListenerin interfaceConditionalAction
-
setListener
- Specified by:
setListenerin interfaceConditionalAction
-
getSound
Get Sound file.- Specified by:
getSoundin interfaceConditionalAction- Returns:
- the sound
-
setSound
Set the sound file.- Parameters:
sound- the new sound file
-
getTypeString
- Specified by:
getTypeStringin interfaceConditionalAction- Returns:
- name of this consequent type
-
getOptionString
Description copied from interface:ConditionalActionGet the Option String in I18N format.- Specified by:
getOptionStringin interfaceConditionalAction- Parameters:
type- true if option is a change; false if option is a trigger.- Returns:
- name of the option for this consequent type
-
getActionDataString
Description copied from interface:ConditionalActionGet an I18N String to represent the Action Data.- Specified by:
getActionDataStringin interfaceConditionalAction- Returns:
- human readable String of the data.
-
getOptionString
Convert consequent option to I18N String.- Parameters:
opt- the option.type- true if option is a change; false if option is a trigger.- Returns:
- a human readable description of the option or an empty String.
-
stringToActionType
Get action type from a String.- Parameters:
str- the string to get the type for- Returns:
- the type or 0 if str is not a recognized action
-
stringToActionData
Get action Data from an I18N String.- Parameters:
str- the I18N string to get the action data for.- Returns:
- the action data of -1 is str is not recognized.
-
getActionDataString
Get the Action Data String in I18N form.- Parameters:
t- the Condition.Action, must be null.data- the constant for the action command type.- Returns:
- the action / data string.
-
description
Get an I18N description of the ConditionAction.- Specified by:
descriptionin interfaceConditionalAction- Parameters:
triggerType- true if option is a change; false if option is a trigger.- Returns:
- human readable description.
-
dispose
Dispose this ConditionalAction.- Specified by:
disposein interfaceConditionalAction
-