Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[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 >>>
What is the difference between the first synch and the subsequent refreshes?

But the only other difference that I can think of between the first time and
the rest is that the first time the entire EMF model is built up without
having any beans instantiated on the remote vm. Then one by one the
top-level beans are instantiated. First the "thisPart" bean, then each
freeform bean in order they are found in. There could be some ordering
problem of the beans being instantiated. The rest of the time all of the
beans are instantiated as the changes occur.
>>>>

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


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

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.

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



Back to the top