|
JHotDraw 7.5.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jhotdraw.beans.AbstractBean
org.jhotdraw.draw.tool.AbstractTool
org.jhotdraw.draw.tool.CreationTool
org.jhotdraw.draw.tool.TextCreationTool
public class TextCreationTool
A tool to create figures which implement the TextHolderFigure
interface, such as TextFigure
. The figure to be created is specified
by a prototype.
To create a figure using this tool, the user does the following mouse gestures on a DrawingView:
Framework
The text creation and editing tools and the TextHolderFigure
interface define together the contracts of a smaller framework inside of the
JHotDraw framework for structured drawing editors.
Contract: TextHolderFigure
, TextCreationTool
,
TextAreaCreationTool
, TextEditingTool
,
TextAreaEditingTool
, FloatingTextField
,
FloatingTextArea
.
Prototype
The text creation tools create new figures by cloning a prototype
TextHolderFigure
object.
Prototype: TextHolderFigure
; Client: TextCreationTool
,
TextAreaCreationTool
.
Field Summary |
---|
Fields inherited from class org.jhotdraw.draw.tool.CreationTool |
---|
createdFigure, minimalSize, minimalSizeTreshold, presentationName, prototype, prototypeAttributes |
Fields inherited from class org.jhotdraw.draw.tool.AbstractTool |
---|
anchor, editor, isWorking, listenerList |
Fields inherited from class org.jhotdraw.beans.AbstractBean |
---|
propertySupport |
Constructor Summary | |
---|---|
TextCreationTool(TextHolderFigure prototype)
Creates a new instance. |
|
TextCreationTool(TextHolderFigure prototype,
java.util.Map<AttributeKey,java.lang.Object> attributes)
Creates a new instance. |
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent event)
|
protected void |
beginEdit(TextHolderFigure textHolder)
|
protected void |
creationFinished(Figure createdFigure)
This method allows subclasses to do perform additonal user interactions after the new figure has been created. |
void |
deactivate(DrawingEditor editor)
Deactivates the tool. |
protected void |
endEdit()
|
boolean |
isEditing()
|
void |
keyReleased(java.awt.event.KeyEvent evt)
|
void |
mouseDragged(java.awt.event.MouseEvent e)
|
void |
mousePressed(java.awt.event.MouseEvent e)
Creates a new figure at the location where the mouse was pressed. |
void |
mouseReleased(java.awt.event.MouseEvent evt)
|
void |
updateCursor(DrawingView view,
java.awt.Point p)
|
Methods inherited from class org.jhotdraw.draw.tool.CreationTool |
---|
activate, createFigure, getAddedFigure, getCreatedFigure, getPrototype, isToolDoneAfterCreation, setToolDoneAfterCreation |
Methods inherited from class org.jhotdraw.beans.AbstractBean |
---|
addPropertyChangeListener, addPropertyChangeListener, clone, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TextCreationTool(TextHolderFigure prototype)
public TextCreationTool(TextHolderFigure prototype, java.util.Map<AttributeKey,java.lang.Object> attributes)
Method Detail |
---|
public void deactivate(DrawingEditor editor)
Tool
deactivate
in interface Tool
deactivate
in class CreationTool
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
mousePressed
in class CreationTool
public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
mouseDragged
in class CreationTool
protected void beginEdit(TextHolderFigure textHolder)
public void mouseReleased(java.awt.event.MouseEvent evt)
mouseReleased
in interface java.awt.event.MouseListener
mouseReleased
in class CreationTool
protected void endEdit()
public void keyReleased(java.awt.event.KeyEvent evt)
keyReleased
in interface java.awt.event.KeyListener
keyReleased
in class AbstractTool
public void actionPerformed(java.awt.event.ActionEvent event)
actionPerformed
in interface java.awt.event.ActionListener
protected void creationFinished(Figure createdFigure)
CreationTool
creationFinished
in class CreationTool
public boolean isEditing()
public void updateCursor(DrawingView view, java.awt.Point p)
updateCursor
in class CreationTool
|
Copyright 1996-2010 (c) by the authors and contributors of the JHotDraw project. Some rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |