Interface Handle

  • All Superinterfaces:
    Cloneable, Figure, Restorable, ShapeFigure
    All Known Implementing Classes:
    AbstractHandle, PointHandle, RotateHandle, ScaleHandle, VertexHandle

    public interface Handle
    extends ShapeFigure
    Handles are shown on figures vertices or boundaries. Usually they when figures are selected. Various handle types may be used to modify a figure's geometry, e.g. resize, rotate or move figures or their vertices.

    Important note: The shape and bounds returned by handles are in view coordinates. This is in contrast to figures, which return these properties in model coordinates.

    Clients should not implement this interface directly, because it may change in the future. Instead they should derive their Handle implementation from AbstractHandle.

    Since:
    Ceres 0.10
    • Method Detail

      • getLocation

        Point2D getLocation()
        Returns:
        The current location in model coordinates.
      • getCursor

        Cursor getCursor()
        Returns:
        The mouse cursor that will appear if users point the mouse over a handle.
      • getShape

        Shape getShape()
        Gets the shape (geometry) for this figure.
        Specified by:
        getShape in interface ShapeFigure
        Returns:
        The shape in view coordinates.
      • setShape

        void setShape​(Shape shape)
        Sets the shape (geometry) for this figure.
        Specified by:
        setShape in interface ShapeFigure
        Parameters:
        shape - The shape in view coordinates.
      • getBounds

        Rectangle2D getBounds()
        The bounds of the handle.
        Specified by:
        getBounds in interface Figure
        Returns:
        The bounds of the handle in view units.