Package net.infonode.docking.util
Class MixedViewHandler
- java.lang.Object
-
- net.infonode.docking.util.MixedViewHandler
-
- All Implemented Interfaces:
ViewFactoryManager
,ViewSerializer
public class MixedViewHandler extends java.lang.Object implements ViewFactoryManager, ViewSerializer
The mixed view map simplifies mixing static and dynamic views inside the same root window. The static views are handled by anAbstractViewMap
and the dynamic views are handled by an customViewSerializer
.- Since:
- IDW 1.3.0
-
-
Constructor Summary
Constructors Constructor Description MixedViewHandler(AbstractViewMap viewMap, ViewSerializer viewSerializer)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ViewFactory[]
getViewFactories()
Returns the view factories.View
readView(java.io.ObjectInputStream in)
Reads and returns a view.void
writeView(View view, java.io.ObjectOutputStream out)
Writes a view to a stream.
-
-
-
Constructor Detail
-
MixedViewHandler
public MixedViewHandler(AbstractViewMap viewMap, ViewSerializer viewSerializer)
Constructor.- Parameters:
viewMap
- this map is first searched when serializing a viewviewSerializer
- is used if the view was not found in the viewMap
-
-
Method Detail
-
getViewFactories
public ViewFactory[] getViewFactories()
Description copied from interface:ViewFactoryManager
Returns the view factories.- Specified by:
getViewFactories
in interfaceViewFactoryManager
- Returns:
- the view factories
-
writeView
public void writeView(View view, java.io.ObjectOutputStream out) throws java.io.IOException
Description copied from interface:ViewSerializer
Writes a view to a stream. Note that the view property values are written automatically, so this method should not write them.- Specified by:
writeView
in interfaceViewSerializer
- Parameters:
view
- the view to writeout
- the stream on which to write the view- Throws:
java.io.IOException
- if there is a stream error
-
readView
public View readView(java.io.ObjectInputStream in) throws java.io.IOException
Description copied from interface:ViewSerializer
Reads and returns a view. Must read all the data written in theViewSerializer.writeView(net.infonode.docking.View, java.io.ObjectOutputStream)
method. Note that the view property values are read automatically, so this method should not read them. This method should return null if the serialized view can't be resolved.- Specified by:
readView
in interfaceViewSerializer
- Parameters:
in
- the stream from which to read the view state- Returns:
- the view, null if the view can't be resolved
- Throws:
java.io.IOException
- if there is a stream error
-
-