public class ImageTool extends CreationTool
Immediately, after the ImageTool has been activated, it opens a JFileChooser, letting the user specify an image file. The the user then performs the following mouse gesture:
Prototype
The ImageTool creates new figures by cloning a prototype
ImageHolderFigure object.
Prototype: ImageHolderFigure; Client: ImageTool.
| Modifier and Type | Field and Description |
|---|---|
protected javax.swing.JFileChooser |
fileChooser |
protected java.awt.FileDialog |
fileDialog |
protected boolean |
useFileDialog |
protected java.lang.Thread |
workerThread |
createdFigure, minimalSize, minimalSizeTreshold, presentationName, prototype, prototypeAttributesanchor, editor, isWorking, listenerListpropertySupport| Constructor and Description |
|---|
ImageTool(ImageHolderFigure prototype)
Creates a new instance.
|
ImageTool(ImageHolderFigure prototype,
java.util.Map<AttributeKey,java.lang.Object> attributes)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
activate(DrawingEditor editor)
Activates the tool for the given editor.
|
boolean |
isUseFileDialog() |
void |
setUseFileDialog(boolean newValue) |
createFigure, creationFinished, deactivate, getAddedFigure, getCreatedFigure, getPrototype, isToolDoneAfterCreation, mouseDragged, mousePressed, mouseReleased, setToolDoneAfterCreation, updateCursoraddToolListener, addUndoableEditListener, constrainPoint, constrainPoint, createActionMap, createInputMap, draw, editCopy, editCut, editDelete, editDuplicate, editPaste, fireAreaInvalidated, fireAreaInvalidated, fireBoundsInvalidated, fireToolDone, fireToolStarted, getActionMap, getDrawing, getEditor, getInputMap, getToolTipText, getView, isActive, keyPressed, keyReleased, keyTyped, maybeFireBoundsInvalidated, mouseClicked, mouseEntered, mouseExited, mouseMoved, removeToolListener, removeUndoableEditListener, setActionMap, setInputMap, supportsHandleInteraction, viewToDrawingaddPropertyChangeListener, addPropertyChangeListener, clone, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListenerprotected java.awt.FileDialog fileDialog
protected javax.swing.JFileChooser fileChooser
protected boolean useFileDialog
protected java.lang.Thread workerThread
public ImageTool(ImageHolderFigure prototype)
public ImageTool(ImageHolderFigure prototype, java.util.Map<AttributeKey,java.lang.Object> attributes)
public void setUseFileDialog(boolean newValue)
public boolean isUseFileDialog()
public void activate(DrawingEditor editor)
Toolactivate in interface Toolactivate in class CreationTool