|
||||||||||
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
public abstract class DiagramLayoutManager
Abstract superclass for managers of diagram layout. Contains static methods
to layout a specific diagram, and manages selection of an appropriate
subclass to translate the diagram into the internal KGraph
structure.
Field Summary | |
---|---|
static int |
MAX_PROGRESS_LEVELS
maximal number of recursion levels for which progress is displayed. |
Constructor Summary | |
---|---|
DiagramLayoutManager()
|
Method Summary | |
---|---|
protected abstract void |
applyLayout()
Applies the transferred layout to the original diagram. |
protected abstract KNode |
buildLayoutGraph(IEditorPart editorPart,
EditPart editPart,
boolean layoutAncestors)
Builds a KGraph instance for the given editor or edit part. |
static CachedLayout |
cacheLayout(IEditorPart theeditorPart,
EditPart editPart,
boolean animate,
boolean progressBar)
Performs layout on the given editor by choosing an appropriate layout manager instance and caches the layout result. |
static int |
calcAnimationTime(int graphSize)
Calculates animation time for the given graph size. |
void |
doLayout(IEditorPart editorPart,
EditPart editPart,
boolean animate,
boolean progressBar,
boolean layoutAncestors,
boolean cacheLayout)
Performs layout on the given editor or edit part using this layout manager. |
protected abstract CachedLayout |
getCachedLayout()
Returns the cached layout for the last layout run. |
protected abstract KNode |
getLayoutGraph()
Returns the last built layout graph. |
static void |
layout(IEditorPart editorPart,
EditPart editPart,
boolean animate,
boolean progressBar)
Performs layout on the given editor by choosing an appropriate layout manager instance. |
static void |
layout(IEditorPart theeditorPart,
EditPart editPart,
boolean animate,
boolean progressBar,
boolean layoutAncestors)
Performs layout on the given editor by choosing an appropriate layout manager instance. |
static void |
registerManager(DiagramLayoutManager manager)
Registers the given diagram layout manager. |
protected abstract boolean |
supports(EditPart editPart)
Determines whether this layout manager is able to perform layout for the given edit part. |
protected abstract boolean |
supports(IEditorPart editorPart)
Determines whether this layout manager is able to perform layout for the given editor. |
protected abstract void |
transferLayout(boolean cacheLayout)
Transfers all layout data from the last created KGraph instance to the original diagram. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MAX_PROGRESS_LEVELS
Constructor Detail |
---|
public DiagramLayoutManager()
Method Detail |
---|
public static final void registerManager(DiagramLayoutManager manager)
manager
- an instance of a diagram layout managerpublic static final void layout(IEditorPart editorPart, EditPart editPart, boolean animate, boolean progressBar)
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 layoutedanimate
- if true, Draw2D animation is activatedprogressBar
- if true, a progress bar is displayedpublic static final void layout(IEditorPart theeditorPart, EditPart editPart, boolean animate, boolean progressBar, boolean layoutAncestors)
theeditorPart
- 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 layoutedanimate
- if true, Draw2D animation is activatedprogressBar
- if true, a progress bar is displayedlayoutAncestors
- if true, layout is not only performed for the selected edit
part, but also for its ancestorspublic static final CachedLayout cacheLayout(IEditorPart theeditorPart, EditPart editPart, boolean animate, boolean progressBar)
theeditorPart
- 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 layoutedanimate
- if true, Draw2D animation is activatedprogressBar
- if true, a progress bar is displayed
public final void doLayout(IEditorPart editorPart, EditPart editPart, boolean animate, boolean progressBar, boolean layoutAncestors, boolean cacheLayout)
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 layoutedanimate
- if true, Draw2D animation is activatedprogressBar
- if true, a progress bar is displayedlayoutAncestors
- if true, layout is not only performed for the selected edit
part, but also for its ancestorscacheLayout
- if true, the layout result is cached for the underlying modelpublic static int calcAnimationTime(int graphSize)
graphSize
- total number of nodes in the graph
protected abstract boolean supports(IEditorPart editorPart)
editorPart
- an editor part
protected abstract boolean supports(EditPart editPart)
editPart
- an edit part
protected abstract KNode buildLayoutGraph(IEditorPart editorPart, EditPart editPart, boolean layoutAncestors)
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 abstract void transferLayout(boolean cacheLayout)
cacheLayout
- if true, the layout result is cached for the underlying modelprotected abstract void applyLayout()
protected abstract KNode getLayoutGraph()
protected abstract CachedLayout getCachedLayout()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |