com.xinapse.multisliceimage.roi
Enum ROIState

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

public enum ROIState
extends java.lang.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 Summary
DELETED
          ROIState for a deleted ROI.
DELETED_SELECTED
          ROIState for a deleted ROI that is selected by the user.
EDIT_OUTLINE
          ROIState for a normal selected irregular ROI when its outline is editable.
EDITABLE
          ROIState for a normal, selected and editable ROI.
NORMAL
          ROIState for a normal, unselected ROI.
SELECTED
          ROIState for a normal, selected ROI.
 
Method Summary
static java.awt.Color getChoosableColor(int index)
          Returns one of the user-choosable ROI colours.
 java.awt.Color getDrawColor(byte userColour)
          Returns the colour with which an ROI in this state should be drawn.
static int getNChoosableColors()
          Returns the number of user-choosable ROI colours that may be set.
static void setChoosableColor(int index, java.awt.Color c)
          Sets one of the user-choosable ROI colours.
static void setColor(java.awt.Color c)
          Sets the colour with which ROIs in their normal, unselected state should be drawn.
static void setDeletedColor(java.awt.Color c)
          Sets the colour with which deleted ROIs should be drawn.
static void setSelectedColor(java.awt.Color c)
          Sets the colour with which ROIs in their selected state should be drawn.
 java.lang.String toString()
          Returns a string describing this ROI state.
static ROIState valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static ROIState[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

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 Detail

values

public static ROIState[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (ROIState c : ROIState.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static ROIState valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

getDrawColor

public java.awt.Color getDrawColor(byte userColour)
Returns the colour with which an ROI in this state should be drawn.

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 java.awt.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:
java.lang.ArrayIndexOutOfBoundsException - if the supplied index is outside the range for the number of user-choosable colours.

setChoosableColor

public static void setChoosableColor(int index,
                                     java.awt.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:
java.lang.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(java.awt.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(java.awt.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(java.awt.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 java.lang.String toString()
Returns a string describing this ROI state.

Overrides:
toString in class java.lang.Enum<ROIState>
Returns:
a string describing this ROI state.


Copyright 2006-2011 Xinapse Systems Limited. All Rights Reserved.