public class DACustomButton extends Canvas {
- private static int drawCount = 0;
-
public static final int MAX_SIZE = 100;
public static final int STATE_NORMAL = 0;
@Override
public void paintControl(PaintEvent e) {
- System.out.println("draw button : " + drawCount++ + " text : " + attr.getText());
buttonRenderer.draw(e.gc, (Canvas) e.widget, state, attr);
}
};
private static final int MIN = 60000;
private static final int SEC = 1000;
private static final int TWO_DIGIT = 10;
- private static final int TIMER_PERIOD = 10;
+ private static final int TIMER_PERIOD = 1000;
private static final String ZERO = "0";
private Timer timer;
public TimerClock(Composite parent, int style) {
super(parent, style);
me = this;
- me.addPaintListener(paintListener);
- me.setBackground(ColorResources.RED);
+ addPaintListener(paintListener);
+ setBackground(ColorResources.RED);
}
private PaintListener paintListener = new PaintListener() {
Rectangle myRect = me.getClientArea();
if (bgImage != null) {
- Rectangle imgRect = bgImage.getBounds();
- me.setSize(imgRect.width, imgRect.height);
myRect = me.getClientArea();
gc.drawImage(bgImage, myRect.x, myRect.y);
} else {