|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hermit.android.instruments.Gauge
org.hermit.android.instruments.TextGauge
public class TextGauge
A Gauge
which displays data in textual form, generally as
a grid of numeric values.
Constructor Summary | |
---|---|
TextGauge(SurfaceRunner parent)
Set up this view, and configure the text fields to be displayed in this element. |
|
TextGauge(SurfaceRunner parent,
java.lang.String[] template,
int rows)
Set up this view, and configure the text fields to be displayed in this element. |
Method Summary | |
---|---|
protected void |
drawBody(Canvas canvas,
Paint paint,
long now)
This method is called to ask the element to draw itself. |
char[][][] |
getBuffer()
Get the text buffers for the field values. |
int |
getPreferredHeight()
Get the minimum height needed to fit all the text. |
int |
getPreferredWidth()
Get the minimum width needed to fit all the text. |
int |
getTextColor()
Get the text colour of this element. |
float |
getTextSize()
Get the text size of this element. |
protected void |
initializePaint(Paint paint)
Set up the paint for this element. |
void |
setGeometry(Rect bounds)
This is called during layout when the size of this element has changed. |
void |
setMargins(int left,
int top,
int right,
int bottom)
Set the margins around the displayed text. |
void |
setTextColor(int col)
Set the text colour of this element. |
void |
setTextFields(java.lang.String[] template,
int rows)
Set up the text fields to be displayed in this element. |
void |
setTextSize(float size)
Set the text size of this element. |
Methods inherited from class org.hermit.android.instruments.Gauge |
---|
cacheBackground, draw, drawBackground, drawBackgroundBody, drawFinish, drawStart, error, getBackgroundColor, getBaseTextSize, getBounds, getGridColor, getHeadTextSize, getHeight, getInnerGap, getInterPadding, getMiniTextSize, getPaint, getPlotColor, getSidebarWidth, getSurface, getTextScaleX, getTextTypeface, getTinyTextSize, getWidth, haveBounds, optionSet, setBackgroundColor, setBaseTextSize, setDataColors, setGridColor, setHeadTextSize, setInnerGap, setInterPadding, setMiniTextSize, setPlotColor, setSidebarWidth, setTextScaleX, setTextTypeface, setTinyTextSize |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TextGauge(SurfaceRunner parent)
setTextFields(String[] template, int rows)
to set the
table format.
parent
- Parent surface.public TextGauge(SurfaceRunner parent, java.lang.String[] template, int rows)
parent
- Parent surface.template
- Strings representing the columns to display.
Each one should be a sample piece of text
which will be measured to determine the
required space for each column. Must be provided.rows
- Number of rows of text to display.Method Detail |
---|
protected void initializePaint(Paint paint)
initializePaint
in class Gauge
paint
- The paint to initialise.public void setGeometry(Rect bounds)
setGeometry
in class Gauge
bounds
- The bounding rect of this element within
its parent View.public void setMargins(int left, int top, int right, int bottom)
left
- The left margin.top
- The top margin.right
- The right margin.bottom
- The bottom margin.public void setTextFields(java.lang.String[] template, int rows)
template
- Strings representing the columns to display.
Each one should be a sample piece of text
which will be measured to determine the
required space for each column.rows
- Number of rows of text to display.public char[][][] getBuffer()
public int getPreferredWidth()
getPreferredWidth
in class Gauge
public int getPreferredHeight()
getPreferredHeight
in class Gauge
public void setTextColor(int col)
col
- The new text colour, in ARGB format.public int getTextColor()
public void setTextSize(float size)
size
- The new text size.public float getTextSize()
protected void drawBody(Canvas canvas, Paint paint, long now)
drawBody
in class Gauge
canvas
- Canvas to draw into.paint
- The Paint which was set up in initializePaint().now
- Nominal system time in ms. of this update.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |