motris
Class LayerList

java.lang.Object
  extended bymotris.data.Description
      extended byparameter.ParameterizedObjectAdaptor
          extended bymotris.LayerList
All Implemented Interfaces:
ParameterizedObject, ParameterizedObject.ParameterChangedListener

public class LayerList
extends ParameterizedObjectAdaptor
implements ParameterizedObject.ParameterChangedListener

Maintains a list of all display layers. Note that this class is a "model" and does not contain functions for displaying the layers or allowing the user to manipulate them

Author:
dahlkamp

Nested Class Summary
 
Nested classes inherited from class parameter.ParameterizedObject
ParameterizedObject.ParameterChangedListener, ParameterizedObject.ParameterizedObjectManager
 
Field Summary
static int LAYER_POSITION_BACK
           
static int LAYER_POSITION_FRONT
           
static int LAYER_POSITION_SMART
           
private  LayerController layerController
           
private  java.util.Vector layers
           
private  LayerViewer layerViewer
           
private  java.util.Vector layerVisible
           
 double zoomFactor
           
 
Fields inherited from class parameter.ParameterizedObjectAdaptor
parameterChangedNotifyList
 
Fields inherited from class motris.data.Description
 
Constructor Summary
LayerList()
           
 
Method Summary
 void addDisplayLayer(Layer _l, int position, boolean visible, boolean fireParameterChanged)
          Register new Layer to be displayed
 Layer getLayer(int index)
           
 java.util.Vector getLayers()
           
 ParameterSet getParameters()
          Parameters for LayerViewer are Position of Layers and layer parameters
 boolean isVisible(int index)
           
 boolean moveLayer(int index, boolean moveUp)
           
 void parameterChanged(ParameterizedObject source)
           
 boolean removeDisplayLayer(Layer _l)
           
 void setLayerController(LayerController _lc)
           
 void setLayerViewer(LayerViewer _lv)
           
 boolean setParameters(ParameterSet _params)
          Set Parameters of this class
 void setVisible(int index, boolean visible)
           
 void setZoomFactor(double _zoomFactor, boolean doScrolling)
           
private  void switchLayerPositions(int fromIndex, int toIndex)
           
 
Methods inherited from class parameter.ParameterizedObjectAdaptor
addParameterChangedListener, finalize, fireParameterChanged, parameterEdited, removeParameterChangedListener
 
Methods inherited from class motris.data.Description
getDescription, getIdentifier, getName, setDescription, setIdentifier, setName
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LAYER_POSITION_FRONT

public static final int LAYER_POSITION_FRONT
See Also:
Constant Field Values

LAYER_POSITION_BACK

public static final int LAYER_POSITION_BACK
See Also:
Constant Field Values

LAYER_POSITION_SMART

public static final int LAYER_POSITION_SMART
See Also:
Constant Field Values

layers

private java.util.Vector layers

layerController

private LayerController layerController

layerViewer

private LayerViewer layerViewer

layerVisible

private java.util.Vector layerVisible

zoomFactor

public double zoomFactor
Constructor Detail

LayerList

public LayerList()
Method Detail

getLayers

public java.util.Vector getLayers()
Returns:
Vector of DisplaLayers

getLayer

public Layer getLayer(int index)

setZoomFactor

public void setZoomFactor(double _zoomFactor,
                          boolean doScrolling)

addDisplayLayer

public void addDisplayLayer(Layer _l,
                            int position,
                            boolean visible,
                            boolean fireParameterChanged)
Register new Layer to be displayed

Parameters:
_l - new Layer
position - where to insert the new layer into the list (LAYER_POSITION_XXX constants)
visible - new layer is visible by default
fireParameterChanged - notify GUI that new layer is visible. should be true unless you want to add multiple layers. In this case it is more efficient to set it true only for the last layer

removeDisplayLayer

public boolean removeDisplayLayer(Layer _l)

setVisible

public void setVisible(int index,
                       boolean visible)

isVisible

public boolean isVisible(int index)

moveLayer

public boolean moveLayer(int index,
                         boolean moveUp)

switchLayerPositions

private void switchLayerPositions(int fromIndex,
                                  int toIndex)

getParameters

public ParameterSet getParameters()
Parameters for LayerViewer are Position of Layers and layer parameters

Specified by:
getParameters in interface ParameterizedObject
Overrides:
getParameters in class ParameterizedObjectAdaptor

setParameters

public boolean setParameters(ParameterSet _params)
Description copied from interface: ParameterizedObject
Set Parameters of this class

Specified by:
setParameters in interface ParameterizedObject
Overrides:
setParameters in class ParameterizedObjectAdaptor

setLayerController

public void setLayerController(LayerController _lc)

setLayerViewer

public void setLayerViewer(LayerViewer _lv)

parameterChanged

public void parameterChanged(ParameterizedObject source)
Specified by:
parameterChanged in interface ParameterizedObject.ParameterChangedListener