com.xinapse.util
Enum IntensityRelation

java.lang.Object
  extended by java.lang.Enum<IntensityRelation>
      extended by com.xinapse.util.IntensityRelation
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<IntensityRelation>, javax.swing.Icon

public enum IntensityRelation
extends java.lang.Enum<IntensityRelation>
implements javax.swing.Icon

An enumeration of possible intensity relationships.


Nested Class Summary
static class IntensityRelation.IntensityRelationButton
          A Button for setting an intensity relation.
static class IntensityRelation.PanelGenerator
          Class for generating JPanels for selecting an IntensityRelation.
 
Enum Constant Summary
HYPERINTENSE
          A feature is hyperintense.
HYPOINTENSE
          A feature is hypointense.
UNKNOWN
          A feature may be hyperintense or hypointense.
 
Field Summary
static IntensityRelation DEFAULT_INTENSITY_RELATION
          The default IntensityRelation.
static org.apache.commons.cli.Option OPTION
          An Option that can be used for command-line processing of an optional list of intensity relations.
 
Method Summary
 java.lang.String getDescription()
          Returns a String describing this IntensityRelation in detail.
 int getIconHeight()
           
 int getIconWidth()
           
static IntensityRelation getInstance(java.lang.String s)
          Returns the IntensityRelation specified by the argument.
static void main(java.lang.String[] args)
          Run the self-test of the IntensityRelation class.
 void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
           
static IntensityRelation[] parseRelations(java.lang.String s)
          Get an array of IntenstyRelations from a String comma-separated list of relations.
static java.lang.String toPreferencesString(IntensityRelation[] relations)
          Returns a String containing the array of IntensityRelations as a comma-separated list, suitable for saving the relations in the Preferences.
 java.lang.String toString()
          Returns a short String describing this IntensityRelation.
static IntensityRelation valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static IntensityRelation[] 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

UNKNOWN

public static final IntensityRelation UNKNOWN
A feature may be hyperintense or hypointense.


HYPERINTENSE

public static final IntensityRelation HYPERINTENSE
A feature is hyperintense.


HYPOINTENSE

public static final IntensityRelation HYPOINTENSE
A feature is hypointense.

Field Detail

DEFAULT_INTENSITY_RELATION

public static final IntensityRelation DEFAULT_INTENSITY_RELATION
The default IntensityRelation.


OPTION

public static final org.apache.commons.cli.Option OPTION
An Option that can be used for command-line processing of an optional list of intensity relations.

Method Detail

values

public static IntensityRelation[] 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 (IntensityRelation c : IntensityRelation.values())
    System.out.println(c);

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

valueOf

public static IntensityRelation 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

getDescription

public final java.lang.String getDescription()
Returns a String describing this IntensityRelation in detail.

Returns:
a java.lang.String describing this IntensityRelation in detail.

toString

public java.lang.String toString()
Returns a short String describing this IntensityRelation.

Overrides:
toString in class java.lang.Enum<IntensityRelation>
Returns:
a java.lang.String describing this IntensityRelation.

getInstance

public static IntensityRelation getInstance(java.lang.String s)
                                     throws java.text.ParseException
Returns the IntensityRelation specified by the argument.

Parameters:
s - a String describing the IntensityRelation.
Throws:
java.text.ParseException

parseRelations

public static IntensityRelation[] parseRelations(java.lang.String s)
                                          throws java.text.ParseException
Get an array of IntenstyRelations from a String comma-separated list of relations.

Parameters:
s - a comma-separated list of relations, where entries with two adjacent commas are interpreted as IntensityRelation.UNKNOWN.
Throws:
java.text.ParseException

toPreferencesString

public static java.lang.String toPreferencesString(IntensityRelation[] relations)
Returns a String containing the array of IntensityRelations as a comma-separated list, suitable for saving the relations in the Preferences.

Returns:
a comma-separated list of IntensityRelations.

main

public static void main(java.lang.String[] args)
Run the self-test of the IntensityRelation class.

Parameters:
args - ignored.

getIconHeight

public int getIconHeight()
Specified by:
getIconHeight in interface javax.swing.Icon

getIconWidth

public int getIconWidth()
Specified by:
getIconWidth in interface javax.swing.Icon

paintIcon

public void paintIcon(java.awt.Component c,
                      java.awt.Graphics g,
                      int x,
                      int y)
Specified by:
paintIcon in interface javax.swing.Icon


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