Class medicineTool

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

public class medicineTool
extends java.lang.Object
implements ourTool

The medicineTool class handles the image with the mouse events and color. The class medicineTool includes methods for clicking, dragging, and releasing the mouse, and for obtaining the color of the image. There are no OS/Hardware dependencies and no variances. There is no need for any security constraints and no references to external specifications.


Field Summary
(package private)  java.awt.Color myColor
          The Color object that represents the image with the specified color.
 
Constructor Summary
medicineTool()
          Creates a medinceTool object.
 
Method Summary
 void clickAction(java.awt.event.MouseEvent mevt, main_canvas theCanvas)
          Presents the mouse event when a mouse button is pressed on a component without moving the mouse cursor.
 void dragAction(java.awt.event.MouseEvent mevt, main_canvas theCanvas)
          Allows the user to drag the mouse, using the medicineTool.
 java.awt.Color getMyColor()
          Returns the Color of medicineTool.
 void mouseReleaseAction(java.awt.event.MouseEvent mevt, main_canvas theCanvas)
          Allows the user to release the mouse, using the medicineTool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myColor

java.awt.Color myColor
The Color object that represents the image with the specified color.

Constructor Detail

medicineTool

public medicineTool()
Creates a medinceTool object. There are no OS/Hardware dependencies and no variances. There is no need for any security constraints and no references to external specifications.

Method Detail

clickAction

public void clickAction(java.awt.event.MouseEvent mevt,
                        main_canvas theCanvas)
Presents the mouse event when a mouse button is pressed on a component without moving the mouse cursor. There are no OS/Hardware dependencies and no variances. There is no need for any security constraints and no references to external specifications.

Specified by:
clickAction in interface ourTool
Parameters:
mevt - contains information about the mouse event with x-coordinates and y-coordinates.
theCanvas - contains contents of the bufferedImage with its x-coordinate and y-coordinate.

dragAction

public void dragAction(java.awt.event.MouseEvent mevt,
                       main_canvas theCanvas)
Allows the user to drag the mouse, using the medicineTool. This method was not implemented because it is unnecessary for a medicineTool to be dragged. However, it was created because medicineTool implements OurTool. There are no OS/Hardware dependencies and no variances. There is no need for any security constraints and no references to external specifications.

Specified by:
dragAction in interface ourTool
Parameters:
mevt - contains information about the mouse event.
theCanvas - contains contents of the main canvas image.

mouseReleaseAction

public void mouseReleaseAction(java.awt.event.MouseEvent mevt,
                               main_canvas theCanvas)
Allows the user to release the mouse, using the medicineTool. This method was not implemented because it is unnecessary for a medicineTool to be released, since it is only needed to be clicked once. However, it was created because medicineTool implements OurTool. There are no OS/Hardware dependencies and no variances. There is no need for any security constraints and no references to external specifications.

Specified by:
mouseReleaseAction in interface ourTool
Parameters:
mevt - contains information of the mouse events.
theCanvas - provides contents of the main canvas image.

getMyColor

public java.awt.Color getMyColor()
Returns the Color of medicineTool. There are no OS/Hardware dependencies and no variances. There is no need for any security constraints and no references to external specifications.

Returns:
the color field.