com.javadocking.model.codec
Interface DockModelDecoder

All Known Implementing Classes:
DockModelPropertiesDecoder

public interface DockModelDecoder

This is an interface for a class that creates a DockModel from a source. It can also decode a DockingPathModel.

Information on using dock model decoders is in How to Use Dock Model Encoders and Decoders in The Sanaware Developer Guide.

Author:
Heidi Rakels.

Method Summary
 boolean canDecodeSource(java.lang.String sourceName)
          Checks whether this decoder can decode the given data into a dock model.
 DockModel decode(java.lang.String sourceName, java.util.Map dockablesMap, java.util.Map ownersMap, java.util.Map visualizersMap)
          Creates a new dock model from the data found in the given data source, and adds the given dockables to the model.
 

Method Detail

canDecodeSource

boolean canDecodeSource(java.lang.String sourceName)
Checks whether this decoder can decode the given data into a dock model. Often this will only be a simple test, e.g. checking the file extension of a file.

Parameters:
sourceName - The name of a data source; typically a file name or a URL.

decode

DockModel decode(java.lang.String sourceName,
                 java.util.Map dockablesMap,
                 java.util.Map ownersMap,
                 java.util.Map visualizersMap)
                 throws java.io.IOException
Creates a new dock model from the data found in the given data source, and adds the given dockables to the model. The decoded dock model is given to the docking manager (DockingManager.setDockModel(DockModel)).

Parameters:
sourceName - The name of a data source; typically a file name or a URL.
dockablesMap - A map with the dockables for the model.
  • map key: the ID of the dockable (java.lang.String).
  • map value: the dockable (Dockable).
ownersMap - A map with the owner windows.
  • map key: the ID of the owner window (java.lang.String).
  • map value: the owner window (java.awt.window).
visualizersMap - A map with the visualizers.
  • map key: the key of the visualizer (java.lang.String).
  • map value: the visualizer (java.awt.window).
Returns:
The dock model with the decoded docks and the given dockables.
Throws:
java.io.IOException - If an error occurs while retrieving the source, reading the source or decoding the data.