|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DockModel
A dock model represents a collection of docks that are used in an application.
Information on using dock models is in How to Use Dock Models in The Sanaware Developer Guide.
The dock model should be given to the docking manager with the method:
DockingManager.setDockModel(DockModel)
.
This model is a collection of trees of docks:
LeafDock
s.Dockable
s.CompositeDock
s.This dock model contains the root docks. All docks of the model have one of the root docks as root. Every root dock of the model can be retrieved with a key.
For every root dock the owner window has to be specified.
If the dock is a java.awt.Component, then the root dock should be its window ancestor.
If the dock is a FloatDock
, then the owner is the window that will own
the floating windows.
Method Summary | |
---|---|
void |
addOwner(java.lang.String ownerId,
java.awt.Window window)
Adds the specified window as owner to this dock model. |
void |
addRootDock(java.lang.String rootKey,
Dock dock,
java.awt.Window owner)
Adds a root dock with its key to this dock model. |
void |
addVisualizer(java.lang.String key,
Visualizer visualizer,
java.awt.Window owner)
Adds a visualizer with its key to this dock model. |
FloatDock |
getFloatDock(java.awt.Window owner)
Gets the root dock that is the float dock of the given owner window. |
java.lang.String |
getFloatDockKey(java.awt.Window owner)
Gets the key of the root dock that is a float dock of the given owner window. |
java.awt.Window |
getOwner(int index)
Gets the owner window with the specified index in the dock model. |
int |
getOwnerCount()
Gets the number of owner windows in this dock model. |
java.lang.String |
getOwnerID(java.awt.Window ownerWindow)
Gets the ID of the given owner window. |
Dock |
getRootDock(java.lang.String rootKey)
Gets the root dock of this dock model that has the given key associated to it. |
java.util.Iterator |
getRootKeys(java.awt.Window owner)
Gets an iterator that iterates over the keys of all the root docks of the given owner window. |
java.lang.String |
getSource()
Gets the name of the data source for this dock model; typically a file name or a URL. |
Visualizer |
getVisualizer(java.lang.String key)
Gets the visualizers of this dock model that has the given key associated to it. |
java.util.Iterator |
getVisualizerKeys(java.awt.Window owner)
Gets an iterator that iterates over the keys of all the visualizers of the given owner window. |
void |
loadProperties(java.lang.String sourceName,
java.lang.String prefix,
java.util.Properties properties,
java.util.Map dockablesMap,
java.util.Map ownersMap,
java.util.Map docksMap,
java.util.Map visualizersMap)
Loads the properties for this dock model. |
void |
removeOwner(java.awt.Window owner)
Removes the specified window as owner from this dock model. |
void |
removeRootDock(Dock dock)
Removes the root dock from the dock model. |
void |
removeVisualizer(Visualizer visualizer)
Removes the visualizer from the dock model. |
void |
saveProperties(java.lang.String prefix,
java.util.Properties properties,
java.util.Map dockKeys)
Saves the properties of this dock model in the given properties object. |
Method Detail |
---|
void addOwner(java.lang.String ownerId, java.awt.Window window)
ownerId
- The ID for the owner. All the owner window IDs have to be different.window
- The owner window.
java.lang.IllegalArgumentException
- If there is already a window with this owner ID.java.lang.String getOwnerID(java.awt.Window ownerWindow)
int getOwnerCount()
java.awt.Window getOwner(int index)
index
- The index of the owner window to retrieve.
java.lang.IndexOutOfBoundsException
- If the index is out of range (index < 0 || index >= getOwnerCount()).void removeOwner(java.awt.Window owner)
owner
- The owner window to be removed.
java.lang.IllegalArgumentException
- If the given window is not an owner window.void addRootDock(java.lang.String rootKey, Dock dock, java.awt.Window owner)
rootKey
- The key for the root dock. These keys should be different for all root docks and visualizers.dock
- The root dock that is added.owner
- The window that owns this dock.
java.lang.IllegalArgumentException
- If the specified owner is not an owner window of this model.
java.lang.IllegalArgumentException
- If the specified dock is already a root dock in the model.
java.lang.IllegalArgumentException
- If the specified dock is not a root dock.java.util.Iterator getRootKeys(java.awt.Window owner)
Dock getRootDock(java.lang.String rootKey)
rootKey
- The key of the root dock that is retrieved.
void removeRootDock(Dock dock)
dock
- The root dock to remove.
java.lang.IllegalArgumentException
- If the specified dock is not a root dock of this dock model.void addVisualizer(java.lang.String key, Visualizer visualizer, java.awt.Window owner)
key
- The key for the visualizer. These keys should be different for all root docks and visualizers.visualizer
- The visualizer that is added.owner
- The window that owns this visualizer.
java.lang.IllegalArgumentException
- If the specified owner is not an owner window of this model.
java.lang.IllegalArgumentException
- If the specified visualizer is already a visualizer in the model.java.util.Iterator getVisualizerKeys(java.awt.Window owner)
Visualizer getVisualizer(java.lang.String key)
key
- The key of the visualier that is retrieved.
void removeVisualizer(Visualizer visualizer)
visualizer
- The visualizer to remove.
java.lang.IllegalArgumentException
- If the specified visualizer is not a visualizer of this dock model.FloatDock getFloatDock(java.awt.Window owner)
owner
- The owner window of the float dock.
java.lang.String getFloatDockKey(java.awt.Window owner)
owner
- The owner window of the float dock.
java.lang.String getSource()
void loadProperties(java.lang.String sourceName, java.lang.String prefix, java.util.Properties properties, java.util.Map dockablesMap, java.util.Map ownersMap, java.util.Map docksMap, java.util.Map visualizersMap) throws java.io.IOException
Loads the properties for this dock model. The properties can be found in the given properties object and the property names for this dock model start with the given prefix.
The dockables that should be docked in this dock model are added to this dock model. They can be found in the given dockables mapping. The owner windows with their IDs can be found in the given owners mapping.
This method should be called after the empty constructor to create the content of the dock model. Don't call this method for a dock model that already has a content.
sourceName
- The name of a data source; typically a file name or a URL.prefix
- The prefix for the property names.properties
- The properties object that contains the properties for this dock model. It can contain also
properties for other objects, but they will have another prefix.dockablesMap
- A map with the dockables for the model.
Dockable
).ownersMap
- A map with the owner windows.
docksMap
- The decoded docks should be added to this map. The keys are the keys that were used for encoding the docks.
Dock
).visualizersMap
- A map with the visualizers.
java.io.IOException
- If an error occurs while decoding the data.void saveProperties(java.lang.String prefix, java.util.Properties properties, java.util.Map dockKeys)
Saves the properties of this dock model in the given properties object.
The property names for this dock model should start with the given prefix.
prefix
- The prefix for the property names.properties
- The properties object to which the properties should be added.dockKeys
- A mapping between the docks that are already saved and the keys that are used for the save.
The encoded docks should be added to this map.
Dock
).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |