|
||||||||||
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.
Field Summary | |
---|---|
static int |
MAX_PROGRESS_LEVELS
maximal number of recursion levels for which progress is displayed. |
Constructor Summary | |
---|---|
DiagramLayoutManager()
|
Method Summary | |
---|---|
abstract void |
addChangeListener(IEditorPart editorPart,
IEditorChangeListener listener)
Register a listener for change of the active editor or active selection. |
void |
applyAndZoom(int nodeCount,
boolean animate,
boolean cacheLayout)
Apply layout with zoom and animation. |
void |
applyAnimatedLayout(boolean animate,
boolean cacheLayout,
int nodeCount)
Apply layout with or without animation. |
protected abstract void |
applyLayout()
Applies the transferred layout to the original diagram. |
abstract KNode |
buildLayoutGraph(IEditorPart editorPart,
EditPart editPart,
boolean layoutAncestors)
Builds a KGraph instance for the given editor or edit part. |
static int |
calcAnimationTime(int graphSize)
Calculates animation time for the given graph size. |
protected abstract ICachedLayout |
getCachedLayout()
Returns the cached layout for the last layout run. |
abstract EditPart |
getCurrentEditPart()
Returns the currently processed top level edit part. |
EditPart |
getEditPart(KNode knode)
Returns the edit part associated with the given layout node. |
protected ILayoutConfig |
getExternalConfig()
Returns the layout configuration that was set externally for this layout manager. |
abstract ILayoutInspector |
getInspector(EditPart editPart)
Returns a layout inspector for the given edit part. |
abstract ILayoutInspector |
getInspector(IEditorPart editorPart)
Returns a layout inspector for the given editor part. |
abstract ILayoutConfig |
getLayoutConfig(EditPart editPart)
Returns a layout configuration for the given edit part. |
abstract KNode |
getLayoutGraph()
Returns the last built layout graph. |
KNode |
getLayoutNode(EditPart editPart)
Returns the layout node associated with the given edit part. |
int |
getPriority()
Return the manager priority. |
abstract ISelection |
getSelection(IEditorPart editorPart)
Returns the current selection for the given editor part. |
void |
layout(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. |
void |
layout(IEditorPart editorPart,
EditPart editPart,
boolean animate,
boolean progressBar,
boolean layoutAncestors,
boolean cacheLayout,
boolean zoom)
Performs layout on the given editor or edit part using this layout manager. |
IStatus |
layout(IKielerProgressMonitor progressMonitor,
boolean layoutAncestors)
Performs layout on the given editor or edit part using this layout manager and a specific progress monitor. |
abstract void |
removeChangeListener(IEditorChangeListener listener)
Remove a change listener from all editors for which it has registered. |
void |
setLayoutConfig(ILayoutConfig layoutConfig)
Set an external layout configuration to use with this layout manager. |
void |
setPriority(int thepriority)
Set the manager priority. |
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 final int getPriority()
public final void setPriority(int thepriority)
thepriority
- the priority to setpublic final void setLayoutConfig(ILayoutConfig layoutConfig)
null
as parameter resets the configuration to the standard.
layoutConfig
- a layout configuration, or null
protected final ILayoutConfig getExternalConfig()
null
public final void layout(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 final void layout(IEditorPart editorPart, EditPart editPart, boolean animate, boolean progressBar, boolean layoutAncestors, boolean cacheLayout, boolean zoom)
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 modelzoom
- if true, automatic zoom-to-fit is activatedpublic final void applyAndZoom(int nodeCount, boolean animate, boolean cacheLayout)
animate
- if true, activate Draw2D animationcacheLayout
- if true, the layout result is cached for the underlying modelnodeCount
- the number of nodes in the layouted diagrampublic final void applyAnimatedLayout(boolean animate, boolean cacheLayout, int nodeCount)
animate
- if true, activate Draw2D animationcacheLayout
- if true, the layout result is cached for the underlying modelnodeCount
- the number of nodes in the layouted diagrampublic IStatus layout(IKielerProgressMonitor progressMonitor, boolean layoutAncestors)
progressMonitor
- a progress monitor to which progress of the layout algorithm
is reportedlayoutAncestors
- if true, layout is not only performed for the selected edit
part, but also for its ancestors
public static int calcAnimationTime(int graphSize)
graphSize
- total number of nodes in the graph
public EditPart getEditPart(KNode knode)
buildLayoutGraph(IEditorPart, EditPart, boolean)
was called.
knode
- a node from the layout graph
null
public KNode getLayoutNode(EditPart editPart)
buildLayoutGraph(IEditorPart, EditPart, boolean)
was called.
editPart
- an edit part of the currently layouted diagram
null
public abstract EditPart getCurrentEditPart()
buildLayoutGraph(IEditorPart, EditPart, boolean)
was called.
protected abstract boolean supports(IEditorPart editorPart)
editorPart
- an editor part
protected abstract boolean supports(EditPart editPart)
editPart
- an edit part
public 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
public abstract ILayoutInspector getInspector(EditPart editPart)
editPart
- an edit part
null
if the edit part
is not supportedpublic abstract ILayoutInspector getInspector(IEditorPart editorPart)
editorPart
- an editor part
null
if the editor part
is not supportedpublic abstract ILayoutConfig getLayoutConfig(EditPart editPart)
editPart
is
null
, a generic layout configuration is created.
editPart
- an edit part
protected abstract void transferLayout(boolean cacheLayout)
cacheLayout
- if true, the layout result is cached for the underlying modelprotected abstract void applyLayout()
public abstract KNode getLayoutGraph()
protected abstract ICachedLayout getCachedLayout()
public abstract void addChangeListener(IEditorPart editorPart, IEditorChangeListener listener)
editorPart
- editor to register tolistener
- listener to registerpublic abstract void removeChangeListener(IEditorChangeListener listener)
listener
- listener to removepublic abstract ISelection getSelection(IEditorPart editorPart)
editorPart
- an editor part
null
if the selection cannot
be determined
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |