net.tmachine.gpg.hue
Class ShapeCreator

java.lang.Object
  extended bynet.tmachine.gpg.hue.BaseHUD
      extended bynet.tmachine.gpg.hue.ShapeCreator
All Implemented Interfaces:
java.util.EventListener, HUD, java.awt.event.MouseListener, java.awt.event.MouseMotionListener

public class ShapeCreator
extends BaseHUD

A simple HUD that, when active, draws a crosshair and responds to drag / click+move events by drawing a new Rectangle, and when the mouse is released it creates a new rectangle of that size + position and adds it to the base document


Field Summary
protected  boolean creatingShape
          indicates that we are in the middle of a drag action that is creating a shape
protected  int sx
          co-ords where the current create-shape gesture was started
protected  int sy
          co-ords where the current create-shape gesture was started
 
Fields inherited from class net.tmachine.gpg.hue.BaseHUD
isActive, isVisible, manager, name
 
Constructor Summary
ShapeCreator()
           
 
Method Summary
 void mousePressed(java.awt.event.MouseEvent e)
           
 void mouseReleased(java.awt.event.MouseEvent e)
           
 void paint(java.awt.Graphics g)
          If this HUD is visible, it will be asked to paint to the supplied display surface during repaints
 
Methods inherited from class net.tmachine.gpg.hue.BaseHUD
getName, isActive, isActive, isVisible, isVisible, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, setManager, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sx

protected int sx
co-ords where the current create-shape gesture was started


sy

protected int sy
co-ords where the current create-shape gesture was started


creatingShape

protected boolean creatingShape
indicates that we are in the middle of a drag action that is creating a shape

Constructor Detail

ShapeCreator

public ShapeCreator()
Method Detail

paint

public void paint(java.awt.Graphics g)
Description copied from interface: HUD
If this HUD is visible, it will be asked to paint to the supplied display surface during repaints

Parameters:
g -

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Specified by:
mousePressed in interface java.awt.event.MouseListener
Overrides:
mousePressed in class BaseHUD

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Specified by:
mouseReleased in interface java.awt.event.MouseListener
Overrides:
mouseReleased in class BaseHUD