net.sf.jcgm.core
Class EllipticalArc

java.lang.Object
  extended by net.sf.jcgm.core.Command
      extended by net.sf.jcgm.core.EllipseElement
          extended by net.sf.jcgm.core.EllipticalArc
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
EllipticalArcClose

public class EllipticalArc
extends EllipseElement

Class=2, Element=7

Version:
$Id: EllipticalArc.java 46 2011-12-14 08:26:44Z phica $
Author:
xphc (Philippe Cadé), BBNT Solutions

Field Summary
protected  double endVectorDeltaX
           
protected  double endVectorDeltaY
           
protected  double startVectorDeltaX
           
protected  double startVectorDeltaY
           
 
Fields inherited from class net.sf.jcgm.core.EllipseElement
center, ellipse, firstConjugateDiameterEndPoint, secondConjugateDiameterEndPoint
 
Fields inherited from class net.sf.jcgm.core.Command
args, currentArg
 
Constructor Summary
EllipticalArc(int ec, int eid, int l, java.io.DataInput in)
           
 
Method Summary
protected  void applyArcs(CGMDisplay d, java.awt.geom.AffineTransform transform)
          {@inheritDoc) From the specification:
protected  java.awt.Shape createShape(double centerFirstDistance, double centerSecondDistance)
          Creates the ellipse around the origin.
protected  int getClosureType()
           
 void paint(CGMDisplay d)
           
 java.lang.String toString()
           
 
Methods inherited from class net.sf.jcgm.core.EllipseElement
distance, initializeShape
 
Methods inherited from class net.sf.jcgm.core.Command
alignOnWord, clone, getElementClass, getElementCode, info, makeByte, makeChar, makeColorIndex, makeColorIndex, makeDirectColor, makeEnum, makeFixedPoint, makeFixedString, makeFloat32, makeFloatingPoint, makeFloatingPoint32, makeIndex, makeInt, makeName, makePoint, makeReal, makeSDR, makeSignedInt16, makeSignedInt24, makeSignedInt32, makeSignedInt8, makeSizeSpecification, makeString, makeUInt, makeVc, makeVdc, printShape, read, readCommand, sizeOfDirectColor, sizeOfEnum, sizeOfInt, sizeOfPoint, sizeOfVdc, unimplemented, unsupported
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

startVectorDeltaX

protected double startVectorDeltaX

startVectorDeltaY

protected double startVectorDeltaY

endVectorDeltaX

protected double endVectorDeltaX

endVectorDeltaY

protected double endVectorDeltaY
Constructor Detail

EllipticalArc

public EllipticalArc(int ec,
                     int eid,
                     int l,
                     java.io.DataInput in)
              throws java.io.IOException
Throws:
java.io.IOException
Method Detail

createShape

protected java.awt.Shape createShape(double centerFirstDistance,
                                     double centerSecondDistance)
Description copied from class: EllipseElement
Creates the ellipse around the origin.

Overrides:
createShape in class EllipseElement
Parameters:
centerFirstDistance - Width of the ellipse
centerSecondDistance - Height of the ellipse
Returns:

getClosureType

protected int getClosureType()

applyArcs

protected void applyArcs(CGMDisplay d,
                         java.awt.geom.AffineTransform transform)
{@inheritDoc) From the specification:

The defined arc begins at the intersection of the ellipse and the start ray and follows the ellipse to the intersection of the ellipse and the end ray in the direction defined as follows. A "conjugate radius" is defined to be half of a conjugate diameter. Letting the centre point be labelled M, the first CDP end point P1, and the second CDP end point P2, then the line segments M-P1 and M-P2 define two conjugate radii, referred to in what follows as the first conjugate radius and the second conjugate radius respectively. The conjugate radii meet at M and define two angles: the sum of the two angles is 360°, one angle is less than 180° and the other is greater than 180°. The drawing direction of the elliptical arc is the direction from the first conjugate radius to the second conjugate radius through the smaller of these two angles.

Overrides:
applyArcs in class EllipseElement
transform - The inverted transformation that is applied to the ellipse

paint

public void paint(CGMDisplay d)
Overrides:
paint in class EllipseElement

toString

public java.lang.String toString()
Overrides:
toString in class EllipseElement


Part of the jcgm library http://jcgm.sourceforge.net/