Skip to main content

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


Hi,

You shouldn't be looking at anything starting with REM. This is an internal implementation of the IProxy interfaces for remote vm. You should be accessing the proxies through the IProxy interfaces.  As I recall you have a well-defined set of visuals and you don't need a java project and extension capability, so you can run using the IDE implementation of the IProxys. This will be much faster foy you because the visuals will not require a remote vm to be started and you won't be forced to be in a java project (remote vm proxies require a java project, the IDE implementation does not). Look at IDERegistration.createProxyFactory methods. IDERegistration is not internal. But the rest of the IDE... stuff is. We haven't gotton around to making it API yet.


REMExpression is an implementation of the IExpression interface. What we used to do was use straight IMEthodPRoxy invokes. This is like calling a method. The problem is that each invoke requires a round-trip to the remote vm. When we built up GUI's this round-tripping added up and slowed things down. The _expression_ were used to pipe the invokes to the remote vm. What happens is that we don't wait for us response, we just keeping pushing commands to the remote vm. Then at the very end we do an invoke, and this then waits for all of the previous commands to be invoked and returns results.

It turns out though that expressions on IDE proxies is actually slower than using the IMethodProxy invokes. That is because when using IDE proxies, it turns around and calls things directly. This is very fast and doesn't have the latency problem that the sockets have that are used with the remote vm. So if you are IDE it doesn't require expressions for performance.

However, ComponentManager isn't currently written to work without expressions. I see now that it might be a good idea to add calls that don't require expressions. That would make it faster for you using IDE and no expressions.

Now, the way we connect the EMF model to the live beans is through an EMF adapter. This adapter (called BeanProxyAdapter (or BeanProxyAdapter2 depending on what driver you have, we just recently renamed BeanProxyAdapter2 back to BeanProxyAdapter) controls the live bean. It hears of changes to the EMF and propagates them to the live beans.

You can use something similiar but I don't think it needs to be as complex because you have a controlled environment. You don't have to handle a wide and undetermined range of beans. Your adapter can simply create the visual, connect it to the ComponentManager, listen for changes, and update the visual. The visual should be accessed through the IDE proxies because that is what the ComponentManager expects.

We also have something called a ModelChangeController. We pipe our command stack through this so that only one thread is making changes at time. Plus it has a very important added function. You can queue up runnables during the execution of the commands that will then be executed at the end of the transaction (the command stack execution). This is important because things like grabbing images is expensive, so you don't want to do it over and over during the execution of the command because of changes happening. So the image grabbing is queued up to the end of the transaction and only occurs once.

Rich


"Namrata" <namrata@xxxxxxxxxxxxxx>
Sent by: ve-dev-bounces@xxxxxxxxxxx

06/24/2005 01:21 AM

Please respond to
Discussions people developing code for the Visual Editor project

To
<ve-dev@xxxxxxxxxxx>
cc
Subject
[ve-dev] Re: Using JEM to draw cartoon images of widgets (Namrata)





Rich,

Thanks for the information.

I debugged VE today, and came across REMExpression data structure in many
places. I guessed that this is the _expression_ for instantiating a bean?

Will I be need to use/initialize/configure the REMExpression data, or is it
something internal?

My model is an emf defined xml model. I will need a mapping between the xml
node and the corresponding swing class? I realized the VE uses an EMF model
on top of the code model. Where can I find the relation between the EMF
model and the corresponding visual class?

Thanks
Namrata.

>
> HI Namrata,
>
> It depends. For us if we have a frame with buttons on it, we only care
> about the image of the frame because that image will include the image of
> the buttons since they are on the frame. Since we can get the absolute
> location of the buttons relative to the frame from the ComponentManager,
> we know their position and size and we could just use that as our child
> figure bounds. Our child figure has a transparent image on it (i.e. no
> image is painted but it has bounds so that it can be clicked on, or a
> border drawn around it).
>
> If you wanted only the image of the button to put someplace else other
> than to be within the image of the frame, then you would have to retrieve
> the image of the button separately.
>
> Rich

_______________________________________________
ve-dev mailing list
ve-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ve-dev


Back to the top