com.javadocking.dock
Interface LeafDock

All Superinterfaces:
Dock
All Known Subinterfaces:
DockableHider, ExternalizeDock
All Known Implementing Classes:
GridDock, LineDock, SingleDock, TabDock

public interface LeafDock
extends Dock

This is a dock that contains dockables. This kind of docks are the leaves in the dock trees.

Information on using leaf docks is in How to Use Laef Docks in The Sanaware Developer Guide.

Author:
Heidi Rakels.

Method Summary
 void addDockable(Dockable dockableToAdd, Position position)
           Adds the given dockable to this dock at the given position.
 boolean canRemoveDockable(Dockable dockable)
          Determines if the specified dockable can be removed from this dock.
 boolean containsDockable(Dockable dockable)
          Determines if the given dockable is docked in this dock.
 Dockable getDockable(int index)
          Gets the dockable with the specified index, that is docked in this dock.
 int getDockableCount()
          Gets the number of dockables that are docked in this dock.
 Position getDockablePosition(Dockable dockable)
          Gets the position where the dockable is docked in this dock.
 boolean moveDockable(Dockable dockable, java.awt.Point relativeLocation)
          Moves a dockable to a new position in this dock.
 boolean removeDockable(Dockable dockable)
          Removes the specified dockable from this dock.
 
Methods inherited from interface com.javadocking.dock.Dock
addDockable, addDockingListener, getDockPriority, getParentDock, isEmpty, isFull, loadProperties, removeDockingListener, retrieveDockingRectangle, saveProperties, setParentDock
 

Method Detail

addDockable

void addDockable(Dockable dockableToAdd,
                 Position position)

Adds the given dockable to this dock at the given position.

If there is already a dockable at the given position, or if the position is invalid, then the dockable is added at another position.

Parameters:
dockableToAdd - The dockable to add to this dock.
position - The position of the dockable.
Throws:
java.lang.IllegalStateException - If the dock is full.

canRemoveDockable

boolean canRemoveDockable(Dockable dockable)
Determines if the specified dockable can be removed from this dock.

Parameters:
dockable - The dockable that will be removed.
Returns:
True if the specified dockable can be removed from this dock, false otherwise.

removeDockable

boolean removeDockable(Dockable dockable)
Removes the specified dockable from this dock.

Parameters:
dockable - The dockable that will be removed.
Returns:
True if the specified dockable was removed from this dock, false otherwise.

getDockableCount

int getDockableCount()
Gets the number of dockables that are docked in this dock.

Returns:
The number of dockables that are docked in this dock.

getDockable

Dockable getDockable(int index)
                     throws java.lang.IndexOutOfBoundsException
Gets the dockable with the specified index, that is docked in this dock.

Parameters:
index - The index of the dockable
Returns:
The dockable with the specified index that is docked in this dock.
Throws:
java.lang.IndexOutOfBoundsException - If the index is out of range (index < 0 || index >= getDockableCount()).

containsDockable

boolean containsDockable(Dockable dockable)
Determines if the given dockable is docked in this dock.

Parameters:
dockable - The dockable.
Returns:
True if if the given dockable is docked in this dock, false otherwise.

moveDockable

boolean moveDockable(Dockable dockable,
                     java.awt.Point relativeLocation)
Moves a dockable to a new position in this dock.

Parameters:
dockable - The dockable that will be moved.
relativeLocation - The location to which the dockable will be moved, relatively to the dock.
Returns:
True if the position of the dockable changed, false otherwise.
Throws:
java.lang.IllegalArgumentException - If the given dockable is not docked in this dock.

getDockablePosition

Position getDockablePosition(Dockable dockable)
                             throws java.lang.IllegalArgumentException
Gets the position where the dockable is docked in this dock.

Parameters:
dockable - The dockable that is docked in this dock.
Returns:
The position where the dockable is docked in this dock. Not null.
Throws:
java.lang.IllegalArgumentException - If the given dockable is not docked in this dock.