Class AbstractLabelPart

    • Constructor Detail

      • AbstractLabelPart

        public AbstractLabelPart()
    • Method Detail

      • 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.
      • getContent

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

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

        protected java.lang.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.
      • setLabelPosition

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