Class AbstractLabelPart

java.lang.Object
org.eclipse.gef.mvc.fx.parts.AbstractVisualPart<V>
org.eclipse.gef.mvc.fx.parts.AbstractContentPart<javafx.scene.Group>
org.eclipse.gef.zest.fx.parts.AbstractLabelPart
All Implemented Interfaces:
IActivatable, IAdaptable, IAdaptable.Bound<IViewer>, IDisposable, IContentPart<javafx.scene.Group>, ITransformableContentPart<javafx.scene.Group>, IVisualPart<javafx.scene.Group>
Direct Known Subclasses:
EdgeLabelPart, NodeLabelPart

public abstract class AbstractLabelPart extends AbstractContentPart<javafx.scene.Group> implements ITransformableContentPart<javafx.scene.Group>
Abstract base class for external labels, i.e. labels that are not part of the visualization of another controller. The standard node label is part of the node part's visualization. However, edge labels are implemented as external labels, for example.
  • Field Details

  • Constructor Details

    • AbstractLabelPart

      public AbstractLabelPart()
  • Method Details

    • computeLabelPosition

      public abstract Point computeLabelPosition()
      Computes a position for this label.
      Returns:
      The computed position for this label in the coordinate system of the GraphPart that contains this label.
    • createText

      protected javafx.scene.text.Text createText()
      Creates the text visual.
      Returns:
      The created Text.
    • doActivate

      protected void doActivate()
      Overrides:
      doActivate in class AbstractVisualPart<javafx.scene.Group>
    • doAttachToAnchorageVisual

      protected void doAttachToAnchorageVisual(IVisualPart<? extends javafx.scene.Node> anchorage, String role)
      Overrides:
      doAttachToAnchorageVisual in class AbstractVisualPart<javafx.scene.Group>
    • doDeactivate

      protected void doDeactivate()
      Overrides:
      doDeactivate in class AbstractVisualPart<javafx.scene.Group>
    • doDetachFromAnchorageVisual

      protected void doDetachFromAnchorageVisual(IVisualPart<? extends javafx.scene.Node> anchorage, String role)
      Overrides:
      doDetachFromAnchorageVisual in class AbstractVisualPart<javafx.scene.Group>
    • doGetContentChildren

      protected List<? extends Object> doGetContentChildren()
      Specified by:
      doGetContentChildren in class AbstractContentPart<javafx.scene.Group>
    • getContent

      public javafx.util.Pair<? extends org.eclipse.gef.common.attributes.IAttributeStore,String> getContent()
      Specified by:
      getContent in interface IContentPart<javafx.scene.Group>
      Overrides:
      getContent in class AbstractContentPart<javafx.scene.Group>
    • getContentTransform

      public javafx.scene.transform.Affine getContentTransform()
      Specified by:
      getContentTransform in interface ITransformableContentPart<javafx.scene.Group>
    • getLabelPosition

      public Point getLabelPosition()
      Retrieves the stored position for the label.
      Returns:
      The label position stored in the attributes.
    • getLabelPositionAttributeKey

      protected String getLabelPositionAttributeKey()
      Retrieves the position attribute key for the given label role.
      Returns:
      The key via which to retrieve the position attribute for the label.
    • getText

      protected javafx.scene.text.Text getText()
      Returns the text visual.
      Returns:
      The Text used as visual.
    • recomputeLabelPosition

      public void recomputeLabelPosition()
      Recomputes the label position.
    • refreshPosition

      protected void refreshPosition(javafx.scene.Node visual, Point position)
      Adjusts the label's position to fit the given Point.
      Parameters:
      visual - This node's visual.
      position - This node's position.
    • setContentTransform

      public void setContentTransform(javafx.scene.transform.Affine transform)
      Specified by:
      setContentTransform in interface ITransformableContentPart<javafx.scene.Group>
    • setLabelPosition

      public void setLabelPosition(Point computedPosition)
      Sets the stored label position to the given value.
      Parameters:
      computedPosition - The new label position.