|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.opensourcephysics.display.Circle org.opensourcephysics.display.MeasuredCircle org.opensourcephysics.display.InteractiveCircle org.opensourcephysics.display.Protractor
public class Protractor
A Protractor with an arrow that can be used to measure angles.
Nested Class Summary | |
---|---|
class |
Protractor.Tip
|
Nested classes/interfaces inherited from class org.opensourcephysics.display.InteractiveCircle |
---|
InteractiveCircle.InteractiveCircleLoader |
Field Summary | |
---|---|
protected double |
arrowTheta
|
protected java.text.DecimalFormat |
f
|
protected double |
orientation
|
protected boolean |
showTheta
|
protected InteractiveLabel |
tauBox
|
protected Protractor.Tip |
tip
|
Fields inherited from class org.opensourcephysics.display.Circle |
---|
color, pixRadius, x, y |
Constructor Summary | |
---|---|
Protractor()
Constructs a protractor with a default radius of 40 pixels. |
|
Protractor(int protractorRadius)
Constructs a protractor with the given pixel size. |
Method Summary | |
---|---|
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. |
Methods inherited from class org.opensourcephysics.display.InteractiveCircle |
---|
getLoader, isEnabled, isInside, setEnabled |
Methods inherited from class org.opensourcephysics.display.MeasuredCircle |
---|
getXMax, getXMin, getYMax, getYMin, isMeasured, setMeasured |
Methods inherited from class org.opensourcephysics.display.Circle |
---|
getX, getY, setX, setXY, setY, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.opensourcephysics.display.Interactive |
---|
getX, getY, setX, setXY, setY |
Methods inherited from interface org.opensourcephysics.display.Measurable |
---|
getXMax, getXMin, getYMax, getYMin, isMeasured |
Field Detail |
---|
protected Protractor.Tip tip
protected double arrowTheta
protected double orientation
protected java.text.DecimalFormat f
protected boolean showTheta
protected InteractiveLabel tauBox
Constructor Detail |
---|
public Protractor(int protractorRadius)
protractorRadius
- intpublic Protractor()
Method Detail |
---|
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 Interactive
findInteractive
in class InteractiveCircle
public void draw(DrawingPanel panel, java.awt.Graphics g)
draw
in interface Drawable
draw
in class Circle
panel
- DrawingPanelg
- Graphics
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |