com.javadocking.visualizer
Interface Visualizer

All Known Subinterfaces:
Externalizer
All Known Implementing Classes:
DockingMinimizer, FloatExternalizer, LineMinimizer, MinimizerPanel, SingleMaximizer

public interface Visualizer

This is an interface for an object that can visualize Dockables in a special state.

The special state is a constant defined by DockableState, but not DockableState.NORMAL or DockableState.CLOSED.

Information on using visualizers is in How to Use Visualizers (Minimizers and Maximizers) in The Sanaware Developer Guide.

A visualizer will usually be used to maximize (DockableState.MAXIMIZED) or minimize(DockableState.MINIMIZED) a dockable.

When a dockable is visualized, it can be removed from its LeafDock, but this is not obligatory. It can also be hidden in its dock, if the dock implements the interface DockableHider.

Author:
Heidi Rakels.

Method Summary
 boolean canVisualizeDockable(Dockable dockableToVisualize)
          Determines if a dockable can be visualized by this visualizer.
 int getState()
          Determines the state of the dockables that are visualized by this visualizer.
 Dockable getVisualizedDockable(int index)
          Gets the visualized dockable with the specified index.
 int getVisualizedDockableCount()
          Gets the number of visualized dockables of this visualizer.
 void loadProperties(java.lang.String prefix, java.util.Properties properties, java.util.Map dockablesMap, java.awt.Window owner)
           Loads the properties for this visualizer.
 void removeVisualizedDockable(Dockable dockableToRemove)
          Removes the visualized dockables from this visualizer.
 void saveProperties(java.lang.String prefix, java.util.Properties properties)
           Saves the properties of this visualizer in the given properties object.
 void visualizeDockable(Dockable dockableToVisualize)
          Adds a dockable to this visualizer.
 

Method Detail

canVisualizeDockable

boolean canVisualizeDockable(Dockable dockableToVisualize)
Determines if a dockable can be visualized by this visualizer.

Parameters:
dockableToVisualize - The dockable whose content has to be visualized. May not be nul.
Returns:
True if the dockable can be visualized, lse otherwise.

visualizeDockable

void visualizeDockable(Dockable dockableToVisualize)
Adds a dockable to this visualizer.

Parameters:
dockableToVisualize - The dockable whose content has to be visualized. May not be nul.

removeVisualizedDockable

void removeVisualizedDockable(Dockable dockableToRemove)
Removes the visualized dockables from this visualizer.

Throws:
java.lang.IllegalArgumentException - If the dockable is not visualized in this visualizer.

getVisualizedDockableCount

int getVisualizedDockableCount()
Gets the number of visualized dockables of this visualizer.

Returns:
The number of visualized dockables of this visualizer.

getVisualizedDockable

Dockable getVisualizedDockable(int index)
                               throws java.lang.IndexOutOfBoundsException
Gets the visualized dockable with the specified index.

Returns:
The visualized dockable with the specified index.
Throws:
java.lang.IndexOutOfBoundsException - If the index is out of range (index < 0 || index >= getvisualizedDockableCount()).

getState

int getState()
Determines the state of the dockables that are visualized by this visualizer.

Returns:
The state of the dockables that are visualized by this visualizer. The special state is a constant defined by DockableState, but not DockableState.NORMAL or DockableState.CLOSED.

saveProperties

void saveProperties(java.lang.String prefix,
                    java.util.Properties properties)

Saves the properties of this visualizer in the given properties object.

The property names for this visualizer should start with the given prefix.

Parameters:
prefix - The prefix for the property names.
properties - The properties object to which the properties should be added.

loadProperties

void loadProperties(java.lang.String prefix,
                    java.util.Properties properties,
                    java.util.Map dockablesMap,
                    java.awt.Window owner)
                    throws java.io.IOException

Loads the properties for this visualizer. The properties can be found in the given properties object. The property names for this visualizer start with the given prefix.

The dockables can be added to this visualizer. This is not obligatory. They can be found in the given dockables mapping.

This method should be called after the empty constructor to create the content of the visualizer. Don't call this method for a visualizer that already has a content.

Parameters:
prefix - The prefix of the names of the properties that have been intended for this visualizer.
properties - The properties object that contains the properties for this visualizer. It can contain also properties for other objects, but they will have another prefix.
dockablesMap - A mapping that contains the available dockables.
  • map key: the ID of the dockable (java.lang.String).
  • map value: the dockable (Dockable).
owner - The owner window of the visualizer in the dock model (DockModel).
Throws:
java.io.IOException - If an error occures while decoding the properties.