Class Brush

java.lang.Object
  extended by java.awt.Image
      extended by java.awt.image.BufferedImage
          extended by Brush
All Implemented Interfaces:
java.awt.image.RenderedImage, java.awt.image.WritableRenderedImage, java.awt.Transparency
Direct Known Subclasses:
EyeDropperTool, MagicWandTool, PaintBucketTool, Tool

public class Brush
extends java.awt.image.BufferedImage

This class is what makes all of our brush tools

Author:
ian. Created Mar 23, 2008.

Field Summary
(package private)  java.lang.String name
          This is the given name for the brush.
 int x
          this field provides x coordinates for all brushes that are built.
 int y
          this field provides y coordinates for all brushes that are built.
 
Fields inherited from class java.awt.image.BufferedImage
TYPE_3BYTE_BGR, TYPE_4BYTE_ABGR, TYPE_4BYTE_ABGR_PRE, TYPE_BYTE_BINARY, TYPE_BYTE_GRAY, TYPE_BYTE_INDEXED, TYPE_CUSTOM, TYPE_INT_ARGB, TYPE_INT_ARGB_PRE, TYPE_INT_BGR, TYPE_INT_RGB, TYPE_USHORT_555_RGB, TYPE_USHORT_565_RGB, TYPE_USHORT_GRAY
 
Fields inherited from class java.awt.Image
accelerationPriority, SCALE_AREA_AVERAGING, SCALE_DEFAULT, SCALE_FAST, SCALE_REPLICATE, SCALE_SMOOTH, UndefinedProperty
 
Fields inherited from interface java.awt.Transparency
BITMASK, OPAQUE, TRANSLUCENT
 
Constructor Summary
Brush(int size)
          creates a new Brush of width twice the given width the brushes name is defaulted to its width
Brush(int size, java.io.File f, java.lang.String s)
          creates a new brush from the specified file of an image, and names it the given name
 
Method Summary
 int getSize()
          returns the width of the Brush
 void Paint(Canvas c, int x, int y)
          paints with the brush on the specified canvas at the specified location
 java.lang.String toString()
           
 
Methods inherited from class java.awt.image.BufferedImage
addTileObserver, coerceData, copyData, createGraphics, getAlphaRaster, getColorModel, getData, getData, getGraphics, getHeight, getHeight, getMinTileX, getMinTileY, getMinX, getMinY, getNumXTiles, getNumYTiles, getProperty, getProperty, getPropertyNames, getRaster, getRGB, getRGB, getSampleModel, getSource, getSources, getSubimage, getTile, getTileGridXOffset, getTileGridYOffset, getTileHeight, getTileWidth, getTransparency, getType, getWidth, getWidth, getWritableTile, getWritableTileIndices, hasTileWriters, isAlphaPremultiplied, isTileWritable, releaseWritableTile, removeTileObserver, setData, setRGB, setRGB
 
Methods inherited from class java.awt.Image
flush, getAccelerationPriority, getCapabilities, getScaledInstance, setAccelerationPriority
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

x

public int x
this field provides x coordinates for all brushes that are built.


y

public int y
this field provides y coordinates for all brushes that are built.


name

java.lang.String name
This is the given name for the brush.

Constructor Detail

Brush

public Brush(int size)
creates a new Brush of width twice the given width the brushes name is defaulted to its width

Parameters:
size -

Brush

public Brush(int size,
             java.io.File f,
             java.lang.String s)
creates a new brush from the specified file of an image, and names it the given name

Parameters:
size - width of brush image
f - the file to be used
s - name of the brush
Method Detail

getSize

public int getSize()
returns the width of the Brush

Returns:
the size

Paint

public void Paint(Canvas c,
                  int x,
                  int y)
paints with the brush on the specified canvas at the specified location

Parameters:
c - the canvas to paint to
x - the x coord of the brushes location
y - the y coord of the brushes location

toString

public java.lang.String toString()
Overrides:
toString in class java.awt.image.BufferedImage