example.photoalbum
Class TestChart

java.lang.Object
  extended by example.photoalbum.TestChart

 class TestChart
extends java.lang.Object

A quick sample of graphics which generates a series of images that can be used as a sample animation. The animation consists of a title, a pie, and a bar chart. The charts are sized to the requested size so they will look good on devices with various screen sizes.


Field Summary
(package private)  int barSize
          Size of the Bar chart used for width and height
(package private)  int fh
          height of the font
(package private)  javax.microedition.lcdui.Font font
          Font used for drawing text
(package private)  int frameno
          The current frame number
(package private)  int h
          Height of the canvas
(package private)  int pad
          Padding used between items
(package private)  int pieSize
          Size of the Pie chart used for width and height
(package private)  int titleHeight
          Height of the title
(package private)  int w
          Width of the canvas
 
Constructor Summary
TestChart(int width, int height)
          Initialize a new TestPattern to match the requested size.
 
Method Summary
 java.util.Vector generateImages()
          Generate the frames for this animated chart.
 void paint(javax.microedition.lcdui.Graphics g)
          Draw the current frame.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

w

int w
Width of the canvas


h

int h
Height of the canvas


font

javax.microedition.lcdui.Font font
Font used for drawing text


fh

int fh
height of the font


titleHeight

int titleHeight
Height of the title


pad

int pad
Padding used between items


pieSize

int pieSize
Size of the Pie chart used for width and height


barSize

int barSize
Size of the Bar chart used for width and height


frameno

int frameno
The current frame number

Constructor Detail

TestChart

public TestChart(int width,
                 int height)
Initialize a new TestPattern to match the requested size.

Parameters:
width - the requested width of the Images
height - the requested height of the Images
Method Detail

generateImages

public java.util.Vector generateImages()
Generate the frames for this animated chart. It consists of hour frames with the first frame containing only the base, and frame 2,3,4 adding the colors to the bars of the bar chart.

Returns:
the Vector of Images.

paint

public void paint(javax.microedition.lcdui.Graphics g)
Draw the current frame. The field frameno contains the current frame number.

Parameters:
g - the Graphics context