|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.javadocking.model.DefaultDockModel
public class DefaultDockModel
This is a basic dock model implementation.
Constructor Summary | |
---|---|
DefaultDockModel()
Constructs a dock model. |
|
DefaultDockModel(java.lang.String source)
Constructs a dock model with the given source. |
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 owner)
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. |
boolean |
isLoadOwnerRectangle()
Determines if the position and size of every owner window of a dock model are decoded and the properties are set on the owner window of the dock model. |
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 visualizerToRemove)
Removes the visualizer from the dock model. |
void |
saveProperties(java.lang.String prefix,
java.util.Properties properties,
java.util.Map docks)
Saves the properties of this dock model in the given properties object. |
void |
setLoadOwnerRectangle(boolean loadFrameRectangle)
Sets if the position and size of every owner window of a dock model are decoded and the properties are set on the owner window of the dock model. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultDockModel()
public DefaultDockModel(java.lang.String source)
source
- The name of the data source for this dock model; typically a file name or a URL.Method Detail |
---|
public java.lang.String getSource()
DockModel
getSource
in interface DockModel
public void addOwner(java.lang.String ownerId, java.awt.Window window)
DockModel
addOwner
in interface DockModel
ownerId
- The ID for the owner. All the owner window IDs have to be different.window
- The owner window.public java.lang.String getOwnerID(java.awt.Window owner)
DockModel
getOwnerID
in interface DockModel
public int getOwnerCount()
DockModel
getOwnerCount
in interface DockModel
public java.awt.Window getOwner(int index)
DockModel
getOwner
in interface DockModel
index
- The index of the owner window to retrieve.
public void removeOwner(java.awt.Window owner)
DockModel
removeOwner
in interface DockModel
owner
- The owner window to be removed.public void addRootDock(java.lang.String rootKey, Dock dock, java.awt.Window owner)
DockModel
addRootDock
in interface DockModel
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.public Dock getRootDock(java.lang.String rootKey)
DockModel
getRootDock
in interface DockModel
rootKey
- The key of the root dock that is retrieved.
public void removeRootDock(Dock dock)
DockModel
removeRootDock
in interface DockModel
dock
- The root dock to remove.public java.util.Iterator getRootKeys(java.awt.Window owner)
DockModel
getRootKeys
in interface DockModel
public void addVisualizer(java.lang.String key, Visualizer visualizer, java.awt.Window owner)
DockModel
addVisualizer
in interface DockModel
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.public Visualizer getVisualizer(java.lang.String key)
DockModel
getVisualizer
in interface DockModel
key
- The key of the visualier that is retrieved.
public java.util.Iterator getVisualizerKeys(java.awt.Window owner)
DockModel
getVisualizerKeys
in interface DockModel
public void removeVisualizer(Visualizer visualizerToRemove)
DockModel
removeVisualizer
in interface DockModel
visualizerToRemove
- The visualizer to remove.public FloatDock getFloatDock(java.awt.Window owner)
DockModel
getFloatDock
in interface DockModel
owner
- The owner window of the float dock.
public java.lang.String getFloatDockKey(java.awt.Window owner)
DockModel
getFloatDockKey
in interface DockModel
owner
- The owner window of the float dock.
public 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
DockModel
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.
loadProperties
in interface DockModel
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.public void saveProperties(java.lang.String prefix, java.util.Properties properties, java.util.Map docks)
DockModel
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.
saveProperties
in interface DockModel
prefix
- The prefix for the property names.properties
- The properties object to which the properties should be added.docks
- 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
).public boolean isLoadOwnerRectangle()
public void setLoadOwnerRectangle(boolean loadFrameRectangle)
loadFrameRectangle
- True if the position and size of every owner window of a dock model are decoded and
the properties are set on the owner window of the dock model.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |