|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.jaxodraw.object.JaxoObject
net.sf.jaxodraw.object.JaxoExtendedObject
net.sf.jaxodraw.object.JaxoParticleObject
net.sf.jaxodraw.object.Jaxo3PointObject
net.sf.jaxodraw.object.arc.JaxoArcObject
public abstract class JaxoArcObject
The mother of all arc objects.
Field Summary |
---|
Fields inherited from class net.sf.jaxodraw.object.Jaxo3PointObject |
---|
SELECT_P3 |
Fields inherited from class net.sf.jaxodraw.object.JaxoParticleObject |
---|
GHOST_DASH, GLUON_FREQ, PHOTON_FREQ, SCALAR_DASH |
Fields inherited from class net.sf.jaxodraw.object.JaxoExtendedObject |
---|
SELECT_DX, SELECT_DY, SELECT_P2 |
Fields inherited from class net.sf.jaxodraw.object.JaxoObject |
---|
D_FORMAT, GRAY_SCALE_FORMAT, SELECT_NONE, SELECT_P1 |
Constructor Summary | |
---|---|
JaxoArcObject()
|
Method Summary | |
---|---|
JaxoArrow.Coordinates |
arrowCoordinates()
Returns the coordinates of the arrow of the current object. |
double |
getArcLength()
Calculates the length of this arc. |
protected double[] |
getArcParameters()
Returns the parameters for the arc calculated from the three points. |
Point2D.Double |
getArcPoint(double t)
This routine returns an arc point that is t * arcLength away from P1. |
Point2D.Double |
getCenterPoint()
Get the center point of the circle that contains the arc. |
Point2D.Double |
getEquidistantPoint(int i,
int n)
Get equidistant points on the arc. |
Point2D.Float[] |
getEquidistantPoints(int n)
Get equidistant points on the arc. |
Point2D.Double |
getMidArcPoint()
Calculates the point in the middle of the arc. |
double |
getOpeningAngle()
Calculates the opening angle of this arc. |
double |
getRadius()
Calculates the radius of this arc. |
boolean |
isClockwise()
Determines the 'handed-ness' of this arc, ie whether the three points (in click order) lie in clock- or anti-clockwise direction. |
boolean |
isCopy(JaxoObject comp)
Determines if this JaxoObject is a copy of the specified one. |
boolean |
isSingular()
Checks if this arc is singular. |
void |
paintVisualAid(JaxoGraphics2D g2)
Paints a visual aid for the user during dragging (moving or resizing) of this JaxoObject. |
void |
setArcPts(int x1,
int y1,
int x2,
int y2,
int p3,
int q3)
Deprecated. unused. Use Jaxo3PointObject.setLocation(int,int,int,int,int,int) instead. |
void |
setState(JaxoObject o)
Restore state to the values of 'o'. |
protected boolean |
tooSingular(double epsilon)
Tests if the current arc is too close to the singularity where all three points are aligned and the middle click-point (P2) is on the outside from the other two. |
Methods inherited from class net.sf.jaxodraw.object.Jaxo3PointObject |
---|
canBeSelected, copyFrom, getGrabbedHandle, getPointCount, getX, getX3, getY, getY3, isOneLine, moveBy, paintHandles, rescaleObject, set3Pts, setLocation, setX, setX3, setY, setY3, smallestDistanceTo |
Methods inherited from class net.sf.jaxodraw.object.JaxoParticleObject |
---|
arrowPositionIs, copy, copyFrom, dashIs, dlSepIs, getAmp, getArrow, getArrowPosition, getDash, getDLSeparation, getWiggles, isDoubleLine, isFlip, isPaintArrow, paintArrow, setAmp, setArrow, setArrowPosition, setDash, setDLSeparation, setDoubleLine, setFlip, setPaintArrow, setPreferences, setWiggles |
Methods inherited from class net.sf.jaxodraw.object.JaxoExtendedObject |
---|
copyFrom, getHeight, getRelh, getRelSize, getRelw, getSize, getStroke, getStrokeWidth, getWidth, getX2, getY2, latexWidth, resetStroke, setLocation, setRadius, setRelativeHeight, setRelativeWidth, setRelWAndH, setStroke, setStrokeWidth, setX2, setY2, strokeIs |
Methods inherited from class net.sf.jaxodraw.object.JaxoObject |
---|
addPropertyChangeListener, contains, contains, contains, contains, copyFrom, firePropertyChange, getBounds2D, getBoundsWithHandles, getColor, getGeneralPath, getLaTexLocation, getName, getPathIterator, getPathIterator, getPoints, getX, getY, intersects, intersects, isAround, isMarked, latexCommand, paint, prepareEditPanel, propertyChange, removePropertyChangeListener, setAsMarked, setColor, setLocation, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setPointCount, setPoints, setTransient, setX, setXPosition, setY, setYPosition |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.awt.Shape |
---|
getBounds |
Constructor Detail |
---|
public JaxoArcObject()
Method Detail |
---|
public final void setArcPts(int x1, int y1, int x2, int y2, int p3, int q3)
Jaxo3PointObject.setLocation(int,int,int,int,int,int)
instead.
x1
- The x coordinate of the first click point of this arc.y1
- The y coordinate of the first click point of this arc.x2
- The x coordinate of the second click point of this arc.y2
- The y coordinate of the second click point of this arc.p3
- The x coordinate of the third click point of this arc.q3
- The y coordinate of the third click point of this arc.public boolean isCopy(JaxoObject comp)
isCopy
in class Jaxo3PointObject
comp
- The JaxoObject to compare against.
public void setState(JaxoObject o)
JaxoObject.copy()
.
setState
in class JaxoParticleObject
o
- the object to copy from.public void paintVisualAid(JaxoGraphics2D g2)
paintVisualAid
in class JaxoObject
g2
- The graphics context to paint the visual aid.protected final double[] getArcParameters()
public boolean isSingular()
An arc is considered singular if its arc length goes to infinity. This is the case when all three points are co-linear and the middle click-point is on the outside from the other two. In practice it is checked if the angle at the middle click-point is below a cutoff value of one degree.
Note that there is another type of singularity where the arc radius goes to infinity while the arc length stays finite. This is the case when the three points are co-linear and the middle click-point is between the other two. Such an arc is not considered singular, it only degenerates into a line.
Arc-specific methods generally return simplified values for singular arcs, eg the radius is set to infinity, so one should call this method first to make sure that returned values can be expected to be accurate.
protected boolean tooSingular(double epsilon)
epsilon
- upper bound for the angle at P2 (in radians).
public JaxoArrow.Coordinates arrowCoordinates()
arrowCoordinates
in class JaxoParticleObject
public final boolean isClockwise()
public final double getArcLength()
public final double getOpeningAngle()
public final double getRadius()
getRadius
in class JaxoExtendedObject
public final Point2D.Double getEquidistantPoint(int i, int n)
i
- The index of the point to return.n
- The number of segments to divide the arc.
public Point2D.Float[] getEquidistantPoints(int n)
n
- The number of segments to divide the arc.
public final Point2D.Double getArcPoint(double t)
t
- The parameter, has to be between 0 and 1.
public final Point2D.Double getCenterPoint()
public final Point2D.Double getMidArcPoint()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |