mirror of https://github.com/rusefi/jzy3d-api.git
Enhancement: creating a bridge in the given composite (without creating an inner embedded composite)
This commit is contained in:
parent
7b4e58b1bc
commit
8cdc378249
|
@ -78,4 +78,23 @@ public class Bridge {
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void adaptIn(Composite embedder, final Component componentAWT) {
|
||||
final Frame frame = SWT_AWT.new_Frame(embedder);
|
||||
frame.add(componentAWT);
|
||||
|
||||
// disposing the frame cleanly
|
||||
embedder.addDisposeListener(new DisposeListener(){
|
||||
public void widgetDisposed(DisposeEvent arg0) {
|
||||
EventQueue.invokeLater(new Runnable () {
|
||||
public void run () {
|
||||
//System.out.println("Bridge is disposing frame containing " + componentAWT.getName() + " - " + componentAWT.getClass());
|
||||
frame.dispose();
|
||||
// the awt component is supposed to be disposed by the user
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue