Class AbstractViewMap

java.lang.Object
net.infonode.docking.util.AbstractViewMap
All Implemented Interfaces:
ViewFactoryManager, ViewSerializer
Direct Known Subclasses:
StringViewMap, ViewMap

public abstract class AbstractViewMap extends Object implements ViewFactoryManager, ViewSerializer
Base class for view maps.
Since:
IDW 1.1.0
  • Constructor Details

    • AbstractViewMap

      public AbstractViewMap()
  • Method Details

    • writeViewId

      protected abstract void writeViewId(Object id, ObjectOutputStream out) throws IOException
      Throws:
      IOException
    • readViewId

      protected abstract Object readViewId(ObjectInputStream in) throws IOException
      Throws:
      IOException
    • getViewCount

      public int getViewCount()
      Returns the number of views in this map.
      Returns:
      the number of views in this map
    • getViewAtIndex

      public View getViewAtIndex(int index)
      Returns the view at a specific index. The view index is the same as the number of views in the map when the view was added to the map.
      Parameters:
      index - the view index
      Returns:
      the view at the index
    • getViewFactories

      public ViewFactory[] getViewFactories()
      Description copied from interface: ViewFactoryManager
      Returns the view factories.
      Specified by:
      getViewFactories in interface ViewFactoryManager
      Returns:
      the view factories
    • contains

      public boolean contains(View view)
      Returns true if this view map contains the view.
      Parameters:
      view - the view
      Returns:
      true if this view map contains the view
      Since:
      IDW 1.3.0
    • writeView

      public void writeView(View view, ObjectOutputStream out) throws 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 interface ViewSerializer
      Parameters:
      view - the view to write
      out - the stream on which to write the view
      Throws:
      IOException - if there is a stream error
    • readView

      public View readView(ObjectInputStream in) throws IOException
      Description copied from interface: ViewSerializer
      Reads and returns a view. Must read all the data written in the ViewSerializer.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 interface ViewSerializer
      Parameters:
      in - the stream from which to read the view state
      Returns:
      the view, null if the view can't be resolved
      Throws:
      IOException - if there is a stream error
    • addView

      protected void addView(Object id, View view)
    • removeView

      protected void removeView(Object id)
    • getView

      protected View getView(Object id)