br.usp.ime.klava.segmentit.util
Enum StructuringElement

java.lang.Object
  extended by java.lang.Enum<StructuringElement>
      extended by br.usp.ime.klava.segmentit.util.StructuringElement
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<StructuringElement>

public enum StructuringElement
extends java.lang.Enum<StructuringElement>

Represents an square structuring element utilized in morphological operations.

Author:
Bruno Klava

Enum Constant Summary
SQUARE_11x11
          A square of width and height equal to 11 pixels.
SQUARE_3x3
          A square of width and height equal to 3 pixels.
SQUARE_5x5
          A square of width and height equal to 5 pixels.
SQUARE_7x7
          A square of width and height equal to 7 pixels.
SQUARE_9x9
          A square of width and height equal to 9 pixels.
 
Method Summary
 int getSide()
          Returns the size (width and height are equal) of this square structuring element.
static StructuringElement select(java.awt.Component parent, java.lang.String title)
          Prompts the user to select a structuring element.
 java.lang.String toString()
          Return a string representation of this structuring element in the form: < side>x<side>
static StructuringElement valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static StructuringElement[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

SQUARE_3x3

public static final StructuringElement SQUARE_3x3
A square of width and height equal to 3 pixels.


SQUARE_5x5

public static final StructuringElement SQUARE_5x5
A square of width and height equal to 5 pixels.


SQUARE_7x7

public static final StructuringElement SQUARE_7x7
A square of width and height equal to 7 pixels.


SQUARE_9x9

public static final StructuringElement SQUARE_9x9
A square of width and height equal to 9 pixels.


SQUARE_11x11

public static final StructuringElement SQUARE_11x11
A square of width and height equal to 11 pixels.

Method Detail

values

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

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

valueOf

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

getSide

public int getSide()
Returns the size (width and height are equal) of this square structuring element.

Returns:
the size of this square structuring element

toString

public java.lang.String toString()
Return a string representation of this structuring element in the form: < side>x<side>

Overrides:
toString in class java.lang.Enum<StructuringElement>

select

public static StructuringElement select(java.awt.Component parent,
                                        java.lang.String title)
Prompts the user to select a structuring element.

Parameters:
parent - the Component parent of the prompt window
title - the title of the prompt window
Returns:
a structuring element selected by the user, null if the user canceled the selection