|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjpicedt.graphic.model.AbstractElement
jpicedt.graphic.model.PicParallelogram
jpicedt.graphic.model.PicEllipse
jpicedt.graphic.model.PicCircleFrom3Points
public class PicCircleFrom3Points
A class implementing either a circle or an arc, whose geometry is specified by a PicEllipse,
yet is further controllable by three additional points: this may either be a plain circle going through
these three points, or an arc going from P_1 to P_3 through P_2, in
which case a pie or a chord may be added as well.
Superclass control-points are still available here,
yet geometry is constrained to a circle by invoking e.g. super.setCtrlPt using a SQUARE EditConstraint.
| Field Summary | |
|---|---|
protected PicPoint |
circlePt1
The first point (out of three) this circle goes through, aka circle's specification point. |
protected PicPoint |
circlePt2
second spec-point, same as circlePt1 |
protected PicPoint |
circlePt3
second spec-point, same as circlePt1 |
static int |
LAST_PT
|
static int |
P_1
index of first ctrl-point |
static int |
P_2
index of intermediate ctrl-point |
static int |
P_3
index of last ctrl-point |
| Fields inherited from class jpicedt.graphic.model.PicEllipse |
|---|
CHORD, closure, greatAxis, OPEN, P_ANGLE_END, P_ANGLE_START, PIE, rotatedAngleEnd, rotatedAngleStart, rotationAngle, skewAngleEnd, skewAngleStart, smallAxis |
| 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 | |
|---|---|
PicCircleFrom3Points()
Creates a new circle reduced to a single point located at (0,0). |
|
PicCircleFrom3Points(boolean plain,
int closure)
Creates a new arc or circle reduced to a single point located at (0,0), with a default attribute set and the given closure type. |
|
PicCircleFrom3Points(boolean plain,
int closure,
PicAttributeSet set)
Creates a new arc or circle reduced to a single point located at (0,0), with the given closure and attribute set. |
|
PicCircleFrom3Points(PicAttributeSet set)
Creates a new (full) circle reduced to a single point located at (0,0), with the given attribute set. |
|
PicCircleFrom3Points(PicCircleFrom3Points circle)
"cloning" constructor (to be used by clone()) |
|
PicCircleFrom3Points(PicPoint pt1,
PicPoint pt2,
PicPoint pt3,
boolean plain,
int closure,
PicAttributeSet set)
Create a new arc or circle whose geometry is specified by the 3 given points, and with the given attribute set. |
|
PicCircleFrom3Points(PicPoint pt1,
PicPoint pt2,
PicPoint pt3,
PicAttributeSet set)
Create a new circle whose geometry is specificed by the the 3 given points, and with the given attribute set. |
|
| Method Summary | |
|---|---|
PicCircleFrom3Points |
clone()
Overrides Object.clone() method |
PicEllipse |
convertToEllipse()
Convert this circle to a new PicEllipse object. |
ArrayList<PEAction> |
createActions(ActionDispatcher actionDispatcher,
ActionLocalizer localizer,
HitInfo hi)
Create an array of Action's related to this object |
AbstractCustomizer |
createCustomizer()
Return a Customizer for geometry editing |
PicPoint |
getCtrlPt(int numPoint,
PicPoint src)
Get the coordinate of the control point indexed by "numPoint". |
CtrlPtSubset |
getCtrlPtSubset(ConvexZoneGroup csg,
BitSet czExtension)
Renvoie un la partie des points de contrôle qui satisfont à l'un des deux critères suivants: ceux compris dans l'ensemble de zones convexes csg, et
ceux en relation avec les points de contrôle satisfaisant au première critère selon une relation
définies par czExtension
|
String |
getDefaultName()
Return a localised string that represents this object's name |
int |
getFirstPointIndex()
Returns the index of the first user-controlled point that can be retrieved by getCtrlPt(). |
int |
getLastPointIndex()
Returns the index of the last user-controlled point that can be retrieved by getCtrlPt(). |
boolean |
isPlain()
Return true if this PicEllipse is a plain ellipse, ie if angle extent equals 360. |
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 |
setCtrlPt(int numPoint,
PicPoint pt,
EditPointConstraint c)
Set the coordinate of the point indexed by "numPoint" to the given value. |
void |
setPlain(boolean b)
|
void |
shear(PicPoint ptOrg,
double shx,
double shy,
UserConfirmationCache ucc)
Shear this Element by the given params wrt to the given origin |
String |
toString()
Implementation of the Object.toString() method, used for debugging purpose |
void |
translate(double dx,
double dy)
Translate this circle by (dx,dy) |
protected void |
updateControlPoints(int numPoint)
Update the values of the three control-points from the geometry of the superclass. |
protected void |
updateEllipse()
This method update the geometry of the superclass, i.e. specification points P_BL,
P_BR and P_TL, from the current value of the three control points
P_1, P_2, P_3. |
| Methods inherited from class jpicedt.graphic.model.PicParallelogram |
|---|
getB2TVec, getCenter, getL2RtoXAxisAngle, getL2RVec, isRectangle, isXYorYXRectangle, isXYRectangle, makeRectangle, makeXYRectangle, setCtrlPt, setGeometry, setGeometry, toParalleloBasisCoordinates, 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, createShape, getAttribute, getAttributeSet, getBoundingBox, getDrawing, getName, getParent, getView, removeView, replaceBy, scale, scale, scale, setAttribute, setAttributeSet, setCtrlPt, setParent, setViewFromFactory, shear, syncArrowGeometry |
| Field Detail |
|---|
public static final int P_1
public static final int P_2
public static final int P_3
public static final int LAST_PT
protected PicPoint circlePt1
setCtrlPt method, and
is used to update superclass's geometry when updateEllipse is invoked.
protected PicPoint circlePt2
protected PicPoint circlePt3
| Constructor Detail |
|---|
public PicCircleFrom3Points()
public PicCircleFrom3Points(boolean plain,
int closure)
plain - if true, we draw a plain circle and ignore the closure parameter.closure - closure type as defined in java.awt.geom.Arc2Dpublic PicCircleFrom3Points(PicAttributeSet set)
public PicCircleFrom3Points(boolean plain,
int closure,
PicAttributeSet set)
plain - if true, we draw a plain circle and ignore the closure parameter.closure - closure type as defined in java.awt.geom.Arc2D
public PicCircleFrom3Points(PicPoint pt1,
PicPoint pt2,
PicPoint pt3,
PicAttributeSet set)
public PicCircleFrom3Points(PicPoint pt1,
PicPoint pt2,
PicPoint pt3,
boolean plain,
int closure,
PicAttributeSet set)
plain - whether to draw a plain circle or an arcclosure - closure type as defined in java.awt.geom.Arc2Dpublic PicCircleFrom3Points(PicCircleFrom3Points circle)
| Method Detail |
|---|
public PicCircleFrom3Points clone()
Object.clone() method
clone in interface Elementclone in class PicEllipsepublic int getFirstPointIndex()
getCtrlPt().
getFirstPointIndex in interface ElementgetFirstPointIndex in class PicParallelogrampublic int getLastPointIndex()
getCtrlPt().
getLastPointIndex in interface ElementgetLastPointIndex in class PicEllipsepublic String getDefaultName()
PicEllipse
getDefaultName in class PicEllipsepublic PicEllipse convertToEllipse()
PicEllipse object.
protected void updateEllipse()
P_BL,
P_BR and P_TL, from the current value of the three control points
P_1, P_2, P_3.
updateEllipse in class PicEllipseprotected void updateControlPoints(int numPoint)
updateEllipse(), yet the other way around.
numPoint - index of the PicParallelogram's control-point that was moved
public void setCtrlPt(int numPoint,
PicPoint pt,
EditPointConstraint c)
setCtrlPt in interface ElementsetCtrlPt in class PicEllipsenumPoint - one of P_TL, P_TR, P_BL, P_BR, SIDE_T, SIDE_B, SIDE_L, SIDE_R or P_CENTER.c - either null or one of PicParallelogram.EditConstraint
public PicPoint getCtrlPt(int numPoint,
PicPoint src)
getCtrlPt in interface ElementgetCtrlPt in class PicEllipsenumPoint - one of P_1, P_2 or P_3.src - a PicPoint to update and create if necessary
numPoint ;
if src is null, allocates a new PicPoint and return it,
otherwise directly modifies src and returns it as well for convenience.
public void translate(double dx,
double dy)
translate in interface Elementtranslate in class PicParallelogramdx - The X coordinate of translation vectordy - The Y coordinate of translation vector
public void scale(double ptOrgX,
double ptOrgY,
double sx,
double sy,
UserConfirmationCache ucc)
(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.
scale in interface Elementscale in class PicEllipseucc - 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.
public void rotate(PicPoint ptOrg,
double angle)
Element by the given angle along the given point
rotate in interface Elementrotate in class PicEllipseangle - rotation angle in radians
public void mirror(PicPoint ptOrg,
PicVector normalVector)
this relativement à l'axe
défini par ptOrg et normalVector.
mirror in interface Elementmirror in class PicEllipseptOrg - le PicPoint par lequel passe l'axe de réflexion.normalVector - le PicVector normal à l'axe de réflexion.
public void shear(PicPoint ptOrg,
double shx,
double shy,
UserConfirmationCache ucc)
Element by the given params wrt to the given origin
shear in interface Elementshear in class PicEllipseucc - 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.
public CtrlPtSubset getCtrlPtSubset(ConvexZoneGroup csg,
BitSet czExtension)
Elementcsg, et
czExtension
getCtrlPtSubset in interface ElementgetCtrlPtSubset in class PicParallelogramcsg - l'ensemble de zones convexes ConvexZoneGroup auquel l'appartenance on teste les
points de contrôle.czExtension - cet argument est ignoré
CtrlPtSubset valuejpicedt.graphic.modelpublic boolean isPlain()
PicEllipse
isPlain in class PicEllipsepublic void setPlain(boolean b)
public String toString()
toString in class PicEllipse
public ArrayList<PEAction> createActions(ActionDispatcher actionDispatcher,
ActionLocalizer localizer,
HitInfo hi)
Action's related to this object
createActions in interface ActionFactorycreateActions in class PicParallelogramactionDispatcher - dispatches events to the proper PECanvaslocalizer - i18n localizer for PEAction'shi - une HitInfo contenant les informations relatives à l'évènement-souris qui a
déclencher le menu contextuel.public AbstractCustomizer createCustomizer()
createCustomizer in interface CustomizerFactorycreateCustomizer in class PicEllipse
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||