bibliothek.gui.dock.toolbar.expand
Enum ExpandedState

java.lang.Object
  extended by java.lang.Enum<ExpandedState>
      extended by bibliothek.gui.dock.toolbar.expand.ExpandedState
All Implemented Interfaces:
Serializable, Comparable<ExpandedState>

public enum ExpandedState
extends Enum<ExpandedState>

Describes the state of a Dockable as seen by the ExpandableToolbarItemStrategyListener and by ExpandableToolbarItem.

Author:
Benjamin Sigg

Enum Constant Summary
EXPANDED
          an expanded Dockable has the largest possible size
SHRUNK
          a shrunk Dockable has the smallest possible size
STRETCHED
          a stretched Dockable has a medium size
 
Method Summary
 int getOrder()
          Gets the order of this state.
static ExpandedState getOrdered(int size)
          Orders the ExpandedStates according to their size, and returns the size'th state.
 ExpandedState larger()
          Gets the next larger state.
 ExpandedState smaller()
          Gets the next smaller state.
static ExpandedState valueOf(String name)
          Returns the enum constant of this type with the specified name.
static ExpandedState[] 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

EXPANDED

public static final ExpandedState EXPANDED
an expanded Dockable has the largest possible size


STRETCHED

public static final ExpandedState STRETCHED
a stretched Dockable has a medium size


SHRUNK

public static final ExpandedState SHRUNK
a shrunk Dockable has the smallest possible size

Method Detail

values

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

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

valueOf

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

getOrdered

public static ExpandedState getOrdered(int size)
Orders the ExpandedStates according to their size, and returns the size'th state.

Parameters:
size - the size of the state, where 0 is the smallest state.
Returns:
the state, not null
Throws:
IllegalArgumentException - if size is smaller than 0 or bigger than the number of available states

getOrder

public int getOrder()
Gets the order of this state. The order tells how big this state is compared to the other states, 0 is the smallest state. This formula always holds true: x == ExpandedState.getOrdered( x.getOrder() );

Returns:
the order of this state

smaller

public ExpandedState smaller()
Gets the next smaller state.

Returns:
the next smaller state or this if there is no smaller state

larger

public ExpandedState larger()
Gets the next larger state.

Returns:
the next larger state or null if there is no larger state