ikuraj / alloy4eclipse

Automatically exported from code.google.com/p/alloy4eclipse
0 stars 0 forks source link

A4 viz graph is "black" (win32 only) #20

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Run A4E on win32
2. Visualize an A4 instance
3. The A4 graph pane is black

What is the expected output? What do you see instead?
The A4 graph pane should show the A4 instance graph

What version of the product are you using? On what operating system?
0.1.7 from SVN

Please provide any additional information below.
With 64-bit linux (ubuntu 7.0.4) and RSA 7.0.0.3,
A4E works fine A4/SAT4J.

I recently started using A4E on win32 where I experienced this problem.
The article below suggests a simple fix
Fix is 
http://www.eclipse.org/articles/article.php?file=Article-Swing-SWT-Integration/i
ndex.html

In A4E's case, applying this article suggests the following changes:

public class MultiPageEditor extends MultiPageEditorPart implements
IResourceChangeListener{

    /**
     * @author Nicolas.Rouquette@jpl.nasa.gov
     * @per Reducing Flicker
     * @see
http://www.eclipse.org/articles/article.php?file=Article-Swing-SWT-Integration/i
ndex.html
     */
    static {
        if (Platform.OS_WIN32.equals(Platform.getOS())) {
            System.setProperty("sun.awt.noerasebackground", "true");
        }
    }

...

    /**
     * Creates page 2 of the multi-page editor,
     * which contains a frame with the graph.
     * 
     * @author Nicolas.Rouquette@jpl.nasa.gov
     * @per Using the SWT/AWT Bridge
     * @see
http://www.eclipse.org/articles/article.php?file=Article-Swing-SWT-Integration/i
ndex.html
     */
    void createPage2() {

                IEditorInput input;
                input=editor.getEditorInput();

                Composite swtAwtComponent = new Composite(getContainer(),
SWT.EMBEDDED | SWT.NO_BACKGROUND);
                java.awt.Frame frame = SWT_AWT.new_Frame(swtAwtComponent );

                /**
                 * @per Creating a Root Pane Container
                 * @see
http://www.eclipse.org/articles/article.php?file=Article-Swing-SWT-Integration/i
ndex.html
                 */
                javax.swing.JApplet applet = new javax.swing.JApplet();
                frame.add(applet);

                javax.swing.JPanel panel = new JPanel();

                MyVizGUI viz = new MyVizGUI();
                viz.run(MyVizGUI.evs_loadInstanceForcefully,
Util.getFileLocation((IResource)input.getAdapter(IResource.class)));

                panel=viz.getGraphPanel();
                if (panel!=null)
                    applet.add(panel);  

                FillLayout layout = new FillLayout();
                swtAwtComponent.setLayout(layout);

                int index = addPage(swtAwtComponent);
....

Original issue reported on code.google.com by nicolas....@gmail.com on 8 Sep 2007 at 10:16

GoogleCodeExporter commented 8 years ago
Antoine, Francois,

I am not using A4E under windows. Could you try the reproduce the bug and 
confirm
that behavior?

Nicolas,

Could you provide us the exact version of the JVM and Eclipse you are using?

Original comment by daniel.l...@gmail.com on 9 Sep 2007 at 5:15

GoogleCodeExporter commented 8 years ago

Original comment by daniel.l...@gmail.com on 10 Sep 2007 at 10:34

GoogleCodeExporter commented 8 years ago
Antoine confirmed me this morning that the current code does not work fine under
Windows with Eclipse 3.3.

Original comment by daniel.l...@gmail.com on 14 Sep 2007 at 12:30

GoogleCodeExporter commented 8 years ago
This problem need to be addressed ASAP.

Original comment by daniel.l...@gmail.com on 14 Sep 2007 at 12:30

GoogleCodeExporter commented 8 years ago
With the 3.3.0 Eclipse (lastest version) and the 0.1.6 A4E i don't have any bug 
with
graph viz.
I'll try more checking tonight.

Original comment by AntoineB...@gmail.com on 14 Sep 2007 at 6:57

GoogleCodeExporter commented 8 years ago
The problem is supposed to be fixed. Need confirmation from users.

Original comment by daniel.l...@gmail.com on 2 Oct 2007 at 9:21