net.sf.jcgm.core
Class EllipseElement
java.lang.Object
net.sf.jcgm.core.Command
net.sf.jcgm.core.EllipseElement
- All Implemented Interfaces:
- java.lang.Cloneable
- Direct Known Subclasses:
- EllipticalArc
public class EllipseElement
- extends Command
Class=4, Element=17
- Version:
- $Id: EllipseElement.java 46 2011-12-14 08:26:44Z phica $
- Author:
- xphc (Philippe Cadé), BBNT Solutions
Constructor Summary |
EllipseElement(int ec,
int eid,
int l,
java.io.DataInput in)
|
Method Summary |
protected void |
applyArcs(CGMDisplay d,
java.awt.geom.AffineTransform transform)
Defines the arc for this ellipse, if any |
protected java.awt.Shape |
createShape(double centerFirstDistance,
double centerSecondDistance)
Creates the ellipse around the origin. |
protected double |
distance(java.awt.geom.Point2D.Double p1,
java.awt.geom.Point2D.Double p2)
Returns the distance between the points p1 and p2 |
protected void |
initializeShape(CGMDisplay d)
Creates the ellipse on the first call. |
void |
paint(CGMDisplay d)
|
java.lang.String |
toString()
|
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 |
center
protected java.awt.geom.Point2D.Double center
firstConjugateDiameterEndPoint
protected java.awt.geom.Point2D.Double firstConjugateDiameterEndPoint
secondConjugateDiameterEndPoint
protected java.awt.geom.Point2D.Double secondConjugateDiameterEndPoint
ellipse
protected java.awt.Shape ellipse
EllipseElement
public EllipseElement(int ec,
int eid,
int l,
java.io.DataInput in)
throws java.io.IOException
- Throws:
java.io.IOException
initializeShape
protected void initializeShape(CGMDisplay d)
- Creates the ellipse on the first call. Returns the previously computed
ellipse on subsequent calls.
- Parameters:
d
-
applyArcs
protected void applyArcs(CGMDisplay d,
java.awt.geom.AffineTransform transform)
- Defines the arc for this ellipse, if any
- Parameters:
d
- transform
- The inverted transformation that is applied to the ellipse
paint
public void paint(CGMDisplay d)
- Overrides:
paint
in class Command
distance
protected double distance(java.awt.geom.Point2D.Double p1,
java.awt.geom.Point2D.Double p2)
- Returns the distance between the points p1 and p2
- Parameters:
p1
- p2
-
- Returns:
createShape
protected java.awt.Shape createShape(double centerFirstDistance,
double centerSecondDistance)
- Creates the ellipse around the origin.
- Parameters:
centerFirstDistance
- Width of the ellipsecenterSecondDistance
- Height of the ellipse
- Returns:
toString
public java.lang.String toString()
- Overrides:
toString
in class Command
Part of the jcgm library http://jcgm.sourceforge.net/