de.cau.cs.kieler.papyrus
Class MultiPartDiagramLayoutManager

java.lang.Object
  extended by de.cau.cs.kieler.kiml.ui.layout.DiagramLayoutManager
      extended by de.cau.cs.kieler.kiml.gmf.GmfDiagramLayoutManager
          extended by de.cau.cs.kieler.papyrus.MultiPartDiagramLayoutManager

public class MultiPartDiagramLayoutManager
extends GmfDiagramLayoutManager

Layout manager wrapper for the Papyrus multi diagram editor.

Rating red

Field Summary
 
Fields inherited from class de.cau.cs.kieler.kiml.ui.layout.DiagramLayoutManager
MAX_PROGRESS_LEVELS
 
Constructor Summary
MultiPartDiagramLayoutManager()
           
 
Method Summary
 void addChangeListener(IEditorPart editorPart, IEditorChangeListener editorListener)
          Register a listener for change of the active editor or active selection.
 KNode buildLayoutGraph(IEditorPart editorPart, EditPart editPart, boolean layoutAncestors)
          Builds a KGraph instance for the given editor or edit part.
 ISelection getSelection(IEditorPart editorPart)
          Returns the current selection for the given editor part.
 void removeChangeListener(IEditorChangeListener editorListener)
          Remove a change listener from all editors for which it has registered.
 boolean supports(IEditorPart editorPart)
          Determines whether this layout manager is able to perform layout for the given editor.
 
Methods inherited from class de.cau.cs.kieler.kiml.gmf.GmfDiagramLayoutManager
applyLayout, getCachedLayout, getCurrentEditPart, getInspector, getLayoutGraph, supports, transferLayout
 
Methods inherited from class de.cau.cs.kieler.kiml.ui.layout.DiagramLayoutManager
calcAnimationTime, getPriority, layout, layout, setPriority
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiPartDiagramLayoutManager

public MultiPartDiagramLayoutManager()
Method Detail

supports

public boolean supports(IEditorPart editorPart)
Determines whether this layout manager is able to perform layout for the given editor.

Overrides:
supports in class GmfDiagramLayoutManager
Parameters:
editorPart - an editor part
Returns:
true if this layout manager supports the editor part

buildLayoutGraph

public KNode buildLayoutGraph(IEditorPart editorPart,
                              EditPart editPart,
                              boolean layoutAncestors)
Builds a KGraph instance for the given editor or edit part. The resulting layout graph should reflect the structure of edit parts in the original diagram.

Overrides:
buildLayoutGraph in class GmfDiagramLayoutManager
Parameters:
editorPart - the editor for which layout is performed, or null if the diagram is not part of an editor
editPart - the parent edit part for which layout is performed, or null if the whole diagram shall be layouted
layoutAncestors - if true, layout is not only performed for the selected edit part, but also for its ancestors
Returns:
a layout graph instance

addChangeListener

public void addChangeListener(IEditorPart editorPart,
                              IEditorChangeListener editorListener)
Register a listener for change of the active editor or active selection. The default implementation does nothing.

Overrides:
addChangeListener in class GmfDiagramLayoutManager
Parameters:
editorPart - editor to register to
editorListener - listener to register

removeChangeListener

public void removeChangeListener(IEditorChangeListener editorListener)
Remove a change listener from all editors for which it has registered. The default implementation does nothing.

Overrides:
removeChangeListener in class GmfDiagramLayoutManager
Parameters:
editorListener - listener to remove

getSelection

public ISelection getSelection(IEditorPart editorPart)
Returns the current selection for the given editor part.

Overrides:
getSelection in class GmfDiagramLayoutManager
Parameters:
editorPart - an editor part
Returns:
the current selection, or null if the selection cannot be determined