|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.javadocking.model.DefaultDockingPath
public class DefaultDockingPath
This is the default implementation for a docking path.
Constructor Summary | |
---|---|
DefaultDockingPath()
Constructs a docking path, which is not initialized. |
|
DefaultDockingPath(java.lang.String id,
java.lang.String rootDockKey,
Dock[] docks,
Position[] positions)
Constructs a docking path with the given properties. |
Method Summary | |
---|---|
static DefaultDockingPath |
copyDockingPath(Dockable dockableForPath,
DockingPath dockingPathToCopy)
Creates a docking path for the given dockable, that is almost a copy of the given docking path. |
static DefaultDockingPath |
createDockingPath(Dockable dockable)
Creates a docking path with the information how the given dockable is docked now in the dock model of the docking manager. |
boolean |
equals(java.lang.Object object)
Returns true if the given object is a DockingPath with the same ID
as this docking path. |
Dock |
getDock(int index)
Gets the dock with the given index in the path. |
int |
getDockCount()
Gets the number of docks in the path. |
java.lang.String |
getID()
Gets the ID of this docking path. |
Position |
getPositionInDock(int index)
Gets the position of the dockable or child dock in the dock with the given index in the path. |
java.lang.String |
getRootDockKey()
Gets the key of the root dock of this path in the DockModel . |
int |
hashCode()
|
void |
loadProperties(java.lang.String prefix,
java.util.Properties properties,
java.util.Map idDockMap)
Loads the properties for this docking path. |
void |
saveProperties(java.lang.String prefix,
java.util.Properties properties,
java.util.Map dockIds)
Saves the properties of this docking path in the given properties object. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultDockingPath()
public DefaultDockingPath(java.lang.String id, java.lang.String rootDockKey, Dock[] docks, Position[] positions)
id
- The ID of the docking path.rootDockKey
- The key of the root dock of this path.docks
- The docks of the path. The dock with index 0 is the root dock. Cannot be null.positions
- The positions of the docks or the in this path. Cannot be null.
The last position can be the position of a dockable in a leaf dock.
java.lang.IllegalArgumentException
- If the lengths of the given array of docks and the given array
of positions are different.
java.lang.NullPointerException
- If one of the docks or one of the positions in the array is null.Method Detail |
---|
public static DefaultDockingPath createDockingPath(Dockable dockable)
dockable
- The dockable for which a docking path is created about its current position in a dock model.
This may not be a composite dockable.
java.lang.IllegalArgumentException
- If the dockable is not docked in a dock, or if the dockable does not belong
to the given dock model.
java.lang.IllegalArgumentException
- If the given dockable is a composite dockable.public static DefaultDockingPath copyDockingPath(Dockable dockableForPath, DockingPath dockingPathToCopy)
dockableForPath
- The dockable for which a docking path is created.
This may not be a composite dockable.dockingPathToCopy
- The docking path that will be used to create a new path.
java.lang.IllegalArgumentException
- If there does not exist a path in the docking path model
of the docking manager for the dockable whose path is used.
java.lang.IllegalArgumentException
- If one of the given dockables is a composite dockable.public java.lang.String getID()
DockingPath
Dockable
in a DockModel
. The ID of this docking path can be the ID of this dockable, but this is not obligatory.
getID
in interface DockingPath
public java.lang.String getRootDockKey()
DockingPath
DockModel
.
The path belongs to a dock tree. This key defines the root of this tree in the dock model.
getRootDockKey
in interface DockingPath
public Position getPositionInDock(int index)
DockingPath
getPositionInDock
in interface DockingPath
index
- The index of the dock in the path.
index + 1
in the dock with index
index
if the given index is smaller than getDockCount() - 1
.
The last position is usually the position of the dockable in the deepest dock of the path, if this
deepest dock is a leaf dock. Not null.public Dock getDock(int index)
DockingPath
Gets the dock with the given index in the path.
The root dock has index 0. The dock with index getDockCount() - 1
can be a
LeafDock
, but this is not obligatory. The other docks are
CompositeDock
s.
getDock
in interface DockingPath
index
- The index of the dock in the path.
public int getDockCount()
DockingPath
getDockCount
in interface DockingPath
public void saveProperties(java.lang.String prefix, java.util.Properties properties, java.util.Map dockIds)
DockingPath
Saves the properties of this docking path in the given properties object.
The property names for this docking path should start with the given prefix.
saveProperties
in interface DockingPath
prefix
- The prefix for the property names.properties
- The properties object to which the properties should be added.dockIds
- A mapping between the 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 idDockMap)
DockingPath
Loads the properties for this docking path. The properties can be found in the given properties object and the property names start with the given prefix.
The docks that should be used inside this docking path can be found in the given docks mapping.
This method should be called after the empty constructor to create the content of the docking path. Don't call this method for a docking path that already has a content.
loadProperties
in interface DockingPath
prefix
- The prefix of the names of the properties that have been intended for this docking path.properties
- The properties object that contains the properties for this docking path. It can contain also
properties for other objects, but they will have another prefix.idDockMap
- A mapping between the dock keys of the docks that are already loaded and the docks.
Dock
).public boolean equals(java.lang.Object object)
DockingPath
with the same ID
as this docking path.
equals
in class java.lang.Object
object
-
DockingPath
with the same ID
as this docking path, false otherwise.public int hashCode()
hashCode
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |