Class AbstractHidingBehavior

java.lang.Object
org.eclipse.gef.mvc.fx.behaviors.AbstractBehavior
org.eclipse.gef.zest.fx.behaviors.AbstractHidingBehavior
All Implemented Interfaces:
IActivatable, IAdaptable.Bound<IVisualPart<? extends Node>>, IBehavior
Direct Known Subclasses:
EdgeHidingBehavior, EdgeLabelHidingBehavior, NodeHidingBehavior

public abstract class AbstractHidingBehavior extends AbstractBehavior
The AbstractHidingBehavior registers listeners on the HidingModel upon activation. When the HidingModel changes, the hidden status of the host is determined. If the hidden status of the host changed, either hide() or show() will be called, respectively. By default, the host's visual's visibility and mouse-transparency are changed depending on the hidden status.
  • Constructor Details

    • AbstractHidingBehavior

      public AbstractHidingBehavior()
  • Method Details

    • determineHiddenStatus

      protected abstract boolean determineHiddenStatus()
      Returns true if the host is currently hidden. Otherwise, returns false.
      Returns:
      true if the host is currently hidden, otherwise false.
    • doActivate

      protected void doActivate()
      Overrides:
      doActivate in class AbstractBehavior
    • doDeactivate

      protected void doDeactivate()
      Overrides:
      doDeactivate in class AbstractBehavior
    • getHidingModel

      protected HidingModel getHidingModel()
      Returns the HidingModel that is installed on the IViewer of the host.
      Returns:
      The HidingModel that is installed on the IViewer of the host.
    • hide

      protected void hide()
      Hides the host. By default, the host's visual's visibility will be set to false and its mouse-transparency will be set to true.
    • isHidden

      protected boolean isHidden()
      Returns true if the host is currently considered to be hidden. Otherwise, returns false.
      Returns:
      true if the host is currently considered to be hidden, otherwise false.
    • onHidingModelChange

      protected void onHidingModelChange(SetChangeListener.Change<? extends Node> change)
      Called upon HidingModel changes. Determines if the host is now hidden using determineHiddenStatus() and compares the result with the previous hidden status. If the host was previously hidden and is not hidden anymore, show() is called. Otherwise, hide() is called.
      Parameters:
      change - The change event of the HidingModel.
    • show

      protected void show()
      Shows the host. By default, the host's visual's visibility will be set to true and its mouse-transparency will be set to false.