de.tu_berlin.cs.tfs.muvitorkit.animation
Interface IGraphicalViewerProvider

All Known Implementing Classes:
MuvitorPage

public interface IGraphicalViewerProvider

Interface used by AnimatedElement to retrieve a GraphicalViewer showing a specified model element from a PageBookView that implements this interface.

Rating red

Method Summary
 GraphicalViewer getViewer(EObject model)
          Method to get the viewer showing a specific model.
 

Method Detail

getViewer

GraphicalViewer getViewer(EObject model)
Method to get the viewer showing a specific model. Added to support AnimatingCommand in finding the viewer in which it should animate some figures.

A sample implementation could look like this:

 public GraphicalViewer getViewer(final EObject model) {
        for (final GraphicalViewer viewer : viewers) {
                if (viewer.getContents() != null
                                && viewer.getContents().getModel() == model) {
                        return viewer;
                }
        }
        return null;
 }
 

Parameters:
model - the model element shown in the viewer
Returns:
a viewer showing the passed model if it exists, otherwise null