Bug 248242 - [Zest] Incorrect display of graph in RCP app
Summary: [Zest] Incorrect display of graph in RCP app
Status: NEW
Alias: None
Product: GEF
Classification: Tools
Component: GEF-Legacy Zest (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: gef-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-23 04:37 EDT by Richard Adams CLA
Modified: 2015-01-22 02:45 EST (History)
0 users

See Also:


Attachments
image of correct and buggy graph display (16.35 KB, image/gif)
2008-09-23 04:37 EDT, Richard Adams CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Adams CLA 2008-09-23 04:37:49 EDT
Created attachment 113228 [details]
image of correct and buggy graph display

Build ID: I20080617-2000

Steps To Reproduce:
1. Create a 'Hello World' RCP app
2. Create a view using a Zest GraphViewer and add this view to the perspective so that it will be displayed on start up.
3. For the content provider to the viewer, create a graph with 1 central node connected by to four others. (i.e., 5 nodes, 4 edges).
4. Run the RCP app - sometimes the graph displays properly, sometimes nodes and edges are missing.


More information:
This is from GEF newsgroup thread 'Re: strange zest rendering in RCP?' started 12/9/08.

I have discovered that it only seems to happen when the view appears from application startup.  I have added a Window->ShowView action to the menubar, and if I close the graphview, and reopen it, the graph appears fine.

 The model is 4 source nodes connected to a  central destination node
                Node1
                   |
                   |
                   |
  Node2   ----> CentralNode<------Node 3
                   |
                   |
                   |
                  Node4

 When running from start up, the central node, 1 edge, and and 1 source node appear in the view, and another node with a self edge but no label. Two nodes are missing completely.  I.e.,

         A node -------------> CentralNode


          Another_unconnected_node


This is actually pretty consistent - so the central node always appears, and 2 others.
 This is using the 'GraphViewer' class in a custom view class that extends ViewPart, and is contributed via the plugin.xml, in exactly the same way as the 'Hello World' RCP view.

The 'createPartControl' method of the view:
public void createPartControl(Composite parent) {
		viewer = new GraphViewer(parent,  SWT.H_SCROLL
				| SWT.V_SCROLL);
		
		viewer.setContentProvider(new ViewContentProvider());
		viewer.setLabelProvider(new MyLabelProvider());
		
		viewer.setConnectionStyle(ZestStyles.CONNECTIONS_DIRECTED);
		viewer.setLayoutAlgorithm(new SpringLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING));
		viewer.setInput(getInput()); // hardcoded test model data
		getSite().setSelectionProvider(viewer);
		setPartName("SBML view");
		
		
	}

MyLabelProvider is a simple implementation of IEntityStyleProvider

ViewContentProvider implements IGraphContentPRovider and returns a hardcoded content.
Comment 1 Alexander Nyßen CLA 2015-01-22 02:45:15 EST
Re-assigning back to inbox, as Ian is no longer active committer.