~vcs-imports/openintents/trunk

« back to all changes in this revision

Viewing changes to sensorsimulator/SensorSimulator/src/hr/fer/tel/sensorsimulator/SensorSimulatorSwtMain.java

  • Committer: peli0101
  • Date: 2011-01-04 16:15:57 UTC
  • Revision ID: peli0101-20110104161557-gna7g36lbfdklfp0
SensorSimulator: Split SensorSimulator into a Swing part and a SWT part.
The SWT part requires the Swing part as an Eclipse project to be open.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/**
2
 
 *
3
 
 */
4
 
package hr.fer.tel.sensorsimulator;
5
 
 
6
 
import org.eclipse.swt.layout.FillLayout;
7
 
import org.eclipse.swt.widgets.Display;
8
 
import org.eclipse.swt.widgets.Shell;
9
 
import org.openintents.tools.sensorsimulator.swt.SensorSimulatorSwt;
10
 
 
11
 
/**
12
 
 *
13
 
 * @author Lee Sanghoon
14
 
 */
15
 
public class SensorSimulatorSwtMain {
16
 
 
17
 
        public void run() {
18
 
                Display display = new Display();
19
 
                Shell shell = new Shell(display);
20
 
                shell.setText("Sensor Simulator");
21
 
                shell.setSize(800, 600);
22
 
                createContents(shell);
23
 
                shell.open();
24
 
                while (!shell.isDisposed()) {
25
 
                        if (!display.readAndDispatch()) {
26
 
                                display.sleep();
27
 
                        }
28
 
                }
29
 
                display.dispose();
30
 
                System.exit(0);
31
 
        }
32
 
 
33
 
        /**
34
 
         * @param shell
35
 
         */
36
 
        private void createContents(Shell shell) {
37
 
                shell.setLayout(new FillLayout());
38
 
 
39
 
                new SensorSimulatorSwt(shell);
40
 
        }
41
 
 
42
 
        /**
43
 
         * @param args
44
 
         */
45
 
        public static void main(String[] args) {
46
 
                new SensorSimulatorSwtMain().run();
47
 
        }
48
 
 
49
 
}