public abstract class Rubberband extends Object
| Modifier and Type | Field and Description |
|---|---|
protected Point |
anchorPt |
protected Component |
component |
protected Point |
endPt |
protected boolean |
firstStretch |
protected Point |
lastPt |
protected Point |
stretchedPt |
| Constructor and Description |
|---|
Rubberband(Component c,
boolean listen)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
anchor(Point p)
Set the anchor point.
|
void |
done()
Last point, done with drawing.
|
abstract void |
drawLast(Graphics2D g) |
abstract void |
drawNext(Graphics2D g) |
void |
end(Point p)
Last point, done with drawing.
|
Point |
getAnchor() |
Rectangle |
getBounds()
Get current Bounds
|
Point |
getEnd() |
Point |
getLast() |
Point |
getStretched() |
boolean |
isActive() |
Rectangle |
lastBounds()
Get previous Bounds
|
void |
setActive(boolean b)
Set whether its in active mode.
|
void |
stretch(Point p)
Erase the last rectangle and draw a new one from the anchor point to this point.
|
protected Point anchorPt
protected Point stretchedPt
protected Point lastPt
protected Point endPt
protected Component component
protected boolean firstStretch
public Rubberband(Component c, boolean listen)
c - draw on top of this Component.public abstract void drawLast(Graphics2D g)
public abstract void drawNext(Graphics2D g)
public void setActive(boolean b)
b - true if in active mode.public boolean isActive()
public Point getAnchor()
public Point getStretched()
public Point getLast()
public Point getEnd()
public boolean anchor(Point p)
public void stretch(Point p)
public void end(Point p)
public void done()
public Rectangle getBounds()
public Rectangle lastBounds()
Copyright © 1999-2012 UCAR/Unidata. All Rights Reserved.