public interface ILayoutContext
extends org.eclipse.gef4.common.attributes.IAttributeStore
ILayoutContext
interface are used for exchanging
of information between layout algorithms and graphical objects displaying
graphs, i.e. an ILayoutContext
represents a graph within the layout
model.Type | Property and Description |
---|---|
javafx.beans.property.ObjectProperty<ILayoutAlgorithm> |
layoutAlgorithm
A property representing the layout algorithm used by this
ILayoutContext . |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
LAYOUT_ALGORITHM_PROPERTY
An
ILayoutContext notifies registered listeners about changes to
the layout algorithm using this property name. |
Modifier and Type | Method and Description |
---|---|
void |
addLayoutFilter(ILayoutFilter layoutFilter)
Adds the given ILayoutFilter to this
ILayoutContext . |
void |
applyLayout(boolean clean)
Applies the layout algorithm of this LayoutContext.
|
void |
flushChanges()
Causes all the changes made to elements in this context to affect the
display.
|
IEdgeLayout[] |
getConnections(INodeLayout layoutEntity1,
INodeLayout layoutEntity2)
Returns all the connections between given source and target entities.
|
IEdgeLayout[] |
getEdges()
Returns all the connections between nodes that should be laid out.
|
ILayoutAlgorithm |
getLayoutAlgorithm()
Returns the static layout algorithm used to layout a newly initialized
graph or after heavy changes to it.
|
INodeLayout[] |
getNodes()
Returns all the nodes that should be laid out.
|
boolean |
isLayoutIrrelevant(IEdgeLayout connLayout)
Returns
true when the given IEdgeLayout is not
relevant for layout according to the configured layout filters . |
boolean |
isLayoutIrrelevant(INodeLayout nodeLayout)
Returns
true when the given INodeLayout is not
relevant for layout according to the configured layout filters . |
javafx.beans.property.ObjectProperty<ILayoutAlgorithm> |
layoutAlgorithmProperty()
A property representing the layout algorithm used by this
ILayoutContext . |
void |
removeLayoutFilter(ILayoutFilter layoutFilter)
Removes the given ILayoutFilter from this
ILayoutContext . |
void |
schedulePostLayoutPass(java.lang.Runnable runnable)
Adds the given
Runnable to the list of runnables which are called
when this ILayoutContext is asked to apply all changes made to
its elements to the display, i.e. within flushChanges() . |
void |
schedulePreLayoutPass(java.lang.Runnable runnable)
Adds the given
Runnable to the list of Runnable s which
are executed before applying a layout, i.e. before
applyLayout(boolean) . |
void |
setLayoutAlgorithm(ILayoutAlgorithm algorithm)
Sets the static layout algorithm for this context.
|
void |
unschedulePostLayoutPass(java.lang.Runnable runnable)
Removes the given
Runnable from the list of runnables which are
called when this ILayoutContext is asked to apply all changes
made to its elements to the display, i.e. within flushChanges() . |
void |
unschedulePreLayoutPass(java.lang.Runnable runnable)
Removes the given
Runnable from the list of Runnable s
which are executed before applying a layout, i.e. before
applyLayout(boolean) . |
javafx.beans.property.ObjectProperty<ILayoutAlgorithm> layoutAlgorithmProperty
ILayoutContext
.static final java.lang.String LAYOUT_ALGORITHM_PROPERTY
ILayoutContext
notifies registered listeners about changes to
the layout algorithm using this property name.javafx.beans.property.ObjectProperty<ILayoutAlgorithm> layoutAlgorithmProperty()
ILayoutContext
.void applyLayout(boolean clean)
clean
- true
to indicate that the algorithm has to fully
re-compute the layout, otherwise false
.INodeLayout[] getNodes()
IEdgeLayout[] getEdges()
IEdgeLayout[] getConnections(INodeLayout layoutEntity1, INodeLayout layoutEntity2)
layoutEntity1
- The source entity.layoutEntity2
- The target entity.void setLayoutAlgorithm(ILayoutAlgorithm algorithm)
algorithm
- The new static ILayoutAlgorithm
for this
ILayoutContext
.void schedulePostLayoutPass(java.lang.Runnable runnable)
Runnable
to the list of runnables which are called
when this ILayoutContext
is asked to apply all changes made to
its elements to the display, i.e. within flushChanges()
.runnable
- A Runnable
called whenever this context is asked to
apply all changes made to its elements to the display.void unschedulePostLayoutPass(java.lang.Runnable runnable)
Runnable
from the list of runnables which are
called when this ILayoutContext
is asked to apply all changes
made to its elements to the display, i.e. within flushChanges()
.runnable
- The Runnable
that should no longer get called when
flushing changes.boolean isLayoutIrrelevant(IEdgeLayout connLayout)
true
when the given IEdgeLayout
is not
relevant for layout according to the configured layout filters
. Otherwise returns false
.connLayout
- The IEdgeLayout
in question.true
when the given IEdgeLayout
is not
relevant for layout according to the configure layout filters,
otherwise false
.boolean isLayoutIrrelevant(INodeLayout nodeLayout)
true
when the given INodeLayout
is not
relevant for layout according to the configured layout filters
. Otherwise returns false
.nodeLayout
- The INodeLayout
in question.true
when the given INodeLayout
is not
relevant for layout according to the configure layout filters,
otherwise false
.void addLayoutFilter(ILayoutFilter layoutFilter)
ILayoutContext
.layoutFilter
- The ILayoutFilter to add to this context.void removeLayoutFilter(ILayoutFilter layoutFilter)
ILayoutContext
.layoutFilter
- The ILayoutFilter to remove to this context.ILayoutAlgorithm getLayoutAlgorithm()
ILayoutContext
.void flushChanges()
void unschedulePreLayoutPass(java.lang.Runnable runnable)
Runnable
from the list of Runnable
s
which are executed before applying a layout, i.e. before
applyLayout(boolean)
.runnable
- The Runnable
to remove from the list of
Runnable
s which are executed before applying a layout.void schedulePreLayoutPass(java.lang.Runnable runnable)
Runnable
to the list of Runnable
s which
are executed before applying a layout, i.e. before
applyLayout(boolean)
.runnable
- The Runnable
to add to the list of Runnable
s
which are executed before applying a layout.Copyright (c) 2014 itemis AG and others. All rights reserved.