Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

jpicedt.graphic.model
Class PicEllipse  view PicEllipse download PicEllipse.java

java.lang.Object
  extended byjpicedt.graphic.model.AbstractElement
      extended byjpicedt.graphic.model.PicRectangle
          extended byjpicedt.graphic.model.PicEllipse
All Implemented Interfaces:
jpicedt.graphic.toolkit.ActionFactory, jpicedt.graphic.toolkit.CustomizerFactory, Element, PicObjectConstants

public class PicEllipse
extends PicRectangle
implements jpicedt.graphic.toolkit.ActionFactory, jpicedt.graphic.toolkit.CustomizerFactory

Elliptic arcs.
The geometrical model is based on PicRectangle , plus specifications for the angle.

Since:
PicEdt 1.2.a

Nested Class Summary
(package private)  class PicEllipse.Customizer
          geometry customizer
 class PicEllipse.ToCircleAction
          transform this PicEllipse to a circle, using either its width, or its height.
 
Nested classes inherited from class jpicedt.graphic.model.AbstractElement
AbstractElement.DefaultPointIterator
 
Nested classes inherited from class jpicedt.graphic.model.Element
Element.PointIterator
 
Field Summary
protected  double angleEnd
          end of angle of the arc (in degrees)
protected  double angleStart
          start of angle of the arc (in degrees)
protected  int closure
          closure type
static int LAST_PT
           
static int P_ANGLE_END
          point marking angle end
static int P_ANGLE_START
          point marking angle start
 
Fields inherited from class jpicedt.graphic.model.PicRectangle
FIRST_PT, P_BL, P_BR, P_CENTER, P_TL, P_TR, P_X1Y1, P_X1Y2, P_X2Y1, P_X2Y2
 
Fields inherited from class jpicedt.graphic.model.AbstractElement
attributeSet, parent, ptsX, ptsY, view
 
Fields inherited from interface jpicedt.graphic.model.PicObjectConstants
CROSSHATCH, CROSSHATCH_FILLED, DASH_OPAQUE, DASH_TRANSPARENT, DASH1, DASH2, DASH3, DASHED, DIMEN, DOT_SEP, DOT_SEP1, DOT_SEP2, DOT_SEP3, DOTTED, DOUBLE_COLOR, DOUBLE_LINE, DOUBLE_SEP, FILL_COLOR, FILL_STYLE, HATCH_ANGLE, HATCH_COLOR, HATCH_SEP, HATCH_WIDTH, HLINES, HLINES_FILLED, INNER, LEFT_ARROW, LINE_COLOR, LINE_STYLE, LINE_WIDTH, MaxAttributeNameIndex, MIDDLE, NONE, OUTER, POLYGON_DOTS, POLYGON_SOLID, POLYGON_STYLE, PS_POINT, RIGHT_ARROW, SHADOW, SHADOW_ANGLE, SHADOW_COLOR, SHADOW_SIZE, SOLID, VLINES, VLINES_FILLED
 
Constructor Summary
PicEllipse()
          Create a new PicEllipse, centered at (0,0), with a null radius, with OPEN as the default closure
PicEllipse(int closure)
          Create a new PicEllipse, centered at (0,0), with a null radius and the given closure and a default attribute set.
PicEllipse(int closure, PicAttributeSet set)
          Create a new PicEllipse, centered at (0,0), with a null radius and the given closure and attribute set.
PicEllipse(PicAttributeSet set)
          Create a new PicEllipse, centered at (0,0), with a null radius, and the given attribute set.
PicEllipse(PicEllipse ellipse)
          "cloning" constructor (to be used by clone())
PicEllipse(jpicedt.graphic.PicPoint ptCenter, double angleStart, double angleEnd, int closure, PicAttributeSet set)
          Create a new PicEllipse with null radius (i.e.
 
Method Summary
 java.lang.Object clone()
          Overload Object.clone() method
 jpicedt.graphic.toolkit.PEAction[] createActions(jpicedt.graphic.toolkit.ActionDispatcher actionDispatcher, jpicedt.graphic.toolkit.ActionLocalizer localizer)
          Create an array of Action's related to this object
 jpicedt.graphic.toolkit.AbstractCustomizer createCustomizer()
           
 double getAngleEnd()
           
 double getAngleExtent()
           
 double getAngleStart()
           
 int getClosureType()
           
 int getLastPointIndex()
          Returns the index of the last point that can be retrieved by getPoint This default implementation returns the greater index allowed in ptsX (or ptsY).
 java.lang.String getName()
          Returns a non-localised string representing this object's name This default implementation returns the class name.
 double getPointX(int numPoint)
          This default implementation returns ptsX[numPoint].
 double getPointY(int numPoint)
          This default implementation returns ptsY[numPoint].This might be a valid implementation as long as subclasses don't have other control points.
 jpicedt.graphic.PicPoint getTangentAtAngleEnd(jpicedt.graphic.PicPoint pt)
          Utility for computing arrow direction.
 jpicedt.graphic.PicPoint getTangentAtAngleStart(jpicedt.graphic.PicPoint pt)
          Utility for computing arrow direction.
 boolean isCircle()
           
 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 (i.e.
 void setAngleStart(double angleStart)
          Set the angle start, then fire a changed-update.
 void setClosureType(int closure)
           
 void setPoint(int numPoint, jpicedt.graphic.PicPoint pt)
          Set the coordinate of the point indexed by "numPoint" to the given value.
 void setPointFromCenter(int numPoint, jpicedt.graphic.PicPoint pt)
          Set the coordinate of the point indexed by "numPoint" to the given value, keeping center fixed.
 java.lang.String toString()
          Implementation of the Object.toString() method, used for debugging purpose
 void transformToCircle(boolean useWidth)
          Transform this ellipse to a circle
 
Methods inherited from class jpicedt.graphic.model.PicRectangle
convertToPolygon, convertToPolygons, getCenter, getCenterX, getCenterY, getFirstPointIndex, getHeight, getWidth, isSquare, setHeight, setWidth, transformToSquare
 
Methods inherited from class jpicedt.graphic.model.AbstractElement
anchorPointsIterator, fireChangedUpdate, getAttribute, getAttributeSet, getBoundingBox, getDrawing, getParent, getPoint, getView, removeView, scale, scale, setAttribute, setAttributeSet, setParent, setViewFromFactory, translate
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

P_ANGLE_END

public static final int P_ANGLE_END
point marking angle end

See Also:
Constant Field Values

P_ANGLE_START

public static final int P_ANGLE_START
point marking angle start

See Also:
Constant Field Values

LAST_PT

public static final int LAST_PT
See Also:
Constant Field Values

angleStart

protected double angleStart
start of angle of the arc (in degrees)


angleEnd

protected double angleEnd
end of angle of the arc (in degrees)


closure

protected int closure
closure type

Constructor Detail

PicEllipse

public PicEllipse()
Create a new PicEllipse, centered at (0,0), with a null radius, with OPEN as 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,
                  PicAttributeSet set)
Create a new PicEllipse, centered at (0,0), with a null radius and the given closure and attribute set.


PicEllipse

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


PicEllipse

public PicEllipse(jpicedt.graphic.PicPoint ptCenter,
                  double angleStart,
                  double angleEnd,
                  int closure,
                  PicAttributeSet set)
Create a new PicEllipse with null radius (i.e. width=height=0) and all angles=0 (a plain ellipse, not an arc)

Since:
PicEdt 1.2.a

PicEllipse

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

Since:
PicEdt 1.0
Method Detail

clone

public java.lang.Object clone()
Overload Object.clone() method

Specified by:
clone in interface Element
Overrides:
clone in class PicRectangle
Since:
PicEdt 1.0

getName

public java.lang.String getName()
Description copied from class: AbstractElement
Returns a non-localised string representing this object's name This default implementation returns the class name.

Specified by:
getName in interface Element
Overrides:
getName in class PicRectangle

getPointX

public double getPointX(int numPoint)
Description copied from class: AbstractElement
This default implementation returns ptsX[numPoint]. This might be a valid implementation as long as subclasses don't have other control points.

Specified by:
getPointX in interface Element
Overrides:
getPointX in class PicRectangle
Since:
PicEdt 1.0

getPointY

public double getPointY(int numPoint)
Description copied from class: AbstractElement
This default implementation returns ptsY[numPoint].This might be a valid implementation as long as subclasses don't have other control points.

Specified by:
getPointY in interface Element
Overrides:
getPointY in class PicRectangle
Since:
PicEdt 1.0

getLastPointIndex

public int getLastPointIndex()
Description copied from class: AbstractElement
Returns the index of the last point that can be retrieved by getPoint This default implementation returns the greater index allowed in ptsX (or ptsY).

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

setPoint

public void setPoint(int numPoint,
                     jpicedt.graphic.PicPoint pt)
Set the coordinate of the point indexed by "numPoint" to the given value.

Specified by:
setPoint in interface Element
Overrides:
setPoint in class PicRectangle

setPointFromCenter

public void setPointFromCenter(int numPoint,
                               jpicedt.graphic.PicPoint pt)
Set the coordinate of the point indexed by "numPoint" to the given value, keeping center fixed. This calls setPoint for P_ANGLE_START and P_ANGLE_END, and superclass for others.

Overrides:
setPointFromCenter in class PicRectangle

isCircle

public boolean isCircle()
Since:
PicEdt 1.0

transformToCircle

public void transformToCircle(boolean useWidth)
Transform this ellipse to a circle

Since:
PicEdt 1.2

setAngleStart

public void setAngleStart(double angleStart)
Set the angle start, then fire a changed-update.

Since:
PicEdt 1.2

getAngleStart

public double getAngleStart()
Since:
PicEdt 1.2

setAngleEnd

public void setAngleEnd(double angleEnd)
Set the angle end, then fire a changed-update.

Since:
PicEdt 1.2

getAngleEnd

public double getAngleEnd()
Since:
PicEdt 1.2

setAngleExtent

public void setAngleExtent(double angleExtent)
Sets the angle extent, keeping the angle start fixed (i.e. modifies angleEnd) Then fire a changed update.

Since:
PicEdt 1.2

getAngleExtent

public double getAngleExtent()
Since:
PicEdt 1.2

getClosureType

public int getClosureType()

setClosureType

public void setClosureType(int closure)

getTangentAtAngleStart

public jpicedt.graphic.PicPoint getTangentAtAngleStart(jpicedt.graphic.PicPoint pt)
Utility for computing arrow direction.


getTangentAtAngleEnd

public jpicedt.graphic.PicPoint getTangentAtAngleEnd(jpicedt.graphic.PicPoint pt)
Utility for computing arrow direction.


toString

public java.lang.String toString()
Implementation of the Object.toString() method, used for debugging purpose

Overrides:
toString in class AbstractElement
Since:
PicEdt 1.1.4

createActions

public jpicedt.graphic.toolkit.PEAction[] createActions(jpicedt.graphic.toolkit.ActionDispatcher actionDispatcher,
                                                        jpicedt.graphic.toolkit.ActionLocalizer localizer)
Create an array of Action's related to this object

Specified by:
createActions in interface jpicedt.graphic.toolkit.ActionFactory

createCustomizer

public jpicedt.graphic.toolkit.AbstractCustomizer createCustomizer()
Specified by:
createCustomizer in interface jpicedt.graphic.toolkit.CustomizerFactory
Overrides:
createCustomizer in class PicRectangle