public class CControlPerspectiveBlop extends Object
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 DockElement
s.Constructor and Description |
---|
CControlPerspectiveBlop(CControlPerspective control) |
Modifier and Type | Method and Description |
---|---|
CPerspective |
getPerspective()
Gets the current layout.
|
CPerspective |
getPerspective(String name)
Gets the perspective which was stored using
name as key. |
String |
getPerspectiveName()
Gets the name of the layout that is currently shown.
|
String[] |
getPerspectiveNames()
Gets the names of all
perspectives that are
available. |
CSetting |
getSetting()
Gets the raw data of the current layout.
|
CSetting |
getSetting(String name)
Gets the raw data about the layout that is stored using
name as key. |
void |
putPerspective(String name,
CPerspective perspective)
Stores a new layout for
name . |
void |
putSetting(String name,
CSetting setting)
Stores raw data of a layout with name
name . |
void |
read(DataInputStream in)
Performs the same actions as
CControl.read(DataInputStream) , this method extracts all layouts of
a byte file. |
void |
readXML(XElement root)
Performs the same actions as
CControl.readXML(XElement) , this method extracts all layouts of
an xml file. |
void |
removePerspective(String name)
Removes a layout from this blop.
|
void |
setPerspective(CPerspective perspective)
Sets the layout that should be loaded.
|
void |
setPerspectiveName(String name)
Sets the name of the current layout.
|
void |
setSetting(CSetting setting)
Sets the raw data of the layout that should be loaded.
|
void |
write(DataOutputStream out)
Performs the same actions as
CControl.write(DataOutputStream) |
void |
writeXML(XElement root)
Performs the same actions as
CControl.writeXML(java.io.File) . |
public CControlPerspectiveBlop(CControlPerspective control)
public String[] getPerspectiveNames()
perspectives
that are
available.public CSetting getSetting(String name)
name
as key.name
- the key of the layoutnull
if name
was not foundgetPerspective(String)
public CPerspective getPerspective(String name)
name
as key.name
- the key of the layoutnull
if name
was not foundpublic void putPerspective(String name, CPerspective perspective)
name
.name
- the name of the layout, not null
perspective
- the new layout, not null
public void putSetting(String name, CSetting setting)
name
.name
- the name of the layout, not null
setting
- the new layout, not null
putPerspective(String, CPerspective)
public void removePerspective(String name)
name
- the name of the layout to removepublic String getPerspectiveName()
null
public void setPerspectiveName(String name)
name
- the name of the current layout, can be null
public CPerspective getPerspective()
null
public CSetting getSetting()
public void setPerspective(CPerspective perspective)
perspective
- the new layout, not null
public void setSetting(CSetting setting)
setting
- the new layout, not null
public void readXML(XElement root) throws XException
CControl.readXML(XElement)
, this method extracts all layouts of
an xml file.root
- the root xml element in the fileXException
- if the structure of root
is not as expectedpublic void read(DataInputStream in) throws IOException
CControl.read(DataInputStream)
, this method extracts all layouts of
a byte file.in
- the stream to read fromif
- the stream cannot be readIOException
public void writeXML(XElement root)
CControl.writeXML(java.io.File)
.root
- the xml element to write intopublic void write(DataOutputStream out) throws IOException
CControl.write(DataOutputStream)
out
- the stream to write intoIOException
- if the stream is not writeable