|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectbrushTool
public class brushTool
This class is the Brush Tool. It controls what the brush does. It controls the color, the position and the shape. The object state should be enable. OS is windows. NO implementation variance is allowed. There are no security constaints. There are no external secification.
Field Summary | |
---|---|
(package private) java.awt.image.BufferedImage |
brushImage
this is a BufferedImage variable. |
int |
brushType
Stores the type of the brush (1-12). |
int |
DOT1
this is a int variable. |
int |
DOT2
this is a int variable. |
int |
DOT3
this is a int variable. |
(package private) java.awt.Graphics2D |
g2D
this is a Graphics2D variable. |
int |
LEFT1
this is a int variable. |
int |
LEFT2
this is a int variable. |
int |
LEFT3
this is a int variable. |
private int |
prevX
Stores the previous x. |
private int |
prevY
Stores the previous y. |
int |
RIGHT1
this is a int variable. |
int |
RIGHT2
this is a int variable. |
int |
RIGHT3
this is a int variable. |
int |
SQUARE1
this is a int variable. |
int |
SQUARE2
this is a int variable. |
int |
SQUARE3
this is a int variable. |
Constructor Summary | |
---|---|
brushTool()
Creates a brushTool with the brushType initialized to DOT1 by calling super() and setBrushType() to initialize brushType. |
Method Summary | |
---|---|
void |
clickAction(java.awt.event.MouseEvent mevt,
main_canvas theCanvas)
This method controls the colors when you click left or right. |
void |
dragAction(java.awt.event.MouseEvent mevt,
main_canvas theCanvas)
This method controls the position or location of the brush as it is moved by the user. |
java.awt.Shape |
drawBrush(int x,
int y)
Draws the brush strokes on the canvas according to the width and height of the x and y ints passed in. |
void |
drawStuff(java.awt.event.MouseEvent mevt,
int x,
int y,
main_canvas theCanvas)
This method controls all the other methods in order to draw what the user intends to do. |
int |
getBrushType()
This method returns the brushType as an int. |
java.awt.Color |
getG2dColor()
This method returns the Color of g2d. |
void |
mouseReleaseAction(java.awt.event.MouseEvent mevt,
main_canvas theCanvas)
Depending on where the user releases the mouse, this method stores the position or location of the brush. |
void |
setBrushType(int type)
This method sets the brushtype as specified by the int, type, that is passed in. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final int DOT1
public final int DOT2
public final int DOT3
public final int SQUARE1
public final int SQUARE2
public final int SQUARE3
public final int RIGHT1
public final int RIGHT2
public final int RIGHT3
public final int LEFT1
public final int LEFT2
public final int LEFT3
java.awt.image.BufferedImage brushImage
public int brushType
java.awt.Graphics2D g2D
private int prevX
private int prevY
Constructor Detail |
---|
public brushTool()
Method Detail |
---|
public void clickAction(java.awt.event.MouseEvent mevt, main_canvas theCanvas)
clickAction
in interface ourTool
mevt
- This is a MouseEvent variable.theCanvas
- this is a main_canvas variablepublic void dragAction(java.awt.event.MouseEvent mevt, main_canvas theCanvas)
dragAction
in interface ourTool
mevt
- This is a MouseEvent variable.theCanvas
- this is a main_canvas variablepublic void mouseReleaseAction(java.awt.event.MouseEvent mevt, main_canvas theCanvas)
mouseReleaseAction
in interface ourTool
mevt
- This is a MouseEvent variable.theCanvas
- this is a main_canvas variablepublic void drawStuff(java.awt.event.MouseEvent mevt, int x, int y, main_canvas theCanvas)
mevt
- This is a MouseEvent variable.theCanvas
- this is a main_canvas variablex
- this is a int variabley
- this is a int variablepublic void setBrushType(int type)
type
- This is a int variable that represents the brush type.getBrushType()
public int getBrushType()
setBrushType(int)
public java.awt.Shape drawBrush(int x, int y)
x
- This is a int variable.y
- this is a int variable.
public java.awt.Color getG2dColor()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |