com.vlsolutions.swing.docking
Class DockableState

java.lang.Object
  extended by com.vlsolutions.swing.docking.DockableState
All Implemented Interfaces:
java.lang.Comparable

public class DockableState
extends java.lang.Object
implements java.lang.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.


Field Summary
static int STATE_CLOSED
          A constant describing a Dockable that is not visible.
static int STATE_DOCKED
          A constant describing a Dockable that is visible (displayed in a DockableContainer)
static int STATE_FLOATING
          A constant describing a Dockable that is currently floating (detached from the desktop)
static int STATE_HIDDEN
          A constant describing a Dockable that is in auto-hide mode (reduced to a button)
static int STATE_MAXIMIZED
          A constant describing a Dockable that is currently maximized
 
Constructor Summary
DockableState()
           
DockableState(DockableState copy, RelativeDockablePosition position)
          Creates a dockable state based on an existing state, with another relative positionning
DockableState(DockingDesktop desktop, Dockable dockable, int state)
           
DockableState(DockingDesktop desktop, Dockable dockable, int state, RelativeDockablePosition position)
           
 
Method Summary
 int compareTo(java.lang.Object object)
          Comparable interface, used to sort components by name order.
 DockingDesktop getDesktop()
          Returns the desktop currently using this dockable, or null if none
 Dockable getDockable()
          Returns the dockable this state is for
 RelativeDockablePosition getPosition()
          Returns the relative restore position of the dockable when it is not shown (auto-hide or closed).
 int getState()
          Returns the current state of the dockable (CLOSED, DOCKED, HIDDEN...).
static java.lang.String getStateName(int state)
          Returns a litteral representation of the given state
 boolean isClosed()
          Convenience method returning wether the dockable is in the CLOSED state
 boolean isDocked()
          Convenience method returning wether the dockable is in the DOCKED state
 boolean isFloating()
          Convenience method returning wether the dockable is in the FLOATING state
 boolean isHidden()
          Convenience method returning wether the dockable is in the HIDDEN state
 boolean isMaximized()
          Convenience method returning wether the dockable is in the MAXIMIZED state
 void setDesktop(DockingDesktop desktop)
          Updates the desktop field (desktop using this dockable)
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

STATE_CLOSED

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

See Also:
Constant Field Values

STATE_DOCKED

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

See Also:
Constant Field Values

STATE_HIDDEN

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

See Also:
Constant Field Values

STATE_MAXIMIZED

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

See Also:
Constant Field Values

STATE_FLOATING

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

See Also:
Constant Field Values
Constructor Detail

DockableState

public DockableState()

DockableState

public DockableState(DockingDesktop desktop,
                     Dockable dockable,
                     int state)

DockableState

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

DockableState

public DockableState(DockableState copy,
                     RelativeDockablePosition position)
Creates a dockable state based on an existing state, with another relative positionning

Method Detail

compareTo

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

Specified by:
compareTo in interface java.lang.Comparable

getDockable

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


isDocked

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


isHidden

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


isClosed

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


isFloating

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


isMaximized

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


getState

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


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 ).


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getStateName

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

Since:
2.0.1

getDesktop

public DockingDesktop getDesktop()
Returns the desktop currently using this dockable, or null if none

Since:
2.1

setDesktop

public void setDesktop(DockingDesktop desktop)
Updates the desktop field (desktop using this dockable)

Since:
2.1


© Copyright 2004-2007 VLSolutions. All Rights Reserved.
www.vlsolutions.com : Java Components - Smart Client Applications