Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » RAP and Nebula: Impressive!
RAP and Nebula: Impressive! [message #1721558] Thu, 28 January 2016 10:09 Go to next message
Michael Fritscher is currently offline Michael FritscherFriend
Messages: 43
Registered: September 2012
Member
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 Smile ) 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 Smile )
* disable functionality which RAP doesn't have

most of the things are working Smile
* 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.
index.php/fa/24796/0/
* 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.
index.php/fa/24794/0/
index.php/fa/24795/0/
* 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 1635 times)
  • Attachment: Gauge.png
    (Size: 64.09KB, Downloaded 1523 times)
  • Attachment: Oscilloscop.png
    (Size: 61.14KB, Downloaded 1462 times)
Re: RAP and Nebula: Impressive! [message #1723072 is a reply to message #1721558] Thu, 11 February 2016 11:32 Go to previous messageGo to next message
Michael Fritscher is currently offline Michael FritscherFriend
Messages: 43
Registered: September 2012
Member
And here is the screenshot for the gant chart:
index.php/fa/24956/0/
  • Attachment: Gant.png
    (Size: 52.56KB, Downloaded 1369 times)

[Updated on: Thu, 11 February 2016 11:33]

Report message to a moderator

Re: RAP and Nebula: Impressive! [message #1723078 is a reply to message #1723072] Thu, 11 February 2016 12:24 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi,
that's very impressive. Did you make any modifications to the original
Nebula code? Could you please list the missing API in RAP that is used
by these Nebula widgets? Maybe now it's possible to implement some of them.
Regards,
Ivan

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: RAP and Nebula: Impressive! [message #1723097 is a reply to message #1723078] Thu, 11 February 2016 15:18 Go to previous messageGo to next message
Michael Fritscher is currently offline Michael FritscherFriend
Messages: 43
Registered: September 2012
Member
Hi,

the biggest part was:
* 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 Wink )
* disable functionality which RAP doesn't have.

and the workarounds I mentioned in the posts before.
Else the code is left original.

Some of the missing stuff:
* gc.textExtent()
* gc.setLineStyle()
* gc.getLineDash()
* gc.setInterpolation()
* gc.setTransform()
* gc.textExtent()
* new GC(Image)
* SWT.TRAVERSE_*
* SWT.HIGH
* SWT.PaintItem
* Scrollbar.setIncrement()
* org.eclipse.swt.program.Program
* FileDialog.setFilterExtensions
* Control.traverse()
* new Transform(Device)
* Canvas.drawBackground()
* Canvas.scroll()
* Canvas.setDragDetect()
* Canvas.setCapture()
* Canvas.drawBackground()
* FontMetrics.getAscent()
* FontMetrics.getLeading()

* TreeViewer.*drag/drop* (can't look up now where there are exactly defined)

* Composite.addPaintListener
* Composite.addMouseMoveListener
* Composite.addMouseTrackListener
* Composite.addMouseWheelListener

* org.eclipse.jface.window.DefaultToolTip
* org.eclipse.jface.window.ToolTip

* org.eclipse.swt.graphics.Pattern

* Text.cut()
* Text.paste()

I think the biggest thing would be to mainstream Draw2D from the GEF incubator. The mouse listener are a problem regarding bandwidth. An idea could be perhaps that these listeners only get fired if a button or wheel get pressed or release, with a RAP-specific option to enable transferring mouse movements as well, with minimal duration between 2 transfers (+ every click). In my environment (local networks) for instance I've no bandwidth problem Wink

A bigger thing would be to maintain a local copy of the GC data, which also enables things like new GC(Image) I guess.

Fixing of the nebula widget's manifests is more a "political decision" I guess?

Best regards,
Michael

[Updated on: Thu, 11 February 2016 15:19]

Report message to a moderator

Re: RAP and Nebula: Impressive! [message #1723104 is a reply to message #1723097] Thu, 11 February 2016 15:56 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi,
thanks for the list. gc.setTransform() and new Transform(Device)are
already implemented in RAP 3.1M4. Probably we could also implement:
- Scrollbar.setIncrement()
360794: [ScrollBar] Support (page) increment
https://bugs.eclipse.org/bugs/show_bug.cgi?id=360794
- MouseTrackListener

Regards,
Ivan

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: RAP and Nebula: Impressive! [message #1723169 is a reply to message #1723104] Fri, 12 February 2016 10:22 Go to previous messageGo to next message
Michael Fritscher is currently offline Michael FritscherFriend
Messages: 43
Registered: September 2012
Member
I just tried RAP 3.1 (just switched from RAP 3.0 to RAP3.1) - on the Gant chart I got the log I attached. I'll try to make a simple project to reproduce this.
  • Attachment: log.txt
    (Size: 77.62KB, Downloaded 186 times)
Re: RAP and Nebula: Impressive! [message #1723180 is a reply to message #1723169] Fri, 12 February 2016 11:27 Go to previous messageGo to next message
Michael Fritscher is currently offline Michael FritscherFriend
Messages: 43
Registered: September 2012
Member
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 199 times)
Re: RAP and Nebula: Impressive! [message #1723188 is a reply to message #1723169] Fri, 12 February 2016 12:28 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
HI,
which exact RAP 3.1 milestone are you using? M5?
Regards,
Ivan

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: RAP and Nebula: Impressive! [message #1723215 is a reply to message #1723188] Fri, 12 February 2016 14:20 Go to previous messageGo to next message
Michael Fritscher is currently offline Michael FritscherFriend
Messages: 43
Registered: September 2012
Member
The current one from http://download.eclipse.org/rt/rap/3.1 - 3.1.0.20160202-1338 . So yes, seems to be M5.

[Updated on: Fri, 12 February 2016 14:20]

Report message to a moderator

Re: RAP and Nebula: Impressive! [message #1723236 is a reply to message #1723215] Fri, 12 February 2016 16:18 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Michael,
could you please attach the modified
"org.eclipse.nebula.widgets.ganttchart" bundle?
Regards,
Ivan

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: RAP and Nebula: Impressive! [message #1723237 is a reply to message #1723236] Fri, 12 February 2016 16:22 Go to previous messageGo to next message
Michael Fritscher is currently offline Michael FritscherFriend
Messages: 43
Registered: September 2012
Member
Hello Ivan,

here it is Smile

Best regards,
Michael
Re: RAP and Nebula: Impressive! [message #1723372 is a reply to message #1723237] Mon, 15 February 2016 09:04 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Thanks Michael.
The issue has been isolated. Pending change is waiting for review:
https://git.eclipse.org/r/#/c/66600/
Will be fixed in RAP 3.1 M6.
Regards,
Ivan

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: RAP and Nebula: Impressive! [message #1723410 is a reply to message #1723372] Mon, 15 February 2016 13:12 Go to previous messageGo to next message
Michael Fritscher is currently offline Michael FritscherFriend
Messages: 43
Registered: September 2012
Member
Ah, thanks for the quick fix Smile

One question: How can I help debug client JS crashes myself to be able to give more info? This one was a bit complicated one I think, but perhaps I could help if those things happen in simplier cases Wink

Best regards,
Michael

[Updated on: Mon, 15 February 2016 13:15]

Report message to a moderator

Re: RAP and Nebula: Impressive! [message #1723414 is a reply to message #1723410] Mon, 15 February 2016 13:32 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
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/
Re: RAP and Nebula: Impressive! [message #1725157 is a reply to message #1721558] Tue, 01 March 2016 09:57 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Michael,
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

--
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 Go to previous messageGo to next message
Michael Fritscher is currently offline Michael FritscherFriend
Messages: 43
Registered: September 2012
Member
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 139 times)
Re: RAP and Nebula: Impressive! [message #1745399 is a reply to message #1725157] Mon, 10 October 2016 10:57 Go to previous message
Michael Fritscher is currently offline Michael FritscherFriend
Messages: 43
Registered: September 2012
Member
Ivan Furnadjiev wrote on Tue, 01 March 2016 04:57
Michael,
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 Sad 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]

Report message to a moderator

Previous Topic:Embed RAP panel with components in an HTML page
Next Topic:FileDialog Rap 3.0+ Filter
Goto Forum:
  


Current Time: Fri Mar 29 15:15:25 GMT 2024

Powered by FUDForum. Page generated in 0.06224 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top