public class LayoutListenerSupport
extends java.lang.Object
LayoutListenerSupport
can handle the (un-)registration of layout
event listeners (IContextListener
, IGraphStructureListener
,
ILayoutListener
, and IPruningListener
) and firing of events.
It is used by the AbstractLayoutContext
.Constructor and Description |
---|
LayoutListenerSupport(ILayoutContext context)
Constructs a new
LayoutListenerSupport for the given
ILayoutContext . |
public LayoutListenerSupport(ILayoutContext context)
LayoutListenerSupport
for the given
ILayoutContext
.context
- The ILayoutContext
for which this
LayoutListenerSupport
handles (un-)registration of
layout listeners and firing of events.public void addContextListener(IContextListener listener)
IContextListener
to the list of listeners which
are notified about context changes.listener
- The IContextListener
which is added to the listeners
list.public void addGraphStructureListener(IGraphStructureListener listener)
IGraphStructureListener
to the list of listeners
which are notified about structural changes.listener
- The IGraphStructureListener
which is added to the
listeners list.public void addLayoutListener(ILayoutListener listener)
ILayoutListener
to the list of listeners which are
notified about layout changes.listener
- The ILayoutListener
which is added to the listeners
list.public void addPruningListener(IPruningListener listener)
IPruningListener
to the list of listeners which
are notified about pruning changes.listener
- The IPruningListener
which is added to the listeners
list.public void fireBackgroundEnableChangedEvent()
IContextListener
s via
IContextListener.backgroundEnableChanged(ILayoutContext)
.public void fireBoundsChangedEvent()
IContextListener
s via
IContextListener.boundsChanged(ILayoutContext)
.
A dynamic layout is applied afterwards unless all listeners return
true
.
public void fireConnectionAddedEvent(IConnectionLayout connection)
IGraphStructureListener
s via
IGraphStructureListener.connectionAdded(ILayoutContext, IConnectionLayout)
.
A dynamic layout is applied afterwards unless all listeners return
true
.
connection
- The IConnectionLayout
which was added to the
ILayoutContext
.public void fireConnectionRemovedEvent(IConnectionLayout connection)
IGraphStructureListener
s via
IGraphStructureListener.connectionRemoved(ILayoutContext, IConnectionLayout)
.
A dynamic layout is applied afterwards unless all listeners return
true
.
connection
- The IConnectionLayout
which was removed from the
ILayoutContext
.public void fireNodeAddedEvent(INodeLayout node)
IGraphStructureListener
s via
IGraphStructureListener.nodeAdded(ILayoutContext, INodeLayout)
.
A dynamic layout is applied afterwards unless all listeners return
true
.
node
- The INodeLayout
which was added to the
ILayoutContext
.public void fireNodeMovedEvent(INodeLayout node)
ILayoutListener
s via
ILayoutListener.nodeMoved(ILayoutContext, INodeLayout)
.
A dynamic layout is applied afterwards unless all listeners return
true
.
node
- The INodeLayout
whose
LayoutProperties.LOCATION_PROPERTY
changed.public void fireNodeRemovedEvent(INodeLayout node)
IGraphStructureListener
s via
IGraphStructureListener.nodeRemoved(ILayoutContext, INodeLayout)
.
A dynamic layout is applied afterwards unless all listeners return
true
.
node
- The INodeLayout
which was removed from the
ILayoutContext
.public void fireNodeResizedEvent(INodeLayout node)
ILayoutListener
s via
ILayoutListener.nodeResized(ILayoutContext, INodeLayout)
.
A dynamic layout is applied afterwards unless all listeners return
true
.
node
- The INodeLayout
whose
LayoutProperties.SIZE_PROPERTY
changed.public void firePruningEnableChangedEvent()
IContextListener
s via
IContextListener.pruningEnablementChanged(ILayoutContext)
.public void fireSubgraphMovedEvent(ISubgraphLayout subgraph)
ILayoutListener
s via
ILayoutListener.subgraphMoved(ILayoutContext, ISubgraphLayout)
.
A dynamic layout is applied afterwards unless all listeners return
true
.
subgraph
- The ISubgraphLayout
whose
LayoutProperties.LOCATION_PROPERTY
changed.public void fireSubgraphResizedEvent(ISubgraphLayout subgraph)
ILayoutListener
s via
ILayoutListener.subgraphResized(ILayoutContext, ISubgraphLayout)
.
A dynamic layout is applied afterwards unless all listeners return
true
.
subgraph
- The ISubgraphLayout
whose
LayoutProperties.SIZE_PROPERTY
changed.public void removeContextListener(IContextListener listener)
IContextListener
from the list of listeners
which are notified about context changes.listener
- The IContextListener
which is removed from the
listeners list.public void removeGraphStructureListener(IGraphStructureListener listener)
IGraphStructureListener
from the list of
listeners which are notified about structural changes.listener
- The IGraphStructureListener
which is removed from the
listeners list.public void removeLayoutListener(ILayoutListener listener)
ILayoutListener
from the list of listeners
which are notified about layout changes.listener
- The ILayoutListener
which is removed from the
listeners list.public void removePruningListener(IPruningListener listener)
IPruningListener
from the list of listeners
which are notified about pruning changes.listener
- The IPruningListener
which is removed from the
listeners list.Copyright (c) 2014 itemis AG and others. All rights reserved.