Home » Eclipse Projects » Remote Application Platform (RAP) » RAP and Nebula: Impressive!
RAP and Nebula: Impressive! [message #1721558] |
Thu, 28 January 2016 10:09  |
Eclipse User |
|
|
|
Hi,
the last days I tried to get several Nebula widgets working in RAP. After importing draw2d from GEF incubation and a wild java error weeding party (20k to 0 ) solving the following main problems:
* The Nebula widget's manifests reference bundles instead of packages, which needed to be changed
* missing constants in the SWT class (most were in draw2d)
* missing RTL constants and functions (but going to be fixed in RAP 3.1 )
* disable functionality which RAP doesn't have
most of the things are working 
* FormattedText: no problem
* Oscilloscope: Needs functionality to get a GC from a image instead of a canvas. Should be quite easy for the most usecases, because this can be done on the servers side. But luckily, it is only used for writing upright diagramm labels, so I just disabled it. Works very smooth, even animations.

* Visualisation (I tried xygraph, tank, temperature, speed view etc.): works, but flickers on update. Perhaps this could be optimized using a double buffer strategy on the client side with a default transparent picture. Interactions are working. The flickering could be tolerable for some usecases.


* Gant charts: I needed to disable a redraw() call (else I got a stack overflow). Static view is working, dynamic changes are suffering from missing MouseEvents I think. Perhaps at least sending MousePress(Up/Down) Events would be nice (and don't need so much more bandwith, because MouseClick events are fired anyway and I don't think that a user do so many clicks per second (move is another story). But even the static view is very, very useful!
I was quite impressed how easy it was and how many things are working. As Nebula mentions also compatibility with RAP: Are there any collaborations?
Attachment: BarChart.png
(Size: 58.12KB, Downloaded 1672 times)
Attachment: Gauge.png
(Size: 64.09KB, Downloaded 1572 times)
Attachment: Oscilloscop.png
(Size: 61.14KB, Downloaded 1511 times)
|
|
| | | | | |
Re: RAP and Nebula: Impressive! [message #1723180 is a reply to message #1723169] |
Fri, 12 February 2016 11:27   |
Eclipse User |
|
|
|
Its the (a bit adapted, ie converted to a RCP-View) GantChartScopeView:
public void createPartControl(Composite parent) {
// Create a chart
GanttChart ganttChart = new GanttChart(parent, SWT.NONE);
// Create a scope
GanttEvent scopeEvent = new GanttEvent(ganttChart, "Scope of 3 events");
// Create some calendars
Calendar sdEventOne = Calendar.getInstance();
Calendar edEventOne = Calendar.getInstance();
edEventOne.add(Calendar.DATE, 10);
Calendar sdEventTwo = Calendar.getInstance();
Calendar edEventTwo = Calendar.getInstance();
sdEventTwo.add(Calendar.DATE, 11);
edEventTwo.add(Calendar.DATE, 15);
Calendar cpDate = Calendar.getInstance();
cpDate.add(Calendar.DATE, 16);
// Create events
GanttEvent eventOne = new GanttEvent(ganttChart, "Scope Event 1");
GanttEvent eventTwo = new GanttEvent(ganttChart, "Scope Event 2", sdEventTwo, edEventTwo, 10);
GanttEvent eventThree = new GanttEvent(ganttChart, "Checkpoint", cpDate, cpDate, 75);
eventThree.setCheckpoint(true);
// Add events to scope
scopeEvent.addScopeEvent(eventOne);
scopeEvent.addScopeEvent(eventTwo);
scopeEvent.addScopeEvent(eventThree);
eventOne.addScopeEvent(eventTwo);
eventOne.addScopeEvent(eventThree);
// Show chart
//shell.open();
/*
while (!shell.isDisposed ()) {
if (!display.readAndDispatch ()) display.sleep ();
}
display.dispose ();
*/
}
The interesting thing is that if I remove all but
GanttChart ganttChart = new GanttChart(parent, SWT.NONE);
I get the error mentioned in the attachment.
Attachment: log2.txt
(Size: 56.44KB, Downloaded 216 times)
|
|
| | | | | | |
Re: RAP and Nebula: Impressive! [message #1723414 is a reply to message #1723410] |
Mon, 15 February 2016 13:32   |
Eclipse User |
|
|
|
Hi Michael,
to debug client crashes you need a knowledge about the JS client (JS
code) and the RAP protocol. These crashes can be related to some
server-side (rendering) code, like in this case... or pure JS (client)
errors or browser glitches. There is no step-by-step debugging guide. In
any case, we consider JS crashes as priority one problems. Just file a
bugzilla and they will be addressed as soon as possible.
Regards,
Ivan
--
Ivan Furnadjiev
Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/
Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
|
|
| |
Repaint issue with xygraph [message #1745397 is a reply to message #1725157] |
Mon, 10 October 2016 10:30   |
Eclipse User |
|
|
|
After some experiments with the xygraph, it seems to have severe repaint issues.
I'm using current RAP 3.1.1 + draw2d.* from GEF incubator.
If I use the attached code without the block marked with [repaint] the graph disapperas after 1 or 2 clicks on the toolbar. After resizing the browser window it is redrawn again. If I enable the marked code it disappears after a second. It is reddrawn correctly after a resize, but after a second it disapperas again. So there seems to be a severe problem with the repaint functionality on the LightweightSystem component. Perhaps it is coupled with the massive flicker problem when using e.g. the GaugeFigure?
I've bundled all relevant packages and files in the packages.zip.
[code]
package de.zft.kommunikationsframework_gui_nebula_template.views;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
import org.eclipse.draw2d.LightweightSystem;
import org.eclipse.nebula.visualization.xygraph.dataprovider.CircularBufferDataProvider;
import org.eclipse.nebula.visualization.xygraph.figures.ToolbarArmedXYGraph;
import org.eclipse.nebula.visualization.xygraph.figures.Trace;
import org.eclipse.nebula.visualization.xygraph.figures.Trace.PointStyle;
import org.eclipse.nebula.visualization.xygraph.figures.XYGraph;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.part.ViewPart;
public class XYGraphView extends ViewPart {
public static final String ID = XYGraphView.class.getName();
@Override
public void createPartControl(final Composite parent) {
//FormattedText tf = new FormattedText(parent, SWT.None);
//tf.setFormatter(new NumberFormatter());
parent.setLayout(new FillLayout());
//final Shell shell = new Shell();
//shell.setSize(800, 600);
//Oscilloscope scope = new Oscilloscope(parent, SWT.NONE);
//scope.getDispatcher(0).dispatch();
//use LightweightSystem to create the bridge between SWT and draw2D
//final LightweightSystem lws = new LightweightSystem(shell);
final LightweightSystem lws = new LightweightSystem(new Canvas(parent, SWT.NONE));
//create a new XY Graph.
XYGraph xyGraph = new XYGraph();
xyGraph.setTitle("Simple Example");
final ToolbarArmedXYGraph toolbarArmedXYGraph = new ToolbarArmedXYGraph(xyGraph);
//set it as the content of LightwightSystem
//lws.setContents(xyGraph);
lws.setContents(toolbarArmedXYGraph);
//create a trace data provider, which will provide the data to the trace.
CircularBufferDataProvider traceDataProvider = new CircularBufferDataProvider(false);
traceDataProvider.setBufferSize(100);
traceDataProvider.setCurrentXDataArray(new double[]{10, 23, 34, 45, 56, 78, 88, 99});
traceDataProvider.setCurrentYDataArray(new double[]{11, 44, 55, 45, 88, 98, 52, 23});
ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
ScheduledFuture<?> future = scheduler.scheduleAtFixedRate(new Runnable() {
public void run() {
parent.getDisplay().asyncExec(new Runnable() {
public void run() {
lws.getUpdateManager().addDirtyRegion(toolbarArmedXYGraph, 0, 0, 1000, 1000);
lws.getUpdateManager().performUpdate();
}
});
}
}, 1000, 1000, TimeUnit.MILLISECONDS);
[/repaint]
//create the trace
Trace trace = new Trace("Trace1-XY Plot",
xyGraph.primaryXAxis, xyGraph.primaryYAxis, traceDataProvider);
//set trace property
trace.setPointStyle(PointStyle.XCROSS);
//add the trace to xyGraph
xyGraph.addTrace(trace);
//shell.open();
//shell.layout();
}
@Override
public void setFocus() {
// TODO Auto-generated method stub
}
}
[code]
Attachment: packages.zip
(Size: 2.58MB, Downloaded 163 times)
|
|
|
Re: RAP and Nebula: Impressive! [message #1745399 is a reply to message #1725157] |
Mon, 10 October 2016 10:57  |
Eclipse User |
|
|
|
Ivan Furnadjiev wrote on Tue, 01 March 2016 04:57Michael,
did you try Nebula CDateTime/DateChooser in RAP? If so please comment on
bug:
467162: Date control that supports null value
https://bugs.eclipse.org/bugs/show_bug.cgi?id=467162
Thanks,
Ivan
Sorry, missed that I yust tried it. It works - at least the basics and after killing the TypedListener (which imports org.eclipse.swt.internal.SWTEventListener, which is bad)
Edit: The DateChooser is working well, too! Yust needed to kill
case SWT.TRAVERSE_ARROW_NEXT :
case SWT.TRAVERSE_ARROW_PREVIOUS :
case SWT.TRAVERSE_PAGE_NEXT :
case SWT.TRAVERSE_PAGE_PREVIOUS :
event.doit = false;
break;
[Updated on: Mon, 10 October 2016 11:17] by Moderator Report message to a moderator
|
|
|
Goto Forum:
Current Time: Tue Feb 18 00:24:42 GMT 2025
Powered by FUDForum. Page generated in 0.08242 seconds
|