|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.microedition.lcdui.Item
javax.microedition.lcdui.CustomItem
de.enough.polish.ui.FakeCustomItem
de.enough.polish.ui.ChartItem
public class ChartItem
The ChartItem renders numerical integer based data in a diagram.
Copyright Enough Software 2006 - 2008
history
Nov 28, 2006 - rob creation
| Field Summary |
|---|
| Fields inherited from class javax.microedition.lcdui.CustomItem |
|---|
KEY_PRESS, KEY_RELEASE, KEY_REPEAT, NONE, POINTER_DRAG, POINTER_PRESS, POINTER_RELEASE, TRAVERSE_HORIZONTAL, TRAVERSE_VERTICAL |
| Constructor Summary | |
|---|---|
ChartItem(java.lang.String label,
int[][] dataSequences,
int[] colors)
Creates a new ChartItem. |
|
ChartItem(java.lang.String label,
int[][] dataSequences,
int[] colors,
java.lang.String[] labelsData,
java.lang.String labelY,
java.lang.String labelX,
int baseLine,
int divider)
Creates a new ChartItem. |
|
ChartItem(java.lang.String label,
int[][] dataSequences,
int[] colors,
java.lang.String[] labelsData,
java.lang.String labelY,
java.lang.String labelX,
int baseLine,
int divider,
Style style)
Creates a new ChartItem. |
|
ChartItem(java.lang.String label,
int[][] dataSequences,
int[] colors,
Style style)
Creates a new ChartItem. |
|
| Method Summary | |
|---|---|
protected java.lang.String |
createCssSelector()
Retrieves the CSS selector for this item. |
int |
getAxisColor()
|
int |
getBaseLine()
|
int[] |
getColors()
|
int |
getDataMaximum()
|
int |
getDataMinimum()
|
int[][] |
getDataSequences()
|
int |
getDivider()
|
java.lang.String[] |
getLabelsData()
|
java.lang.String |
getLabelX()
|
java.lang.String |
getLabelY()
|
int |
getScaleFactorX()
Retrieves the scale factor used by the default implementation. |
int |
getScaleFactorY()
Retrieves the scale factor used by the default implementation. |
protected void |
initContent(int firstLineWidth,
int lineWidth)
Initialises this item. |
protected void |
paintContent(int x,
int y,
int leftBorder,
int rightBorder,
javax.microedition.lcdui.Graphics g)
Paints the content of this item. |
int |
paintGrid(int x,
int y,
int leftBorder,
int rightBorder,
int[] inout_params,
javax.microedition.lcdui.Graphics g)
Paints the labels and the axis of this chart. |
void |
setAxisColor(int axisColor)
|
void |
setBaseLine(int baseLine)
|
void |
setColors(int[] colors)
|
void |
setDataMaximum(int dataMaximum)
|
void |
setDataMinimum(int dataMinimum)
|
void |
setDataSequences(int[][] dataSequences)
Sets the data that should be visualized. |
void |
setDivider(int divider)
|
void |
setLabelsData(java.lang.String[] labelsData)
|
void |
setLabelX(java.lang.String labelX)
|
void |
setLabelY(java.lang.String labelY)
|
void |
setStyle(Style style)
Sets the style of this item. |
| Methods inherited from class javax.microedition.lcdui.CustomItem |
|---|
getGameAction, getInteractionModes, invalidate, keyPressed, keyReleased, keyRepeated, pointerDragged, pointerPressed, pointerReleased, repaint, repaint, sizeChanged, traverse, traverseOut |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ChartItem(java.lang.String label,
int[][] dataSequences,
int[] colors)
label - the labeldataSequences - the actual data that should be visualizedcolors - the colors of each data sequence, can be overridden by the designer for most ChartItemViews
public ChartItem(java.lang.String label,
int[][] dataSequences,
int[] colors,
Style style)
label - the labeldataSequences - the actual data that should be visualizedcolors - the colors of each data sequence, can be overridden by the designer for most ChartItemViewsstyle - the J2ME Polish style of this item
public ChartItem(java.lang.String label,
int[][] dataSequences,
int[] colors,
java.lang.String[] labelsData,
java.lang.String labelY,
java.lang.String labelX,
int baseLine,
int divider)
label - the labeldataSequences - the actual data that should be visualizedcolors - the colors of each data sequence, can be overridden by the designer for most ChartItemViewslabelsData - optional labels for the legend of this itemlabelY - the optional label for the vertical axis (e.g. revenue)labelX - the optional label for the horizontal axis (e.g. years)baseLine - the reference point from which the data should be shown. This can be a handy trick for making growth
seem more spectacular, for example - just show the difference between a former year and today instead of
showing the absolute growth, for example. Set to 0 for playing it clean.divider - can be used to simulate floating point numbers with integer numbers, a devider of 100 can make eurocents to euros, for example (or cents to dollars).
A divider of 1.000.000 could show revenue in million pounds, for example.
public ChartItem(java.lang.String label,
int[][] dataSequences,
int[] colors,
java.lang.String[] labelsData,
java.lang.String labelY,
java.lang.String labelX,
int baseLine,
int divider,
Style style)
label - the labeldataSequences - the actual data that should be visualizedcolors - the colors of each data sequence, can be overridden by the designer for most ChartItemViewslabelsData - optional labels for the legend of this itemlabelY - the optional label for the vertical axis (e.g. revenue)labelX - the optional label for the horizontal axis (e.g. years)baseLine - the reference point from which the data should be shown. This can be a handy trick for making growth
seem more spectacular, for example - just show the difference between a former year and today instead of
showing the absolute growth, for example. Set to 0 for playing it clean.divider - can be used to simulate floating point numbers with integer numbers, a devider of 100 can make eurocents to euros, for example (or cents to dollars).
A divider of 1.000.000 could show revenue in million pounds, for example.style - the J2ME Polish style of this item| Method Detail |
|---|
protected java.lang.String createCssSelector()
FakeCustomItem
createCssSelector in class FakeCustomItem
protected void initContent(int firstLineWidth,
int lineWidth)
FakeCustomItem
initContent in class FakeCustomItemfirstLineWidth - the maximum width of the first linelineWidth - the maximum width of any following linesFakeCustomItem.contentWidth,
FakeCustomItem.contentHeight,
FakeCustomItem.preferredWidth,
FakeCustomItem.preferredHeight
public int paintGrid(int x,
int y,
int leftBorder,
int rightBorder,
int[] inout_params,
javax.microedition.lcdui.Graphics g)
x - the left start positiony - the upper start positionleftBorder - the left border, nothing must be painted left of this positionrightBorder - the right border, nothing must be painted right of this positioninout_params - an array with 2 elements for adjusting x and y:
int[] inout_params = new int[]{ x, y };
int baseLineY = chart.paintGrid(x, y, leftBorder, rightBorder, inout_params, g);
x = inout_params[0];
y = inout_params[1];
g - the Graphics on which this item should be painted.
protected void paintContent(int x,
int y,
int leftBorder,
int rightBorder,
javax.microedition.lcdui.Graphics g)
FakeCustomItem
paintContent in class FakeCustomItemx - the left start positiony - the upper start positionleftBorder - the left border, nothing must be painted left of this positionrightBorder - the right border, nothing must be painted right of this positiong - the Graphics on which this item should be painted.public void setStyle(Style style)
FakeCustomItem
setStyle in class FakeCustomItemstyle - the new style for this item.public int getBaseLine()
public void setBaseLine(int baseLine)
baseLine - the baseLine to setpublic int getDataMaximum()
public void setDataMaximum(int dataMaximum)
dataMaximum - the dataMaximum to setpublic int getDataMinimum()
public void setDataMinimum(int dataMinimum)
dataMinimum - the dataMinimum to setpublic int[][] getDataSequences()
public void setDataSequences(int[][] dataSequences)
dataSequences - the dataSequences to setpublic int getDivider()
public void setDivider(int divider)
divider - the divider to setpublic java.lang.String[] getLabelsData()
public void setLabelsData(java.lang.String[] labelsData)
labelsData - the labelsData to setpublic java.lang.String getLabelX()
public void setLabelX(java.lang.String labelX)
labelX - the labelX to setpublic java.lang.String getLabelY()
public void setLabelY(java.lang.String labelY)
labelY - the labelY to setpublic int getAxisColor()
public void setAxisColor(int axisColor)
axisColor - the axisColor to setpublic int[] getColors()
public void setColors(int[] colors)
colors - the colors to setpublic int getScaleFactorY()
public int getScaleFactorX()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||