Class CControlPerspectiveBlop
java.lang.Object
bibliothek.gui.dock.common.perspective.CControlPerspectiveBlop
A
CControlPerspectiveBlop stores all the data a file contains that was written
with CControl.write(java.io.DataOutputStream) or CControl.writeXML(java.io.File). This
class allows clients to read and modify the layout files without actually loading any DockElements.- Author:
- Benjamin Sigg
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the current layout.getPerspective(String name) Gets the perspective which was stored usingnameas key.Gets the name of the layout that is currently shown.String[]Gets the names of allperspectivesthat are available.Gets the raw data of the current layout.getSetting(String name) Gets the raw data about the layout that is stored usingnameas key.voidputPerspective(String name, CPerspective perspective) Stores a new layout forname.voidputSetting(String name, CSetting setting) Stores raw data of a layout with namename.voidread(DataInputStream in) Performs the same actions asCControl.read(DataInputStream), this method extracts all layouts of a byte file.voidPerforms the same actions asCControl.readXML(XElement), this method extracts all layouts of an xml file.voidremovePerspective(String name) Removes a layout from this blop.voidsetPerspective(CPerspective perspective) Sets the layout that should be loaded.voidsetPerspectiveName(String name) Sets the name of the current layout.voidsetSetting(CSetting setting) Sets the raw data of the layout that should be loaded.voidwrite(DataOutputStream out) Performs the same actions asCControl.write(DataOutputStream)voidPerforms the same actions asCControl.writeXML(java.io.File).
-
Constructor Details
-
CControlPerspectiveBlop
-
-
Method Details
-
getPerspectiveNames
Gets the names of allperspectivesthat are available.- Returns:
- the name of the perspectives
-
getSetting
Gets the raw data about the layout that is stored usingnameas key.- Parameters:
name- the key of the layout- Returns:
- the raw data or
nullifnamewas not found - See Also:
-
getPerspective
Gets the perspective which was stored usingnameas key.- Parameters:
name- the key of the layout- Returns:
- the perspective or
nullifnamewas not found
-
putPerspective
Stores a new layout forname.- Parameters:
name- the name of the layout, notnullperspective- the new layout, notnull
-
putSetting
Stores raw data of a layout with namename.- Parameters:
name- the name of the layout, notnullsetting- the new layout, notnull- See Also:
-
removePerspective
Removes a layout from this blop.- Parameters:
name- the name of the layout to remove
-
getPerspectiveName
Gets the name of the layout that is currently shown.- Returns:
- the name of the current layout, can be
null
-
setPerspectiveName
Sets the name of the current layout.- Parameters:
name- the name of the current layout, can benull
-
getPerspective
Gets the current layout.- Returns:
- the currently applied layout, may be
null
-
getSetting
Gets the raw data of the current layout.- Returns:
- the raw data
-
setPerspective
Sets the layout that should be loaded.- Parameters:
perspective- the new layout, notnull
-
setSetting
Sets the raw data of the layout that should be loaded.- Parameters:
setting- the new layout, notnull
-
readXML
Performs the same actions asCControl.readXML(XElement), this method extracts all layouts of an xml file.- Parameters:
root- the root xml element in the file- Throws:
XException- if the structure ofrootis not as expected
-
read
Performs the same actions asCControl.read(DataInputStream), this method extracts all layouts of a byte file.- Parameters:
in- the stream to read from- Throws:
IOException- if the stream cannot be read
-
writeXML
Performs the same actions asCControl.writeXML(java.io.File).- Parameters:
root- the xml element to write into
-
write
Performs the same actions asCControl.write(DataOutputStream)- Parameters:
out- the stream to write into- Throws:
IOException- if the stream is not writeable
-