JHotDraw 6.0b1

org.jhotdraw.contrib
Class GridPainter

java.lang.Object
  extended by org.jhotdraw.contrib.GridPainter
All Implemented Interfaces:
java.io.Serializable, Painter

public class GridPainter
extends java.lang.Object
implements Painter

This painter draws a grid as background for the drawing view

See Also:
Serialized Form

Constructor Summary
GridPainter(int newSeparation)
          It constructs the painter using the desired separation (both horizontal and vertical)
GridPainter(int horizontalSeparation, int verticalSeparation)
          It constructs the painter using the desired horizontal and vertical separation
 
Method Summary
 void draw(java.awt.Graphics g, DrawingView view)
          Draws into the given DrawingView.
 java.awt.Color getColor()
           
 int getHorizontalSeparation()
           
 int getVerticalSeparation()
           
 void setColor(java.awt.Color newColor)
           
 void setHorizontalSeparation(int newHorizontalSeparation)
           
 void setVerticalSeparation(int newVerticalSeparation)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GridPainter

public GridPainter(int horizontalSeparation,
                   int verticalSeparation)
It constructs the painter using the desired horizontal and vertical separation

Parameters:
horizontalSeparation -
verticalSeparation -

GridPainter

public GridPainter(int newSeparation)
It constructs the painter using the desired separation (both horizontal and vertical)

Parameters:
newSeparation - number of pixel which should separate the grid
Method Detail

getHorizontalSeparation

public int getHorizontalSeparation()

setHorizontalSeparation

public void setHorizontalSeparation(int newHorizontalSeparation)

getVerticalSeparation

public int getVerticalSeparation()

setVerticalSeparation

public void setVerticalSeparation(int newVerticalSeparation)

draw

public void draw(java.awt.Graphics g,
                 DrawingView view)
Description copied from interface: Painter
Draws into the given DrawingView.

Specified by:
draw in interface Painter
See Also:
Painter.draw(java.awt.Graphics, org.jhotdraw.framework.DrawingView)

getColor

public java.awt.Color getColor()

setColor

public void setColor(java.awt.Color newColor)

JHotDraw 6.0b1