Class DefaultPrimitivesDrawer

java.lang.Object
org.gvsig.fmap.mapcontrol.impl.DefaultPrimitivesDrawer
All Implemented Interfaces:
PrimitivesDrawer
Direct Known Subclasses:
MapControlDrawer2D

public class DefaultPrimitivesDrawer extends Object implements PrimitivesDrawer
Author:
Jorge Piera
  • Field Details

    • graphics

      protected Graphics2D graphics
    • color

      protected Color color
    • xorColor

      protected Color xorColor
  • Constructor Details

    • DefaultPrimitivesDrawer

      public DefaultPrimitivesDrawer()
    • DefaultPrimitivesDrawer

      public DefaultPrimitivesDrawer(Graphics2D graphics)
  • Method Details

    • drawLine

      public void drawLine(int x1, int y1, int x2, int y2)
      Specified by:
      drawLine in interface PrimitivesDrawer
    • drawOval

      public void drawOval(int x, int y, int width, int height)
      Specified by:
      drawOval in interface PrimitivesDrawer
    • drawRect

      public void drawRect(int x, int y, int width, int height)
      Description copied from interface: PrimitivesDrawer
      It draws a rectangle on the map using the color specified using the PrimitivesDrawer.setColor(Color) method.
      Specified by:
      drawRect in interface PrimitivesDrawer
      Parameters:
      x - The minimum X coordinate.
      y - The minimum Y coordinate.
      width - The rectangle width.
      height - The rectangle height.
    • fillRect

      public void fillRect(int x, int y, int width, int height)
      Description copied from interface: PrimitivesDrawer
      It fills a rectangle on the map using the color specified using the PrimitivesDrawer.setColor(Color) method.
      Specified by:
      fillRect in interface PrimitivesDrawer
      Parameters:
      x - The minimum X coordinate.
      y - The minimum Y coordinate.
      width - The rectangle width.
      height - The rectangle height.
    • setColor

      public void setColor(Color color)
      Description copied from interface: PrimitivesDrawer
      Sets the color that is used to draw the objects that don't have a symbol.
      Specified by:
      setColor in interface PrimitivesDrawer
      Parameters:
      color - The color to use on the drawing operations.
    • setGraphics

      public void setGraphics(Graphics graphics)
      Description copied from interface: PrimitivesDrawer
      This method sets the Graphics where the Drawer has to draw all the objects.
      Specified by:
      setGraphics in interface PrimitivesDrawer
      Parameters:
      graphics - The component where the new objects has to be drawn.
    • stopDrawing

      public void stopDrawing(Object obj)
      Description copied from interface: PrimitivesDrawer
      This method is used to finish a drawing process that needs to be synchronized.
      Specified by:
      stopDrawing in interface PrimitivesDrawer
      Parameters:
      obj - The object that has locked the resource.
    • startDrawing

      public void startDrawing(Object obj) throws InterruptedException
      Description copied from interface: PrimitivesDrawer
      This method is used to start a drawing process that needs to be synchronized.
      Specified by:
      startDrawing in interface PrimitivesDrawer
      Parameters:
      obj - The object that locks the resource.
      Throws:
      InterruptedException
    • setRenderingHints

      public void setRenderingHints(RenderingHints hints)
    • setStroke

      public void setStroke(Stroke stroke)
    • cleanCanvas

      public void cleanCanvas(MapControl mapCtrl)