com.vlsolutions.swing.docking

Class DockableState

public class DockableState extends Object implements Comparable

General information about the current state of a dockable component.

This class is a simple record of a dockable and its current display state.

It is used together with DockableStateChangeEvents (and listeners) to track changes of Dockable visibility.

UNKNOWN: 2005/10/07 Lilian Chamontin : added getStateName(int state) method

Field Summary
static intSTATE_CLOSED
A constant describing a Dockable that is not visible.
static intSTATE_DOCKED
A constant describing a Dockable that is visible (displayed in a DockableContainer)
static intSTATE_FLOATING
A constant describing a Dockable that is currently floating (detached from the desktop)
static intSTATE_HIDDEN
A constant describing a Dockable that is in auto-hide mode (reduced to a button)
static intSTATE_MAXIMIZED
A constant describing a Dockable that is currently maximized
Constructor Summary
DockableState()
DockableState(Dockable dockable, int state)
DockableState(Dockable dockable, int state, RelativeDockablePosition position)
Method Summary
intcompareTo(Object object)
Comparable interface, used to sort components by name order.
DockablegetDockable()
Returns the dockable this state is for
RelativeDockablePositiongetPosition()
Returns the relative restore position of the dockable when it is not shown (auto-hide or closed).
intgetState()
Returns the current state of the dockable (CLOSED, DOCKED, HIDDEN...).
static StringgetStateName(int state)
Returns a litteral representation of the given state
booleanisClosed()
Convenience method returning wether the dockable is in the CLOSED state
booleanisDocked()
Convenience method returning wether the dockable is in the DOCKED state
booleanisFloating()
Convenience method returning wether the dockable is in the FLOATING state
booleanisHidden()
Convenience method returning wether the dockable is in the HIDDEN state
booleanisMaximized()
Convenience method returning wether the dockable is in the MAXIMIZED state
StringtoString()

Field Detail

STATE_CLOSED

public static final int STATE_CLOSED
A constant describing a Dockable that is not visible.

STATE_DOCKED

public static final int STATE_DOCKED
A constant describing a Dockable that is visible (displayed in a DockableContainer)

STATE_FLOATING

public static final int STATE_FLOATING
A constant describing a Dockable that is currently floating (detached from the desktop)

STATE_HIDDEN

public static final int STATE_HIDDEN
A constant describing a Dockable that is in auto-hide mode (reduced to a button)

STATE_MAXIMIZED

public static final int STATE_MAXIMIZED
A constant describing a Dockable that is currently maximized

Constructor Detail

DockableState

public DockableState()

DockableState

public DockableState(Dockable dockable, int state)

DockableState

public DockableState(Dockable dockable, int state, RelativeDockablePosition position)

Method Detail

compareTo

public int compareTo(Object object)
Comparable interface, used to sort components by name order.

getDockable

public Dockable getDockable()
Returns the dockable this state is for

getPosition

public RelativeDockablePosition getPosition()
Returns the relative restore position of the dockable when it is not shown (auto-hide or closed).

Please note that this position is meaningless for visible components (as it is not automatically calculated at every move / resize of the dockable ).

getState

public int getState()
Returns the current state of the dockable (CLOSED, DOCKED, HIDDEN...).

getStateName

public static String getStateName(int state)
Returns a litteral representation of the given state

Since: 2.0.1

isClosed

public boolean isClosed()
Convenience method returning wether the dockable is in the CLOSED state

isDocked

public boolean isDocked()
Convenience method returning wether the dockable is in the DOCKED state

isFloating

public boolean isFloating()
Convenience method returning wether the dockable is in the FLOATING state

isHidden

public boolean isHidden()
Convenience method returning wether the dockable is in the HIDDEN state

isMaximized

public boolean isMaximized()
Convenience method returning wether the dockable is in the MAXIMIZED state

toString

public String toString()
© Copyright 2004-2005 VLSolutions. All Rights Reserved.
www.vlsolutions.com : Java Components - Smart Client Applications