Class ShapeSymbol

  • All Implemented Interfaces:
    Symbol

    public class ShapeSymbol
    extends Object
    implements Symbol
    A point symbol that is represented by a Java AWT shape geometry.
    Since:
    Ceres 0.13
    • Constructor Detail

      • ShapeSymbol

        public ShapeSymbol​(Shape shape)
    • Method Detail

      • createCircle

        public static ShapeSymbol createCircle​(double size)
      • createSquare

        public static ShapeSymbol createSquare​(double size)
      • createPin

        public static ShapeSymbol createPin​(double size)
      • getShape

        public Shape getShape()
      • draw

        public void draw​(Rendering rendering,
                         FigureStyle style)
        Description copied from interface: Symbol
        Draws the symbol on the given rendering using the given style. The rendering's graphics is transformed so that drawing can be done directly in symbol coordinates using view units, e.g.
             rendering.getGraphics().draw(symbolShape);
         
        or
             rendering.getGraphics().drawRenderedImage(symbolImage, null);
         
        Specified by:
        draw in interface Symbol
        Parameters:
        rendering - The rendering.
        style - The style.
      • isHitBy

        public boolean isHitBy​(double x,
                               double y)
        Description copied from interface: Symbol
        Tests weather this symbol is hit by the given point.
        Specified by:
        isHitBy in interface Symbol
        Parameters:
        x - The X-coordinate of the point in symbol coordinates using view units.
        y - The Y-coordinate of the point in symbol coordinates using view units.
        Returns:
        true, if so.
      • getBounds

        public Rectangle2D getBounds()
        Description copied from interface: Symbol
        The bounds of the symbol.
        Specified by:
        getBounds in interface Symbol
        Returns:
        The bounds of the symbol in symbol coordinates using view units.