Enum Class ROIState

java.lang.Object
java.lang.Enum<ROIState>
com.xinapse.multisliceimage.roi.ROIState
All Implemented Interfaces:
Serializable, Comparable<ROIState>, Constable

public enum ROIState extends Enum<ROIState>
An enumeration of the different states in which an ROI can be. The state of an ROI affects its on-screen appearance and manipulability.
  • Enum Constant Details

    • DELETED

      public static final ROIState DELETED
      ROIState for a deleted ROI.
    • DELETED_SELECTED

      public static final ROIState DELETED_SELECTED
      ROIState for a deleted ROI that is selected by the user.
    • NORMAL

      public static final ROIState NORMAL
      ROIState for a normal, unselected ROI.
    • SELECTED

      public static final ROIState SELECTED
      ROIState for a normal, selected ROI.
    • EDITABLE

      public static final ROIState EDITABLE
      ROIState for a normal, selected and editable ROI.
    • EDIT_OUTLINE

      public static final ROIState EDIT_OUTLINE
      ROIState for a normal selected irregular ROI when its outline is editable.
  • Method Details

    • values

      public static ROIState[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ROIState valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getDrawColor

      public Color getDrawColor(byte userColour)
      Returns the colour with which an ROI in this state should be drawn.
      Parameters:
      userColour - the user-defined colour for the ROI.
      Returns:
      the colour with which an ROI in this state should be drawn.
    • getNChoosableColors

      public static int getNChoosableColors()
      Returns the number of user-choosable ROI colours that may be set.
      Returns:
      the number of user-choosable ROI colours that may be set.
    • getChoosableColor

      public static Color getChoosableColor(int index)
      Returns one of the user-choosable ROI colours.
      Parameters:
      index - the index to the user-choosable colour.
      Returns:
      c the user-choosable colour at the given index.
      Throws:
      ArrayIndexOutOfBoundsException - if the supplied index is outside the range for the number of user-choosable colours.
    • setChoosableColor

      public static void setChoosableColor(int index, Color c)
      Sets one of the user-choosable ROI colours.
      Parameters:
      c - the user-choosable colour.
      index - the index to the user-choosable colour.
      Throws:
      ArrayIndexOutOfBoundsException - if the supplied index is outside the range for the number of user-choosable colours that may be set.
    • setColor

      public static void setColor(Color c)
      Sets the colour with which ROIs in their normal, unselected state should be drawn.
      Parameters:
      c - the colour with which normal, unselected ROIs are to be drawn.
    • setSelectedColor

      public static void setSelectedColor(Color c)
      Sets the colour with which ROIs in their selected state should be drawn.
      Parameters:
      c - the colour with which selected ROIs are to be drawn.
    • setDeletedColor

      public static void setDeletedColor(Color c)
      Sets the colour with which deleted ROIs should be drawn.
      Parameters:
      c - the colour with which deleted ROIs are to be drawn.
    • toString

      public String toString()
      Returns a string describing this ROI state.
      Overrides:
      toString in class Enum<ROIState>
      Returns:
      a string describing this ROI state.