Package com.xinapse.multisliceimage.roi
Enum Class ROIState
- All Implemented Interfaces:
Serializable
,Comparable<ROIState>
,Constable
An enumeration of the different states in which an ROI can be.
The state of an ROI affects its on-screen appearance and manipulability.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionROIState for a deleted ROI.ROIState for a deleted ROI that is selected by the user.ROIState for a normal selected irregular ROI when its outline is editable.ROIState for a normal, selected and editable ROI.ROIState for a normal, unselected ROI.ROIState for a normal, selected ROI. -
Method Summary
Modifier and TypeMethodDescriptionstatic Color
getChoosableColor
(int index) Returns one of the user-choosable ROI colours.getDrawColor
(byte userColour) Returns the colour with which an ROI in this state should be drawn.static int
Returns the number of user-choosable ROI colours that may be set.static void
setChoosableColor
(int index, Color c) Sets one of the user-choosable ROI colours.static void
Sets the colour with which ROIs in their normal, unselected state should be drawn.static void
Sets the colour with which deleted ROIs should be drawn.static void
Sets the colour with which ROIs in their selected state should be drawn.toString()
Returns a string describing this ROI state.static ROIState
Returns the enum constant of this class with the specified name.static ROIState[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
DELETED
ROIState for a deleted ROI. -
DELETED_SELECTED
ROIState for a deleted ROI that is selected by the user. -
NORMAL
ROIState for a normal, unselected ROI. -
SELECTED
ROIState for a normal, selected ROI. -
EDITABLE
ROIState for a normal, selected and editable ROI. -
EDIT_OUTLINE
ROIState for a normal selected irregular ROI when its outline is editable.
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
getDrawColor
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
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
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
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
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
Sets the colour with which deleted ROIs should be drawn.- Parameters:
c
- the colour with which deleted ROIs are to be drawn.
-
toString
Returns a string describing this ROI state.
-