|
||||||||||
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.bezier.JaxoBezierObject
public abstract class JaxoBezierObject
Abstract class for the implementation of a bezier curve.
Field Summary | |
---|---|
static int |
SELECT_P4
Fourth point (index 3). |
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 | |
---|---|
JaxoBezierObject()
|
Method Summary | |
---|---|
JaxoArrow.Coordinates |
arrowCoordinates()
Returns the coordinates of the arrow of the current object. |
protected static String |
bezierLatexCommand(String options,
Point2D p1,
Point2D p2,
Point2D p3,
Point2D p4)
Return a latex Bezier command. |
boolean |
canBeSelected(int handle,
int mode)
Determines if the object can be selected (moved, edited, etc) from the given point in a given edit mode. |
void |
copyFrom(JaxoBezierObject temp)
Sets all parameters from the given object to the current one. |
protected String |
getArrowCommand(float scale)
|
double |
getBezierLength()
Returns the approximate length of this Bezier curve. |
int |
getGrabbedHandle(int clickX,
int clickY,
JaxoHandle h)
Determines which handle the user has selected to move/resize/edit an object. |
protected static Point2D |
getLatexPoint(double x,
double y,
float scaleFactor,
int canvasHeight)
Returns the latex (ie axodraw) coordinates of the point passed of this JaxoObject. |
protected static Point2D |
getLatexPoint(Point2D p,
float scaleFactor,
int canvasHeight)
Returns the latex (ie axodraw) coordinates of the point passed of this JaxoObject. |
Point2D |
getPoint(double u)
Returns a point of this Bezier curve at parameter u. |
int |
getPointCount()
Returns the number of points it takes to draw this object. |
protected Point2D |
getPointOnCurve(double t)
Returns a point of this Bezier curve at a given parameter value. |
int |
getX(int index)
X coordinate of Point 0 <= index < getPointCount(). |
int |
getX4()
Returns the x coordinate of the fourth click point of this Bezier. |
int |
getY(int index)
Y coordinate of Point 0 <= index < getPointCount(). |
int |
getY4()
Returns the y coordinate of the fourth click point of this Bezier. |
boolean |
isCopy(JaxoObject comp)
Determines if this JaxoObject is a copy of the specified one. |
boolean |
isNoFreqStretching()
Returns the frequency stretching property of this Bezier. |
void |
moveBy(int deltaX,
int deltaY)
Reset the coordinates of the object when it is moved by deltaX and deltaY. |
void |
paintHandles(JaxoGraphics2D g2,
JaxoHandle h,
int editMode)
Paints the handles of this JaxoObject that allow to move/resize/edit it. |
void |
paintVisualAid(JaxoGraphics2D g2)
Paints a visual aid for the user during dragging (moving or resizing) of this JaxoObject. |
void |
rescaleObject(int orx,
int ory,
float scale)
Rescale this JaxoObject by the scale factor scale, keeping the point (orx, ory) fixed. |
void |
setBezierPts(int sx1,
int sy1,
int sx2,
int sy2,
int sx3,
int sy3,
int sx4,
int sy4)
Deprecated. unused. Use setLocation(int,int,int,int,int,int,int,int) instead. |
void |
setLocation(int sx1,
int sy1,
int sx2,
int sy2,
int sx3,
int sy3,
int sx4,
int sy4)
Sets the points of this Bezier. |
void |
setNoFreqStretching(boolean nofs)
Sets the frequency stretching property of this Bezier. |
void |
setPreferences()
Applies default values to this JaxoObject. |
void |
setState(JaxoObject o)
Restore state to the values of 'o'. |
void |
setX(int index,
int value)
Set X coordinate of Point 0 <= index < getPointCount() to 'value'. |
void |
setX4(int newx4)
Sets the x coordinate of the fourth click point of this Bezier. |
void |
setY(int index,
int value)
Set Y coordinate of Point 0 <= index < getPointCount() to 'value'. |
void |
setY4(int newy4)
Sets the y coordinate of the fourth click point of this Bezier. |
double |
slope(double u)
Returns the first derivative of this Bezier curve at parameter u. |
float |
smallestDistanceTo(int px,
int py)
Determines the smallest distance of any of the handles of this JaxoObject from the given point. |
Methods inherited from class net.sf.jaxodraw.object.Jaxo3PointObject |
---|
copyFrom, getX3, getY3, isOneLine, set3Pts, setLocation, setX3, setY3 |
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, setWiggles |
Methods inherited from class net.sf.jaxodraw.object.JaxoExtendedObject |
---|
copyFrom, getHeight, getRadius, 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 |
Field Detail |
---|
public static final int SELECT_P4
Constructor Detail |
---|
public JaxoBezierObject()
Method Detail |
---|
public int getPointCount()
getPointCount
in class Jaxo3PointObject
public int getX(int index)
getX
in class Jaxo3PointObject
index
- The index of the point to get.
public int getY(int index)
getY
in class Jaxo3PointObject
index
- The index of the point to get.
public void setX(int index, int value)
setX
in class Jaxo3PointObject
index
- The index of the point to set.value
- The value to set.public void setY(int index, int value)
setY
in class Jaxo3PointObject
index
- The index of the point to set.value
- The value to set.public final void setNoFreqStretching(boolean nofs)
nofs
- True if this Bezier is not frequency stretched.public final boolean isNoFreqStretching()
public final void setX4(int newx4)
newx4
- The x coordinate of the fourth click point of this Bezier.public final int getX4()
public final void setY4(int newy4)
newy4
- The y coordinate of the fourth click point of this Bezier.public final int getY4()
public final void setBezierPts(int sx1, int sy1, int sx2, int sy2, int sx3, int sy3, int sx4, int sy4)
setLocation(int,int,int,int,int,int,int,int)
instead.
sx1
- The x coordinate of the first click point of this Bezier.sy1
- The y coordinate of the first click point of this Bezier.sx2
- The x coordinate of the second click point of this Bezier.sy2
- The y coordinate of the second click point of this Bezier.sx3
- The x coordinate of the third click point of this Bezier.sy3
- The y coordinate of the third click point of this Bezier.sx4
- The x coordinate of the fourth click point of this Bezier.sy4
- The y coordinate of the fourth click point of this Bezier.public final void setLocation(int sx1, int sy1, int sx2, int sy2, int sx3, int sy3, int sx4, int sy4)
sx1
- The x coordinate of the first click point of this Bezier.sy1
- The y coordinate of the first click point of this Bezier.sx2
- The x coordinate of the second click point of this Bezier.sy2
- The y coordinate of the second click point of this Bezier.sx3
- The x coordinate of the third click point of this Bezier.sy3
- The y coordinate of the third click point of this Bezier.sx4
- The x coordinate of the fourth click point of this Bezier.sy4
- The y coordinate of the fourth click point of this Bezier.public boolean isCopy(JaxoObject comp)
isCopy
in class Jaxo3PointObject
comp
- The JaxoObject to compare against.
public void copyFrom(JaxoBezierObject temp)
temp
- The object to copy from.public void setState(JaxoObject o)
JaxoObject.copy()
.
setState
in class JaxoParticleObject
o
- the object to copy from.public final void paintVisualAid(JaxoGraphics2D g2)
paintVisualAid
in class JaxoObject
g2
- The graphics context to paint the visual aid.public final void paintHandles(JaxoGraphics2D g2, JaxoHandle h, int editMode)
paintHandles
in class Jaxo3PointObject
g2
- The corresponding graphics context.h
- A handle object to be used for painting.editMode
- The edit mode that the handles are being painted in.public final float smallestDistanceTo(int px, int py)
smallestDistanceTo
in class Jaxo3PointObject
px
- The x coordinate of the test point.py
- The y coordinate of the test point.
public int getGrabbedHandle(int clickX, int clickY, JaxoHandle h)
getGrabbedHandle
in class Jaxo3PointObject
clickX
- The x coordinate where the mouse click has ocurred.clickY
- The y coordinate where the mouse click has ocurred.h
- A handle object.
public boolean canBeSelected(int handle, int mode)
canBeSelected
in class Jaxo3PointObject
handle
- One of the static variables SELECT_* defined for
this JaxoObject.mode
- The current edit mode.
public final void moveBy(int deltaX, int deltaY)
moveBy
in class Jaxo3PointObject
deltaX
- The x displacement.deltaY
- The y displacement.public final void rescaleObject(int orx, int ory, float scale)
rescaleObject
in class Jaxo3PointObject
orx
- The x-coordinate of the fixed point.ory
- The y-coordinate of the fixed point.scale
- The scale parameter.protected static Point2D getLatexPoint(double x, double y, float scaleFactor, int canvasHeight)
x
- the x coordinate of the pointy
- the y coordinate of the pointscaleFactor
- A scalefactor.canvasHeight
- The current height of the canvas.
protected static Point2D getLatexPoint(Point2D p, float scaleFactor, int canvasHeight)
p
- the pointscaleFactor
- A scalefactor.canvasHeight
- The current height of the canvas.
protected static String bezierLatexCommand(String options, Point2D p1, Point2D p2, Point2D p3, Point2D p4)
options
- the latex options for the command.p1
- the first control point of the Bezier.p2
- the second control point of the Bezier.p3
- the third control point of the Bezier.p4
- the fourth control point of the Bezier.
protected String getArrowCommand(float scale)
public JaxoArrow.Coordinates arrowCoordinates()
arrowCoordinates
in class JaxoParticleObject
public Point2D getPoint(double u)
u
- the parameter value, needs to be between 0 and 1.
protected Point2D getPointOnCurve(double t)
getPoint(double)
, the parameter may be outside the
interval [0:1]. If it lies outside, the closest end-point of the Bezier
curve is returned, i.e. the returned Point is always a point of the
Bezier curve. This method should only be used to avoid rounding errors
at the end points.
t
- the curve parameter.
If t < 0 then the Point at t=0 will be returned.
If t > 1 then the Point at t=1 will be returned.
public double slope(double u)
u
- the parameter value, needs to be between 0 and 1.
public final double getBezierLength()
public void setPreferences()
preferences
.
setPreferences
in class JaxoParticleObject
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |