Class AbstractLineConnectionFigure

All Implemented Interfaces:
ConnectingFigure, Figure, LineConnectingFigure, NonTransformableFigure, TransformCachingFigure, PropertyBean, StyleableBean, StyleablePropertyBean, TreeNode<Figure>
Direct Known Subclasses:
AbstractElbowLineConnectionWithMarkersFigure, AbstractPathConnectionWithMarkersFigure, AbstractStraightLineConnectionWithMarkersFigure, LineConnectionFigure

public abstract class AbstractLineConnectionFigure extends AbstractLeafFigure implements NonTransformableFigure, LineConnectingFigure
Base class for line connection figure.
Author:
Werner Randelshofer
  • Property Details

    • connected

      public javafx.beans.property.ReadOnlyBooleanWrapper connectedProperty
      See Also:
  • Constructor Details

    • AbstractLineConnectionFigure

      public AbstractLineConnectionFigure()
    • AbstractLineConnectionFigure

      public AbstractLineConnectionFigure(javafx.geometry.Point2D start, javafx.geometry.Point2D end)
    • AbstractLineConnectionFigure

      public AbstractLineConnectionFigure(double startX, double startY, double endX, double endY)
  • Method Details

    • onPropertyChanged

      protected <T> void onPropertyChanged(Key<T> key, @Nullable T oldValue, @Nullable T newValue, boolean wasAdded, boolean wasRemoved)
      Description copied from class: AbstractFigure
      Overrides of this method must call super!
      Overrides:
      onPropertyChanged in class AbstractFigure
      Type Parameters:
      T - the value type of the property
      Parameters:
      key - the changed key
      oldValue - the old value
      newValue - the new value
      wasAdded - whether the value was added (hence oldValue does not matter)
      wasRemoved - whether the value was removed (hence newValue does not matter)
    • doAddedToDrawing

      public void doAddedToDrawing(Drawing drawing)
      Description copied from class: AbstractFigure
      This method is called by Figure.addedToDrawing(org.jhotdraw8.draw.figure.Drawing). The implementation of this class is empty.
      Overrides:
      doAddedToDrawing in class AbstractFigure
      Parameters:
      drawing - the drawing
    • doRemovedFromDrawing

      protected void doRemovedFromDrawing(Drawing drawing)
      Description copied from class: AbstractFigure
      This method is called by AbstractFigure.removedFromDrawing(org.jhotdraw8.draw.figure.Drawing). The implementation of this class is empty.
      Overrides:
      doRemovedFromDrawing in class AbstractFigure
      Parameters:
      drawing - the drawing
    • getCssLayoutBounds

      public CssRectangle2D getCssLayoutBounds()
      Specified by:
      getCssLayoutBounds in interface Figure
    • getLayoutSubjects

      public ReadOnlySet<Figure> getLayoutSubjects()
      Returns all figures which are connected by this figure - they provide to the layout of this figure.
      Specified by:
      getLayoutSubjects in interface Figure
      Returns:
      an unmodifiable set of connected figures
    • isConnected

      public boolean isConnected()
    • isLayoutable

      public boolean isLayoutable()
      Description copied from interface: Figure
      Whether the layout method of this figure does anything.

      The default implementation returns false.

      Specified by:
      isLayoutable in interface Figure
      Returns:
      true if the layout method is not empty.
    • removeAllLayoutSubjects

      public void removeAllLayoutSubjects()
      Description copied from class: AbstractFigure
      This implementation is empty.
      Specified by:
      removeAllLayoutSubjects in interface Figure
      Overrides:
      removeAllLayoutSubjects in class AbstractFigure
    • removeLayoutSubject

      public void removeLayoutSubject(Figure subject)
      Description copied from class: AbstractFigure
      This implementation is empty.
      Specified by:
      removeLayoutSubject in interface Figure
      Overrides:
      removeLayoutSubject in class AbstractFigure
      Parameters:
      subject - the connected figure
    • reshapeInLocal

      public void reshapeInLocal(javafx.scene.transform.Transform transform)
      Description copied from interface: Figure
      Attempts to change the local bounds of the figure.

      The figure may choose to only partially change its local bounds.

      Specified by:
      reshapeInLocal in interface Figure
      Specified by:
      reshapeInLocal in interface NonTransformableFigure
      Parameters:
      transform - the desired transformation in local coordinates
    • reshapeInLocal

      public void reshapeInLocal(CssSize x, CssSize y, CssSize width, CssSize height)
      Description copied from interface: Figure
      Attempts to change the local bounds of the figure.

      See {#link #reshapeInLocal(Transform)} for a description of this method.

      This method takes parameters as CssSizes. This can be used to avoid rounding errors when the figure is reshaped in non-pixel units.

      This method can forward a call to Figure.reshapeInLocal(Transform) using the following code:

      
       void reshapeInLocal(CssSize x, CssSize y, CssSize width, CssSize height) {
         Transform tx = Transforms.createReshapeTransform(getCssBoundsInLocal(), x, y, width, height);
         reshapeInLocal(tx);
       }
       
      Specified by:
      reshapeInLocal in interface Figure
      Parameters:
      x - desired x-position in parent coordinates
      y - desired y-position in parent coordinates
      width - desired width in parent coordinates, may be negative
      height - desired height in parent coordinates, may be negative
    • setEndConnection

      public void setEndConnection(Figure target, Connector connector)
    • setStartConnection

      public void setStartConnection(Figure target, Connector connector)
    • updateConnectedProperty

      protected void updateConnectedProperty()
    • connectedProperty

      public javafx.beans.property.ReadOnlyBooleanWrapper connectedProperty()
      Returns:
      the connected property