Home » Eclipse Projects » Remote Application Platform (RAP) » Image
Image [message #86749] |
Mon, 12 May 2008 05:16 |
Salwa Alzhmi Messages: 69 Registered: July 2009 |
Member |
|
|
Hi
I want to know how can i create an image from my Image Data or from my
input stream, because am using Jfree Chart lib,,,and there is no bridge
between SWTand AWT in RAP "for example SWT_AWT.new_Frame(this)". So, am
trying to write the image to a buffer using AWT, and then load it from the
same buffer using SWT.
RWT Image class dosn't provide a constractor to recieve an image data , or
even an input stream, which makes it diffecult to regenerate the image.
Another Question here , Some of Jfree Library APIs are using Swing,So is
RAP supporting Swing?.
thankx
Regards
Salwa
|
|
|
Re: Image [message #86867 is a reply to message #86749] |
Mon, 12 May 2008 10:37 |
Eclipse User |
|
|
|
Originally posted by: fappel.innoopract.com
Hi,
you may use Graphics#getImage(String,InputStream) for creating an image
based on an input stream.
RAP doesn't support Swing. In theory this could be possible, but the
effort to do so is currently out of the project's scope.
Ciao
Frank
-----Ursprüngliche Nachricht-----
Von: Salwa [mailto:salwa.moh@gmail.com]
Bereitgestellt: Montag, 12. Mai 2008 07:17
Bereitgestellt in: eclipse.technology.rap
Unterhaltung: Image
Betreff: Image
Hi
I want to know how can i create an image from my Image Data or from my
input stream, because am using Jfree Chart lib,,,and there is no bridge
between SWTand AWT in RAP "for example SWT_AWT.new_Frame(this)". So, am
trying to write the image to a buffer using AWT, and then load it from
the same buffer using SWT.
RWT Image class dosn't provide a constractor to recieve an image data ,
or even an input stream, which makes it diffecult to regenerate the
image.
Another Question here , Some of Jfree Library APIs are using Swing,So is
RAP supporting Swing?.
thankx
Regards
Salwa
|
|
| |
Charts in RAP (was Re: Image) [message #86896 is a reply to message #86881] |
Mon, 12 May 2008 12:37 |
Eclipse User |
|
|
|
Originally posted by: evolanakis.innoopract.com
Hi Salwa,
I see two possibilities:
- as mentioned in a previous thread, if you can use JFree on the server
to save the chart into an image file, you should be able to show the
image in RAP. For example you can write a servlet that returns an image.
- second, you could look into the google chart API. For example this
shows a pie chart:
http://chart.apis.google.com/chart?chs=250x100&chd=t:60, 40&cht=p3&chl=Hello|World
This works great in the browser (but may be problematic if you have an
offline RCP client). The drawback is that you send the chart data over
unsecured http, so it could be a problem if your data is confidential.
There is small POJO Java wrapper that does not have any dependencies here:
http://code.google.com/p/gchartjava/
GChartJava example:
Slice slice1 = new Slice(33,"foo");
Slice slice2 = new Slice(33,"bar");
Slice slice3 = new Slice(34,"zap");
PieChart chart = new PieChart(slice1, slice2, slice3);
String url = chart.createURLString();
You can then use the URL to show the chart.
If you want a very polished solution, you could write a custom widget
around this, but I'm sure there other options too.
Regards,
Elias.
Salwa wrote:
>
> Hi Frank
> Is that mean I can't get JFree library work till I do the integration
> between RAP and Jfree , and replace swing dependancy with swt and Jfaces ?
>
>
> Thankx Salwa
>
|
|
| |
Re: Image [message #87255 is a reply to message #87168] |
Wed, 14 May 2008 14:34 |
Eclipse User |
|
|
|
Originally posted by: fappel.innoopract.com
Hi,
maybe I don't understand the problem. But if you have a servlet that
produces the JFreeChart, why don't you use the browser widget and set
the URL of the browser widget to the servlet (browser.setURL(
"myApp/myServlet?chart=0815"))? If the servlet is mapped like this:
<extension point="org.eclipse.equinox.http.registry.servlets">
<servlet
alias="/myServlet"
class="org.mycompany.myproject.MyServlet"
httpcontextId="org.eclipse.rap.httpcontext"
load-on-startup="true">
</servlet>
</extension>
Ciao
Frank
-----Ursprüngliche Nachricht-----
Von: Salwa [mailto:salwa.moh@gmail.com]
Bereitgestellt: Mittwoch, 14. Mai 2008 14:27
Bereitgestellt in: eclipse.technology.rap
Unterhaltung: Image
Betreff: Re: Charts in RAP (was Re: Image)
thankx Elias,
I know now how to create a servlet to generate A JFreeChart , but I
wanted to know how can I use servlet on my RAP application. Actually The
servlet result should be shown in a browser within my RAP Application.
How can I do that.
am using equinox.Jetty as a webserver.
Regards
Salwa
|
|
| |
Re: Image [message #87382 is a reply to message #87367] |
Thu, 15 May 2008 05:08 |
Eclipse User |
|
|
|
Originally posted by: fappel.innoopract.com
Hm,
somehow it truncated the explanation, which was already there. But
anyway, are you running your app currently from the Eclipse IDE? Meaning
your app URL would look s.th. like this:
http://192.168.1.12:7070/rap?startup=myentrypoint. Running the same app
(let's say it's called myapp) on a tomcat for example the URL would look
like this: http://192.168.1.12:7070/myapp/rap?startup=myentrypoint. So
running from the IDE access to your servlet should look like this:
http://192.168.1.12:7070/myServletName, where myServletName is the
servlet alias name mapped in the extension-point. On tomcat it should
look like this: http://192.168.1.12:7070/myapp/myServletName.
Ciao
Frank
-----Ursprüngliche Nachricht-----
Von: Salwa [mailto:salwa.moh@gmail.com]
Bereitgestellt: Mittwoch, 14. Mai 2008 23:22
Bereitgestellt in: eclipse.technology.rap
Unterhaltung: Image
Betreff: Re: Image
Thankx Alot Frank
I have added the extension with http ,, to register my servlet class,
but i didn't get a result on my browser ,,and am sure because of the
URL.
my URL is look like this:
http://192.168.1.12:7070/Salwa/SarvletClassName
where Salwa is my RAP application alias name and SarvletClassName is my
servlet alias name.
Could you please explain your URL
"browser.setURL("myApp/myServlet?chart=0815"))? " , because I didn't get
what you mean by "myApp" and "chart=0815"
Regards
Salwa
|
|
| |
Re: Image [message #90131 is a reply to message #87528] |
Mon, 26 May 2008 21:14 |
Eclipse User |
|
|
|
Originally posted by: tavoaqp.gmail.com
Hi Salma
How could I pass data to this servlet in order to generate dynamic graphs?
thanks
Gustavo
Salwa escreveu:
>
> Thankx Very much Frank and Elias , JFreeChart is working fine with me
> now ..
>
>
>
> Regards Salwa
|
|
|
Goto Forum:
Current Time: Thu Apr 25 14:16:37 GMT 2024
Powered by FUDForum. Page generated in 0.03842 seconds
|