http://www.jpicedt.org

jpicedt.graphic.model
Class PicEllipse

java.lang.Object
  extended by jpicedt.graphic.model.AbstractElement
      extended by jpicedt.graphic.model.PicParallelogram
          extended by jpicedt.graphic.model.PicEllipse
All Implemented Interfaces:
Element, PicMultiCurveConvertable, ActionFactory, CustomizerFactory
Direct Known Subclasses:
PicCircleFrom3Points

public class PicEllipse
extends PicParallelogram

Ellipse ou arc, basé sur un parallélogramme.
Le modèle géométrique de cette ellipse (ou de son homologue arc) tout en étant basé sur un parallelogramme, est équivalent à une ellipse ayant subi une rotation autour de son centre.

Dans la documentation qui suit nous allons utiliser trois systèmes de coordonnées :

Les angles d'arc sont être exprimés selon le cas dans l'un des trois systèmes précédents, comme indiqué par la documentation correspondante du code.
Le préfixe skew fait référence à des angles mesurés dans la base parallélogramme, le préfixe rotated à la base ellipse, et les prefixes corrected ou rotation à des angles dans la base canonique. Pour des raisons historiques les angles de la base parallélogramme et de la base ellipse sont en degrés, et ceux de la base canonique en radians.

Comme les axes de l'ellipse ne sont pas en géneral parallèles aux côtés du parallélogramme, sauf si celui-ci est rectangle, les bases parallélogramme et ellise diffèrent en général, il en va de même de la base canonique, sauf dans le cas d'un cercle.

Dans la base parallélogramme, l'arc peut être obtenu par la courbe paramétrique suivante :

Centre + cos(tU+sin(tV

avec t allant de skewAngleStart à skewAngleEnd.

Dans la base ellipse, l'arc peut être obtenu par la courbe paramétrique suivante :

Centre + cos(tA+sin(tB

avec t allant de rotatedAngleStart à rotatedAngleEnd. Une autre façon de construire l'arc est d'effectuer une rotation de rotationAngle (dans le sens trigonométrique, c'est à dire antihoraire) de l'arc dont la courbe paramétrée est :
Centre+greatAxis×cos(tI + smallAxis×sin(tJ

avec I,J la base canonique, et t allant de rotatedAngleStart à rotatedAngleEnd. Notez que ceci implique que si smallAxis est négatif, alors l'arc va dans le sens horaire, et non antihoraire.

Dans la base canonique, le point de début de l'arc et le point de fin de l'arc ont des coordonnées polaires dont l'angle est respectivement rorationAngle + correctedAngleStart et rotationAngle + correctedAngleEnd. On rappelle que l'arc va du début à la fin dans le sens horaire si smallAxisLength < 0, et dans le sens antihoraire sinon.

illustration des angles d'ellipse

[TODO]
changes ALL internal angles to radian, and move conversion to setters/getters is user may want to enter degrees.

Since:
jPicEdt 1.4
Version:
$Id: PicEllipse.java,v 1.49 2013/09/10 05:09:41 vincentb1 Exp $
Author:
Vincent Guirardel, Sylvain Reynal, Vincent Belaïche

Field Summary
static int CHORD
          prefined closure type for arcs
protected  int closure
          closure type
protected  double greatAxis
          Lengths of the great axis of the ellipse.
static int LAST_PT
           
static int OPEN
          prefined closure type for arcs
static int P_ANGLE_END
          point marking end-of-arc
static int P_ANGLE_START
          point marking start-of-arc
static int PIE
          prefined closure type for arcs
protected  double rotatedAngleEnd
          Arc angles in degrees, as measured in the ellipse basis.
protected  double rotatedAngleStart
          Arc angles in degrees, as measured in the ellipse basis.
protected  double rotationAngle
          Angle in radians (CCW) between the great axis of the ellipse and the horizontal axis.
protected  double skewAngleEnd
           
protected  double skewAngleStart
          Arc start- and end- angles in degrees as measured with respect to parallolegram's basis (see toParalleloBasisCoordinates() for details on how this basis is defined).
protected  double smallAxis
          Length of the small axis of the ellipse.
 
Fields inherited from class jpicedt.graphic.model.PicParallelogram
b2tVec, CTRL_PT_SIDE_BITMAP, FIRST_PT, IN_SIDE_B, IN_SIDE_L, IN_SIDE_R, IN_SIDE_T, l2rVec, P_BL, P_BR, P_CENTER, P_TL, P_TR, ptBL, ptBR, ptTR, SIDE_0, SIDE_B, SIDE_L, SIDE_R, SIDE_T
 
Fields inherited from class jpicedt.graphic.model.AbstractElement
attributeSet, name, parent, view
 
Constructor Summary
PicEllipse()
          Create a new PicEllipse, centered at (0,0), with a null radius.
PicEllipse(int closure)
          Create a new PicEllipse, centered at (0,0), with a null radius, the given closure type.
PicEllipse(int closure, PicAttributeSet set)
          Create a new PicEllipse, centered at (0,0), with a null radius, the given closure type, and the given attribute set.
PicEllipse(PicAttributeSet set)
          Create a new PicEllipse, centered at (0,0), with a null radius, and the given attribute set.
PicEllipse(PicEllipse src)
          "cloning" constructor (to be used by clone())
PicEllipse(PicPoint p1, PicPoint p2, PicPoint p3, int closure)
          Create a new PicEllipse object using the 3 given points as 3 consecutive points of the surrounding parallelogram, and a default attribute set.
PicEllipse(PicPoint p1, PicPoint p2, PicPoint p3, int closure, PicAttributeSet set)
          Create a new PicEllipse object using the 3 given points as 3 consecutive points of the surrounding parallelogram, and the given attribute set.
 
Method Summary
protected  void _updateAxis()
          Compute the axes of the ellipse (smallAxis, greatAxis), and the rotated angles in terms of the skew angles.
 PicEllipse clone()
          Overload Object.clone() method
 PicMultiCurve convertToMultiCurve()
          Return a Bezier curve created from this ellipse.
 AbstractCustomizer createCustomizer()
          Returns a customizer (Swing) component
 Shape createShape()
          Creates a Shape that reflects the geometry of this model.
 double getAngleEnd()
          Returns skewAngleEnd, ie angle end of the arc in degrees, measured in the frame defined by the parallelogram.
 double getAngleExtent()
          Returns the extent of the arc in degrees (CCW) as measured in the parallelogram basis.
 double getAngleStart()
          Returns skewAngleStart, ie the starting angle of the arc in degrees, measured in the frame defined by the parallelogram.
 int getArcType()
          Returns the closure type, ie one of CHORD, PIE or OPEN predefined constant fields.
 String getArcTypeAsString()
          Returns the closure type as a String, ie one of "chord", "pie" or "open"
 Rectangle2D getBoundingBox(Rectangle2D r)
          Returns the bounding box (ie the surrounding rectangle) in double precision Used for instance to determine the arguments of a \\begin{picture} command.
 double getCorrectedAngleEnd()
           
 double getCorrectedAngleStart()
           
 PicPoint getCtrlPt(int numPoint, PicPoint src)
          Return the user-controlled point having the given index.
 String getDefaultName()
          Return a localised string that represents this object's name
 double getGreatAxisLength()
          Return the length of the great-axis of this ellipse/arc.
 int getLastPointIndex()
          Return the index of the last point that can be retrieved by getCtrlPt.
 double getRotatedAngleEnd()
          Returns rotatedAngleEnd, ie the angle end of the arc in degrees as measured in the frame defined by the axes of the ellipse, that is to say relative to the great axe, and with CW or CCW orientiation depending on whether getSmallAxisLength() returns a positive or negative number.
 double getRotatedAngleExtent()
          Returns the angle extent of the arc in degrees as measured in the frame defined by the axes of the ellipse.
 double getRotatedAngleStart()
          Return rotatedAngleStart, ie the angle start of the arc in degrees, as measured in the frame defined by the axes of the ellipse, that is to say relative to the great axe, and with CW or CCW orientiation depending on whether getSmallAxisLength() returns a positive or negative number.
 double getRotationAngle()
          Return the rotation angle, ie the angle between the great axis of the ellipse and the horizontal axis.
 double getSmallAxisLength()
          Return the signed length of the small-axis of this ellipse/arc.
 PicVector getTangentAtAngleEnd(PicVector pt)
          Utility for computing arrow direction.
 PicVector getTangentAtAngleStart(PicVector pt)
          Utility for computing arrow direction.
 boolean isArc()
          Returns true if this PicEllipse is an arc, ie if angle extent does not equl 360
 boolean isCircular()
          Returns TRUE if this ellipse is circular, ie if smallAxis==greatAxis.
 boolean isClosed()
          Returns whether this arc or ellipse is closed or not.
 boolean isFlat()
          Return true if this ellipse is flat.
 boolean isPlain()
          Return true if this PicEllipse is a plain ellipse, ie if angle extent equals 360.
 boolean isRotated()
          Return true if this PicEllipse has a null rotation angle along the x-axis
 void mirror(PicPoint ptOrg, PicVector normalVector)
          Effectue une réflexion sur this relativement à l'axe défini par ptOrg et normalVector.
 void rotate(PicPoint ptOrg, double angle)
          Rotate this Element by the given angle along the given point.
 void scale(double ptOrgX, double ptOrgY, double sx, double sy, UserConfirmationCache ucc)
          Scale this object by (sx,sy) using (ptOrgX,ptOrgY) as the origin.
 void setAngleEnd(double angleEnd)
          Set the angle end, then fire a changed-update.
 void setAngleExtent(double angleExtent)
          Sets the angle extent, keeping the angle start fixed, then fire a changed update.
 void setAngleStart(double angleStart)
          Set the angle start, as measured in the parallelogram basis, then fire a changed-update.
 void setArcType(int closure)
          Sets the closure type to one of CHORD, PIE or OPEN.
 void setCtrlPt(int numPoint, PicPoint pt, EditPointConstraint constraint)
          Set the coordinate of the point indexed by "numPoint" to the given value.
 void setGeometry(Arc2D arc)
          Sets the coordinates of this element from the given shape.
 void setGeometry(PicEllipse ell)
          Sets the coordinates and angle extents of this Element from those of the given source.
 void setPlain()
          Set angle parameters so that this ellipse is a plain ellipse.
 void shear(PicPoint ptOrg, double shx, double shy, UserConfirmationCache ucc)
          Shear this Element by the given params wrt to the given origin.
 void syncArrowGeometry(ArrowView v, ArrowView.Direction d)
          Helper for the associated View.
 String toString()
          Implementation of the Object.toString() method, used for debugging purpose
author: Sylvain Reynal
protected  void updateAxis()
          Compute the axes of the ellipse (smallAxis, greatAxis), and the rotated angles in terms of the skew angles.
protected  void updateEllipse()
           
protected  void updateRotatedAngles()
          Updates values of rotatedAngleStart and rotatedAngleEnd.
 
Methods inherited from class jpicedt.graphic.model.PicParallelogram
createActions, getB2TVec, getCenter, getCtrlPtSubset, getFirstPointIndex, getL2RtoXAxisAngle, getL2RVec, isRectangle, isXYorYXRectangle, isXYRectangle, makeRectangle, makeXYRectangle, setCtrlPt, setGeometry, setGeometry, toParalleloBasisCoordinates, translate, updateParalleloBasis
 
Methods inherited from class jpicedt.graphic.model.AbstractElement
anchorPointsIterator, fireChangedUpdate, getAttribute, getAttributeSet, getDrawing, getName, getParent, getView, pullOutOfGroup, removeView, replaceBy, scale, scale, scale, setAttribute, setAttributeSet, setName, setParent, setViewFromFactory, shear
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jpicedt.graphic.model.Element
anchorPointsIterator, getAttribute, getAttributeSet, getDrawing, getName, getParent, getView, removeView, replaceBy, scale, scale, scale, setAttribute, setAttributeSet, setParent, setViewFromFactory, shear
 

Field Detail

P_ANGLE_START

public static final int P_ANGLE_START
point marking start-of-arc

See Also:
Constant Field Values

P_ANGLE_END

public static final int P_ANGLE_END
point marking end-of-arc

See Also:
Constant Field Values

LAST_PT

public static final int LAST_PT
See Also:
Constant Field Values

CHORD

public static final int CHORD
prefined closure type for arcs

See Also:
Constant Field Values

OPEN

public static final int OPEN
prefined closure type for arcs

See Also:
Constant Field Values

PIE

public static final int PIE
prefined closure type for arcs

See Also:
Constant Field Values

skewAngleStart

protected double skewAngleStart
Arc start- and end- angles in degrees as measured with respect to parallolegram's basis (see toParalleloBasisCoordinates() for details on how this basis is defined).

To wind up shortly, let U and V denote unit-vectors defined by the sides of the parallelogram (these are actually given by "l2rVec" and "b2tVec" protected fields, yet immediately after updateParalleloBasis has been called), then the starting point of the arc is located at : Center+cos(skewAngleStart)*U+sin(skewAngleStart)*V.

This value is closer to the user than rotatedAngleStart. [SR:je ne comprend pas cette phrase !!!]

Moreover, arc is modelled by the following parametrized curve :
Center + cos(t)*U+sin(t)*V,
for t ranging from skewAngleStart to skewAngleEnd.

We set skewAngleStart in (-180,180], and skewAngleEnd in (skewAngleStart,skewAngleStart+360]. This means that if one makes a mirror symmetry of the parallelogram and keeps the values of these "skew" angles unchanged, then we get the mirror image of the arc.
We use degrees because user may enter a value. [SR:pending] On peut faire la conversion dans les setters correspondants (setAngleXXX). L'ideal est qd meme d'avoir la meme unite partout (en interne) pour ne pas s'emmeler les pedales.

See Also:
PicParallelogram.l2rVec, PicParallelogram.b2tVec

skewAngleEnd

protected double skewAngleEnd
See Also:
skewAngleStart

rotationAngle

protected double rotationAngle
Angle in radians (CCW) between the great axis of the ellipse and the horizontal axis.


smallAxis

protected double smallAxis
Length of the small axis of the ellipse. May be negative, as this gives a more coherent behaviour under negative scaling in one direction. The sign is determined by the orientation of the parallelogram.


greatAxis

protected double greatAxis
Lengths of the great axis of the ellipse.


rotatedAngleStart

protected double rotatedAngleStart
Arc angles in degrees, as measured in the ellipse basis. These are computed from their "skew" counterparts, through a call to updateRotatedAngles, and are obviously identical with them if surrounding parallelogram is a rectangle.

These angles may be used to build an appropriate Shape for this Element, by first creating an Arc2D from these angles, then rotating this shape by rotationAngle.

We restrict values of rotatedAngleStart to (-180,180], and those of rotatedAngleEnd to (rotatedAngleStart,rotatedAngleStart+360].


rotatedAngleEnd

protected double rotatedAngleEnd
Arc angles in degrees, as measured in the ellipse basis. These are computed from their "skew" counterparts, through a call to updateRotatedAngles, and are obviously identical with them if surrounding parallelogram is a rectangle.

These angles may be used to build an appropriate Shape for this Element, by first creating an Arc2D from these angles, then rotating this shape by rotationAngle.

We restrict values of rotatedAngleStart to (-180,180], and those of rotatedAngleEnd to (rotatedAngleStart,rotatedAngleStart+360].


closure

protected int closure
closure type

Constructor Detail

PicEllipse

public PicEllipse()
Create a new PicEllipse, centered at (0,0), with a null radius. CLOSED is the default closure


PicEllipse

public PicEllipse(PicAttributeSet set)
Create a new PicEllipse, centered at (0,0), with a null radius, and the given attribute set.


PicEllipse

public PicEllipse(int closure)
Create a new PicEllipse, centered at (0,0), with a null radius, the given closure type.

Parameters:
closure - one of CHORD, PIE or OPEN.

PicEllipse

public PicEllipse(int closure,
                  PicAttributeSet set)
Create a new PicEllipse, centered at (0,0), with a null radius, the given closure type, and the given attribute set.

Parameters:
closure - one of CHORD, PIE or OPEN.

PicEllipse

public PicEllipse(PicPoint p1,
                  PicPoint p2,
                  PicPoint p3,
                  int closure,
                  PicAttributeSet set)
Create a new PicEllipse object using the 3 given points as 3 consecutive points of the surrounding parallelogram, and the given attribute set.

Parameters:
closure - one of CHORD, PIE or OPEN.

PicEllipse

public PicEllipse(PicPoint p1,
                  PicPoint p2,
                  PicPoint p3,
                  int closure)
Create a new PicEllipse object using the 3 given points as 3 consecutive points of the surrounding parallelogram, and a default attribute set.

Parameters:
closure - one of CHORD, PIE or OPEN.

PicEllipse

public PicEllipse(PicEllipse src)
"cloning" constructor (to be used by clone())

Parameters:
src - The PicEllipse object to clone
Method Detail

clone

public PicEllipse clone()
Overload Object.clone() method

Specified by:
clone in interface Element
Overrides:
clone in class PicParallelogram

getDefaultName

public String getDefaultName()
Return a localised string that represents this object's name

Overrides:
getDefaultName in class PicParallelogram
Returns:
a localised string that represents this object's name

setCtrlPt

public void setCtrlPt(int numPoint,
                      PicPoint pt,
                      EditPointConstraint constraint)
Set the coordinate of the point indexed by "numPoint" to the given value. If point controls the parallelogram, calls the paralleogram setCtrlPt method, and updates axis.

Specified by:
setCtrlPt in interface Element
Overrides:
setCtrlPt in class PicParallelogram
Parameters:
numPoint - one of P_TL, P_TR, P_BL, P_BR, SIDE_T, SIDE_B, SIDE_L, SIDE_R or P_CENTER.
constraint - either null or one of PicParallelogram.EditConstraint

setGeometry

public void setGeometry(PicEllipse ell)
Sets the coordinates and angle extents of this Element from those of the given source. This methods fires a DrawingEvent.

Since:
jpicedt 1.5

setGeometry

public void setGeometry(Arc2D arc)
Sets the coordinates of this element from the given shape. This methods fires a DrawingEvent.

Since:
jpicedt 1.5

getCtrlPt

public PicPoint getCtrlPt(int numPoint,
                          PicPoint src)
Return the user-controlled point having the given index. The general contract in Element is to return an IMMUTABLE instance of PicPoint, so that the only way to alter the geometry of this element is by calling the setCtrlPt method.

Specified by:
getCtrlPt in interface Element
Overrides:
getCtrlPt in class PicParallelogram
Parameters:
numPoint - the point index, should be greater or equal to the value returned by getFirstPointIndex, and lower or equal to getLastPointIndex.
Returns:
the point indexed by numPoint ; if src is null, allocates a new PicPoint and return it, otherwise directly modifies src and returns it as well for convenience.

scale

public void scale(double ptOrgX,
                  double ptOrgY,
                  double sx,
                  double sy,
                  UserConfirmationCache ucc)
Scale this object by (sx,sy) using (ptOrgX,ptOrgY) as the origin. This implementation simply apply a scaling transform to all specification-points. Note that sx and sy may be negative. This method eventually fires a changed-update event.

Specified by:
scale in interface Element
Overrides:
scale in class PicParallelogram
ucc - une valeur UserConfirmationCache permettant de demander à l'utilisateur confirmation, de se souvenir de la dernière confirmation qu'il a donné, ou de ses préférences.

rotate

public void rotate(PicPoint ptOrg,
                   double angle)
Rotate this Element by the given angle along the given point.

Specified by:
rotate in interface Element
Overrides:
rotate in class PicParallelogram
Parameters:
angle - rotation angle in radians

mirror

public void mirror(PicPoint ptOrg,
                   PicVector normalVector)
Effectue une réflexion sur this relativement à l'axe défini par ptOrg et normalVector.

Specified by:
mirror in interface Element
Overrides:
mirror in class PicParallelogram
Parameters:
ptOrg - le PicPoint par lequel passe l'axe de réflexion.
normalVector - le PicVector normal à l'axe de réflexion.

shear

public void shear(PicPoint ptOrg,
                  double shx,
                  double shy,
                  UserConfirmationCache ucc)
Shear this Element by the given params wrt to the given origin.

Specified by:
shear in interface Element
Overrides:
shear in class PicParallelogram
ucc - une valeur UserConfirmationCache permettant de demander à l'utilisateur confirmation, de se souvenir de la dernière confirmation qu'il a donné, ou de ses préférences.

convertToMultiCurve

public PicMultiCurve convertToMultiCurve()
Return a Bezier curve created from this ellipse.

Specified by:
convertToMultiCurve in interface PicMultiCurveConvertable
Overrides:
convertToMultiCurve in class PicParallelogram
Since:
jpicedt 1.4

createShape

public Shape createShape()
Creates a Shape that reflects the geometry of this model.

Specified by:
createShape in interface Element
Overrides:
createShape in class PicParallelogram

getBoundingBox

public Rectangle2D getBoundingBox(Rectangle2D r)
Description copied from class: PicParallelogram
Returns the bounding box (ie the surrounding rectangle) in double precision Used for instance to determine the arguments of a \\begin{picture} command.

This implementation compute the bounding-box from the smallest rectangle that encompasses all the specification-points.

Specified by:
getBoundingBox in interface Element
Overrides:
getBoundingBox in class PicParallelogram
Returns:
the bounding box (i.e. the surrounding rectangle) in double precision Used e.g. to determine the arguments of the \\begin{picture} command. If r is null, allocate a new rectangle and returns it. Otherwise the source rectangle is modified and returned for convenience. [todo:reynal] this really need to be improved : this method would probably better be moved to the attached view, since the latter knows exactly what the TRUE bounding box is.

syncArrowGeometry

public void syncArrowGeometry(ArrowView v,
                              ArrowView.Direction d)
Helper for the associated View. This implementation updates the geometry of the given ArrowView only if isArc()==true.

Specified by:
syncArrowGeometry in interface Element
Overrides:
syncArrowGeometry in class AbstractElement

getRotationAngle

public double getRotationAngle()
Return the rotation angle, ie the angle between the great axis of the ellipse and the horizontal axis.

Returns:
the rotation angle in radians (CCW)
See Also:
rotationAngle

getGreatAxisLength

public double getGreatAxisLength()
Return the length of the great-axis of this ellipse/arc.


getSmallAxisLength

public double getSmallAxisLength()
Return the signed length of the small-axis of this ellipse/arc. A positive sign indicate that the rotated angles are CCW, while a negative sign indicates that the rotated angles are CW.


setAngleStart

public void setAngleStart(double angleStart)
Set the angle start, as measured in the parallelogram basis, then fire a changed-update. Arc always extends CCW from angle-start to angle-end, ie angle-extent is always positive.

Parameters:
angleStart - The starting angle of the arc, in degrees, counted COUNTERCLOCKWISE (aka trigonometric), and measured in the parallelogram basis, ie skewAngleStart.

getAngleStart

public double getAngleStart()
Returns skewAngleStart, ie the starting angle of the arc in degrees, measured in the frame defined by the parallelogram.


setAngleEnd

public void setAngleEnd(double angleEnd)
Set the angle end, then fire a changed-update. Arc always extends CCW from angle-start to angle-end, ie angle-extent is always positive.

Parameters:
angleEnd - The angle end of the arc, in degrees, measured in the frame defined by the parallelogram, ie skewAngleEnd.

getAngleEnd

public double getAngleEnd()
Returns skewAngleEnd, ie angle end of the arc in degrees, measured in the frame defined by the parallelogram. (value of skewAngleStart)


setAngleExtent

public void setAngleExtent(double angleExtent)
Sets the angle extent, keeping the angle start fixed, then fire a changed update. If not positive, 360 is added to it.

Parameters:
angleExtent - Angular extent of the arc, in degrees, counted COUNTERCLOCKWISE as measured in parallelogram basis.

getAngleExtent

public double getAngleExtent()
Returns the extent of the arc in degrees (CCW) as measured in the parallelogram basis. Note that this method returns 360 for a plain ellipse, not 0.

Returns:
an angle in (0,360]

getRotatedAngleStart

public double getRotatedAngleStart()
Return rotatedAngleStart, ie the angle start of the arc in degrees, as measured in the frame defined by the axes of the ellipse, that is to say relative to the great axe, and with CW or CCW orientiation depending on whether getSmallAxisLength() returns a positive or negative number.


getCorrectedAngleStart

public double getCorrectedAngleStart()

getCorrectedAngleEnd

public double getCorrectedAngleEnd()

getRotatedAngleEnd

public double getRotatedAngleEnd()
Returns rotatedAngleEnd, ie the angle end of the arc in degrees as measured in the frame defined by the axes of the ellipse, that is to say relative to the great axe, and with CW or CCW orientiation depending on whether getSmallAxisLength() returns a positive or negative number.


getRotatedAngleExtent

public double getRotatedAngleExtent()
Returns the angle extent of the arc in degrees as measured in the frame defined by the axes of the ellipse.


getArcType

public int getArcType()
Returns the closure type, ie one of CHORD, PIE or OPEN predefined constant fields.


getArcTypeAsString

public String getArcTypeAsString()
Returns the closure type as a String, ie one of "chord", "pie" or "open"


setArcType

public void setArcType(int closure)
Sets the closure type to one of CHORD, PIE or OPEN.


getLastPointIndex

public int getLastPointIndex()
Return the index of the last point that can be retrieved by getCtrlPt.

Specified by:
getLastPointIndex in interface Element
Overrides:
getLastPointIndex in class PicParallelogram

isFlat

public boolean isFlat()
Return true if this ellipse is flat.


isCircular

public boolean isCircular()
Returns TRUE if this ellipse is circular, ie if smallAxis==greatAxis.

See Also:
getSmallAxisLength(), getGreatAxisLength()

isPlain

public boolean isPlain()
Return true if this PicEllipse is a plain ellipse, ie if angle extent equals 360.


isArc

public boolean isArc()
Returns true if this PicEllipse is an arc, ie if angle extent does not equl 360


isRotated

public boolean isRotated()
Return true if this PicEllipse has a null rotation angle along the x-axis


setPlain

public void setPlain()
Set angle parameters so that this ellipse is a plain ellipse.


isClosed

public boolean isClosed()
Returns whether this arc or ellipse is closed or not. This depends on the closure type, and this PicEllipse being plain or not.


_updateAxis

protected void _updateAxis()
Compute the axes of the ellipse (smallAxis, greatAxis), and the rotated angles in terms of the skew angles.


updateAxis

protected void updateAxis()
Compute the axes of the ellipse (smallAxis, greatAxis), and the rotated angles in terms of the skew angles.


updateEllipse

protected void updateEllipse()

updateRotatedAngles

protected void updateRotatedAngles()
Updates values of rotatedAngleStart and rotatedAngleEnd. Axes must be updated beforehands for this computation to be valid. if greatAxis==0 (implies smallAxis==0), we keep the old values [case of ellipse reduced to a point]. Flat case is handled by fromSkewToRotated.


getTangentAtAngleStart

public PicVector getTangentAtAngleStart(PicVector pt)
Utility for computing arrow direction.

Parameters:
pt - a preallocated PicPoint that get filled with the result ; a new one is allocated if pt==null
Returns:
a unit-1 vector tangent to the arc, at phi = start angle, pointing "outwardly"

getTangentAtAngleEnd

public PicVector getTangentAtAngleEnd(PicVector pt)
Utility for computing arrow direction.

Parameters:
pt - a preallocated PicPoint that get filled with the result ; a new one is allocated if pt==null
Returns:
a unit-1 vector tangent to the arc, at phi = end angle, pointing "outwardly"

toString

public String toString()
Implementation of the Object.toString() method, used for debugging purpose
author: Sylvain Reynal

Overrides:
toString in class PicParallelogram
Since:
PicEdt 1.1.4

createCustomizer

public AbstractCustomizer createCustomizer()
Description copied from interface: CustomizerFactory
Returns a customizer (Swing) component

Specified by:
createCustomizer in interface CustomizerFactory
Overrides:
createCustomizer in class PicParallelogram
Returns:
a Customizer for geometry editing
Since:
jpicedt 1.3.3

http://www.jpicedt.org

Submit a bug : syd@jpicedt.org