|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectselectallTool
public class selectallTool
The class selectallTool uses the ourTool interface. It selects a rectangular region. See also selectTool It should work with all operating systems and hardware. There are no variances and no security constraints.
Field Summary | |
---|---|
java.lang.String |
action_name
Action name. |
(package private) java.awt.image.BufferedImage |
backupImage
Holds the current, backup, selected and pasted image. |
(package private) java.awt.image.BufferedImage |
curImage
Holds the current, backup, selected and pasted image. |
private boolean |
dragged
Used as a flag to determine if the mouse was dragged. |
boolean |
drawOpaque
Flag used to determine if drawOpaque is on or not. |
private int |
endX
Holds the starting X,Y and ending X,Y. |
private int |
endY
Holds the starting X,Y and ending X,Y. |
private int |
fillType
1 = border left_color, 2 = fill with right_color, 3 = solid left_color. |
private java.awt.Graphics2D |
g2D
Holds a Graphics2D. |
private java.awt.Graphics2D |
g2D_temp
Holds a Graphics2D. |
private boolean |
moved
Flag to determine is it has moved. |
private boolean |
moving
Flag to determine if it is moving. |
int |
onCanvasFlag
Determines if it is on the canvas. |
private boolean |
pasted
Flag to determine is it has been pasted. |
(package private) java.awt.image.BufferedImage |
pastedImage
Holds the current, backup, selected and pasted image. |
private int |
pasteX
x coord of where to be pasted. |
private int |
pasteY
y of where to be pasted. |
private boolean |
selected
Flag to determine is it has been selected. |
(package private) java.awt.image.BufferedImage |
selectedImage
Holds the current, backup, selected and pasted image. |
private java.awt.BasicStroke |
selectStroke
Holds the stroke that is selected. |
private java.awt.BasicStroke |
selectStrokeW
Holds the stroke that is selected for the white part. |
private int |
startX
Holds the starting X,Y and ending X,Y. |
private int |
startY
Holds the starting X,Y and ending X,Y. |
(package private) java.awt.image.BufferedImage |
tempImage
Holds the temp image. |
Constructor Summary | |
---|---|
selectallTool()
Creates a selectallTool and sets the Stroke. |
Method Summary | |
---|---|
void |
clear(main_canvas theCanvas)
clears the selected portion of image. |
void |
clickAction(java.awt.event.MouseEvent mevt,
main_canvas theCanvas)
Allows the user to click on the canvas and select all of the image. |
void |
deSelect(main_canvas theCanvas)
Resets canvas to backup image and resets all data members and flags to original values. |
void |
dragAction(java.awt.event.MouseEvent mevt,
main_canvas theCanvas)
Selects a rectangle according to movement of mouse, as specified by the coordinates of MouseEvent. |
java.awt.image.BufferedImage |
getCopyImage(main_canvas theCanvas)
Returns the selected rectangle. |
java.awt.image.BufferedImage |
getCutImage(main_canvas theCanvas)
Copies selected image to be cut, and removes. |
boolean |
getDragged()
This function returns the current state of the flag dragged. |
java.awt.Color |
getG2dColor()
This function returns the Color of the g2d. |
boolean |
getOpaque()
This function returns true if it is set to opaque, false otherwise. |
boolean |
getPasted()
This function returns the current state of the flag pasted. |
boolean |
getSelected()
This function returns the current state of the flag selected. |
int |
getStartX()
This function returns the current X-position of subimage selected. |
int |
getStartY()
This function returns the current Y-position of subimage selected. |
boolean |
isSelected()
This function the state of anything being selected. |
void |
mouseReleaseAction(java.awt.event.MouseEvent mevt,
main_canvas theCanvas)
Allows the user to release the mouse and stop selecting. |
void |
myDrawImage(java.awt.Color rightColor)
Pastes image into selected area but does not update canvas -- see setPastedImage. |
void |
selectAll(main_canvas theCanvas)
Allows the user to select the entire main_canvas. |
void |
setOpaque(boolean value)
sets the opaque flag. |
void |
setPastedImage(java.awt.image.BufferedImage theImage,
main_canvas theCanvas,
int x,
int y)
updates canvas with pasted image. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private int startX
private int startY
private int endX
private int endY
private boolean dragged
private boolean moved
private int fillType
java.awt.image.BufferedImage curImage
java.awt.image.BufferedImage backupImage
java.awt.image.BufferedImage selectedImage
java.awt.image.BufferedImage pastedImage
java.awt.image.BufferedImage tempImage
private java.awt.Graphics2D g2D
private java.awt.Graphics2D g2D_temp
private boolean selected
private boolean pasted
private boolean moving
private java.awt.BasicStroke selectStroke
private java.awt.BasicStroke selectStrokeW
private int pasteX
private int pasteY
public boolean drawOpaque
public int onCanvasFlag
public java.lang.String action_name
Constructor Detail |
---|
public selectallTool()
Method Detail |
---|
public void clickAction(java.awt.event.MouseEvent mevt, main_canvas theCanvas)
clickAction
in interface ourTool
mevt
- MosueEvent upon initial clicktheCanvas
- current main_canvaspublic void dragAction(java.awt.event.MouseEvent mevt, main_canvas theCanvas)
dragAction
in interface ourTool
mevt
- MosueEvent dragging mousetheCanvas
- the current main_canvaspublic void mouseReleaseAction(java.awt.event.MouseEvent mevt, main_canvas theCanvas)
mouseReleaseAction
in interface ourTool
mevt
- MouseEvent release of clicktheCanvas
- the current main_canvaspublic void selectAll(main_canvas theCanvas)
theCanvas
- main_canvas objectpublic java.awt.image.BufferedImage getCopyImage(main_canvas theCanvas)
theCanvas
- the current main_canvas
public void myDrawImage(java.awt.Color rightColor)
rightColor
- Color of right-clickpublic java.awt.image.BufferedImage getCutImage(main_canvas theCanvas)
theCanvas
- the current main_canvas
public void setPastedImage(java.awt.image.BufferedImage theImage, main_canvas theCanvas, int x, int y)
theImage
- BufferedImage to be pastedtheCanvas
- the current main_canvasx
- an int representing the x coordinatey
- an int representing the y coordinatepublic boolean getPasted()
public void deSelect(main_canvas theCanvas)
theCanvas
- main_canvaspublic boolean getSelected()
public int getStartX()
public int getStartY()
public void setOpaque(boolean value)
value
- boolean opaqueness passed ingetOpaque()
public boolean getOpaque()
setOpaque(boolean)
public void clear(main_canvas theCanvas)
theCanvas
- the current main_canvaspublic java.awt.Color getG2dColor()
public boolean getDragged()
public boolean isSelected()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |