|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.cau.cs.kieler.kiml.ui.layout.DiagramLayoutManager
de.cau.cs.kieler.kiml.gmf.GmfDiagramLayoutManager
public class GmfDiagramLayoutManager
Diagram layout manager that is able to generically layout diagrams generated
by GMF. The internal KGraph graph structure is built from the structure of
edit parts in the diagram. The new layout is applied to the diagram using
GmfLayoutEditPolicy
, which creates a GmfLayoutCommand
to
directly manipulate data in the GMF notation model, where layout information
is stored persistently.
Field Summary |
---|
Fields inherited from class de.cau.cs.kieler.kiml.ui.layout.DiagramLayoutManager |
---|
MAX_PROGRESS_LEVELS |
Constructor Summary | |
---|---|
GmfDiagramLayoutManager()
|
Method Summary | |
---|---|
void |
addChangeListener(IEditorPart editorPart,
IEditorChangeListener listener)
Register a listener for change of the active editor or active selection. |
protected void |
applyLayout()
Applies the transferred layout to the original diagram. |
KNode |
buildLayoutGraph(IEditorPart editorPart,
EditPart editPart,
boolean layoutAncestors)
Builds a KGraph instance for the given editor or edit part. |
protected ICachedLayout |
getCachedLayout()
Returns the cached layout for the last layout run. |
EditPart |
getCurrentEditPart()
Returns the currently processed top level edit part. |
ILayoutInspector |
getInspector(EditPart editPart)
Returns a layout inspector for the given edit part. |
KNode |
getLayoutGraph()
Returns the last built layout graph. |
ISelection |
getSelection(IEditorPart editorPart)
Returns the current selection for the given editor part. |
void |
removeChangeListener(IEditorChangeListener listener)
Remove a change listener from all editors for which it has registered. |
protected boolean |
supports(EditPart editPart)
Determines whether this layout manager is able to perform layout for the given edit part. |
protected boolean |
supports(IEditorPart editorPart)
Determines whether this layout manager is able to perform layout for the given editor. |
protected void |
transferLayout(boolean cacheLayout)
Transfers all layout data from the last created KGraph instance to the original diagram. |
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 |
---|
public GmfDiagramLayoutManager()
Method Detail |
---|
protected boolean supports(IEditorPart editorPart)
supports
in class DiagramLayoutManager
editorPart
- an editor part
protected boolean supports(EditPart editPart)
supports
in class DiagramLayoutManager
editPart
- an edit part
public void addChangeListener(IEditorPart editorPart, IEditorChangeListener listener)
addChangeListener
in class DiagramLayoutManager
editorPart
- editor to register tolistener
- listener to registerpublic void removeChangeListener(IEditorChangeListener listener)
removeChangeListener
in class DiagramLayoutManager
listener
- listener to removepublic ISelection getSelection(IEditorPart editorPart)
getSelection
in class DiagramLayoutManager
editorPart
- an editor part
null
if the selection cannot
be determinedpublic ILayoutInspector getInspector(EditPart editPart)
getInspector
in class DiagramLayoutManager
editPart
- an edit part
public KNode buildLayoutGraph(IEditorPart editorPart, EditPart editPart, boolean layoutAncestors)
buildLayoutGraph
in class DiagramLayoutManager
editorPart
- the editor for which layout is performed, or null
if
the diagram is not part of an editoreditPart
- the parent edit part for which layout is performed, or null
if the whole diagram shall be layoutedlayoutAncestors
- if true, layout is not only performed for the selected edit
part, but also for its ancestors
protected void transferLayout(boolean cacheLayout)
transferLayout
in class DiagramLayoutManager
cacheLayout
- if true, the layout result is cached for the underlying modelprotected void applyLayout()
applyLayout
in class DiagramLayoutManager
public KNode getLayoutGraph()
getLayoutGraph
in class DiagramLayoutManager
protected ICachedLayout getCachedLayout()
getCachedLayout
in class DiagramLayoutManager
public EditPart getCurrentEditPart()
getCurrentEditPart
in class DiagramLayoutManager
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |