JHotDraw 6.0b1

org.jhotdraw.contrib
Class NestedCreationTool

java.lang.Object
  extended by org.jhotdraw.standard.AbstractTool
      extended by org.jhotdraw.standard.CreationTool
          extended by org.jhotdraw.contrib.NestedCreationTool
All Implemented Interfaces:
Tool

public class NestedCreationTool
extends CreationTool


Nested Class Summary
 
Nested classes/interfaces inherited from class org.jhotdraw.standard.AbstractTool
AbstractTool.EventDispatcher
 
Constructor Summary
NestedCreationTool(DrawingEditor newDrawingEditor, Figure prototype)
           
 
Method Summary
 CompositeFigure getContainerFigure()
           
 void mouseDown(java.awt.event.MouseEvent e, int x, int y)
          Creates a new figure by cloning the prototype.
 void mouseMove(java.awt.event.MouseEvent e, int x, int y)
          Handles mouse moves (if the mouse button is up).
 void mouseUp(java.awt.event.MouseEvent e, int x, int y)
          Checks if the created figure is empty.
protected  void setContainerFigure(CompositeFigure newContainerFigure)
           
protected  void toolDone()
           
 
Methods inherited from class org.jhotdraw.standard.CreationTool
activate, createFigure, createUndoActivity, deactivate, getAddedFigure, getAddedFigures, getCreatedFigure, getPrototypeFigure, mouseDrag, setAddedFigure, setAddedFigures, setCreatedFigure, setPrototypeFigure
 
Methods inherited from class org.jhotdraw.standard.AbstractTool
addToolListener, checkUsable, createEventDispatcher, createViewChangeListener, drawing, editor, getActiveDrawing, getActiveView, getAnchorX, getAnchorY, getEventDispatcher, getUndoActivity, isActive, isEnabled, isUsable, keyDown, removeToolListener, setAnchorX, setAnchorY, setEditor, setEnabled, setUndoActivity, setUsable, setView, view, viewCreated, viewDestroying, viewSelectionChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NestedCreationTool

public NestedCreationTool(DrawingEditor newDrawingEditor,
                          Figure prototype)
Method Detail

mouseDown

public void mouseDown(java.awt.event.MouseEvent e,
                      int x,
                      int y)
Description copied from class: CreationTool
Creates a new figure by cloning the prototype.

Specified by:
mouseDown in interface Tool
Overrides:
mouseDown in class CreationTool

mouseMove

public void mouseMove(java.awt.event.MouseEvent e,
                      int x,
                      int y)
Description copied from class: AbstractTool
Handles mouse moves (if the mouse button is up).

Specified by:
mouseMove in interface Tool
Overrides:
mouseMove in class AbstractTool

mouseUp

public void mouseUp(java.awt.event.MouseEvent e,
                    int x,
                    int y)
Description copied from class: CreationTool
Checks if the created figure is empty. If it is, the figure is removed from the drawing.

Specified by:
mouseUp in interface Tool
Overrides:
mouseUp in class CreationTool
See Also:
Figure.isEmpty()

setContainerFigure

protected void setContainerFigure(CompositeFigure newContainerFigure)

getContainerFigure

public CompositeFigure getContainerFigure()

toolDone

protected void toolDone()

JHotDraw 6.0b1