Class LayeredRootPart

java.lang.Object
org.eclipse.gef.mvc.fx.parts.AbstractVisualPart<javafx.scene.Group>
org.eclipse.gef.mvc.fx.parts.LayeredRootPart
All Implemented Interfaces:
IActivatable, IAdaptable, IAdaptable.Bound<IViewer>, IDisposable, IRootPart<javafx.scene.Group>, IVisualPart<javafx.scene.Group>

public class LayeredRootPart extends AbstractVisualPart<javafx.scene.Group> implements IRootPart<javafx.scene.Group>
The LayeredRootPart is an IRootPart that manages a number of layers for the visualization, namely, the content layer, feedback layer, and handle layer. The visuals of the different IVisualParts are inserted into these layers depending on their type, i.e. IContentPart visuals are inserted into the content layer, IFeedbackPart visuals are inserted into the feedback layer, and IHandlePart visuals are inserted into the handle layer.

The layers are stacked on top of each other with the content layer at the bottom and the handle layer at the top. The feedback layer in the middle is mouse transparent, i.e. you cannot interact with the visuals in this layer.

  • Constructor Details

    • LayeredRootPart

      public LayeredRootPart()
      Default constructor.
  • Method Details

    • activateChildren

      protected void activateChildren()
      Description copied from class: AbstractVisualPart
      Activates the children of this AbstractVisualPart.
      Overrides:
      activateChildren in class AbstractVisualPart<javafx.scene.Group>
    • createContentLayer

      protected javafx.scene.Group createContentLayer()
      Creates the content layer visual.
      Returns:
      The content layer visual.
    • createFeedbackLayer

      protected javafx.scene.Group createFeedbackLayer()
      Creates the feedback layer visual.
      Returns:
      The feedback layer visual.
    • createHandleLayer

      protected javafx.scene.Group createHandleLayer()
      Creates the handle layer visual.
      Returns:
      The handle layer visual.
    • createLayer

      protected javafx.scene.Group createLayer(boolean mouseTransparent)
      Creates a Group and sets its Node.pickOnBoundsProperty() to false. Does also set its Node.mouseTransparentProperty() to the given value.
      Parameters:
      mouseTransparent - The value for the layer's Node.mouseTransparentProperty().
      Returns:
      The created layer.
    • deactivateChildren

      protected void deactivateChildren()
      Description copied from class: AbstractVisualPart
      Deactivates the children of this AbstractVisualPart.
      Overrides:
      deactivateChildren in class AbstractVisualPart<javafx.scene.Group>
    • determineViewer

      protected IViewer determineViewer(IVisualPart<? extends javafx.scene.Node> parent, Multiset<IVisualPart<? extends javafx.scene.Node>> anchoreds)
      Description copied from class: AbstractVisualPart
      Determines the viewer reference via the given parent or any of the given anchoreds.
      Overrides:
      determineViewer in class AbstractVisualPart<javafx.scene.Group>
      Parameters:
      parent - The parent to obtain the viewer from.
      anchoreds - The anchoreds to alternatively obtain the viewer from.
      Returns:
      The viewer, if it could be determined via the parent or any of the anchoreds.
    • doAddChildVisual

      protected void doAddChildVisual(IVisualPart<? extends javafx.scene.Node> child, int index)
      Description copied from class: AbstractVisualPart
      Performs the addition of the child's visual to this IVisualPart's visual.
      Overrides:
      doAddChildVisual in class AbstractVisualPart<javafx.scene.Group>
      Parameters:
      child - The IVisualPart being added
      index - The child's position
      See Also:
    • doAttachToAnchorageVisual

      protected void doAttachToAnchorageVisual(IVisualPart<? extends javafx.scene.Node> anchorage, String role)
      Description copied from class: AbstractVisualPart
      Attaches this part's visual to the visual of the given anchorage.
      Overrides:
      doAttachToAnchorageVisual in class AbstractVisualPart<javafx.scene.Group>
      Parameters:
      anchorage - The anchorage IVisualPart.
      role - The anchorage role.
    • doCreateVisual

      protected javafx.scene.Group doCreateVisual()
      Description copied from class: AbstractVisualPart
      Creates this part's visual.
      Specified by:
      doCreateVisual in class AbstractVisualPart<javafx.scene.Group>
      Returns:
      This part's visual.
    • doDetachFromAnchorageVisual

      protected void doDetachFromAnchorageVisual(IVisualPart<? extends javafx.scene.Node> anchorage, String role)
      Description copied from class: AbstractVisualPart
      Detaches this part's visual from the visual of the given anchorage.
      Overrides:
      doDetachFromAnchorageVisual in class AbstractVisualPart<javafx.scene.Group>
      Parameters:
      anchorage - The anchorage IVisualPart.
      role - The anchorage role.
    • doRefreshVisual

      protected void doRefreshVisual(javafx.scene.Group visual)
      Description copied from class: AbstractVisualPart
      Refreshes this part's visualization based on this part's content.
      Specified by:
      doRefreshVisual in class AbstractVisualPart<javafx.scene.Group>
      Parameters:
      visual - This part's visual.
    • doRemoveChildVisual

      protected void doRemoveChildVisual(IVisualPart<? extends javafx.scene.Node> child, int index)
      Description copied from class: AbstractVisualPart
      Removes the child's visual from this IVisualPart's visual.
      Overrides:
      doRemoveChildVisual in class AbstractVisualPart<javafx.scene.Group>
      Parameters:
      child - The child IVisualPart.
      index - The index of the child whose visual is to be removed.
    • getContentLayer

      public javafx.scene.Group getContentLayer()
      Returns the content layer visual. The content layer visual is created in case it was not created before.
      Returns:
      The content layer visual.
      See Also:
    • getContentPartChildren

      public List<IContentPart<? extends javafx.scene.Node>> getContentPartChildren()
      Description copied from interface: IRootPart
      Returns all children of type IContentPart contained by this IRootPart.
      Specified by:
      getContentPartChildren in interface IRootPart<javafx.scene.Group>
      Returns:
      A list containing all IContentPart children.
    • getFeedbackLayer

      public javafx.scene.Group getFeedbackLayer()
      Returns the feedback layer visual. The feedback layer visual is created in case it was not created before.
      Returns:
      The feedback layer visual.
      See Also:
    • getFeedbackPartChildren

      public List<IFeedbackPart<? extends javafx.scene.Node>> getFeedbackPartChildren()
      Description copied from interface: IRootPart
      Returns all children of type IFeedbackPart contained by this IRootPart.
      Specified by:
      getFeedbackPartChildren in interface IRootPart<javafx.scene.Group>
      Returns:
      A list containing all IFeedbackPart children.
    • getHandleLayer

      public javafx.scene.Group getHandleLayer()
      Returns the handle layer visual. The handle layer visual is created in case it was not created before.
      Returns:
      The handle layer visual.
      See Also:
    • getHandlePartChildren

      public List<IHandlePart<? extends javafx.scene.Node>> getHandlePartChildren()
      Description copied from interface: IRootPart
      Returns all children of type IHandlePart contained by this IRootPart.
      Specified by:
      getHandlePartChildren in interface IRootPart<javafx.scene.Group>
      Returns:
      A list containing all IHandlePart children.
    • getRoot

      public IRootPart<? extends javafx.scene.Node> getRoot()
      Description copied from interface: IVisualPart
      Returns the IRootPart. This method should only be called internally or by helpers such as edit policies. The root can be used to get the viewer.
      Specified by:
      getRoot in interface IVisualPart<javafx.scene.Group>
      Overrides:
      getRoot in class AbstractVisualPart<javafx.scene.Group>
      Returns:
      null or the IRootPart