Class ActionChangeName
- java.lang.Object
-
- gov.nih.mipav.model.scripting.actions.ActionBase
-
- gov.nih.mipav.model.scripting.actions.ActionImageProcessorBase
-
- gov.nih.mipav.model.scripting.actions.ActionChangeName
-
- All Implemented Interfaces:
ScriptableActionInterface
public class ActionChangeName extends ActionImageProcessorBase
A script action which changes the name of an image.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
IMAGE_NAME_ACTION_LABEL
The label to use for the parameter indicating whether the image name should be replaced, prepended to, or appended to.private static java.lang.String
IMAGE_NAME_LABEL
The label to use for the parameter indicating the new image name.static java.lang.String
NAME_ACTION_APPEND
The value that can be used with the 'image_name_action' parameter to indicate that the 'new_image_name' parameter should be appended to the current image name.static java.lang.String
NAME_ACTION_PREPEND
The value that can be used with the 'image_name_action' parameter to indicate that the 'new_image_name' parameter should be prepended to the current image name.static java.lang.String
NAME_ACTION_REPLACE
The value that can be used with the 'image_name_action' parameter to indicate that the current image name should be replaced with the 'new_image_name' parameter value.private java.lang.String
recordingNewImageName
The new name given to the image.private java.lang.String
recordingOldImageName
The old image name.-
Fields inherited from class gov.nih.mipav.model.scripting.actions.ActionImageProcessorBase
INPUT_IMAGE_LABEL, recordingInputImage, recordingResultImage
-
Fields inherited from class gov.nih.mipav.model.scripting.actions.ActionBase
isScript
-
-
Constructor Summary
Constructors Constructor Description ActionChangeName()
Constructor for the dynamic instantiation and execution of the script action.ActionChangeName(ModelImage image, java.lang.String oldImageName, java.lang.String newImageName)
Constructor used to record the ChangeName script action line.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
insertScriptLine()
If a script is being recorded and the action (read: algorithm) is done, add an entry for this action.void
scriptRun(ParameterTable parameters)
Sets up the action dialog state and then executes it.void
setNewImageName(java.lang.String name)
Changes the image name which should be recorded as given to the input image.void
setOldImageName(java.lang.String name)
Changes the old name of the input image.-
Methods inherited from class gov.nih.mipav.model.scripting.actions.ActionImageProcessorBase
createInputImageParameter, isImageStoredInRecorder, setInputImage, setResultImage, storeImageInRecorder, storeImageInRunner
-
Methods inherited from class gov.nih.mipav.model.scripting.actions.ActionBase
getActionName, getActionName, isScript, setIsScript
-
-
-
-
Field Detail
-
NAME_ACTION_REPLACE
public static final java.lang.String NAME_ACTION_REPLACE
The value that can be used with the 'image_name_action' parameter to indicate that the current image name should be replaced with the 'new_image_name' parameter value.- See Also:
- Constant Field Values
-
NAME_ACTION_PREPEND
public static final java.lang.String NAME_ACTION_PREPEND
The value that can be used with the 'image_name_action' parameter to indicate that the 'new_image_name' parameter should be prepended to the current image name.- See Also:
- Constant Field Values
-
NAME_ACTION_APPEND
public static final java.lang.String NAME_ACTION_APPEND
The value that can be used with the 'image_name_action' parameter to indicate that the 'new_image_name' parameter should be appended to the current image name.- See Also:
- Constant Field Values
-
IMAGE_NAME_LABEL
private static final java.lang.String IMAGE_NAME_LABEL
The label to use for the parameter indicating the new image name.- See Also:
- Constant Field Values
-
IMAGE_NAME_ACTION_LABEL
private static final java.lang.String IMAGE_NAME_ACTION_LABEL
The label to use for the parameter indicating whether the image name should be replaced, prepended to, or appended to.- See Also:
- Constant Field Values
-
recordingNewImageName
private java.lang.String recordingNewImageName
The new name given to the image.
-
recordingOldImageName
private java.lang.String recordingOldImageName
The old image name.
-
-
Constructor Detail
-
ActionChangeName
public ActionChangeName()
Constructor for the dynamic instantiation and execution of the script action.
-
ActionChangeName
public ActionChangeName(ModelImage image, java.lang.String oldImageName, java.lang.String newImageName)
Constructor used to record the ChangeName script action line.- Parameters:
image
- The image whose name was changed.oldImageName
- The old name of the image.newImageName
- The new name given to the image (the image's current name).
-
-
Method Detail
-
insertScriptLine
public void insertScriptLine()
If a script is being recorded and the action (read: algorithm) is done, add an entry for this action.- Specified by:
insertScriptLine
in interfaceScriptableActionInterface
- Specified by:
insertScriptLine
in classActionImageProcessorBase
-
scriptRun
public void scriptRun(ParameterTable parameters)
Sets up the action dialog state and then executes it.- Specified by:
scriptRun
in interfaceScriptableActionInterface
- Specified by:
scriptRun
in classActionImageProcessorBase
- Parameters:
parameters
- Table of parameters for the script to use.
-
setNewImageName
public void setNewImageName(java.lang.String name)
Changes the image name which should be recorded as given to the input image.- Parameters:
name
- The new name given to the input image.
-
setOldImageName
public void setOldImageName(java.lang.String name)
Changes the old name of the input image.- Parameters:
name
- The old name of the input image.
-
-