Class CControlPerspectiveBlop

java.lang.Object
bibliothek.gui.dock.common.perspective.CControlPerspectiveBlop

public class CControlPerspectiveBlop extends Object
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 Details

  • Method Details

    • getPerspectiveNames

      public String[] getPerspectiveNames()
      Gets the names of all perspectives that are available.
      Returns:
      the name of the perspectives
    • getSetting

      public CSetting getSetting(String name)
      Gets the raw data about the layout that is stored using name as key.
      Parameters:
      name - the key of the layout
      Returns:
      the raw data or null if name was not found
      See Also:
    • getPerspective

      public CPerspective getPerspective(String name)
      Gets the perspective which was stored using name as key.
      Parameters:
      name - the key of the layout
      Returns:
      the perspective or null if name was not found
    • putPerspective

      public void putPerspective(String name, CPerspective perspective)
      Stores a new layout for name.
      Parameters:
      name - the name of the layout, not null
      perspective - the new layout, not null
    • putSetting

      public void putSetting(String name, CSetting setting)
      Stores raw data of a layout with name name.
      Parameters:
      name - the name of the layout, not null
      setting - the new layout, not null
      See Also:
    • removePerspective

      public void removePerspective(String name)
      Removes a layout from this blop.
      Parameters:
      name - the name of the layout to remove
    • getPerspectiveName

      public String getPerspectiveName()
      Gets the name of the layout that is currently shown.
      Returns:
      the name of the current layout, can be null
    • setPerspectiveName

      public void setPerspectiveName(String name)
      Sets the name of the current layout.
      Parameters:
      name - the name of the current layout, can be null
    • getPerspective

      public CPerspective getPerspective()
      Gets the current layout.
      Returns:
      the currently applied layout, may be null
    • getSetting

      public CSetting getSetting()
      Gets the raw data of the current layout.
      Returns:
      the raw data
    • setPerspective

      public void setPerspective(CPerspective perspective)
      Sets the layout that should be loaded.
      Parameters:
      perspective - the new layout, not null
    • setSetting

      public void setSetting(CSetting setting)
      Sets the raw data of the layout that should be loaded.
      Parameters:
      setting - the new layout, not null
    • readXML

      public void readXML(XElement root) throws XException
      Performs the same actions as CControl.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 of root is not as expected
    • read

      public void read(DataInputStream in) throws IOException
      Performs the same actions as CControl.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

      public void writeXML(XElement root)
      Performs the same actions as CControl.writeXML(java.io.File).
      Parameters:
      root - the xml element to write into
    • write

      public void write(DataOutputStream out) throws IOException
      Performs the same actions as CControl.write(DataOutputStream)
      Parameters:
      out - the stream to write into
      Throws:
      IOException - if the stream is not writeable