use of eu.esdihumboldt.hale.ui.util.swing.SwingComposite in project hale by halestudio.
the class BBOXPage method createContent.
@Override
protected void createContent(Composite parent) {
Composite page = new Composite(parent, SWT.NONE);
GridLayoutFactory.swtDefaults().numColumns(1).applyTo(page);
SwingComposite wrapper = new SwingComposite(page);
GridDataFactory.fillDefaults().grab(true, true).hint(600, 400).applyTo(wrapper);
wrapper.getContentPane().setLayout(new BorderLayout());
// create map kit
mapKit = new BasicMapKit();
// configure map
updateMap(null);
// mapKit.addCustomPainter(mypainter);
// add map kit
wrapper.getContentPane().add(mapKit, BorderLayout.CENTER);
// create tool
final Display display = Display.getCurrent();
final Runnable updateRunner = new Runnable() {
@Override
public void run() {
updateState();
}
};
bboxTool = new BBoxTool() {
@Override
protected void addPosition(GeoPosition pos) {
super.addPosition(pos);
display.asyncExec(updateRunner);
}
@Override
public void reset() {
super.reset();
display.asyncExec(updateRunner);
}
};
// activate tool
new MapToolAction(bboxTool, mapKit, true);
setControl(page);
}
Aggregations