|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecttabs.ScribbleUtility
public class ScribbleUtility
Instances of this class can be used to make line drawings onto the drawing area
| Constructor Summary | |
|---|---|
ScribbleUtility(int resizedImageWidth,
int resizedImageHeight)
Creates a new instance of this class given the project's width and height of the drawing area |
|
| Method Summary | |
|---|---|
void |
clear()
Clear the scribble's image |
void |
dispose()
|
void |
drawCurrentLayer(java.awt.Graphics2D g2d)
Draw this scribble image using the given graphics context |
protected java.awt.Color |
getcurrentColor()
Returns the scribble's current drawing color |
java.lang.Object |
getCurrentState()
Returns a copy of the scribble's current image |
java.awt.image.BufferedImage |
getLayerImage()
Returns the scribble's current image |
void |
mouseDragged(java.awt.event.MouseEvent evt)
Notify the scribble that the mouse is dragged; results in drawing a line in the scibble's current layer |
void |
mousePressed(java.awt.event.MouseEvent e)
Notify the scribble that the mouse was pressed; results in creating a new empty layer ready to be drawn with mouseDragged method |
void |
mouseReleased(java.awt.event.MouseEvent e)
Notify the scribble that the mouse was released; results in closing the current layer and add it to the scribble's final image |
void |
setAlphaOpacity(java.awt.AlphaComposite ac)
Change the scribble's drawing opacity |
protected void |
setCurrentColor(java.awt.Color color)
Change the scribble's drawing color |
void |
setCurrentState(java.lang.Object o)
Set the current scribble's image |
void |
setStroke(java.awt.Stroke stroke)
Change the scribble's drawing stroke |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ScribbleUtility(int resizedImageWidth,
int resizedImageHeight)
resizedImageWidth - width of the project's drawing arearesizedImageHeight - height of the project's drawing area| Method Detail |
|---|
public void clear()
public void drawCurrentLayer(java.awt.Graphics2D g2d)
g2d - the graphics context to use for drawingpublic java.lang.Object getCurrentState()
public java.awt.image.BufferedImage getLayerImage()
public void mousePressed(java.awt.event.MouseEvent e)
e - public void mouseReleased(java.awt.event.MouseEvent e)
e - public void mouseDragged(java.awt.event.MouseEvent evt)
evt - public void setCurrentState(java.lang.Object o)
o - a BuferedImage containing the new scribble's imagepublic void setStroke(java.awt.Stroke stroke)
stroke - the new stroke to be used by the scribblepublic void setAlphaOpacity(java.awt.AlphaComposite ac)
ac - the new opacity to be used by the scribbleprotected void setCurrentColor(java.awt.Color color)
color - the new color to be used by the scribbleprotected java.awt.Color getcurrentColor()
public void dispose()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||