Class bucketTool

java.lang.Object
  extended by bucketTool
All Implemented Interfaces:
ourTool

public class bucketTool
extends java.lang.Object
implements ourTool

This class is for the bucket option which is coloring the canvas with a specific color. The state should be enable. OS is windows. Implementation variances are not allowed. There are no security constraints. There are no external specifications.


Field Summary
(package private)  int imgHeight
          These variable are ints that stores in the width and height.
(package private)  int imgWidth
          These variable are ints that stores in the width and height.
 
Constructor Summary
bucketTool()
          Creates a bucketTool with no parameters.
 
Method Summary
 void clickAction(java.awt.event.MouseEvent mevt, main_canvas theCanvas)
          Controls what the user clicks as specified by the MouseEvent and main_canvas passed in.
 void dragAction(java.awt.event.MouseEvent mevt, main_canvas theCanvas)
          Should allow the user to drag the bucket as specified by the MouseEvent and main_canvas passed in.
 void mouseReleaseAction(java.awt.event.MouseEvent mevt, main_canvas theCanvas)
          Should allow the user to release the mouse on the bucket as specified by the MouseEvent and main_canvas passed in.
 void pour(java.awt.image.BufferedImage theImage, int boundRGB, int newRGBValue, int x, int y)
          Pours the paint onto the canvas as specified by the BufferedImage, and size passed in.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

imgWidth

int imgWidth
These variable are ints that stores in the width and height.


imgHeight

int imgHeight
These variable are ints that stores in the width and height.

Constructor Detail

bucketTool

public bucketTool()
Creates a bucketTool with no parameters. There are no null values. There are no return values. The constructor initialize the variable. OS is windows. Implementation variances are not allowed. There are no exception. There are no security constraints.

Method Detail

clickAction

public void clickAction(java.awt.event.MouseEvent mevt,
                        main_canvas theCanvas)
Controls what the user clicks as specified by the MouseEvent and main_canvas passed in. If the user clicks on the left button, the left color on the pallete will be used to color with. Otherwise, if the user clicks on the right button, the right color on the pallete will be used. The state transition depends on the user. The arguments are MouseEvent and main_canvas. There are no return values. The method controls the click action of the user. OS is windows. Implementation variances is not allowed. There is no exception. There is no security constraints.

Specified by:
clickAction in interface ourTool
Parameters:
mevt - this is a MouseEvent
theCanvas - this is a main_canvas variable

dragAction

public void dragAction(java.awt.event.MouseEvent mevt,
                       main_canvas theCanvas)
Should allow the user to drag the bucket as specified by the MouseEvent and main_canvas passed in. However, since it is the bucketTool, dragging is unnecessary. The function was created because it implements OurTool. The state transition depends on the user. The arguments are MouseEvent and main_canvas. There are no return values. The method controls the click action of the user. OS is windows. Implementation variances is not allowed. There is no exception. There is no security constraints.

Specified by:
dragAction in interface ourTool
Parameters:
mevt - this is a MouseEvent
theCanvas - this is a main_canvas variable

mouseReleaseAction

public void mouseReleaseAction(java.awt.event.MouseEvent mevt,
                               main_canvas theCanvas)
Should allow the user to release the mouse on the bucket as specified by the MouseEvent and main_canvas passed in. However, since it is the bucketTool, releasing the mouse is unnecessary. The function was created because it implements OurTool. The state transition depends on the user. The arguments are MouseEvent and main_canvas. There are no return values. The method controls the click action of the user. OS is windows. Implementation variances is not allowed. There is no exception. There is no security constraints.

Specified by:
mouseReleaseAction in interface ourTool
Parameters:
mevt - this is a MouseEvent
theCanvas - this is a main_canvas variable

pour

public void pour(java.awt.image.BufferedImage theImage,
                 int boundRGB,
                 int newRGBValue,
                 int x,
                 int y)
Pours the paint onto the canvas as specified by the BufferedImage, and size passed in. The state transition depends on the user. The arguments are MouseEvent and main_canvas. There are no return values. OS is windows. Implementation variances is not allowed. There is no exception. There is no security constraints.

Parameters:
theImage - BufferedImage
boundRGB - int
newRGBValue - int
x - int reflecting width
y - int reflecting height