Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[ve-dev] Re: Using JEM to draw cartoon images of widgets

Hi Rich,

Thanks for the detailed information.
It took me a while to absorb the information and place it in the right
context. I understand the code references you made in your email. However, I
still am lost about some high level concepts.

1. Does each component get rendered in the Proxy VM individually, or is the
entire form/frame content gets rendered and then each component's cartoon is
retrieved seperately.

For example - If I have a frame with two buttons in it, then how do I get
the image for each of the buttons. Do I create the entire frame and the
buttons in the proxy VM first, and then get the images individually for
Frame/Button1/Button2? Or,
Do I create a JWindow and then place the Frame in it first, get its cartoon
image, and then place Button1 in the JWindow and get its cartoon image and
so on.

Thanks
Namrata

----- Original Message -----
From: <ve-dev-request@xxxxxxxxxxx>
To: <ve-dev@xxxxxxxxxxx>
Sent: Monday, June 13, 2005 8:01 AM
Subject: ve-dev Digest, Vol 4, Issue 4


> Send ve-dev mailing list submissions to
> ve-dev@xxxxxxxxxxx
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://dev.eclipse.org/mailman/listinfo/ve-dev
> or, via email, send a message with subject or body 'help' to
> ve-dev-request@xxxxxxxxxxx
>
> You can reach the person managing the list at
> ve-dev-owner@xxxxxxxxxxx
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of ve-dev digest..."
>
>
> Today's Topics:
>
>    1. Using JEM to draw cartoon images of widgets (Namrata)
>    2. Initial size of swing containers (Janak Mulani)
>    3. Re: Initial size of swing containers (Rich Kulp)
>    4. Re: Using JEM to draw cartoon images of widgets (Rich Kulp)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 13 Jun 2005 07:37:52 -0800
> From: "Namrata" <namrata@xxxxxxxxxxxxxx>
> Subject: [ve-dev] Using JEM to draw cartoon images of widgets
> To: <ve-dev@xxxxxxxxxxx>
> Message-ID: <003001c5702d$eed43110$030fa8c0@xxxxxxxxxxxxxx>
> Content-Type: text/plain; charset="iso-8859-1"
>
>
> Hi,
>
> I'm evaluating the feasibility of developing a form designer. Our model is
a static XML based model to represent AWT/Swing forms.
>
> I want to develop an editor using EMF/GEF. For drawing the images, I want
to reuse the VE internal functionality in the JEM plugin.
>
> I looked at the VE source and the JEM test code, but its still confusing
due to lack of a document. I will greatly appreciate any pointers on a high
level description of how to use JEM to create the widgets in a seperate VM
and scrape the cartoon images to display in the form designer.
>
> In return I will document the JEM API and the usage in detail.
>
> Thanks in advance.
> Namrata
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
http://eclipse.org/pipermail/ve-dev/attachments/20050613/11c2d26a/attachment
.html
>
> ------------------------------
>
> Message: 2
> Date: Mon, 13 Jun 2005 12:12:29 +0200
> From: "Janak Mulani" <janak.mulani@xxxxxxxxx>
> Subject: [ve-dev] Initial size of swing containers
> To: "ve-Dev@Eclipse. Org" <ve-dev@xxxxxxxxxxx>
> Message-ID: <JKEGLEJHFHKKKCOFIJDMGEIADIAA.janak.mulani@xxxxxxxxx>
> Content-Type: text/plain; charset="us-ascii"
>
> Dear VE Team,
>
> I have a question regarding Swing containers.
>
> Scenario:
>
> When Swing containers (such as JPanel, JTabbebPane, JScrollPane,
> JDesktopPane, JToolBar) are placed on the canvas, they appear as small
> square (with width=10, height=10) on the canvas.
>
> Questions:
>
> 1. How does one control the initial size of containers on the canvas?
>
> 2. Could you please point me to the relevant code that is controlling the
> initial size of a container on the canvas?
>
> Thanks and regards,
>
> Janak
>
>
>
> ------------------------------
>
> Message: 3
> Date: Mon, 13 Jun 2005 09:13:59 -0400
> From: Rich Kulp <richkulp@xxxxxxxxxx>
> Subject: Re: [ve-dev] Initial size of swing containers
> To: Discussions people developing code for the Visual Editor project
> <ve-dev@xxxxxxxxxxx>
> Message-ID:
> <OF3C04242E.B06413EE-ON8525701F.00481382-8525701F.0048B149@xxxxxxxxxx>
> Content-Type: text/plain; charset="us-ascii"
>
> Hi Janak,
>
> The initial size of containers on the freeform is their preferred size or
> the size that has been explicitly given to it when it was dropped (for
> example when dropping it can also be sized). If the size is (0,0) then
> there would be no image (or for some other reason there is no image), then
> cde.ImageFigure chooses a default size of (10,10).
>
> Rich
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
http://eclipse.org/pipermail/ve-dev/attachments/20050613/ebee1b10/attachment
.html
>
> ------------------------------
>
> Message: 4
> Date: Mon, 13 Jun 2005 10:02:06 -0400
> From: Rich Kulp <richkulp@xxxxxxxxxx>
> Subject: Re: [ve-dev] Using JEM to draw cartoon images of widgets
> To: Discussions people developing code for the Visual Editor project
> <ve-dev@xxxxxxxxxxx>
> Message-ID:
> <OF34344C8A.DA69077B-ON8525701F.0048B663-8525701F.004D18F0@xxxxxxxxxx>
> Content-Type: text/plain; charset="us-ascii"
>
> Hello Namrata,
>
> I would not use JEM completely for something like this. Your model is
> static and doesn't require customer code. In that case I would suggest
> using the proxy part only, but use the IDE proxy registration instead of
> the remote vm registration. It will be much faster that way since you
> won't need to start and maintain a remote vm. Also it means that your
> project DOES NOT have to be a java project. To use remote vm you would
> need to have your customer's project be a java project.
>
> I suggest using our 1.1M2 driver with the Eclipse 3.1RC1 (RC2 when it
> comes out), and the appropriate GEF/EMF. That has the latest fixes in it.
>
> I suggest you use:
>
> org.eclipse.ve.internal.jfc.core.ComponentManager - This will handle the
> refresh and retrieval of the image. It can be your IVisualComponent
> (though in the M2 drop it is not an IVisualComponent, but in the next drop
> of VE 1.1 it will be an IVisualComponent all by itself, until then you
> will need to wrapper it).
> org.eclipse.jem.internal.proxy.ide.IDERegistration to start a registry
> that runs under the Eclipse JVM instead of a remote JVM.
> IDERegistration.createIDEPRoxyFactoryRegistry will probably be sufficient
> for your purposes. This would be sufficient if you do not need to access
> any classes other than a predefined set that you know about. If you need
> to access customer classes that come from a project at runtime, then you
> will need to use the remote vm instead.
> Use a org.eclipse.ve.internal.cde.core.ImageFigure and
> org.eclipse.ve.internal.cde.core.ImageFigureController to work with the
> ComponentManager to get the image's size and the image itself.
> I would use org.eclipse.ve.internal.cde.core.ContentsGraphicalEditpart as
> the base editpart representing the white freeform surface (this would be
> put into the GraphicalViewer's setContents() method).
> Your Swing visual components (those that produce the images you wish to
> capture), should be in your plugin's library jar so that the
> IDERegistration registry can see them (using the
> createIDEProxyFactoryRegistry(name, pluginname, otherurls. In this case
> otherURLS can be null, then it will just look in your plugin (the plugin
> name passed in actually) for the classes that you are trying to create.
> Also, I'm pretty sure your Swing visual components need to be hosted
> within a JWindow to be able to get an image. We usually use a JDialog so
> that we can actually show it during development to see what is happening
> on the remote vm, but a JWindow would be more convienent because it
> wouldn't need an unused JFrame under the covers. You would need to put the
> JWindow way off-screen or it could show up (we use (10,000, 10,000)).
> Take a look at org.eclipse.ve.internal.jfc.core.ComponentGraphicalEditPart
> as an example. Do not use it directly, copy pieces of it instead. I would
> also look at how  org.eclipse.ve.internal.jfc.core.ComponentProxyAdapter
> works with the ComponentManager to tell it the image is invalid and how
> the ComponentManager then sends the image back.
> For the ComponentManager to work you will need to use the
> org.eclipse.ve.internal.cde.core.ModelChangeController. You will need to
> create a subclass of it. And you should subclass the GEF commandstack so
> that it will wrapper the call to execute within a call to the
> ModelChangeController (see . The change controller is important because
> one of the things it can do is to allow runnables to be queued up to the
> end of the transaction (the transaction is the execute of the command
> stack). We use this with the ComponentManager so that we don't get any new
> images until after the transaction is complete. If we didn't have the
> change controller, we wouldn't know when the transaction was complete and
> we would instead have to get a new image on every change. That can be a
> lot of extra images that aren't needed. For the stack I would subclass
> GEF's command stack and just override the execute, undo, redo, to do
> something like:
>
>         public void execute(final Command aCommand) {
>                 modelChangeController.doModelChanges(new Runnable() {
>
>                         public void run() {
>                                 CommandStack.this.super.execute(aCommand);
>                         }
>                 }, false);
>         }
>
> This may be enough to get you started. I would start with the IDERegistry
> to see how to create your Swing visuals, then move up to ComponentManager
> to see how to get the images, and then finally up to the editparts to put
> it all together.
>
> I'm sorry we don't have an example of this. We really do want to
> hightlight such capabilities.
>
> Thanks,
> Rich Kulp
>
>
>
>
> "Namrata" <namrata@xxxxxxxxxxxxxx>
> Sent by: ve-dev-bounces@xxxxxxxxxxx
> 06/13/2005 11:37 AM
> Please respond to
> Discussions people developing code for the Visual Editor project
>
>
> To
> <ve-dev@xxxxxxxxxxx>
> cc
>
> Subject
> [ve-dev] Using JEM to draw cartoon images of widgets
>
>
>
>
>
>
>
> Hi,
>
> I'm evaluating the feasibility of developing a form designer. Our model is
> a static XML based model to represent AWT/Swing forms.
>
> I want to develop an editor using EMF/GEF. For drawing the images, I want
> to reuse the VE internal functionality in the JEM plugin.
>
> I looked at the VE source and the JEM test code, but its still confusing
> due to lack of a document. I will greatly appreciate any pointers on a
> high level description of how to use JEM to create the widgets in a
> seperate VM and scrape the cartoon images to display in the form designer.
>
> In return I will document the JEM API and the usage in detail.
>
> Thanks in advance.
> Namrata_______________________________________________
> ve-dev mailing list
> ve-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/ve-dev
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
http://eclipse.org/pipermail/ve-dev/attachments/20050613/73b46cac/attachment
.html
>
> ------------------------------
>
> _______________________________________________
> ve-dev mailing list
> ve-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/ve-dev
>
>
> End of ve-dev Digest, Vol 4, Issue 4
> ************************************
>



Back to the top