com.rolemodelsoft.drawlet.shapes
Class TopHandle

java.lang.Object
  |
  +--com.rolemodelsoft.drawlet.basics.AbstractInputEventHandler
        |
        +--com.rolemodelsoft.drawlet.basics.CanvasHandle
              |
              +--com.rolemodelsoft.drawlet.basics.SquareCanvasHandle
                    |
                    +--com.rolemodelsoft.drawlet.shapes.BoundsHandle
                          |
                          +--com.rolemodelsoft.drawlet.shapes.TopHandle

public class TopHandle
extends BoundsHandle

This class provides a handle that shows up at the top of a figure and reshapes the figure accordingly as it is dragged.


Fields inherited from class com.rolemodelsoft.drawlet.shapes.BoundsHandle
figure, locator
 
Fields inherited from class com.rolemodelsoft.drawlet.basics.CanvasHandle
canvas, halfWidth, HANDLE_SIZE, previousTool
 
Constructor Summary
TopHandle(Figure figure)
          Constructs and initializes a new instance of a handle which can affect the figure's bounds by changing its top.
 
Method Summary
protected  Locator defaultLocator(Figure figure)
          Answer the default/initial locator.
 void mouseDragged(java.awt.event.MouseEvent evt)
          Called if the mouse is dragged (the mouse button is down).
 
Methods inherited from class com.rolemodelsoft.drawlet.shapes.BoundsHandle
centerX, centerY, getFigure, reshape, resize, setFigure
 
Methods inherited from class com.rolemodelsoft.drawlet.basics.SquareCanvasHandle
getBounds, paint
 
Methods inherited from class com.rolemodelsoft.drawlet.basics.CanvasHandle
contains, defaultHandleSize, finished, getHandleHeight, getHandleSize, getHandleWidth, getX, getY, intersects, mouseReleased, releaseControl, setHandleSize, takeControl
 
Methods inherited from class com.rolemodelsoft.drawlet.basics.AbstractInputEventHandler
keyPressed, keyReleased, keyTyped, mouseClicked, mouseDoubleClicked, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseSingleClicked
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TopHandle

public TopHandle(Figure figure)
Constructs and initializes a new instance of a handle which can affect the figure's bounds by changing its top.
Parameters:
figure - the figure whose bounds we may wish to change.
Method Detail

defaultLocator

protected Locator defaultLocator(Figure figure)
Answer the default/initial locator.
Overrides:
defaultLocator in class BoundsHandle
Parameters:
figure - the figure
Returns:
the default/initial Locator

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent evt)
Called if the mouse is dragged (the mouse button is down). Reshape the figure as appropriate.
Overrides:
mouseDragged in class BoundsHandle
Parameters:
evt - the event