Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ve-dev] Unable to see images on Open




"Janak Mulani" <janak.mulani@xxxxxxxxx>
Sent by: ve-dev-bounces@xxxxxxxxxxx

11/07/2005 01:43 PM

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

To
"Discussions people developing code for the Visual Editor project" <ve-dev@xxxxxxxxxxx>
cc
Subject
[ve-dev] Unable to see images on Open





Hi Rich,

Thanks for your help.

1. SCENARIO:

- Drop a ULCButton on the canvas. Works ok.
- Close Visual Class.
- Open Visual Class. ULCButton is not visible.
- Refresh/Synch once and the ULCButton is visible.

Question:

Why doesn't the button show up on opening the Visual Class? Why is a refresh
required?

>>> RLK
I did recently find an ordering problem with SWT Shell because the
addToFreeForm was called AFTER the shell was instantiated in the initial
refresh. This meant that the shell took its default visibility value of
false, and so didn't show any of the children. This only happened because by
default SWT Shells are not visible. You need to explicitly make them
visible.
>>>

I checked the order in the debugger and it seems ok.

First the bean is instantiated (the process is started by
CompositionProxyAdapter.initBeanProxy())

Then SubClassCompositionComponentsGraphicalEditPart.activate() is called,
which calls ULCComponentGraphicalEditPart.activate(), which does
ImageFigureController.setImageNotifier(ULCComponentProxyAdapter), which
calls refreshImage() on ULCCompProxyAdapter, which delegates to
ComponentManager.refreshImage().

(The call sequence is similar as in the case of JButton).

Yet I don't see ULCButton on opening the Visual Class. It requires a
refresh. Can you tell me why?

How do I go about debugging this?


--- RLK I need to understand something first. Your settings are applied to a ULC component, correct? They are not directly applied to the Swing visual that represents the component. When a setting is applied to a ULC component, how is the Swing visual changed? Is it set immediately from the ULC component. Your next response sort of indicates that you need to call pack on the top level ULC Component and only then will the Swing visuals be updated. Is that correct? If that is correct then the pack needs to occur in the initial instantiation after everything else has been instantiated but before the images are requested. Is that correct?

So first time if the beans are not instantiated in the remote VM then how is
the image obtained and displayed?


--- RLK They are instantiated the first time. Then after they are instantiated all of the images are asked to refresh.


----------------

2. In ULC, the beans are instantiated on the server side and properties are
set on them. Then these properties have to be set on the ULC client side
proxy to affect the image. So after each applySetting we call "pack" on the
window ancestor of the component which synchs the client with the server's
state of the GUI. Now this "pack" requires the bean as arg on whose window
ancestor we call pack.

While dropping we set text property of button using CreationPolicy. While
dropping, in the overridden applySetting() method of ULCComponent,
getBeanProxy() returns a non-null value which is passed as arg to the
pack(). This is so because, BenInstantianon and CreationPolicy are two
separate commands and BeanInstantiation occurs first.

However, getBeanProxy() is  null in applySetting() while opening a visual
class. It tries to set text property, but in applySetting when we call pack
we do not still have the bean because _expression_ is invoked later.


--- RLK When using applySetting you use getProxy(). If it has been instantiated, this will return an IBeanProxy. If it is instantiation it returns an IProxy. Either one can then be used in the pack as is (as long as the pack is called through an IExpression, not through a direct IMethodProxy.invoke). Your applySetting is sent an IExpression in the call, you use that IExpression, you don't whip one up.

How do we solve this problem?

Is there a hook which tells us the bean has been instatiated? Ist it
ProxyResolved? If so, is it ok to create and invoke an _expression_ which sets
a property in the proxyResolved method? Even if it is possible, it would not
be nice to do such a thing, I guess!

Thanks and regards,

Janak




Thanks and regards,

Janak

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


Back to the top