Class Shapes
Path builders shared by the radial and flow charts.
Angles are in degrees, measured clockwise from twelve o'clock, which is how people read a dial; screen y grows downwards.
-
Method Summary
Modifier and TypeMethodDescriptionstatic floatpx(float cx, float r, double deg) The x coordinate of a point atdegon a circle.static floatpy(float cy, float r, double deg) The y coordinate of a point atdegon a circle.static GeneralPathribbon(float x0, float top0, float bottom0, float x1, float top1, float bottom1) A band joining a vertical span on one side to a vertical span on the other with S-shaped edges, the link of a sankey diagram.static GeneralPathsector(float cx, float cy, float outer, float inner, double start, double sweep) An annular sector, or a pie wedge wheninneris 0.static GeneralPathsector(GeneralPath p, float cx, float cy, float outer, float inner, double start, double sweep) The same sector written into a path the caller reuses, so painting allocates nothing.
-
Method Details
-
px
public static float px(float cx, float r, double deg) The x coordinate of a point at
degon a circle.Parameters
-
cx: the centre x -
r: the radius -
deg: the angle, clockwise from twelve o'clock
Returns
the x coordinate
-
-
py
public static float py(float cy, float r, double deg) The y coordinate of a point at
degon a circle.Parameters
-
cy: the centre y -
r: the radius -
deg: the angle, clockwise from twelve o'clock
Returns
the y coordinate
-
-
sector
public static GeneralPath sector(float cx, float cy, float outer, float inner, double start, double sweep) An annular sector, or a pie wedge when
inneris 0.Parameters
-
cx: the centre x -
cy: the centre y -
outer: the outer radius -
inner: the inner radius, 0 for a wedge -
start: the start angle in degrees -
sweep: the sweep in degrees, positive clockwise
Returns
a closed path
-
-
sector
public static GeneralPath sector(GeneralPath p, float cx, float cy, float outer, float inner, double start, double sweep) The same sector written into a path the caller reuses, so painting allocates nothing. The path is reset first.
Parameters
-
p: the path to reset and fill -
cx: the centre x -
cy: the centre y -
outer: the outer radius -
inner: the inner radius, 0 for a wedge -
start: the start angle in degrees -
sweep: the sweep in degrees, positive clockwise
Returns
p, closed -
-
ribbon
public static GeneralPath ribbon(float x0, float top0, float bottom0, float x1, float top1, float bottom1) A band joining a vertical span on one side to a vertical span on the other with S-shaped edges, the link of a sankey diagram.
Parameters
-
x0: the left x -
top0: the band's top at the left -
bottom0: the band's bottom at the left -
x1: the right x -
top1: the band's top at the right -
bottom1: the band's bottom at the right
Returns
a closed path
-
-