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