dsx.JDockFloatPro
Class DockFloatFrame

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--java.awt.Frame
                          |
                          +--javax.swing.JFrame
                                |
                                +--dsx.JDockFloatPro.DockFloatFrame

public class DockFloatFrame
extends javax.swing.JFrame

An extended version of javax.swing.JFrame that adds support for docking any instance of java.awt.Component.  Please see the documentations of the DockFloatWindow,  DockFloatPanel, DockFloatMenuBar and DockFloatToolBar for a complete description of Dock/Float components.    You can also add non-Dock/Float components to its center or any sides of its border.    DockFloatFrame provides two methods for persistence of Dock/Float states that can be used to save and restore Dock/Float states.

The following is the sample code of how to use DockFloatFrame

 

public class MyDockFloatFrame extends DockFloatFrame
{
   public MyDockFloatFrame()
   {
      super();
      setSize(400,400);
      DockFloatWindow fdwin=new DockFloatWindow(this,"Testing");
      fdwin.setSize(200,200);
      fdwin.initStates(fdwin.DOCKTOP);
   }   
   public static void main (String args[])
   {
       MyDockFloatFrame frame=new MyDockFloatFrame();
       frame.show();
       frame.validate();
   }
		 
}

See Also:

Inner classes inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame

 

Field Summary
static int

DRAGCAPTION
           

static int

DRAGCAPTIONAUTO
           

static int DRAGHANDLE 
           

 

Fields inherited from class javax.swing.JFrame
accessibleContext, rootPane, rootPaneCheckingEnabled

 

Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR

 

Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT

 

Constructor Summary
DockFloatFrame()
           

 

Method Summary
 public void addFixedComponent (java.awt.component com, java.lang.Object constraints)
           
 public void ClearLayout ()
           
 public void getVersion ()
           
public void LoadDockFloatStates(java.lang.String sFileName)
           
public void removeFixedComponent(java.awt.Component com)
           
public void SaveDockFloatStates(java.lang.String sFileName)
           
public void setDragAreaStyle(int iStyle)
           

 

Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, processKeyEvent, processWindowEvent, setContentPane, setDefaultCloseOperation, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update

 

Methods inherited from class java.awt.Frame
addNotify, finalize, getCursorType, getFrames, getIconImage, getMenuBar, getState, getTitle, isResizable, remove, removeNotify, setCursor, setIconImage, setMenuBar, setResizable, setState, setTitle

 

Methods inherited from class java.awt.Window
addWindowListener, applyResourceBundle, applyResourceBundle, dispose, getFocusOwner, getInputContext, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, isShowing, pack, postEvent, processEvent, removeWindowListener, show, toBack, toFront

 

Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, setFont, validate, validateTree

 

Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processInputMethodEvent, processMouseEvent, processMouseMotionEvent, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus

 

Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

 

Field Detail

DRAGCAPTION

public static final int DRAGCAPTION
Constant used for setDragAreaStyle(int iStyle). When iStyle is set to DRAGCAPTION, the Dock/Float component's drag area always shows the title of the component

DRAGCAPTIONAUTO

public static final int DRAGCAPTIONAUTO
Constant used for setDragAreaStyle(int iStyle). When iStyle is set to DRAGCAPTIONAUTO, the Dock/Float component's drag area  shows the title of the component in the horizontal position when the component is docked to the left, or right of the container;  otherwise a vertical caption title is drawn on the drag area.

DRAGHANDLE

public static final int DRAGHANDLE
Constant used for setDragAreaStyle(int iStyle). When iStyle is set to DRAGHANDLE, the Dock/Float component's drag area shows the 3D drag handle.


 

Constructor Detail

DockFloatFrame

public DockFloatFrame()
Method Detail

addFixedComponent

public void addFixedComponent(java.awt.component com, Object constraints)
Adds the specified component to this container with the specified constraints. The added component is neither floatable nor dockable.   You can use this function to add a component to west, north, sourth, east and center of this container.

Parameters
com - the component to be added
constraints -   an object expressing layout contraints for this component, it can be  BorderLayout.WEST, BorderLayout.NORTH,  BorderLayout.SOUTH, BorderLayout.EAST  BorderLayout.CENTER

ClearLayout

public void ClearLayout()
Clear the current layout.   The function is used to dynamically change the layouts of DockFloatWindow components in the run time.  After the fuction is called,  you can call DockFloatWindow's method to layout the DockFloatWindow components.   The demo LayoutDemo.jar with source code LayoutDemo.java shows how to use the ClearLayout. 

getVersion

public String getVersion()
Gets the version of JDockFloatPro.  It returns a string for the version.   Currently, the version is "3.1". 

removeFixedComponent

public void removeFixedComponent(java.awt.Component com)
Removes the specified compoinent which is added by method addFixedComponent
Parameters
com - the component to be removed

setDragAreaStyle

public void setDragAreaStyle(int iStyle)
Sets the style of the drag area for Dock/Float windows
Parameters
iStyle - specifies the style of drag area, its valid values are
DRAGCAPTION
DRAGCAPTIONAUTO
DRAGHANDLE

LoadDockFloatStates

public void LoadDockFloatStates(java.lang.String sFileName)
Reads the Dock/Float states from the file that is saved by method SaveDockFloatStates.   The call initStates of class DockFloatWindow will use the loaded information to either dock or float component to the previous location.  If you don't want to restore the previous dock/float states, you don't need to call this method.
Parameters
sFileName - specifies the name of the file used to read the Dock/Float states

SaveDockFloatStates

public void SaveDockFloatStates(java.lang.String sFileName)
Saves the Dock/Float states in a file which can be used by method LoadDockFloatStates to restore the Dock/Float states
Parameters
sFilename - specifies the name of the file used to save Dock/Float states.