net.java.swingfx.rubberband.rubberbands
Class RectangularRubberBand

java.lang.Object
  extended by javax.swing.event.MouseInputAdapter
      extended by net.java.swingfx.rubberband.rubberbands.AbstractRubberBand
          extended by net.java.swingfx.rubberband.rubberbands.RectangularRubberBand
All Implemented Interfaces:
MouseListener, MouseMotionListener, EventListener, MouseInputListener, RubberBand
Direct Known Subclasses:
AnimatedRectangularRubberBand, OvalRubberBand

public class RectangularRubberBand
extends AbstractRubberBand

A RubberBand which is rectangular

Since:
1.0 $Revision: 1.1 $
Author:
rwickesser

Field Summary
 
Fields inherited from class net.java.swingfx.rubberband.rubberbands.AbstractRubberBand
canvas, rubberband
 
Constructor Summary
RectangularRubberBand(RubberBandCanvas canvas)
          Creates a new rubber band which is rectangular
 
Method Summary
 void draw(Graphics g)
          Draws the rubber band on the given Graphics object
 void startRubberBand(EventObject event)
          Called when the rubber band is first created, typically on a mouse pressed event
 void stopRubberBand(EventObject event)
          Called when the rubber band is done being created, typically on a mouse released event
 void update(int x, int y, int width, int height)
          Updates the parameters of the rubber band
 void updateRubberBand(EventObject event)
          Called when the rubber band is being updated, typically on a mouse dragged event
 
Methods inherited from class net.java.swingfx.rubberband.rubberbands.AbstractRubberBand
addMouseListeners, getBounds, isHideOnRelease, mouseDragged, mousePressed, mouseReleased, setCanvas, setHideOnRelease
 
Methods inherited from class javax.swing.event.MouseInputAdapter
mouseClicked, mouseEntered, mouseExited, mouseMoved
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RectangularRubberBand

public RectangularRubberBand(RubberBandCanvas canvas)
Creates a new rubber band which is rectangular

Parameters:
canvas - the canvas to draw the rubber band on
Method Detail

update

public void update(int x,
                   int y,
                   int width,
                   int height)
Description copied from interface: RubberBand
Updates the parameters of the rubber band

Parameters:
x - the x coordinate
y - the y coordinate
width - the width of the rubber band
height - the height of the rubber band

draw

public void draw(Graphics g)
Description copied from interface: RubberBand
Draws the rubber band on the given Graphics object

Parameters:
g - the Graphics object to draw the rubber band on

startRubberBand

public void startRubberBand(EventObject event)
Description copied from interface: RubberBand
Called when the rubber band is first created, typically on a mouse pressed event

Parameters:
event - the event that started the rubber band

stopRubberBand

public void stopRubberBand(EventObject event)
Description copied from interface: RubberBand
Called when the rubber band is done being created, typically on a mouse released event

Parameters:
event - the event that stopped the rubber band

updateRubberBand

public void updateRubberBand(EventObject event)
Description copied from interface: RubberBand
Called when the rubber band is being updated, typically on a mouse dragged event

Parameters:
event - the event that started the rubber band