com.javadocking.dock.docker
Class BorderDocker

java.lang.Object
  extended by com.javadocking.dock.docker.BorderDocker
All Implemented Interfaces:
Docker

public class BorderDocker
extends java.lang.Object
implements Docker

This docker tries to dock the Dockable in the borders of an BorderDock. If the dockables that are docked by this docker are moved to other docks, it tries to add the dockables to those other docks.

Author:
Heidi Rakels.

Constructor Summary
BorderDocker()
           
 
Method Summary
 boolean dock(Dockable dockable)
          Adds the dockable to the border dock.
 BorderDock getBorderDock()
          Gets the dock in which the dockables with the minimized headers are docked.
 int[] getChildPositions()
          Gets the positions where the child docks with dockables will be first put.
 void loadProperties(java.lang.String prefix, java.util.Properties properties, java.util.Map dockablesMap)
           Loads the properties for this docker.
 void saveProperties(java.lang.String prefix, java.util.Properties properties)
           Saves the properties of this docker in the given properties object.
 void setBorderDock(BorderDock dock)
          Sets the dock in which the dockables are docked.
 void setChildPositions(int[] childPositions)
          Sets the positions where the child docks with dockables will be first put.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BorderDocker

public BorderDocker()
Method Detail

dock

public boolean dock(Dockable dockable)
Adds the dockable to the border dock.

Specified by:
dock in interface Docker
Parameters:
dockable - The dockable that has to be docked.
Returns:
True if the dockable was added, false otherwise.
Throws:
java.lang.NullPointerException - If the border dock is null.

saveProperties

public void saveProperties(java.lang.String prefix,
                           java.util.Properties properties)
Description copied from interface: Docker

Saves the properties of this docker in the given properties object.

The property names for this docker should start with the given prefix.

Specified by:
saveProperties in interface Docker
Parameters:
prefix - The prefix for the property names.
properties - The properties object to which the properties should be added.

loadProperties

public void loadProperties(java.lang.String prefix,
                           java.util.Properties properties,
                           java.util.Map dockablesMap)
                    throws java.io.IOException
Description copied from interface: Docker

Loads the properties for this docker. The properties can be found in the given properties object. The property names for this docker start with the given prefix.

This method should be called after the empty constructor to create the content of the docker. Don't call this method for a visualizer that already has a content.

Specified by:
loadProperties in interface Docker
Parameters:
prefix - The prefix of the names of the properties that have been intended for this docker.
properties - The properties object that contains the properties for this docker. It can contain also properties for other objects, but they will have another prefix.
dockablesMap - A mapping that contains the available dockables.
  • map key: the ID of the dockable (java.lang.String).
  • map value: the dockable (Dockable).
Throws:
java.io.IOException - If an error occures while decoding the properties.

getChildPositions

public int[] getChildPositions()
Gets the positions where the child docks with dockables will be first put.

Returns:
The positions where the child docks with dockables will be first put.

setChildPositions

public void setChildPositions(int[] childPositions)
Sets the positions where the child docks with dockables will be first put. The possible values in the array are:

Parameters:
childPositions - The positions where the child docks with dockables will be first put.

getBorderDock

public BorderDock getBorderDock()
Gets the dock in which the dockables with the minimized headers are docked.

Returns:
The dock in which the dockables with the minimized headers are docked.

setBorderDock

public void setBorderDock(BorderDock dock)
Sets the dock in which the dockables are docked.

Parameters:
dock - The dock in which the dockables are docked.