Search this API

y.view.hierarchy
Class GroupNodeRealizer.StateChangeListener

java.lang.Object
  extended by y.view.hierarchy.GroupNodeRealizer.StateChangeListener
All Implemented Interfaces:
java.util.EventListener, HierarchyListener
Enclosing class:
GroupNodeRealizer

public static class GroupNodeRealizer.StateChangeListener
extends java.lang.Object
implements HierarchyListener

This static inner class can be used to automatically adjust the groupClosed property of GroupFeature instances. Add this HierarchyListener implementation to the respective HierarchyManager instances and changes of the group nodes' states will be automatically reflected by the groupClosed property. This implementation works together with all GroupFeature implementations (e.g. GroupNodeRealizer and GenericGroupNodeRealizer) implementations as well as proxy node realizer instances that contain an open (index 0) and a closed (index 1) variant at the same time.

See Also:
ProxyShapeNodeRealizer
 

Constructor Summary
GroupNodeRealizer.StateChangeListener()
          Creates a new (unbound) instance of StateChangeListener.
 
Method Summary
 void hierarchyChange(HierarchyEvent e)
          Adjusts groupClosed state of GroupFeature instances as well as delegate realizers of ProxyShapeNodeRealizer instances in response to node state changes.
 boolean isKeepingSelectionState()
          Determines whether or not the selection state of a ProxyShapeNodeRealizer instance should be retained when the proxy's delegate realizer is exchanged due to a node state change.
 void setKeepingSelectionState(boolean enabled)
          Specifies whether or not the selection state of a ProxyShapeNodeRealizer instance should be retained when the proxy's delegate realizer is exchanged due to a node state change.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroupNodeRealizer.StateChangeListener

public GroupNodeRealizer.StateChangeListener()
Creates a new (unbound) instance of StateChangeListener.

Method Detail

isKeepingSelectionState

public boolean isKeepingSelectionState()
Determines whether or not the selection state of a ProxyShapeNodeRealizer instance should be retained when the proxy's delegate realizer is exchanged due to a node state change.

If this property is false, a node state change event might result in an implicit selection state change for ProxyShapeNodeRealizer instances if the selection states of the delegate realizer that is used before the node state change differs from the selection state of the delegate realizer that is used after the node state change.

Defaults to false.

Returns:
true if the selection state of a ProxyShapeNodeRealizer instance is explicitly set again after exchanging its delegate realizer; false otherwise.

setKeepingSelectionState

public void setKeepingSelectionState(boolean enabled)
Specifies whether or not the selection state of a ProxyShapeNodeRealizer instance should be retained when the proxy's delegate realizer is exchanged due to a node state change.

If this property is false, a node state change event might result in an implicit selection state change for ProxyShapeNodeRealizer instances if the selection states of the delegate realizer that is used before the node state change differs from the selection state of the delegate realizer that is used after the node state change.

Defaults to false.

Parameters:
enabled - if true, the selection state of a ProxyShapeNodeRealizer instance is explicitly set again after exchanging its delegate realizer; if false, the selection state of a ProxyShapeNodeRealizer is not explicitly (re-)set.
See Also:
isKeepingSelectionState()

hierarchyChange

public void hierarchyChange(HierarchyEvent e)
Adjusts groupClosed state of GroupFeature instances as well as delegate realizers of ProxyShapeNodeRealizer instances in response to node state changes.

Specified by:
hierarchyChange in interface HierarchyListener
Parameters:
e - a hierarchy event.

© Copyright 2000-2022,
yWorks GmbH.
All rights reserved.