org.jzy3d.bridge.swt
Class Bridge

java.lang.Object
  extended by org.jzy3d.bridge.swt.Bridge

public class Bridge
extends Object

Adapts an AWT component into an SWT container. The following piece of code shows a convenient way of porting an AWT component to SWT:


Important notice: AWT components may trigger events (mouse, keyboard, component events, etc). When attaching a listener on a bridged AWT component that is supposed to modify an SWT widget (such as a text field), it is required to perform this modification into the SWT UI event queue. If not, the target SWT component will throw a SWTException with message "Invalid thread access". Indeed, all SWT widgets check that they are modified inside the UI thread.

Thus, it is suggested to compute events this way:
Text info = new Text(parent, SWT.None);
SWTplot plot = new SWTplot(parent);
plot.addPlotListener(new PlotListener(){
});


If problems are encountered with the Bridge, it is possible to check:
http://wiki.eclipse.org/Albireo_SWT_AWT_bugs
http://www.eclipsezone.com/eclipse/forums/t45697.html

Author:
Martin Pernollet

Constructor Summary
Bridge()
           
 
Method Summary
static void adapt(org.eclipse.swt.widgets.Composite containerSWT, Component componentAWT)
           
static void adaptIn(org.eclipse.swt.widgets.Composite embedder, Component componentAWT)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Bridge

public Bridge()
Method Detail

adapt

public static void adapt(org.eclipse.swt.widgets.Composite containerSWT,
                         Component componentAWT)

adaptIn

public static void adaptIn(org.eclipse.swt.widgets.Composite embedder,
                           Component componentAWT)


Copyright © 2013. All rights reserved.