Interface JaxoPaintableGrid

All Superinterfaces:
JaxoGrid, Transparency
All Known Implementing Classes:
JaxoDefaultGrid

public interface JaxoPaintableGrid extends JaxoGrid, Transparency
A grid that can be painted.
Since:
2.1
  • Field Details

  • Method Details

    • addChangeListener

      void addChangeListener(ChangeListener l)
      ChangeEvents will be fired everytime the actual image of the grid changes (not on canvasSize changes).
      Parameters:
      l - The listener to add.
    • removeChangeListener

      void removeChangeListener(ChangeListener l)
      Removes a change listener.
      Parameters:
      l - The listener to remove.
    • paint

      void paint(Graphics2D g)
      Paints the grid.
      Parameters:
      g - The graphics context to paint the grid.
    • getCanvasSize

      Dimension getCanvasSize()
      Size of the grid canvas. This is the size of the area on which the grid will be painted.
      Returns:
      The size of the grid canvas.
    • setCanvasSize

      void setCanvasSize(Dimension value)
      Sets the size of the grid canvas. This is the size of the area on which the grid will be painted.
      Parameters:
      value - The size to set.
    • setGridSize

      void setGridSize(int value)
      Sets the size of the grid to the given value. This is the distance between two grid points. For a hexagonal grid, the grid size is always forced to be even.
      Parameters:
      value - The grid size to be set.
    • getGridSize

      int getGridSize()
      Returns the current size of the grid. This is the distance between two grid points.
      Returns:
      The grid size.
    • setGridType

      void setGridType(int value)
      Sets the type of the grid (TYPE_XYZ).
      Parameters:
      value - The gridtype to be set.
    • getGridType

      int getGridType()
      Returns the type of the grid.
      Returns:
      The gridtype (TYPE_XYZ).
    • getGridStyle

      int getGridStyle()
      Grid style (STYLE_XYZ constant). The default is STYLE_DOT.
      Returns:
      The grid style.
    • setGridStyle

      void setGridStyle(int value)
      Set style, and repaint.
      Parameters:
      value - The style to set.
    • getGridColor

      Color getGridColor()
      Color of the grid.
      Returns:
      The color of the grid.
    • setGridColor

      void setGridColor(Color value)
      Sets the color of the grid points.
      Parameters:
      value - The color to set.
    • isPainted

      boolean isPainted()
      Determine if this grid gets painted. By default, a grid is painted.
      Returns:
      true if the grid is switched on, false otherwise.
    • setPainted

      void setPainted(boolean painted)
      Determine if this grid gets painted.
      Parameters:
      painted - true if this grid should get painted, false otherwise.
    • isSnapping

      boolean isSnapping()
      Check if points are currently snapped to the grid. By default snapping is off.
      Returns:
      true if this grid snaps points, false otherwise.
    • setSnapping

      void setSnapping(boolean snapping)
      Switch on/off the snapping of this grid.
      Parameters:
      snapping - true if this grid should snap points, false otherwise.