net.comrom.chart
Class LineStyle
java.lang.Object
net.comrom.chart.LineStyle
- public class LineStyle
- extends java.lang.Object
This class draws lines. It contains the description of how a line looks like.
The following code creates the line style for the grid of this chart:
XAxis.gridStyle=new LineStyle(0.2f,GraphicsProvider.getColor(ChartColor.DARKGRAY),LineStyle.LINE_DASHED);
|
Method Summary |
static LineStyle |
createFromString(java.lang.String s)
|
void |
draw(ChartGraphics g,
int x1,
int y1,
int x2,
int y2)
|
void |
drawArc(ChartGraphics g,
int x,
int y,
int w,
int h,
int a1,
int a2)
|
void |
drawOpenPolygon(ChartGraphics g,
int[] x,
int[] y,
int c)
|
void |
drawPolygon(ChartGraphics g,
int[] x,
int[] y,
int c)
|
void |
drawRect(ChartGraphics g,
int x1,
int y1,
int x2,
int y2)
|
void |
drawRoundRect(ChartGraphics g,
int x1,
int y1,
int x2,
int y2)
|
ChartColor |
getColor()
|
int |
getType()
|
float |
getWidth()
|
void |
setColor(ChartColor c)
|
void |
setType(int t)
|
void |
setWidth(float f)
|
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
alphaValue
public float alphaValue
- clear (0), transparency (0.5), opaque (1).
LINE_NORMAL
public static final int LINE_NORMAL
- See Also:
- Constant Field Values
LINE_DASHED
public static final int LINE_DASHED
- See Also:
- Constant Field Values
LINE_DOTS
public static final int LINE_DOTS
- See Also:
- Constant Field Values
LineStyle
public LineStyle(float w,
ChartColor c,
int t)
- Parameters:
w - c -
LineStyle
public LineStyle(float w,
ChartColor c,
int t,
float alpha)
- Parameters:
w - c - t - alpha -
Creates a line style with the given width,
color and style(line, dashed...) and transparency (alpha value)
createFromString
public static LineStyle createFromString(java.lang.String s)
- Parameters:
s -
setType
public void setType(int t)
getType
public int getType()
getColor
public ChartColor getColor()
setColor
public void setColor(ChartColor c)
getWidth
public float getWidth()
setWidth
public void setWidth(float f)
drawArc
public void drawArc(ChartGraphics g,
int x,
int y,
int w,
int h,
int a1,
int a2)
drawPolygon
public void drawPolygon(ChartGraphics g,
int[] x,
int[] y,
int c)
drawOpenPolygon
public void drawOpenPolygon(ChartGraphics g,
int[] x,
int[] y,
int c)
- Parameters:
g - x - y - c -
draws an open polygon.
drawRoundRect
public void drawRoundRect(ChartGraphics g,
int x1,
int y1,
int x2,
int y2)
drawRect
public void drawRect(ChartGraphics g,
int x1,
int y1,
int x2,
int y2)
draw
public void draw(ChartGraphics g,
int x1,
int y1,
int x2,
int y2)
- Parameters:
g - x1 - y1 - x2 - y2 -
draws a line between two points.