net.java.swingfx.rubberband.rubberbands
Interface RubberBand

All Known Implementing Classes:
AbstractRubberBand, AnimatedRectangularRubberBand, OvalRubberBand, RectangularRubberBand

public interface RubberBand

Defines the required functionality for creating a rubber band

Since:
1.0 $Revision: 1.1 $
Author:
rwickesser

Method Summary
 void addMouseListeners()
          Enforces that the mouse listeners are added to the canvas
 void draw(Graphics g)
          Draws the rubber band on the given Graphics object
 Rectangle getBounds()
          Returns an integer Rectangle which contains the size and location of this rubber band
 void setCanvas(RubberBandCanvas canvas)
          Sets the canvas which the rubber band will be drawn onto
 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
 

Method Detail

addMouseListeners

void addMouseListeners()
Enforces that the mouse listeners are added to the canvas


draw

void draw(Graphics g)
Draws the rubber band on the given Graphics object

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

getBounds

Rectangle getBounds()
Returns an integer Rectangle which contains the size and location of this rubber band

Returns:
an integer Rectangle which contains the size and location of this rubber band

setCanvas

void setCanvas(RubberBandCanvas canvas)
Sets the canvas which the rubber band will be drawn onto

Parameters:
canvas - the canvas which the rubber band will be drawn onto

update

void update(int x,
            int y,
            int width,
            int height)
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

startRubberBand

void startRubberBand(EventObject event)
Called when the rubber band is first created, typically on a mouse pressed event

Parameters:
event - the event that started the rubber band

stopRubberBand

void stopRubberBand(EventObject event)
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

void updateRubberBand(EventObject event)
Called when the rubber band is being updated, typically on a mouse dragged event

Parameters:
event - the event that started the rubber band