Drawable, Interactive, Measurablepublic class Protractor extends InteractiveCircle implements Drawable
| Modifier and Type | Class | Description |
|---|---|---|
class |
Protractor.Tip |
InteractiveCircle.InteractiveCircleLoader| Modifier and Type | Field | Description |
|---|---|---|
protected double |
arrowTheta |
|
protected java.text.DecimalFormat |
f |
|
protected double |
orientation |
|
protected boolean |
showTheta |
|
protected InteractiveLabel |
tauBox |
|
protected Protractor.Tip |
tip |
| Constructor | Description |
|---|---|
Protractor() |
Constructs a protractor with a default radius of 40 pixels.
|
Protractor(int protractorRadius) |
Constructs a protractor with the given pixel size.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
draw(DrawingPanel panel,
java.awt.Graphics g) |
Draws the protractor on the given drawing panel.
|
Interactive |
findInteractive(DrawingPanel panel,
int xpix,
int ypix) |
|
double |
getOrientation() |
Gets the orientation of the protractor.
|
double |
getTheta() |
Gets the angle of the arrow on the protractor.
|
boolean |
isShowTheta() |
Gets the show theta property.
|
void |
setOrientation(double angle) |
Sets the orientation of the protractor.
|
void |
setShowTheta(boolean show) |
Shows theta when the protractor is drawn when true.
|
void |
setTheta(double angle) |
Sets the angle of the arrow on the protractor.
|
getX, getY, setX, setXY, setY, toStringgetX, getY, setX, setXY, setYgetLoader, isEnabled, isInside, setEnabledgetXMax, getXMin, getYMax, getYMin, isMeasuredgetXMax, getXMin, getYMax, getYMin, isMeasured, setMeasuredprotected Protractor.Tip tip
protected double arrowTheta
protected double orientation
protected java.text.DecimalFormat f
protected boolean showTheta
protected InteractiveLabel tauBox
public Protractor(int protractorRadius)
protractorRadius - intpublic Protractor()
public void setTheta(double angle)
theta - doublepublic double getTheta()
public void setOrientation(double angle)
angle - doublepublic double getOrientation()
public void setShowTheta(boolean show)
show - booleanpublic boolean isShowTheta()
public Interactive findInteractive(DrawingPanel panel, int xpix, int ypix)
findInteractive in interface InteractivefindInteractive in class InteractiveCirclepublic void draw(DrawingPanel panel, java.awt.Graphics g)