Interface Geometry

  • All Known Implementing Classes:
    BoundsGeometry, CircleGeometry, PathGeometry

    public interface Geometry
    Geometry is an interface that captures the concept of an abstract figure geometry. Classes that implement this geometry are intended to be used as utility classes by figure and manipulators. Geometry objects generally provide support for reshaping and querying geometry-related aspects of figures and shapes. Generally, Geometry objects will contains some number of Site objects as part of this support.

    This interface is fairly "loose," because there are so many different ways that figures might choose to allow access to their geometry. It is not intended to be rigid framework-style interface that defines what implementors should do, but merely to provide a way to loosely group the geometry classes together.

    Version:
    $Id$
    Author:
    John Reekie
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      Figure getFigure()
      Get the figure to which this geometry object is attached.
      java.awt.Shape getShape()
      Get the shape that defines this geometry.
      void setShape​(java.awt.Shape shape)
      Set the shape that defines this geometry object.
      void translate​(double x, double y)
      Translate the geometry object.
    • Method Detail

      • getFigure

        Figure getFigure()
        Get the figure to which this geometry object is attached. Returns null if there isn't one.
      • getShape

        java.awt.Shape getShape()
        Get the shape that defines this geometry. In general, a geometry is defined by a shape of some sort, and this method provides the most general way that a client can access that shape. Implementing classes may choose to define other, more efficient or more type-specific methods.
      • setShape

        void setShape​(java.awt.Shape shape)
        Set the shape that defines this geometry object. Implementing classes should check that the specific type of the shape is one that they can accept, and throw an IllegalArgumentException exception if not.
      • translate

        void translate​(double x,
                       double y)
        Translate the geometry object. This method is typically used by clients as a fast way of changing the geometry. Implementors can use it to update their internal data more efficiently than by using the setShape() method.