All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class gjt.rubberband.Rubberband

java.lang.Object
   |
   +----gjt.rubberband.Rubberband

public abstract class Rubberband
extends Object
An abstract base class for rubberbands.

Rubberbands do their rubberbanding inside of a Component, which must be specified at construction time.

Subclasses are responsible for implementing void drawLast(Graphics g) and void drawNext(Graphics g). drawLast() draws the appropriate geometric shape at the last rubberband location, while drawNext() draws the appropriate geometric shape at the next rubberband location. All of the underlying support for rubberbanding is taken care of here, including handling XOR mode setting; extensions of Rubberband need not concern themselves with anything but drawing the last and next geometric shapes. Extensions may get information about where to draw their shape from getAnchor(), getStretched(), and getLast(), and getEnd(), all of which return a Point.

See Also:
RubberbandLine, RubberbandRectangle, RubberbandEllipse, RubberbandTest

Variable Index

 o anchorPt
 o endPt
 o lastPt
 o stretchedPt

Constructor Index

 o Rubberband()
 o Rubberband(Component)

Method Index

 o anchor(Point)
 o drawLast(Graphics)
 o drawNext(Graphics)
 o end(Point)
 o getAnchor()
 o getBounds()
 o getEnd()
 o getLast()
 o getStretched()
 o isActive()
 o lastBounds()
 o setActive(boolean)
 o setComponent(Component)
 o stretch(Point)

Variables

 o anchorPt
 protected Point anchorPt
 o stretchedPt
 protected Point stretchedPt
 o lastPt
 protected Point lastPt
 o endPt
 protected Point endPt

Constructors

 o Rubberband
 public Rubberband()
 o Rubberband
 public Rubberband(Component c)

Methods

 o drawLast
 public abstract void drawLast(Graphics g)
 o drawNext
 public abstract void drawNext(Graphics g)
 o setActive
 public void setActive(boolean b)
 o setComponent
 public void setComponent(Component c)
 o isActive
 public boolean isActive()
 o getAnchor
 public Point getAnchor()
 o getStretched
 public Point getStretched()
 o getLast
 public Point getLast()
 o getEnd
 public Point getEnd()
 o anchor
 public void anchor(Point p)
 o stretch
 public void stretch(Point p)
 o end
 public void end(Point p)
 o getBounds
 public Rectangle getBounds()
 o lastBounds
 public Rectangle lastBounds()

All Packages  Class Hierarchy  This Package  Previous  Next  Index