|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.faceless.graph2.Graph
org.faceless.graph2.DialGraph
public class DialGraph
A subclass of Graph
for drawing "Dials". Dials are very simple graphs,
made up of "segments" which define a zone on the graph and "needles" which
add a pointer to the graph.
Field Summary | |
---|---|
static int |
ARROW_LARGE
Constant that can be passed into addNeedle() to draw
a large arrow. |
static int |
ARROW_MEDIUM
Constant that can be passed into addNeedle() to draw
a medium arrow. |
static int |
ARROW_NONE
Constant that can be passed into addNeedle() to draw
no arrow at all. |
static int |
ARROW_SMALL
Constant that can be passed into addNeedle() to draw
a small arrow. |
Fields inherited from class org.faceless.graph2.Graph |
---|
VERSION |
Constructor Summary | |
---|---|
DialGraph()
Create a new DialGraph |
Method Summary | |
---|---|
void |
addLabel(AbstractMarker label,
double angle,
double distance)
Add a marker to one of the slices of the DialGraph. |
void |
addLabels(double startangle,
double endangle,
double anglestep,
double distance,
boolean rotate,
TextStyle style,
NumberFormat format,
double startvalue,
double endvalue)
Add numerical labels around the edge of the dial graph. |
void |
addNeedle(double angle,
double start,
double startwidth,
double waist,
double waistwidth,
double end,
double endwidth,
Style style,
int arrow)
Add a "needle" the graph. |
void |
addSegment(double start,
double end,
double inner,
double outer,
Style style)
Add a colored "segment" to the graph. |
void |
addTick(double angle,
double start,
double end,
Style style)
Add a tick to the graph |
void |
addTicks(double startangle,
double endangle,
double anglestep,
double start,
double end,
Style style)
Add several ticks at equally spaced intervals around the graph |
void |
setSliceSize(double size)
Set the number of degrees each straight line makes up in a DialGraph. |
Methods inherited from class org.faceless.graph2.Graph |
---|
addKey, addKey, addText, draw, interrupt, isInterrupted, setAutoColors, setColorOrdering, setDefaultColors, setFixedAspectRatio, setFixedSize, setLicenseKey, setLightLevel, setLightVector, setMetaData, setXRotation, setYRotation, setZRotation |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int ARROW_NONE
addNeedle()
to draw
no arrow at all.
public static final int ARROW_SMALL
addNeedle()
to draw
a small arrow.
public static final int ARROW_MEDIUM
addNeedle()
to draw
a medium arrow.
public static final int ARROW_LARGE
addNeedle()
to draw
a large arrow.
Constructor Detail |
---|
public DialGraph()
Method Detail |
---|
public void addSegment(double start, double end, double inner, double outer, Style style)
start
- the start angle of the segment, in degrees clockwise from 12 o'clockend
- the end angle of the segment, in degrees clockwise from 12 o'clockinner
- the distance from the center of the graph to the inner edge of the range - 0 means the center of the graph, 100 is the outside edge.outer
- the distance from the center of the graph to the outer edge of the range - 0 means the center of the graph, 100 is the outside edge.style
- the Style to draw the slice in.public void addNeedle(double angle, double start, double startwidth, double waist, double waistwidth, double end, double endwidth, Style style, int arrow)
angle
- the angle of the needle, in degrees clockwise from 12 o'clockstart
- the distance from the center, with 0 being the center and 100 being the radiusstartwidth
- the width of the needle at the startwaist
- The distance from the start to the waist - between 0 and 100, or Double.NaN
to draw no waist. Must be greater than "start".waistwidth
- the width at the waistend
- The distance from the center of the graph to the end of the needle, with 0 being the center and 100 being the radius. Must be greater than "start" and "waist".endwidth
- the width of the needle at the endstyle
- the Style to paint the needle in.arrow
- one of ARROW_NONE
, ARROW_SMALL
, ARROW_MEDIUM
or ARROW_LARGE
public void setSliceSize(double size)
public void addLabel(AbstractMarker label, double angle, double distance)
label
- the marker to displayangle
- the angle to draw the marker at, in degrees clockwise from 12 o'clockdistance
- the distance from the center of the graph to draw the marker, with 0 being the center of the graph and 100 the radius. Values > 100 position the marker outside the graph.public void addLabels(double startangle, double endangle, double anglestep, double distance, boolean rotate, TextStyle style, NumberFormat format, double startvalue, double endvalue)
Text
objects and passes them into addLabel()
,
which we recommend doing if this method doesn't do exactly what you want.
startangle
- the angle of the first label, in degrees clockwise from 12 o'clockendangle
- the angle of the last label, in degrees clockwise from 12 o'clockanglestep
- the increment between valuesdistance
- the distance from the center of the graph to the labelrotate
- whether to rotate the labels to match the graphstyle
- the style in which the labels are to be renderedformat
- the format to use for the labelsstartvalue
- the value of the first labelendvalue
- the value of the last labelpublic void addTick(double angle, double start, double end, Style style)
angle
- the angle of the tick, in degrees clockwise from 12 o'clockstart
- the distance from the center of the graph to the start of the tick, with 100 being the outer edgeend
- the distance from the center of the graph to the end of the tick, with 100 being the outer edgestyle
- the style of the tick, or null
for a simple black linepublic void addTicks(double startangle, double endangle, double anglestep, double start, double end, Style style)
startangle
- the angle in degrees at which to start drawing the ticks, in degrees clockwise from 12 o'clockendangle
- the angle in degrees at which to stop drawing the ticks, in degrees clockwise from 12 o'clockanglestep
- how many degrees should be between each tick.start
- the distance from the center of the graph to the start of the tick, with 100 being the outer edgeend
- the distance from the center of the graph to the end of the tick, with 100 being the outer edgestyle
- the style of the ticks, or null
for a simple black line
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |