static final int mapSize = 1000;
private static Image background;
private static Labeling labeling;
public static void main(String[] args) {
final Display display = new Display();
final Shell shell = new Shell(display);
shell.addPaintListener(new PaintListener() {
public void paintControl(PaintEvent event) {
event.gc.drawImage(background, 0, 0);
new LabelOverlay().paintLabels(labeling, event.gc);
}
});
// needed for debugging
shell.addMouseMoveListener(new MouseMoveListener() {
@Override
public void mouseMove(MouseEvent e) {
// System.out.println(e.x + " " + e.y);
}
});
prepare();
shell.setBounds(10, 10, mapSize, mapSize);
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
System.exit(1);
}