|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.javadocking.dock.FloatDock
public class FloatDock
This special dock contains all the floating dockables. It is a composite dock. The child docks are put in a dialog (javaw.swing.JDialog) and are floating on the screen.
Information on using float docks is in How to Use Composite Docks in The Sanaware Developer Guide.
A dockable can be added to this dock if
DockingMode.FLOAT
as one of its possible docking modes.There is an order for the floating child docks. Children with a lower index are on top of children with a higher index.
The parent dock of the float dock is always null. The float dock has a owner window. This is the window that that will be the owner of the dialogs that contain the child docks.
Field Summary |
---|
Fields inherited from interface com.javadocking.dock.CompositeDock |
---|
CHILD_DOCK_PREFIX |
Constructor Summary | |
---|---|
FloatDock()
Constructs a float dock with no owner and a SplitDockFactory
as factory for the child docks. |
|
FloatDock(java.awt.Window owner)
Constructs a float dock with the given window as owner for the child dock windows and a SplitDockFactory as factory for creating child docks. |
|
FloatDock(java.awt.Window owner,
DockFactory childDockFactory)
Constructs a float dock with the given window as owner for the child dock windows and the given factory for the child docks. |
Method Summary | |
---|---|
void |
addChildDock(Dock dock,
java.awt.Point location,
java.awt.Dimension size)
Adds the given dock as child dock to this dock. |
void |
addChildDock(Dock dock,
Position position)
Adds the child dock to the given position. |
boolean |
addDockable(Dockable dockableToAdd,
java.awt.Point relativeLocation,
java.awt.Point dockableOffset)
Adds a dockable to this dock. |
void |
addDockingListener(DockingListener listener)
Adds a listener for DockingEvent s of this dock. |
void |
addWindowFocusListener(java.awt.event.WindowFocusListener windowFocusListener)
Adds the listener that will listen to the window focus events of all the floating windows created by this class. |
void |
clearGhosts()
Clears the ghost child docks from this dock. |
void |
emptyChild(Dock childDock)
Is called when the specified child dock is empty. |
Dock |
getChildDock(int index)
Gets the child dock with the specified index. |
int |
getChildDockCount()
Gets the number of child docks of this dock. |
DockFactory |
getChildDockFactory()
Gets the factory that creates the child docks for this composite dock. |
Position |
getChildDockPosition(Dock childDock)
Gets the position, where the child dock is docked in this dock. |
protected void |
getDefaultFloatingWindowLocation(java.awt.Point location)
Moves the location inside the screen where the floating window has to be placed. |
int |
getDockPriority()
Gets the dock priority for a floatable dockable that will be added to this float dock. |
int |
getDockPriority(Dockable dockableToAdd,
java.awt.Point relativeLocation)
Determines if the dockable can be added. |
java.awt.Window |
getOwner()
Gets the window that owns the floating windows created by this dock. |
CompositeDock |
getParentDock()
Always returns null, because this dock can't have a parent dock. |
void |
ghostChild(Dock childDock)
Makes the given empty child dock invisible. |
boolean |
isEmpty()
Determines if this dock doesn't have any dockables docked in it, or doesn't have any child docks docked in it. |
boolean |
isFull()
Always returns false, because it is never full. |
void |
loadProperties(java.lang.String prefix,
java.util.Properties properties,
java.util.Map newChildDocks,
java.util.Map dockablesMap,
java.awt.Window owner)
Loads the properties for this dock. |
void |
moveDock(Dock childDock,
java.awt.Point relativeLocation,
java.awt.Point dockableOffset)
Moves the given child dock to the new location. |
void |
removeDockingListener(DockingListener listener)
Removes a listener for docking events of this dock. |
void |
removeWindowFocusListener(java.awt.event.WindowFocusListener windowFocusListener)
Removes the given listener. |
int |
retrieveDockingRectangle(Dockable dockable,
java.awt.Point relativeLocation,
java.awt.Point dockableOffset,
java.awt.Rectangle rectangle)
Sets the given rectangle to the position and size of the graphical content component of the dockable, when it will be docked in this dock. |
void |
saveProperties(java.lang.String prefix,
java.util.Properties properties,
java.util.Map childDockIds)
Saves the properties of this dock in the given properties object. |
void |
setChildDockFactory(DockFactory childDockFactory)
Sets the factory that creates the child docks for this composite dock. |
void |
setDockPriority(int dockPriority)
Sets the dock priority for a floatable dockable that will be added to the float dock. |
void |
setOwner(java.awt.Window owner)
Sets the window that owns the floating windows created by this dock. |
void |
setParentDock(CompositeDock parentDock)
Does nothing, because this dock can't have a parent dock. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FloatDock()
SplitDockFactory
as factory for the child docks.
public FloatDock(java.awt.Window owner)
SplitDockFactory
as factory for creating child docks.
owner
- The window that owns the floating windows created by this dock.public FloatDock(java.awt.Window owner, DockFactory childDockFactory)
owner
- The window that owns the floating windows created by this dock.childDockFactory
- The factory for creating child docks.Method Detail |
---|
public int getDockPriority(Dockable dockableToAdd, java.awt.Point relativeLocation)
Determines if the dockable can be added.
It can be added if
DockingMode.FLOAT
as one of its possible docking modes.
When the dockable can be added the value of the property
dockPriority
is returned.
getDockPriority
in interface Dock
dockableToAdd
- The dockable that will be added.relativeLocation
- The location where the dockable will be added.
dockPriority
is returned, otherwise Priority.CANNOT_DOCK
.public int retrieveDockingRectangle(Dockable dockable, java.awt.Point relativeLocation, java.awt.Point dockableOffset, java.awt.Rectangle rectangle)
Dock
Sets the given rectangle to the position and size of the graphical content component of the dockable, when it will be docked in this dock.
Determines if the dockable can be added to this dock. If the dockable cannot be added,
it returns Priority.CANNOT_DOCK
and the given rectangle is not changed.
retrieveDockingRectangle
in interface Dock
dockable
- The dockable that will be added.relativeLocation
- The location where the dockable will be added.dockableOffset
- The mouse location where the dragging started, relatively to the previous dock of the dockable.rectangle
- This rectangle will be set to the location and size of the graphical component of the dockable
when it will be docked in this dock. The rectangle is relative to this dock.
Priority.CANNOT_DOCK
is returned, otherwise a positive integer.public boolean addDockable(Dockable dockableToAdd, java.awt.Point relativeLocation, java.awt.Point dockableOffset)
Dock
Adds a dockable to this dock.
First it determines if the dockable can be added with Dock.getDockPriority(Dockable, Point)
.
If this method returns CANNOT_DOCK, the dockable is not added.
addDockable
in interface Dock
dockableToAdd
- The dockable that will be added.relativeLocation
- The location where the dockable will be added.dockableOffset
- The mouse location where the dragging started, relatively to the previous dock of the dockable.
public boolean isEmpty()
Dock
isEmpty
in interface Dock
public boolean isFull()
isFull
in interface Dock
public CompositeDock getParentDock()
getParentDock
in interface Dock
public void setParentDock(CompositeDock parentDock)
setParentDock
in interface Dock
parentDock
- The parent dock of this dock.public void saveProperties(java.lang.String prefix, java.util.Properties properties, java.util.Map childDockIds)
Dock
Saves the properties of this dock in the given properties object.
The property names for this dock should start with the given prefix.
saveProperties
in interface Dock
prefix
- The prefix for the property names.properties
- The properties object to which the properties should be added.childDockIds
- A mapping between the child docks that are already saved and the keys that are used for the save.
Dock
).public void loadProperties(java.lang.String prefix, java.util.Properties properties, java.util.Map newChildDocks, java.util.Map dockablesMap, java.awt.Window owner) throws java.io.IOException
Dock
Loads the properties for this dock. The properties can be found in the given properties object. The property names for this dock start with the given prefix.
The dockables that should be docked in this dock are added to this dock. They can be found in the given dockables mapping. The docks that should be docked inside this dock are added to this dock. They can be found in the given childDocks mapping.
This method should be called after the empty constructor to create the content of the dock. Don't call this method for a dock that already has a content.
loadProperties
in interface Dock
prefix
- The prefix of the names of the properties that have been intended for this dock.properties
- The properties object that contains the properties for this dock. It can contain also
properties for other objects, but they will have another prefix.newChildDocks
- A mapping between the dock keys of the child docks that are already loaded and the docks.
Dock
).dockablesMap
- A mapping that contains the available dockables.
Dockable
).owner
- The owner window of the dock in the dock model (DockModel
).
java.io.IOException
- If an error occures while decoding the properties.public void addDockingListener(DockingListener listener)
Dock
DockingEvent
s of this dock.
The listener will be informed before and after
adding, moving or removing dockables or child docks from this dock.
addDockingListener
in interface Dock
listener
- A docking listener that will be notified when a dockable or child dock is added, moved, or removed.public void removeDockingListener(DockingListener listener)
Dock
removeDockingListener
in interface Dock
listener
- The docking listener to remove.public void emptyChild(Dock childDock)
CompositeDock
emptyChild
in interface CompositeDock
childDock
- The child dock that is empty.public void ghostChild(Dock childDock)
CompositeDock
ghostChild
in interface CompositeDock
childDock
- The child dock that is empty, but not may be removed.public void clearGhosts()
CompositeDock
clearGhosts
in interface CompositeDock
public int getChildDockCount()
CompositeDock
getChildDockCount
in interface CompositeDock
public Dock getChildDock(int index) throws java.lang.IndexOutOfBoundsException
CompositeDock
getChildDock
in interface CompositeDock
index
- The index of the child dock.
java.lang.IndexOutOfBoundsException
- If the index is out of range (index < 0 || index >= getChildDockCount()).public Position getChildDockPosition(Dock childDock) throws java.lang.IllegalArgumentException
CompositeDock
getChildDockPosition
in interface CompositeDock
childDock
- The dockable that is docked in this dock.
java.lang.IllegalArgumentException
- If the given dock is not docked in this dock.public void addChildDock(Dock dock, Position position) throws java.lang.IllegalStateException
addChildDock
in interface CompositeDock
dock
- The child dock that is added to this float dock in a dialog.position
- The position for the child dock with 3 dimensions:
java.lang.IllegalStateException
- If the dock is full.public DockFactory getChildDockFactory()
CompositeDock
getChildDockFactory
in interface CompositeDock
public void setChildDockFactory(DockFactory childDockFactory)
CompositeDock
setChildDockFactory
in interface CompositeDock
childDockFactory
- The factory that creates the child docks for this composite dock.public java.awt.Window getOwner()
public void setOwner(java.awt.Window owner)
owner
- The window that owns the floating windows created by this dock.public int getDockPriority()
public void setDockPriority(int dockPriority)
dockPriority
- The dock priority for a floatable dockable that will be added to the float dock.public void addWindowFocusListener(java.awt.event.WindowFocusListener windowFocusListener)
windowFocusListener
- The listener that will listen to the window focus events of all the floating windows
created by this class.public void removeWindowFocusListener(java.awt.event.WindowFocusListener windowFocusListener)
windowFocusListener
- The listener that listens to the window focus events of all the floating windows
created by this class.public void moveDock(Dock childDock, java.awt.Point relativeLocation, java.awt.Point dockableOffset)
childDock
- The child dock that has to be moved to the new location.relativeLocation
- The new location for the child dock.dockableOffset
- The mouse location where the dragging started, relatively to the child dock.public void addChildDock(Dock dock, java.awt.Point location, java.awt.Dimension size)
Adds the given dock as child dock to this dock.
The dock is put in a dialog. This dialog is created with the method
SwComponentFactory.createJDialog(Window)
of
the component factory of the DockingManager
.
There is a border set around the dock. This border is created with the method
SwComponentFactory.createFloatingBorder()
of
the component factory of the docking manager.
The floating window is put at the given location. The window will have the given size. If this size is null, then the preferred size is taken.
dock
- The child dock that is added to this float dock in a floating dialog.location
- The location for the dialog.size
- The size for the dialog. This may be null. In that case the preferred
size is taken.protected void getDefaultFloatingWindowLocation(java.awt.Point location)
location
- The location where the floating window will be put,
if the requested location is outside the screen.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |