JIDE 3.5.15

com.jidesoft.docking
Class DockContext

java.lang.Object
  extended by com.jidesoft.docking.DockContext
All Implemented Interfaces:
Serializable

public class DockContext
extends Object
implements Serializable

A object that stores state, mode and size information of a DockableFrame.

See Also:
Serialized Form

Field Summary
static int DOCK_SIDE_ALL
           
static int DOCK_SIDE_ALL_AND_CENTER
           
static int DOCK_SIDE_CENTER
           
static int DOCK_SIDE_EAST
           
static int DOCK_SIDE_HORIZONTAL
           
static int DOCK_SIDE_NORTH
          Which side of the frame the window can swing to and is docking to.
static int DOCK_SIDE_SOUTH
           
static int DOCK_SIDE_UNKNOWN
           
static int DOCK_SIDE_VERTICAL
           
static int DOCK_SIDE_WEST
           
static int MODE_ALL
           
static int MODE_AUTOHIDABLE
          Autohide means the window is docked to a side but still is above any other components, like a sliding door.
static int MODE_DOCKABLE
          Dockable means the window can be docked inside the main window.
static int MODE_FLOATABLE
          Floatable means the window can be floated in a floating container.
static int MODE_HIDABLE
          Hidable means the window can be hided.
static String[] SIDE_NAMES
           
static int STATE_AUTOHIDE
           
static int STATE_AUTOHIDE_SHOWING
           
static int STATE_FLOATING
           
static int STATE_FRAMEDOCKED
           
static int STATE_HIDDEN
          There are six states for each window.
static String[] STATE_NAMES
           
 
Constructor Summary
DockContext()
          Default constructor.
 
Method Summary
 Object clone()
          Clones a DockContext.
 int getAutohideHeight()
           
 com.jidesoft.docking.PreviousState getAutohidePreviousState()
           
 int getAutohideWidth()
           
 com.jidesoft.docking.PreviousState getAvailablePreviousState()
           
 int getCanMode()
           
 com.jidesoft.docking.PreviousState getClosePreviousState()
           
 int getCurrentDockSide()
           
 int getCurrentMode()
          Gets current state.
 int getDockedHeight()
           
 int getDockedWidth()
           
 int getDockID()
           
 com.jidesoft.docking.PreviousState getDockPreviousState()
           
static String getDockSideName(int side)
           
 com.jidesoft.docking.PreviousState getFloatPreviousState()
           
 com.jidesoft.docking.PreviousState getHiddenPreviousState()
           
 int getInitIndex()
          Gets initial index.
 int getInitMode()
          Gets initial state.
 int getInitSide()
          Gets initial side.
 com.jidesoft.docking.PreviousState getMaximizedPreviousState()
           
static String getStateName(int mode)
           
 Rectangle getUndockedBounds()
           
 boolean isAutohidable()
           
 boolean isAutohide()
          Checks if it's in autohide state.
 boolean isAutohideShowing()
          Checks if it's in autohide showing state.
 boolean isAvailable()
           
 boolean isDockable()
           
 boolean isDocked()
          Checks if it's in frame docked state.
 boolean isFloatable()
           
 boolean isFloated()
          Checks if it's in floating state.
 boolean isHidable()
           
 boolean isHidden()
          Checks if it's in hidden state.
 boolean isInitPosition()
           
 void resetDockID(DockingManager dockingManager)
           
 void setAutohidable(boolean autohidable)
           
 void setAutohideHeight(int height)
           
 void setAutohidePreviousState(com.jidesoft.docking.PreviousState autohidePreviousState)
           
 void setAutohideWidth(int width)
           
 void setAvailable(boolean available)
           
 void setAvailablePreviousState(com.jidesoft.docking.PreviousState availablePreviousState)
           
 void setCanMode(int canMode)
           
 void setClosePreviousState(com.jidesoft.docking.PreviousState closePreviousState)
           
 void setCurrentDockSide(int currentDockSide)
           
 void setCurrentMode(int currentMode)
          Sets current state.
 void setDockable(boolean dockable)
           
 void setDockedHeight(int dockedHeight)
           
 void setDockedWidth(int dockedWidth)
           
 void setDockID(DockingManager dockingManager, int dockID)
           
 void setDockPreviousState(com.jidesoft.docking.PreviousState dockPreviousState)
           
 void setFloatable(boolean floatable)
           
 void setFloatPreviousState(com.jidesoft.docking.PreviousState floatPreviousState)
           
 void setHidable(boolean hidable)
           
 void setHiddenPreviousState(com.jidesoft.docking.PreviousState hiddenPreviousState)
           
 void setInitIndex(int initIndex)
          Sets initial index.
 void setInitMode(int initMode)
          Sets the initial state.
 void setInitPosition(boolean initPosition)
           
 void setInitSide(int initSide)
          Sets the initial side.
 void setMaximizedPreviousState(com.jidesoft.docking.PreviousState maximizePreviousState)
           
 void setUndockedBounds(Rectangle bound)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MODE_FLOATABLE

public static final int MODE_FLOATABLE
Floatable means the window can be floated in a floating container.

See Also:
Constant Field Values

MODE_AUTOHIDABLE

public static final int MODE_AUTOHIDABLE
Autohide means the window is docked to a side but still is above any other components, like a sliding door. It will automatically hide itself if it loses focus.

See Also:
Constant Field Values

MODE_DOCKABLE

public static final int MODE_DOCKABLE
Dockable means the window can be docked inside the main window.

See Also:
Constant Field Values

MODE_HIDABLE

public static final int MODE_HIDABLE
Hidable means the window can be hided.

See Also:
Constant Field Values

MODE_ALL

public static final int MODE_ALL
See Also:
Constant Field Values

STATE_HIDDEN

public static final int STATE_HIDDEN
There are six states for each window.

Hidden state: means the window is hidden. User need to choose a menu item in View Menu to make the window visible.

Floating state: means the window is floating around, not docks to any side.

Autohide state: aka auto hide state, the window is hidden behind one of the four SideBar. In sliding active state, the window is visible and active.

FrameDocked state: the window is docked inside the main frame.

See Also:
Constant Field Values

STATE_FLOATING

public static final int STATE_FLOATING
See Also:
Constant Field Values

STATE_AUTOHIDE

public static final int STATE_AUTOHIDE
See Also:
Constant Field Values

STATE_AUTOHIDE_SHOWING

public static final int STATE_AUTOHIDE_SHOWING
See Also:
Constant Field Values

STATE_FRAMEDOCKED

public static final int STATE_FRAMEDOCKED
See Also:
Constant Field Values

STATE_NAMES

public static final String[] STATE_NAMES

DOCK_SIDE_NORTH

public static final int DOCK_SIDE_NORTH
Which side of the frame the window can swing to and is docking to.

See Also:
Constant Field Values

DOCK_SIDE_SOUTH

public static final int DOCK_SIDE_SOUTH
See Also:
Constant Field Values

DOCK_SIDE_EAST

public static final int DOCK_SIDE_EAST
See Also:
Constant Field Values

DOCK_SIDE_WEST

public static final int DOCK_SIDE_WEST
See Also:
Constant Field Values

DOCK_SIDE_CENTER

public static final int DOCK_SIDE_CENTER
See Also:
Constant Field Values

DOCK_SIDE_UNKNOWN

public static final int DOCK_SIDE_UNKNOWN
See Also:
Constant Field Values

DOCK_SIDE_HORIZONTAL

public static final int DOCK_SIDE_HORIZONTAL
See Also:
Constant Field Values

DOCK_SIDE_VERTICAL

public static final int DOCK_SIDE_VERTICAL
See Also:
Constant Field Values

DOCK_SIDE_ALL

public static final int DOCK_SIDE_ALL
See Also:
Constant Field Values

DOCK_SIDE_ALL_AND_CENTER

public static final int DOCK_SIDE_ALL_AND_CENTER
See Also:
Constant Field Values

SIDE_NAMES

public static final String[] SIDE_NAMES
Constructor Detail

DockContext

public DockContext()
Default constructor.

Method Detail

getInitMode

public int getInitMode()
Gets initial state.

Returns:
initial state

setInitMode

public void setInitMode(int initMode)
Sets the initial state. The available states are defined in DockContext. They are STATE_HIDDEN, STATE_FLOATING, STATE_AUTOHIDE and STATE_FRAMEDOCKED. It also supports a few negative value such as STATE_HIDDEN - STATE_FLOATING, STATE_HIDDEN - STATE_AUTOHIDE and STATE_HIDDEN - STATE_FRAMEDOCKED. In those nagative cases, the frame will initially be hidden. But when showFrame is called on this frame, it will use the corrponding mode to show the frame. For example, if initMode is set to STATE_HIDDEN - STATE_FLOATING, the frame will initially be hidden. When showFrame is called, the frame will be floated.

Parameters:
initMode - initial state

getCurrentMode

public int getCurrentMode()
Gets current state.

Returns:
current state

isHidden

public boolean isHidden()
Checks if it's in hidden state.

Returns:
true if it's in hidden state

isDocked

public boolean isDocked()
Checks if it's in frame docked state.

Returns:
true if it's in frame docked state

isFloated

public boolean isFloated()
Checks if it's in floating state.

Returns:
true if it's in floating state

isAutohide

public boolean isAutohide()
Checks if it's in autohide state.

Returns:
true if it's in autohide state

isAutohideShowing

public boolean isAutohideShowing()
Checks if it's in autohide showing state.

Returns:
true if it's in autohide showing state

setCurrentMode

public void setCurrentMode(int currentMode)
Sets current state.

Parameters:
currentMode - current state

getInitSide

public int getInitSide()
Gets initial side.

Returns:
the initial side

setInitSide

public void setInitSide(int initSide)
Sets the initial side. The valid values are DOCK_SIDE_EAST, DOCK_SIDE_WEST, DOCK_SIDE_SOUTH, DOCK_SIDE_NORTH, and DOCK_SIDE_CENTER. If you ever use DOCK_SIDE_CENTER, dockable frame will appear in workspace area thus you need to cal Workspace.setAcceptDockableFrame(boolean) and set it to true. If so, you shouldn't add any other arbitrary components to workspace area.

Parameters:
initSide - the initial side

isInitPosition

public boolean isInitPosition()

setInitPosition

public void setInitPosition(boolean initPosition)

getInitIndex

public int getInitIndex()
Gets initial index.

Returns:
the initial index

setInitIndex

public void setInitIndex(int initIndex)
Sets initial index. After seting initial side and mode, user can use this parameter to define initial position.
If all frames's initMode are FRAMEDOCKED and initSide are SOUTH, the all frames with the same index will form a tabbed pane. Frames with index 0 will appear before frames with index 1. In this case, only 0 and 1 is allowed.
If initMode is AUTOHIDE, the same indexed frames will form a group. In this case, any index greater than 0 is allowed.
If initMode is FLOATING, the same indexed frames will form a tabbed pane and in one floating window. In this case, any index greater than 0 is allowed.

Parameters:
initIndex - the initial index

getCurrentDockSide

public int getCurrentDockSide()

setCurrentDockSide

public void setCurrentDockSide(int currentDockSide)

getUndockedBounds

public Rectangle getUndockedBounds()

setUndockedBounds

public void setUndockedBounds(Rectangle bound)

getAutohideWidth

public int getAutohideWidth()

setAutohideWidth

public void setAutohideWidth(int width)

getAutohideHeight

public int getAutohideHeight()

setAutohideHeight

public void setAutohideHeight(int height)

getDockedWidth

public int getDockedWidth()

setDockedWidth

public void setDockedWidth(int dockedWidth)

getDockedHeight

public int getDockedHeight()

setDockedHeight

public void setDockedHeight(int dockedHeight)

getHiddenPreviousState

public com.jidesoft.docking.PreviousState getHiddenPreviousState()

setHiddenPreviousState

public void setHiddenPreviousState(com.jidesoft.docking.PreviousState hiddenPreviousState)

getClosePreviousState

public com.jidesoft.docking.PreviousState getClosePreviousState()

setClosePreviousState

public void setClosePreviousState(com.jidesoft.docking.PreviousState closePreviousState)

getDockPreviousState

public com.jidesoft.docking.PreviousState getDockPreviousState()

setDockPreviousState

public void setDockPreviousState(com.jidesoft.docking.PreviousState dockPreviousState)

getFloatPreviousState

public com.jidesoft.docking.PreviousState getFloatPreviousState()

setFloatPreviousState

public void setFloatPreviousState(com.jidesoft.docking.PreviousState floatPreviousState)

getAutohidePreviousState

public com.jidesoft.docking.PreviousState getAutohidePreviousState()

setAutohidePreviousState

public void setAutohidePreviousState(com.jidesoft.docking.PreviousState autohidePreviousState)

getDockSideName

public static String getDockSideName(int side)

getStateName

public static String getStateName(int mode)

getDockID

public int getDockID()

setDockID

public void setDockID(DockingManager dockingManager,
                      int dockID)

resetDockID

public void resetDockID(DockingManager dockingManager)

getCanMode

public int getCanMode()

setCanMode

public void setCanMode(int canMode)

isDockable

public boolean isDockable()

setDockable

public void setDockable(boolean dockable)

isHidable

public boolean isHidable()

setHidable

public void setHidable(boolean hidable)

isAutohidable

public boolean isAutohidable()

setAutohidable

public void setAutohidable(boolean autohidable)

isFloatable

public boolean isFloatable()

setFloatable

public void setFloatable(boolean floatable)

getAvailablePreviousState

public com.jidesoft.docking.PreviousState getAvailablePreviousState()

setAvailablePreviousState

public void setAvailablePreviousState(com.jidesoft.docking.PreviousState availablePreviousState)

isAvailable

public boolean isAvailable()

setAvailable

public void setAvailable(boolean available)

getMaximizedPreviousState

public com.jidesoft.docking.PreviousState getMaximizedPreviousState()

setMaximizedPreviousState

public void setMaximizedPreviousState(com.jidesoft.docking.PreviousState maximizePreviousState)

clone

public Object clone()
             throws CloneNotSupportedException
Clones a DockContext. Not all information are cloned. The information closed are initSide, initMode, initIndex, undockedBounds, autohideHeight, autohideWidth, dockedHeight, dockedWidth, currentMode, canMode, and currentDockSide. All other informations are ignored.

Overrides:
clone in class Object
Returns:
a cloned DockContext.
Throws:
CloneNotSupportedException

JIDE 3.5.15