import javax.microedition.lcdui.Graphics; //导入方法依赖的package包/类
public void draw(Graphics g) {
g.setColor(255, 255, 255);
g.fillRect(0, 0, getWidth(), getHeight());
g.setColor(200, 200, 200);
int baseLineY;
if (signal.baseLineY() >= 0) {
baseLineY = (int) ((signal.baseLineY() / (double) signal.maxAltitude()) * (getHeight() / 2));
} else {
baseLineY = (int) ((Math.abs(signal.baseLineY()) / signal.maxAltitude()) * (getHeight() / 2));
baseLineY = -baseLineY;
}
baseLineY = this.getHeight() / 2 - baseLineY;
g.drawLine(0, baseLineY, getWidth(), baseLineY);
for (int i = 0; i < signal.highPoints().length; i++) {
if (signal.highPoints()[i] > offset && signal.highPoints()[i] < offset + getWidth()) {
int highPointY;
if