public abstract class nUIChartImage extends nUIImageElement
Modifier and Type | Field and Description |
---|---|
static float |
DEFAULT_BORDER_THICKNESS
Default thickness of the border to draw around the outside of the entire chart image.
|
static int |
NUM_RENDER_STYLES
Rendering styles
|
static int |
ORIENTATION_HORIZONTAL
Orientations
|
static int |
ORIENTATION_VERTICAL
Orientations
|
static int |
RENDER_STYLE_FLAT
Rendering styles
|
static int |
RENDER_STYLE_GRADIENT
Rendering styles
|
Y_IDENTIFIER_PREV_BOTTOM
COLOR_BACKGROUND_NORMAL, COLOR_BLACK, COLOR_FOREGROUND_DARK, COLOR_FOREGROUND_LIGHT, COLOR_FOREGROUND_NORMAL, COLOR_TRANSPARENT, COLOR_WHITE, DIMENSIONS_IDENTIFIER_PARENT_DIMENSIONS
event_listener, event_listener_exclusive, first_child, last_child, next_sibling, nuiid, parent, prev_sibling, unlink_children_on_removal_from_parent
Constructor and Description |
---|
nUIChartImage(int nuiid)
Chart constructor that creates an empty chart.
|
nUIChartImage(int nuiid,
float[] data)
Chart constructor that takes a single dimension
float
[] array containing the data. |
nUIChartImage(int nuiid,
float[][] data)
Chart constructor that takes a multi dimension
float
[][] array containing the data. |
nUIChartImage(int nuiid,
float[] data,
int stride)
Chart constructor that takes a single dimension
float
[] array containing the data. |
Modifier and Type | Method and Description |
---|---|
void |
clearChartBodyPadding()
Reset to 'automated' determination (performed in each object)
|
int |
getAxisLabelTextColor()
Gets the current color of the chart text labels.
|
int |
getBackgroundColor()
Gets the AARRGGBB color of the chart background
|
float |
getBestGuessScale()
Gets the current chart scale.
|
int |
getBorderColor()
Gets the colour used to paint the chart border.
|
float |
getBorderThickness()
Gets the current thickness, in pixels, of the border drawn around the whole chart.
|
float[] |
getData()
Gets the current one dimensional float array data values.
|
int |
getDataColor(int index)
Gets the data colour used for this value.
|
int[] |
getDataColors()
Gets the current array of data colors.
|
abstract int |
getDefaultNumColors()
Gets the default number of colours that would be used to render this chart.
|
int |
getHeight()
Gets the height of this image element.
|
javax.microedition.lcdui.Image |
getImage()
Gets the chart's Image.
|
int |
getNumColors()
Gets the number of colours that this chart will use to represent its data sets.
|
int |
getOutlineColor()
Sets the outline colour to use when drawing data areas (e.g.
|
float |
getOutlineThickness()
Gets the currently set thickness of the outline to be drawn around data areas in this chart
(e.g.
|
int |
getTickLabelTextColor()
Gets the current color of the tick text labels.
|
int |
getWidth()
Gets the width of this object in pixels.
|
void |
setAxisLabelTextColor(int color)
Sets the color used to draw axis text labels
|
void |
setBackgroundColor(int background_color)
Sets the color of the chart background.
|
void |
setBestGuessScale(float best_guess_scale)
Sets the scale of the chart (as a fraction of the chart's most significant dimension).
|
void |
setBorderColor(int color)
Sets the colour to use when painting a border around the chart.
|
void |
setBorderThickness(float thickness)
Sets the thickness, in pixels, of the border to draw around the whole chart.
|
void |
setChartBodyPadding(float lpad,
float rpad,
float tpad,
float bpad)
Sets relative padding to apply to the chart borders.
|
void |
setChartBodyPadding(int lpad,
int rpad,
int tpad,
int bpad)
Sets the literal padding to apply to the chart borders.
|
void |
setData(float[] data)
Sets a one dimensional
float [] array for this
chart. |
void |
setData(float[][] data)
Sets the
float [] array for this chart from a
multi-dimensional array, combining the arrays into one and
setting the stride appropriately. |
void |
setData(float[] data,
int stride)
Sets the
float [] array for this chart, with a
specific stride value for the data elements. |
void |
setDataColors(int[] data_colors)
Sets the colors for all the data items in the grid.
|
void |
setDefaults()
Sets all default values for this chart type.
|
void |
setHeight(int height)
Sets the height of this chart image.
|
void |
setImage(javax.microedition.lcdui.Image image)
The setImage method from nUIImageElement does nothing at this level,
since we don't want external calls to actually set the image.
|
void |
setOutlineColor(int outline_color)
Sets the outline colour to use when drawing data areas (e.g.
|
void |
setOutlineThickness(float outline_thickness)
Sets the thicknes of the outline that will be drawn around data areas for this chart.
|
void |
setRenderStyle(int render_style)
Sets the rendering style for this chart.
|
void |
setSize(int width,
int height)
Convenient method to set the dimensions of the chart in a
single method call
|
void |
setTickLabelTextColor(int color)
Sets the color used to draw tick text labels
|
void |
setWidth(int width)
Sets the width of this chart image.
|
float |
suggestLineThickness()
Suggest the best size to draw a line given the size of the screen.
|
getAlign, getInnerWidth, getInnerX, setAlign
getY, insertAt
getBackgroundDrawable, getBgcolor, getBottom, getFocus, getFocusable, getGesturable, getInnerHeight, getInnerY, getLeft, getMaxChildX, getMaxChildY, getRight, getScreenInnerX, getScreenInnerY, getScreenX, getScreenY, getTop, getTopLevelParentView, getTopLevelParentWindow, getTriggerable, getX, insertAtInternal, isEnabled, onRemoved, remove, setBackgroundDrawable, setBgcolor, setBottom, setChildFocus, setEnabled, setFocus, setFocusable, setGesturable, setInnerHeight, setInnerWidth, setInnerX, setInnerY, setLeft, setRight, setTop, setTriggerable, setX, setY
add, addEventListener, childElementAt, childIndexOf, getTag, insertAfter, insertBefore, outputChildHierarchy, remove, removeEventListener, replace, replace, setTag
public static final int ORIENTATION_VERTICAL
public static final int ORIENTATION_HORIZONTAL
public static final int RENDER_STYLE_FLAT
public static final int RENDER_STYLE_GRADIENT
public static final int NUM_RENDER_STYLES
public static final float DEFAULT_BORDER_THICKNESS
public nUIChartImage(int nuiid)
nuiid
- Unique Native UI ID (or -1 if unidentified)public nUIChartImage(int nuiid, float[] data) throws java.lang.IllegalArgumentException
float
[]
array containing the data.nuiid
- Unique Native UI ID (or -1 if unidentified)data
- The data used to render this chartjava.lang.IllegalArgumentException
public nUIChartImage(int nuiid, float[][] data) throws java.lang.IllegalArgumentException
float
[][]
array containing the data.nuiid
- Unique Native UI ID (or -1 if unidentified)data
- The data used to render this chartjava.lang.IllegalArgumentException
public nUIChartImage(int nuiid, float[] data, int stride) throws java.lang.IllegalArgumentException
float
[]
array containing the data.nuiid
- Unique Native UI ID (or -1 if unidentified)data
- The data used to render this chartstride
- The stride of the data in the arrayjava.lang.IllegalArgumentException
public void setDefaults()
public float getBestGuessScale()
public void setBestGuessScale(float best_guess_scale)
public float getOutlineThickness()
public void setOutlineThickness(float outline_thickness)
outline_thickness
- the outline thickness to set, in pixels.public void setOutlineColor(int outline_color)
outline_color
- the AARRGGBB color to set.public int getOutlineColor()
public int getWidth()
nUIDisplayObject
getWidth
in class nUIDisplayObject
public int getHeight()
nUIImageElement
getHeight
in class nUIImageElement
public void setWidth(int width)
setWidth
in class nUIDisplayObject
width
- Width in pixelspublic void setHeight(int height)
setHeight
in class nUIDisplayObject
height
- height in pixelspublic int getTickLabelTextColor()
public void setTickLabelTextColor(int color)
color
- the colour to set.public int getAxisLabelTextColor()
public void setAxisLabelTextColor(int color)
color
- the colour to setpublic int getBorderColor()
public void setBorderColor(int color)
color
- the color to set.public float getBorderThickness()
public void setBorderThickness(float thickness)
public void setSize(int width, int height)
width
- the width in pixelsheight
- the height in pixelspublic void setChartBodyPadding(float lpad, float rpad, float tpad, float bpad)
lpad
- the padding to apply from the left-hand edge.rpad
- the padding to apply from the right-hand edge.tpad
- the padding to apply from the top edge.bpad
- the padding to apply from the bottom edge.public void setChartBodyPadding(int lpad, int rpad, int tpad, int bpad)
lpad
- the padding to apply from the left-hand edge.rpad
- the padding to apply from the right-hand edge.tpad
- the padding to apply from the top edge.bpad
- the padding to apply from the bottom edge.public void clearChartBodyPadding()
public void setImage(javax.microedition.lcdui.Image image)
setImage
in class nUIImageElement
image
- ignoredpublic javax.microedition.lcdui.Image getImage()
getImage
in class nUIImageElement
public void setBackgroundColor(int background_color)
background_color
- AARRGGBB color value.public int getBackgroundColor()
public void setRenderStyle(int render_style)
nUIChartRenderer
.
Currently, the available options are RENDER_STYLE_FLAT (solid color fills) and
RENDER_STYLE_GRADIENT (gradiated fill).render_style
- the render style to set.public void setDataColors(int[] data_colors)
data_colors
- the array of AARRGGBB colors, or null to clearpublic int[] getDataColors()
nUIChartingTheme
public int getDataColor(int index)
index
- the index of the colour to get.nUIChartingTheme
public abstract int getDefaultNumColors()
public int getNumColors()
public void setData(float[] data) throws java.lang.IllegalArgumentException
float []
array for this
chart. See the different specialist chart objects for how the
data is interpreted and rendered. The stride value for the
data elements in the array is set to 1.data
- float array containing values for the chartjava.lang.IllegalArgumentException
public void setData(float[] data, int stride) throws java.lang.IllegalArgumentException
float []
array for this chart, with a
specific stride value for the data elements. Different
charts need different amounts of data per element. See the
different specialist chart objects for how the data is
interpreted and rendered.data
- float array containing values for the chartstride
- the stride value to use for the data elements
in the arrayjava.lang.IllegalArgumentException
public void setData(float[][] data) throws java.lang.IllegalArgumentException
float []
array for this chart from a
multi-dimensional array, combining the arrays into one and
setting the stride appropriately.data
- a float[][] multi-dimensional arrayjava.lang.IllegalArgumentException
public float[] getData()
float[]
array containing the data
values of the rendered chart.public float suggestLineThickness()