public void init() {
// get the main window
List<Extension> mainWindowsList= getExtensionManager().getExtensions("MainWindow");
for(Extension extension : mainWindowsList) {
if (extension instanceof MainWindow) {
MainWindow mw = (MainWindow) extension;
// create new marker drawer
MarkerDraw md = new MarkerDraw(mw.getMain3DWidget());
// add the marker drawer
mw.getMain3DWidget().getDrawableManager().add(md);
// add the toolbar button
JButton toolbarbutton = new JButton("Add Marker");
toolbarbutton.addActionListener(md);
mw.getToolBar().add(toolbarbutton);
}
}
}