com.vlsolutions.swing.docking
Class DockingUtilities

java.lang.Object
  extended by com.vlsolutions.swing.docking.DockingUtilities

public class DockingUtilities
extends java.lang.Object

Utility class implementing search/replace algorithms used by the framework.

This class is not inteded for API users, it should be let to framework developpers.


Method Summary
static boolean canUseMouseInfo()
          Returns whether we can use the secured and 1.5 MouseInfo class
static void dispose(FloatingDockableContainer fdc)
          disposes a detached dockable, regardless of its type (frame or dialog)
static java.awt.Container findCompoundAncestorContainer(Dockable dockable)
          searches up the dockable container hierarchy and returns the first ancestor which is a CompoundDockable (or null if not found).
static java.util.ArrayList findCompoundDockableChildren(CompoundDockable compoundDockable)
          Creates a list of all dockable children contained in the given compound dockable.
static DockableContainer findDockableContainer(Dockable dockable)
          returns the first DockableContainer which is parent of this dockable component
static SingleDockableContainer findSingleDockableContainer(Dockable dockable)
          returns the first DockableContainer which is parent of this dockable component
static SingleDockableContainer findSingleDockableContainerAncestor(java.awt.Component component)
          A utility method to find the first single dockable container ancestor of the given component.
static TabbedDockableContainer findTabbedDockableContainer(Dockable dockable)
          Returns the first TabbedDockableContainer which is parent of this dockable component, or null is there isn't any.
static int getDockableStateFromHierarchy(java.awt.Component comp)
          Returns a DockableState value corresponding to this component or -1 if not found.
static java.awt.Point getMouseLocation()
          Returns the mouse location on screen or null if ran in an untrusted environement/ java 1.4
static javax.swing.JRootPane getRootPane(FloatingDockableContainer fdc)
          returns the root pane used by this detached dockable container, regardless of its type (frame or dialog)
static SplitContainer getSplitPane(Dockable dockable, int orientation)
          Returns the split pane containing this dockable (if any), or null if this dockable isn't contained in a splitpane.
static int getTopMostAncestorContainerState(Dockable dockable)
          searches up the dockable container hierarchy and returns the dockable state of the last (top most) ancestor which is a CompoundDockable (or -1 if not found).
static boolean isChildOfCompoundDockable(Dockable dockable)
          checks if this dockable is a child of a compound dockable
static boolean isHeavyWeightComponent(java.awt.Component comp)
          Utility method to find out if a component is heavyweight (of if it contains a heavyweight comp)
static void pack(FloatingDockableContainer fdc)
          packs a detached dockable, regardless of its type (frame or dialog)
static void replaceChild(java.awt.Container parent, java.awt.Component child, java.awt.Component newChild)
          Child replacement
static void setLocation(FloatingDockableContainer fdc, java.awt.Point location)
          positions a detached dockable, regardless of its type (frame or dialog)
static void setLocationRelativeTo(FloatingDockableContainer fdc, java.awt.Component rel)
          positions a detached dockable, regardless of its type (frame or dialog)
static void setSize(FloatingDockableContainer fdc, java.awt.Dimension size)
          resizes a detached dockable, regardless of its type (frame or dialog)
static void setVisible(FloatingDockableContainer fdc, boolean visible)
          shows a detached dockable, regardless of its type (frame or dialog)
static void swapComponents(java.awt.Component comp1, java.awt.Component comp2)
          Swaps two toplevel DockableContainers (their parent must be a SplitContainer)
static void updateResizeWeights(DockingPanel dockingPanel)
          Invoked every time the layout is changed, to rebuild the weighting of split containers
static void validate(FloatingDockableContainer fdc)
          validates a detached dockable, regardless of its type (frame or dialog)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

findDockableContainer

public static DockableContainer findDockableContainer(Dockable dockable)
returns the first DockableContainer which is parent of this dockable component


findSingleDockableContainer

public static SingleDockableContainer findSingleDockableContainer(Dockable dockable)
returns the first DockableContainer which is parent of this dockable component


findTabbedDockableContainer

public static TabbedDockableContainer findTabbedDockableContainer(Dockable dockable)
Returns the first TabbedDockableContainer which is parent of this dockable component, or null is there isn't any.


swapComponents

public static void swapComponents(java.awt.Component comp1,
                                  java.awt.Component comp2)
Swaps two toplevel DockableContainers (their parent must be a SplitContainer)


updateResizeWeights

public static void updateResizeWeights(DockingPanel dockingPanel)
Invoked every time the layout is changed, to rebuild the weighting of split containers


replaceChild

public static void replaceChild(java.awt.Container parent,
                                java.awt.Component child,
                                java.awt.Component newChild)
Child replacement


getSplitPane

public static SplitContainer getSplitPane(Dockable dockable,
                                          int orientation)
Returns the split pane containing this dockable (if any), or null if this dockable isn't contained in a splitpane.

If the dockable is nested in a TabbedDockableContainer, the split pane returned will be the one containing the tabbed container (if any).


findSingleDockableContainerAncestor

public static SingleDockableContainer findSingleDockableContainerAncestor(java.awt.Component component)
A utility method to find the first single dockable container ancestor of the given component.

This method may return null if no SingleDockableContainer ancestor is found.


isHeavyWeightComponent

public static boolean isHeavyWeightComponent(java.awt.Component comp)
Utility method to find out if a component is heavyweight (of if it contains a heavyweight comp)


canUseMouseInfo

public static boolean canUseMouseInfo()
Returns whether we can use the secured and 1.5 MouseInfo class


getMouseLocation

public static java.awt.Point getMouseLocation()
Returns the mouse location on screen or null if ran in an untrusted environement/ java 1.4


pack

public static void pack(FloatingDockableContainer fdc)
packs a detached dockable, regardless of its type (frame or dialog)


setSize

public static void setSize(FloatingDockableContainer fdc,
                           java.awt.Dimension size)
resizes a detached dockable, regardless of its type (frame or dialog)


validate

public static void validate(FloatingDockableContainer fdc)
validates a detached dockable, regardless of its type (frame or dialog)


setLocation

public static void setLocation(FloatingDockableContainer fdc,
                               java.awt.Point location)
positions a detached dockable, regardless of its type (frame or dialog)


setLocationRelativeTo

public static void setLocationRelativeTo(FloatingDockableContainer fdc,
                                         java.awt.Component rel)
positions a detached dockable, regardless of its type (frame or dialog)


setVisible

public static void setVisible(FloatingDockableContainer fdc,
                              boolean visible)
shows a detached dockable, regardless of its type (frame or dialog)


dispose

public static void dispose(FloatingDockableContainer fdc)
disposes a detached dockable, regardless of its type (frame or dialog)


getRootPane

public static javax.swing.JRootPane getRootPane(FloatingDockableContainer fdc)
returns the root pane used by this detached dockable container, regardless of its type (frame or dialog)


findCompoundDockableChildren

public static java.util.ArrayList findCompoundDockableChildren(CompoundDockable compoundDockable)
Creates a list of all dockable children contained in the given compound dockable.

If the compound dockable contains another compound dockable this one is also added, along with its own children.

Returns:
an ArrayList of Dockable

isChildOfCompoundDockable

public static boolean isChildOfCompoundDockable(Dockable dockable)
checks if this dockable is a child of a compound dockable


findCompoundAncestorContainer

public static java.awt.Container findCompoundAncestorContainer(Dockable dockable)
searches up the dockable container hierarchy and returns the first ancestor which is a CompoundDockable (or null if not found).


getTopMostAncestorContainerState

public static int getTopMostAncestorContainerState(Dockable dockable)
searches up the dockable container hierarchy and returns the dockable state of the last (top most) ancestor which is a CompoundDockable (or -1 if not found).


getDockableStateFromHierarchy

public static int getDockableStateFromHierarchy(java.awt.Component comp)
Returns a DockableState value corresponding to this component or -1 if not found.

Two states are currently managed : docked and floating (not hidden/maximized/closed).



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