Class AbstractCreationTool<F extends Figure>

Type Parameters:
F - the type of the figures that can be created by this tool
All Implemented Interfaces:
Tool, PropertyBean, Disableable
Direct Known Subclasses:
BezierCreationTool, CreationTool, PolyCreationTool, TextCreationTool

public abstract class AbstractCreationTool<F extends Figure> extends AbstractTool
AbstractCreationTool.
Author:
Werner Randelshofer
  • Field Details

    • layerFactory

      protected Supplier<Layer> layerFactory
    • figureFactory

      protected Supplier<? extends F extends Figure> figureFactory
    • createdFigure

      protected @Nullable F extends Figure createdFigure
      The created figure.
  • Constructor Details

  • Method Details

    • setFigureFactory

      public void setFigureFactory(Supplier<F> factory)
    • setLayerFactory

      public void setLayerFactory(Supplier<Layer> factory)
    • createFigure

      protected F createFigure()
    • getOrCreateParent

      protected @Nullable Figure getOrCreateParent(DrawingView dv, Figure newFigure)
      Finds a layer for the specified figure. Creates a new layer if no suitable layer can be found.
      Parameters:
      dv - the drawing view
      newFigure - the figure
      Returns:
      a suitable parent for the figure