|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.opensourcephysics.drawing2d.Element org.opensourcephysics.drawing2d.ElementSegment org.opensourcephysics.drawing2d.ElementSpring
public class ElementSpring
Title: ElementSpring
Description: A spring.
Field Summary | |
---|---|
static int |
DEF_LOOPS
|
static int |
DEF_PPL
|
static double |
DEF_RADIUS
|
Fields inherited from class org.opensourcephysics.drawing2d.Element |
---|
TARGET_POSITION, TARGET_SIZE |
Constructor Summary | |
---|---|
ElementSpring()
|
Method Summary | |
---|---|
void |
draw(DrawingPanel _panel,
java.awt.Graphics _g)
Draws the element on a given Graphics2D. |
int |
getLoops()
Returns the number of loops of the spring |
int |
getPointsPerLoop()
Returns the number of points per loop |
double |
getRadius()
Gets the radius of the spring. |
double |
getSolenoid()
Returns the double factor used to make the spring look like a solenoid. |
boolean |
isThinExtremes()
Whether the extremes of the spring should be thin. |
void |
setRadius(double radius)
Sets the radius of the spring. |
void |
setResolution(int _loops,
int _ppl)
Configures the number of points used to display the spring |
void |
setSolenoid(double _sol)
A double factor that makes the spring look like a solenoid. |
void |
setThinExtremes(boolean _thin)
Whether the extremes of the spring should be thin. |
Methods inherited from class org.opensourcephysics.drawing2d.ElementSegment |
---|
findInteractive |
Methods inherited from class org.opensourcephysics.drawing2d.Element |
---|
addInteractionListener, getCanBeMeasured, getDataObject, getInteractionTarget, getName, getPanel, getPosition, getSize, getSizeX, getSizeY, getStyle, getTransformation, getX, getXMax, getXMaxLogscale, getXMin, getXMinLogscale, getY, getYMax, getYMaxLogscale, getYMin, getYMinLogscale, hasChanged, invokeActions, isEnabled, isMeasured, isVisible, removeInteractionListener, setCanBeMeasured, setDataObject, setElementChanged, setEnabled, setName, setNeedToProject, setPanel, setPosition, setSize, setSizeX, setSizeXY, setSizeY, setTransformation, setVisible, setX, setXY, setY, toBodyFrame, toSpaceFrame, updateHotSpot |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final double DEF_RADIUS
public static final int DEF_LOOPS
public static final int DEF_PPL
Constructor Detail |
---|
public ElementSpring()
Method Detail |
---|
public void setRadius(double radius)
radius
- the radius of the spring (normal to its direction)public double getRadius()
public void setSolenoid(double _sol)
_sol
- public double getSolenoid()
public void setThinExtremes(boolean _thin)
_thin
- public boolean isThinExtremes()
public void setResolution(int _loops, int _ppl)
loops
- the number of total loopspointsPerLoop
- the number of points per looppublic int getLoops()
public int getPointsPerLoop()
public void draw(DrawingPanel _panel, java.awt.Graphics _g)
Element
draw
in interface Drawable
draw
in class ElementSegment
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |