Package org.opensourcephysics.display
Class Protractor
java.lang.Object
org.opensourcephysics.display.Circle
org.opensourcephysics.display.MeasuredCircle
org.opensourcephysics.display.InteractiveCircle
org.opensourcephysics.display.Protractor
- All Implemented Interfaces:
- Drawable,- Interactive,- Measurable
A Protractor with an arrow that can be used to measure angles.
- Version:
- 1.0
- Author:
- W. Christian
- 
Nested Class SummaryNested ClassesNested classes/interfaces inherited from class org.opensourcephysics.display.InteractiveCircleInteractiveCircle.InteractiveCircleLoader
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected doubleprotected DecimalFormatprotected doubleprotected booleanprotected InteractiveLabelprotected Protractor.Tip
- 
Constructor SummaryConstructorsConstructorDescriptionConstructs a protractor with a default radius of 40 pixels.Protractor(int protractorRadius) Constructs a protractor with the given pixel size.
- 
Method SummaryModifier and TypeMethodDescriptionvoiddraw(DrawingPanel panel, Graphics g) Draws the protractor on the given drawing panel.findInteractive(DrawingPanel panel, int xpix, int ypix) doubleGets the orientation of the protractor.doublegetTheta()Gets the angle of the arrow on the protractor.booleanGets the show theta property.voidsetOrientation(double angle) Sets the orientation of the protractor.voidsetShowTheta(boolean show) Shows theta when the protractor is drawn when true.voidsetTheta(double angle) Sets the angle of the arrow on the protractor.Methods inherited from class org.opensourcephysics.display.InteractiveCirclegetLoader, isEnabled, isInside, setEnabledMethods inherited from class org.opensourcephysics.display.MeasuredCirclegetXMax, getXMin, getYMax, getYMin, isMeasured, setMeasuredMethods inherited from class org.opensourcephysics.display.CirclegetX, getY, setX, setXY, setY, toStringMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.opensourcephysics.display.InteractivegetX, getY, isInteractive, setX, setXY, setYMethods inherited from interface org.opensourcephysics.display.MeasurablegetXMax, getXMin, getYMax, getYMin, isMeasured
- 
Field Details- 
tip
- 
arrowThetaprotected double arrowTheta
- 
orientationprotected double orientation
- 
f
- 
showThetaprotected boolean showTheta
- 
tauBox
 
- 
- 
Constructor Details- 
Protractorpublic Protractor(int protractorRadius) Constructs a protractor with the given pixel size.- Parameters:
- protractorRadius- int
 
- 
Protractorpublic Protractor()Constructs a protractor with a default radius of 40 pixels.
 
- 
- 
Method Details- 
setThetapublic void setTheta(double angle) Sets the angle of the arrow on the protractor.- Parameters:
- theta- double
 
- 
getThetapublic double getTheta()Gets the angle of the arrow on the protractor.- Returns:
- double
 
- 
setOrientationpublic void setOrientation(double angle) Sets the orientation of the protractor.- Parameters:
- angle- double
 
- 
getOrientationpublic double getOrientation()Gets the orientation of the protractor.- Returns:
- double
 
- 
setShowThetapublic void setShowTheta(boolean show) Shows theta when the protractor is drawn when true.- Parameters:
- show- boolean
 
- 
isShowThetapublic boolean isShowTheta()Gets the show theta property.- Returns:
- boolean
 
- 
findInteractive- Specified by:
- findInteractivein interface- Interactive
- Overrides:
- findInteractivein class- InteractiveCircle
 
- 
drawDraws the protractor on the given drawing panel.
 
-