ch.javasoft.swing
Enum ComponentSizeType

java.lang.Object
  extended by java.lang.Enum<ComponentSizeType>
      extended by ch.javasoft.swing.ComponentSizeType
All Implemented Interfaces:
Serializable, Comparable<ComponentSizeType>

public enum ComponentSizeType
extends Enum<ComponentSizeType>

Enumeratable access to the different sizes of a JComponent.


Enum Constant Summary
Current
          Constant to access the actual size of a component
Maximum
          Constant to access the maximum size of a component
Minimum
          Constant to access the minimum size of a component
Preferred
          Constant to access the preferred size of a component
 
Method Summary
static ComponentSizeType getByPropertyName(String propertyName)
          Returns the component size instance by property name, or null if no constant matches the given property name
abstract  String getPropertyName()
          Returns the property name corresponding to this size type.
abstract  Dimension getSize(JComponent component)
          Return the size of the given component corresponding to this size type
abstract  void setSize(JComponent component, Dimension newSize)
          Set the size of the given component corresponding to this size type
static ComponentSizeType valueOf(String name)
          Returns the enum constant of this type with the specified name.
static ComponentSizeType[] 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, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

Preferred

public static final ComponentSizeType Preferred
Constant to access the preferred size of a component


Minimum

public static final ComponentSizeType Minimum
Constant to access the minimum size of a component


Maximum

public static final ComponentSizeType Maximum
Constant to access the maximum size of a component


Current

public static final ComponentSizeType Current
Constant to access the actual size of a component

Method Detail

values

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

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

valueOf

public static ComponentSizeType valueOf(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:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

setSize

public abstract void setSize(JComponent component,
                             Dimension newSize)
Set the size of the given component corresponding to this size type


getSize

public abstract Dimension getSize(JComponent component)
Return the size of the given component corresponding to this size type


getPropertyName

public abstract String getPropertyName()
Returns the property name corresponding to this size type. Can for instance be used to handle PropertyChangeEvents


getByPropertyName

public static ComponentSizeType getByPropertyName(String propertyName)
Returns the component size instance by property name, or null if no constant matches the given property name