Class KNodeExtensions

java.lang.Object
de.cau.cs.kieler.klighd.krendering.extensions.KNodeExtensions

public class KNodeExtensions extends Object
Provides some helpful extension methods for simplifying the composition of KGraph/KRendering-based view models.

In order to employ them beyond KLighD diagram syntheses you best declare a field of type KNodeExtensions in your class and annotate it with Inject.

Make sure to bind the ViewSynthesisShared annotation in the employed Injector to a Scope, e.g. by calling Guice.createInjector(KRenderingExtensionsPlugin.createSingletonScopeBindingModule()); or Guice.createInjector(KRenderingExtensionsPlugin.createNoScopeBindingModule());.

By means of that Injector you may get a new instance of your class, or you may inject the above mentioned attribute within instances of your class, e.g. by calling injector.injectMembers(this) in the constructor of your class.
Author:
chsch, nre
This class contains Xtend extension methods.
  • Constructor Details

    • KNodeExtensions

      public KNodeExtensions()
  • Method Details

    • nodeExists

      public boolean nodeExists(Object... os)
      A convenient test method to check whether or not a specific node exists in the create extension
    • registerExistingNode

      public KNode registerExistingNode(KNode node, Object... os)
      A convenient method to register a node that was not created via the create extension.
      Returns:
      the previous node associated with the given object(s), or null if there was no node.
    • getNode

      public KNode getNode(Object o)
      A convenient getter preserving the element image relation by a create extension.
    • getNode

      public KNode getNode(Object o1, Object o2)
      A convenient getter preserving the element image relation.
    • getNode

      public KNode getNode(Object... os)
      A convenient getter preserving the element image relation by a create extension.
    • createNode

      public KNode createNode()
      A convenience method to create a KNode without relating it to a business object.
    • createNode

      public KNode createNode(Object o)
      An alias of getNode(java.lang.Object) allowing to express in business that the KNode will be created at this place. It is just syntactic sugar.
    • createNode

      public KNode createNode(Object o1, Object o2)
      An alias of getNode(java.lang.Object) allowing to express in business that the KNode will be created at this place. It is just syntactic sugar.
    • createNode

      public KNode createNode(Object... os)
      An alias of getNode(java.lang.Object) allowing to express in business that the KNode will be created at this place. It is just syntactic sugar.
    • getNodeSize

      public org.eclipse.elk.core.util.Pair<Float,Float> getNodeSize(KNode node)
    • getHeight

      public float getHeight(KNode node)
    • getWidth

      public float getWidth(KNode node)
      Is used in KPortExtensions
    • setNodeSize

      public KNode setNodeSize(KNode node, float width, float height)
    • setWidth

      public KNode setWidth(KNode node, float width)
    • setHeight

      public KNode setHeight(KNode node, float height)
    • setMinimalNodeSize

      public KNode setMinimalNodeSize(KNode node, float width, float height)
    • addLayoutParam

      public <T> KNode addLayoutParam(KNode node, org.eclipse.elk.graph.properties.IProperty<? super T> property, T value)
    • configureOutsideBottomLeftNodeLabelPlacement

      public KNode configureOutsideBottomLeftNodeLabelPlacement(KNode node)
      Configures labels on this node to be outside bottom left-aligned labels by default
    • configureOutsideBottomCenteredNodeLabelPlacement

      public KNode configureOutsideBottomCenteredNodeLabelPlacement(KNode node)
      Configures labels on this node to be outside bottom centrally-aligned labels by default
    • configureOutsideBottomRightNodeLabelPlacement

      public KNode configureOutsideBottomRightNodeLabelPlacement(KNode node)
      Configures labels on this node to be outside bottom right-aligned labels by default
    • configureOutsideTopLeftNodeLabelPlacement

      public KNode configureOutsideTopLeftNodeLabelPlacement(KNode node)
      Configures labels on this node to be outside top left-aligned labels by default
    • configureOutsideTopCenteredNodeLabelPlacement

      public KNode configureOutsideTopCenteredNodeLabelPlacement(KNode node)
      Configures labels on this node to be outside top centrally-aligned labels by default
    • configureOutsideTopRightNodeLabelPlacement

      public KNode configureOutsideTopRightNodeLabelPlacement(KNode node)
      Configures labels on this node to be outside top right-aligned labels by default
    • configureInsideBottomLeftNodeLabelPlacement

      public KNode configureInsideBottomLeftNodeLabelPlacement(KNode node)
      Configures labels on this node to be inside bottom left-aligned labels by default
    • configureInsideBottomCenteredNodeLabelPlacement

      public KNode configureInsideBottomCenteredNodeLabelPlacement(KNode node)
      Configures labels on this node to be inside bottom centrally-aligned labels by default
    • configureInsideBottomRightNodeLabelPlacement

      public KNode configureInsideBottomRightNodeLabelPlacement(KNode node)
      Configures labels on this node to be inside bottom right-aligned labels by default
    • configureInsideCenteredNodeLabelPlacement

      public KNode configureInsideCenteredNodeLabelPlacement(KNode node)
      Configures labels on this node to be inside centrally-aligned labels by default
    • configureInsideTopLeftNodeLabelPlacement

      public KNode configureInsideTopLeftNodeLabelPlacement(KNode node)
      Configures labels on this node to be inside top left-aligned labels by default
    • configureInsideTopCenteredNodeLabelPlacement

      public KNode configureInsideTopCenteredNodeLabelPlacement(KNode node)
      Configures labels on this node to be inside top centrally-aligned labels by default
    • configureInsideTopRightNodeLabelPlacement

      public KNode configureInsideTopRightNodeLabelPlacement(KNode node)
      Configures labels on this node to be inside top right-aligned labels by default