Class JDialogGenerateGrid

All Implemented Interfaces:
ScriptableActionInterface, DialogDefaultsInterface, ActionDiscovery, ActionListener, FocusListener, ItemListener, WindowListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants

public class JDialogGenerateGrid extends JDialogScriptableBase implements ActionDiscovery, ScriptableActionInterface
Author:
pandyan Class that writes grid on image
See Also:
  • Field Details

    • unitsStr

      private String unitsStr
    • widthField

      private JTextField widthField
    • heightField

      private JTextField heightField
    • intensityField

      private JTextField intensityField
    • width

      private float width
    • height

      private float height
    • componentImage

      private ViewJComponentEditImage componentImage
    • isColor

      private boolean isColor
    • intensity

      private float intensity
    • intensityR

      private float intensityR
    • intensityG

      private float intensityG
    • intensityB

      private float intensityB
    • type

      private int type
    • gridColorButton

      private JButton gridColorButton
    • gridColor

      private Color gridColor
    • colorChooser

      private ViewJColorChooser colorChooser
    • zDim

      private int zDim
    • yDim

      private int yDim
    • xDim

      private int xDim
    • resX

      private float resX
    • resY

      private float resY
    • numVertical

      private float numVertical
    • numHorizontal

      private float numHorizontal
    • verticalSpacing

      private int verticalSpacing
    • horizontalSpacing

      private int horizontalSpacing
    • image

      private ModelImage image
    • newImage

      private ModelImage newImage
  • Constructor Details

    • JDialogGenerateGrid

      public JDialogGenerateGrid()
      Empty constructor needed for dynamic instantiation (used during scripting).
    • JDialogGenerateGrid

      public JDialogGenerateGrid(Frame theParentFrame, ViewJComponentEditImage componentImage)
  • Method Details

    • init

      public void init()
    • actionPerformed

      public void actionPerformed(ActionEvent e)
      Specified by:
      actionPerformed in interface ActionListener
      Overrides:
      actionPerformed in class JDialogBase
    • setVariables

      private boolean setVariables()
      Check width and height for validity.
      Returns:
      boolean is okay
    • writeGridOverlay

      protected void writeGridOverlay()
    • callAlgorithm

      protected void callAlgorithm()
      Description copied from class: JDialogScriptableBase
      Starts the algorithm. Already exists in most algorithm dialogs. Should be called during scripted execution and regular operation.
      Specified by:
      callAlgorithm in class JDialogScriptableBase
    • setGUIFromParams

      protected void setGUIFromParams()
      Description copied from class: JDialogScriptableBase
      Set the dialog GUI using the script parameters while running this algorithm as part of a script.
      Specified by:
      setGUIFromParams in class JDialogScriptableBase
    • storeParamsFromGUI

      protected void storeParamsFromGUI() throws ParserException
      Description copied from class: JDialogScriptableBase
      Record the parameters just used to run this algorithm in a script.
      Specified by:
      storeParamsFromGUI in class JDialogScriptableBase
      Throws:
      ParserException - If there is a problem creating/recording the new parameters.
    • doPostAlgorithmActions

      protected void doPostAlgorithmActions()
      Description copied from class: JDialogScriptableBase
      Used to perform actions after the execution of the algorithm is completed (e.g., put the result image in the image table). Defaults to no action, override to actually have it do something.
      Overrides:
      doPostAlgorithmActions in class JDialogScriptableBase
    • getActionMetadata

      public ActionMetadata getActionMetadata()
      Return meta-information about this discoverable action for categorization and labeling purposes.
      Specified by:
      getActionMetadata in interface ActionDiscovery
      Returns:
      Metadata for this action.
    • createInputParameters

      public ParameterTable createInputParameters()
      Returns a table listing the input parameters of this algorithm (which should match up with the scripting parameters used in setGUIFromParams()).
      Specified by:
      createInputParameters in interface ActionDiscovery
      Returns:
      A parameter table listing the inputs of this algorithm.
    • createOutputParameters

      public ParameterTable createOutputParameters()
      Returns a table listing the output parameters of this algorithm (usually just labels used to obtain output image names later).
      Specified by:
      createOutputParameters in interface ActionDiscovery
      Returns:
      A parameter table listing the outputs of this algorithm.
    • getOutputImageName

      public String getOutputImageName(String imageParamName)
      Returns the name of an image output by this algorithm, the image returned depends on the parameter label given (which can be used to retrieve the image object from the image registry).
      Specified by:
      getOutputImageName in interface ActionDiscovery
      Parameters:
      imageParamName - The output image parameter label for which to get the image name.
      Returns:
      The image name of the requested output image parameter label.
    • isActionComplete

      public boolean isActionComplete()
      Returns whether the action has successfully completed its execution.
      Specified by:
      isActionComplete in interface ActionDiscovery
      Returns:
      True, if the action is complete. False, if the action failed or is still running.