f***@eclipse.org
2017-11-13 15:32:23 UTC
The idea is to extend the XYGraphToolbar with another toolbar, called here "header". Then display the combined toolbar and the XYGraph bellow.
When laying out the three Figures, the result is an empty Figure.
Playing with the constraints, I was able to display approximately the graph, but I was not able to accurately set those constraints. The getPreferedSize() method of the xyGraph is returning a Dimension (0.0, 0.0).
Canvas c = new Canvas(parent, SWT.DOUBLE_BUFFERED);
Figure root = new Figure();
LightweightSystem lws = new LightweightSystem(c);
lws.setContents(root);
XYGraph xyGraph = new XYGraph();
XYGraphToolbar xyGraphToolbar = new XYGraphToolbar(xyGraph, XYGraphFlags.COMBINED_ZOOM);
...
Figure toolbar = new Figure();
ToolbarLayout toolbarLayout = new ToolbarLayout();
toolbar.setLayoutManager(toolbarLayout);
Figure header = createHeader();
toolbar.add(header);
toolbar.add(xyGraphToolbar);
root.add(toolbar);
root.add(xyGraph);
To participate in the discussion, go here: https://www.eclipse.org/forums/index.php?t=rview&frm_id=64
When laying out the three Figures, the result is an empty Figure.
Playing with the constraints, I was able to display approximately the graph, but I was not able to accurately set those constraints. The getPreferedSize() method of the xyGraph is returning a Dimension (0.0, 0.0).
Canvas c = new Canvas(parent, SWT.DOUBLE_BUFFERED);
Figure root = new Figure();
LightweightSystem lws = new LightweightSystem(c);
lws.setContents(root);
XYGraph xyGraph = new XYGraph();
XYGraphToolbar xyGraphToolbar = new XYGraphToolbar(xyGraph, XYGraphFlags.COMBINED_ZOOM);
...
Figure toolbar = new Figure();
ToolbarLayout toolbarLayout = new ToolbarLayout();
toolbar.setLayoutManager(toolbarLayout);
Figure header = createHeader();
toolbar.add(header);
toolbar.add(xyGraphToolbar);
root.add(toolbar);
root.add(xyGraph);
To participate in the discussion, go here: https://www.eclipse.org/forums/index.php?t=rview&frm_id=64