Package org.apache.poi.sl.draw.geom
Class ArcToCommand
- java.lang.Object
-
- org.apache.poi.sl.draw.geom.ArcToCommand
-
- All Implemented Interfaces:
ArcToCommandIf
,PathCommand
public class ArcToCommand extends Object implements ArcToCommandIf
ArcTo command within a shape path in DrawingML:<arcTo wR="wr" hR="hr" stAng="stAng" swAng="swAng"/>
Where
wr
andwh
are the height and width radii of the supposed circle being used to draw the arc. This gives the circle a total height of (2 * hR) and a total width of (2 * wR)stAng is the
start
angle andswAng
is the swing angleJava class for CT_Path2DArcTo complex type.
The following schema fragment specifies the expected content contained within this class.
<complexType name="CT_Path2DArcTo"> <complexContent> <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> <attribute name="wR" use="required" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_AdjCoordinate" /> <attribute name="hR" use="required" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_AdjCoordinate" /> <attribute name="stAng" use="required" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_AdjAngle" /> <attribute name="swAng" use="required" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_AdjAngle" /> </restriction> </complexContent> </complexType>
-
-
Constructor Summary
Constructors Constructor Description ArcToCommand()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static double
convertOoxml2AwtAngle(double ooAngle, double width, double height)
Arc2D angles are skewed, OOXML aren't ...boolean
equals(Object o)
String
getHR()
String
getStAng()
String
getSwAng()
String
getWR()
int
hashCode()
void
setHR(String hr)
void
setStAng(String stAng)
void
setSwAng(String swAng)
void
setWR(String wr)
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.poi.sl.draw.geom.ArcToCommandIf
execute
-
-
-
-
Method Detail
-
setHR
public void setHR(String hr)
- Specified by:
setHR
in interfaceArcToCommandIf
-
getHR
public String getHR()
- Specified by:
getHR
in interfaceArcToCommandIf
-
getStAng
public String getStAng()
- Specified by:
getStAng
in interfaceArcToCommandIf
-
getWR
public String getWR()
- Specified by:
getWR
in interfaceArcToCommandIf
-
setWR
public void setWR(String wr)
- Specified by:
setWR
in interfaceArcToCommandIf
-
setStAng
public void setStAng(String stAng)
- Specified by:
setStAng
in interfaceArcToCommandIf
-
getSwAng
public String getSwAng()
- Specified by:
getSwAng
in interfaceArcToCommandIf
-
setSwAng
public void setSwAng(String swAng)
- Specified by:
setSwAng
in interfaceArcToCommandIf
-
convertOoxml2AwtAngle
@Internal public static double convertOoxml2AwtAngle(double ooAngle, double width, double height)
Arc2D angles are skewed, OOXML aren't ... so we need to unskew themFurthermore, ooxml angle starts at the X-axis and increases clock-wise, whereas Arc2D api states "45 degrees always falls on the line from the center of the ellipse to the upper right corner of the framing rectangle" so we need to reverse it
AWT: OOXML: |90/-270 |270/-90 (16200000) | | +/-180-----------0 +/-180-----------0 | (10800000) | |270/-90 |90/-270 (5400000)
- Parameters:
ooAngle
- the angle in OOXML units divided by 60000width
- the width of the bounding boxheight
- the height of the bounding box- Returns:
- the angle in degrees
- See Also:
- unskew angle
-
-