|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface GraphicArc
A GraphicArc
represents a portion of an ellipse.
A GraphicArc
is constructed from either an elliptic instance of
Conic
, or the following graphical values:
center
, an instance of DirectPosition
,
width
and height
, double precision values measured in length units from the center
,
rotation
angle, a double precision value,
start
angle, a double precision value,
end
angle, a double precision value.
The geometric shape of GraphicArc
can be modified via these parameters
(the parameters are converted and passed to the underlying Conic
object).
Similarly, if the underlying Conic
changes shape but remains an ellipse,
then the GraphicArc
reflects that behavior
(see Graphic.refresh()
). If the Conic
changes to a form
other than an ellipse, then the behavior of GraphicArc
is undefined.
The ellipse is oriented by centering it at the origin of a local Cartesian plane, with the major axis of the ellipse is aligned with the x-axis (abcissa). Start and end points of the elliptic arc are measured positively as a counterclockwise angle from the positive x-axis.
The rotation of the ellipse with respect to an external Coordinate Reference System is measured positively as a clockwise angle, starting from a reference line within the Coordinate Reference System and ending at the x-axis of the local Cartesian plane.
The external Coordinate Reference System is the Coordinate Reference System of the DirectPosition
correlating to the center of the ellipse.
If the width and height parameters are specified
in
com.dautelle.units.Length.Pixel
s, then a
GraphicArc
shall retain shape and orientation regardless
of where it appears on the screen canvas. If a
setWidth
or setHeight
method is called
with a conflicting type of Unit
, then the
GraphicArc
should convert its other parameter to the new
Unit
s. Thus, if a GraphicArc
is defined in
pixels, and setWidth is called with a new value and the
com.dautelle.units.Length.Meter
Unit
,
then the GraphicArc
should convert its height to meters as
well.
Nested Class Summary | |
---|---|
static class |
GraphicArc.ArcClosure
Instances of the ArcClosure class represent the various
methods of connecting the endpoints of an arc. |
Field Summary |
---|
Fields inherited from interface Graphic |
---|
DEFAULT_AUTO_EDIT, DEFAULT_BLINK_PATTERN, DEFAULT_BLINKING, DEFAULT_DRAG_SELECTABLE, DEFAULT_MAX_SCALE, DEFAULT_MIN_SCALE, DEFAULT_PICKABLE, DEFAULT_SELECTED, DEFAULT_VISIBLE, DEFAULT_Z_ORDER |
Method Summary | |
---|---|
DirectPosition |
getCenter()
Returns the center of the ellipse defining this GraphicArc . |
PathType |
getClosurePathType()
Retrieves the algorithm that is used in computing the "in-between" pixels of the ArcClosure verteces when the arc is rendered. |
GraphicArc.ArcClosure |
getClosureType()
Returns the closureType. |
double |
getEnd(Unit unit)
Returns this GraphicArc 's ending bearing. |
double |
getHeight(Unit unit)
Returns the size of the height axis of the ellipse defining this GraphicArc , in terms of the given Unit . |
PolygonSymbolizer |
getPolygonSymbolizer()
Returns the GraphicStyle for this GraphicPolygon ,
which is required to be a PolygonSymbolizer . |
double |
getRotation(Unit unit)
Returns this GraphicArc 's orientation source. |
double |
getStart(Unit unit)
Returns this GraphicArc 's start bearing. |
double |
getWidth(Unit unit)
Returns the size of the width axis of the ellipse defining this GraphicArc , in terms of the given Unit . |
boolean |
isAllowingExtentsChange()
Indicates whether this GraphicArc is displaying edit handles for changing
the angular extents of the defining ellipse. |
boolean |
isAllowingRotation()
Indicates whether this GraphicArc is displaying an anchor handle for changing
the rotation of the defining ellipse. |
boolean |
isCircle()
Indicates whether this GraphicArc is a circle. |
boolean |
isClosedEllipse()
Indicates whether this GraphicArc is a closed ellipse. |
void |
setAllowingExtentsChange(boolean newValue)
Sets the boolean that indicates whether this GraphicArc is displaying
edit handles for changing the angular extents of the defining ellipse. |
void |
setAllowingRotation(boolean newValue)
Sets the boolean that indicates whether this GraphicArc displays
an anchor handle for changing the rotation of the defining ellipse. |
void |
setArc(DirectPosition center,
double width,
double height,
Unit lengthUnit,
double rotation,
double start,
double end,
Unit angleUnit)
Sets the geometry for this GraphicArc . |
void |
setCenter(DirectPosition center)
Sets the center of the ellipse defining this GraphicArc . |
void |
setClosurePathType(PathType pathType)
Sets the algorithm that is used in computing the "in-between" pixels of the ArcClosure verteces when the arc is rendered. |
void |
setClosureType(GraphicArc.ArcClosure closureType)
Sets the closureType, which determines how the endpoints of this GraphicArc are connected. |
void |
setEnd(double end,
Unit unit)
Sets this GraphicArc 's end bearing. |
void |
setHeight(double height,
Unit unit)
Sets the size of the height axis of the ellipse defining this GraphicArc , in terms of the given Unit . |
void |
setRotation(double rotation,
Unit unit)
Sets the orientation for the width axis. |
void |
setStart(double start,
Unit unit)
Sets this GraphicArc 's start bearing. |
void |
setWidth(double width,
Unit unit)
Sets the size of the width axis of the ellipse defining this GraphicArc , in terms of the given Unit . |
Method Detail |
---|
void setArc(DirectPosition center, double width, double height, Unit lengthUnit, double rotation, double start, double end, Unit angleUnit)
GraphicArc
.
The geometry is oriented by centering the ellipse at the origin of a local Cartesian plane, with the major axis of the ellipse is aligned with the x-axis (abcissa). Start and end points of the elliptic arc are measured positively as a counterclockwise angle from the positive x-axis.
The rotation of the ellipse with respect to an external Coordinate Reference System is measured positively as a clockwise angle, starting from a reference line within the Coordinate Reference System and ending at the x-axis of the local Cartesian plane.
The geometric values are set on the underlying Conic
geometry for this Graphic
.
center
- the location of the centerpoint of the ellipse defining this GraphicArc
.width
- the length of the major axis of the ellipse defining this GraphicArc
.height
- the length of the minor axis of the ellipse defining this GraphicArc
.lengthUnit
- the unit of width and height.rotation
- the rotation of the ellipse defining this GraphicArc
with respect to the Coordinate Reference System of the centerpoint DirectPosition.start
- the angle of starting point of the arc, drawn clockwise from the positive side of the major axis.end
- the angle of the ending point of the arc, drawn clockwise from the positive side of the major axis.angleUnit
- the unit of rotation.
GeometryNotSupportedException
- if the width value is smaller than the height value is not an ellipse.void setCenter(DirectPosition center)
GraphicArc
.
Value is set on the underlying Conic
geometry for this Graphic
.
DirectPosition getCenter()
GraphicArc
.
Value is acquired from the underlying Conic
geometry for this Graphic
.
void setWidth(double width, Unit unit)
GraphicArc
, in terms of the given Unit
.
Value is set on the underlying Conic
geometry for this Graphic
.
width
- Size of the width axis.unit
- the Unit
of the width value.double getWidth(Unit unit)
GraphicArc
, in terms of the given Unit
.
Value is acquired from the underlying Conic
geometry for this Graphic
.
unit
- the Unit
of the width value.
void setHeight(double height, Unit unit)
GraphicArc
, in terms of the given Unit
.
Value is set on the underlying Conic
geometry for this Graphic
.
height
- Size of the height axis.unit
- the Unit
of the height value.double getHeight(Unit unit)
GraphicArc
, in terms of the given Unit
.
Value is acquired from the underlying Conic
geometry for this Graphic
.
unit
- the Unit
of the height value.
void setRotation(double rotation, Unit unit)
Canvas
, this
might be the angle between the positive X axis and the width
axis of the arc. For a projected arc, this might be the angle
between due north and the width axis.
rotation
- orientation of the arc.unit
- the Unit
for the angle value.double getRotation(Unit unit)
GraphicArc
's orientation source.
unit
- the Unit
for the angle value.
void setStart(double start, Unit unit)
GraphicArc
's start bearing. The arc is stroked
counter-clockwise from start to end.
start
- the start Orientation.unit
- the Unit
for the angle value.double getStart(Unit unit)
GraphicArc
's start bearing. The arc is stroked
counter-clockwise from start to end.
unit
- the Unit
for the angle value.
void setEnd(double end, Unit unit)
GraphicArc
's end bearing. The arc is stroked
counter-clockwise from start to end.
end
- the end orientation.unit
- the Unit
for the angle value.double getEnd(Unit unit)
GraphicArc
's ending bearing. The arc is stroked
counter-clockwise from start to end.
unit
- the Unit
for the angle value.
void setClosureType(GraphicArc.ArcClosure closureType)
GraphicArc
are connected. This is one of the constants defined in the
ArcClosure
class. The integer values corresponding to
these constants are the same as the closure type values in
java.awt.geom.Arc2D
.
closureType
- Closure type of the arc (one of the ArcClosure
constants: OPEN, CHORD, or PIE)GraphicArc.ArcClosure getClosureType()
ArcClosure
constants
OPEN, CHORD, or PIE). The integer values corresponding to these
constants are the same as the constants OPEN, CHORD, and PIE from
java.awt.geom.Arc2d
.boolean isAllowingRotation()
GraphicArc
is displaying an anchor handle for changing
the rotation of the defining ellipse.
void setAllowingRotation(boolean newValue)
GraphicArc
displays
an anchor handle for changing the rotation of the defining ellipse.
boolean isCircle()
GraphicArc
is a circle. The implementation should
test for this based on the geometry settings.
boolean isClosedEllipse()
GraphicArc
is a closed ellipse. The implementation should
test for this based on the geometry settings.
boolean isAllowingExtentsChange()
GraphicArc
is displaying edit handles for changing
the angular extents of the defining ellipse.
void setAllowingExtentsChange(boolean newValue)
GraphicArc
is displaying
edit handles for changing the angular extents of the defining ellipse.
PolygonSymbolizer getPolygonSymbolizer()
GraphicStyle
for this GraphicPolygon
,
which is required to be a PolygonSymbolizer
.
GraphicStyle
.void setClosurePathType(PathType pathType)
ArcClosure
verteces when the arc is rendered. This does not
when there is no closure, i.e. when isClosedEllipse() is false, or
for ArcClosure.OPEN
.
pathType
- This must be one of the static constants in
the PathType class or one of its subclasses.PathType getClosurePathType()
ArcClosure
verteces when the arc is rendered. This does not
when there is no closure, i.e. when isClosedEllipse() is false, or
for ArcClosure.OPEN
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |