org.jhotdraw.draw
Class ImageTool
java.lang.Object
org.jhotdraw.beans.AbstractBean
org.jhotdraw.draw.AbstractTool
org.jhotdraw.draw.CreationTool
org.jhotdraw.draw.ImageTool
- All Implemented Interfaces:
- java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, Tool
public class ImageTool
- extends CreationTool
A tool to create new figures that implement the ImageHolderFigure
interface, such as ImageFigure. The figure to be created is specified by a
prototype.
To create a figure using the ImageTool, the user does the following mouse
gestures on a DrawingView:
- Press the mouse button over the DrawingView. This defines the
upper left point of the Figure bounds.
When the user has performed this mouse gestures, the ImageTool opens a
JFileChooser where the user can specify an image file to be loaded into the
figure. The width and height of the image is used to determine the lower right
corner of the Figure.
- Version:
- 1.0 December 14, 2006 Created.
- Author:
- Werner Randelshofer
- See Also:
- Serialized Form
Method Summary |
void |
creationFinished(Figure createdFigure)
This method allows subclasses to do perform additonal user interactions
after the new figure has been created. |
Methods inherited from class org.jhotdraw.draw.CreationTool |
activate, createFigure, deactivate, getAddedFigure, getCreatedFigure, getPrototype, isToolDoneAfterCreation, mouseDragged, mousePressed, mouseReleased, setToolDoneAfterCreation |
Methods inherited from class org.jhotdraw.draw.AbstractTool |
addToolListener, addUndoableEditListener, constrainPoint, constrainPoint, createActionMap, createInputMap, draw, editCopy, editCut, editDelete, editDuplicate, editPaste, fireAreaInvalidated, fireAreaInvalidated, fireToolDone, fireToolStarted, getActionMap, getDrawing, getEditor, getInputMap, getView, isActive, keyPressed, keyReleased, keyTyped, mouseClicked, mouseEntered, mouseExited, mouseMoved, removeToolListener, removeUndoableEditListener, setActionMap, setInputMap, updateCursor, viewToDrawing |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ImageTool
public ImageTool(ImageHolderFigure prototype)
- Creates a new instance.
ImageTool
public ImageTool(ImageHolderFigure prototype,
java.util.Map attributes)
- Creates a new instance.
creationFinished
public void creationFinished(Figure createdFigure)
- Description copied from class:
CreationTool
- This method allows subclasses to do perform additonal user interactions
after the new figure has been created.
The implementation of this class just invokes fireToolDone.
- Overrides:
creationFinished
in class CreationTool