Class ActionChangeName

All Implemented Interfaces:
ScriptableActionInterface

public class ActionChangeName extends ActionImageProcessorBase
A script action which changes the name of an image.
  • Field Details

    • NAME_ACTION_REPLACE

      public static final 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:
    • NAME_ACTION_PREPEND

      public static final 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:
    • NAME_ACTION_APPEND

      public static final 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:
    • IMAGE_NAME_LABEL

      private static final String IMAGE_NAME_LABEL
      The label to use for the parameter indicating the new image name.
      See Also:
    • IMAGE_NAME_ACTION_LABEL

      private static final 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:
    • recordingNewImageName

      private String recordingNewImageName
      The new name given to the image.
    • recordingOldImageName

      private String recordingOldImageName
      The old image name.
  • Constructor Details

    • ActionChangeName

      public ActionChangeName()
      Constructor for the dynamic instantiation and execution of the script action.
    • ActionChangeName

      public ActionChangeName(ModelImage image, String oldImageName, 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 Details

    • 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 interface ScriptableActionInterface
      Specified by:
      insertScriptLine in class ActionImageProcessorBase
    • scriptRun

      public void scriptRun(ParameterTable parameters)
      Sets up the action dialog state and then executes it.
      Specified by:
      scriptRun in interface ScriptableActionInterface
      Specified by:
      scriptRun in class ActionImageProcessorBase
      Parameters:
      parameters - Table of parameters for the script to use.
    • setNewImageName

      public void setNewImageName(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(String name)
      Changes the old name of the input image.
      Parameters:
      name - The old name of the input image.