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

Hi Rich,

Sorry! I did not mean to confuse you. What I meant got lost in translation!

I really appreciate the time and effort you are spending to help me and am
grateful to you for the same.

There are two issues:

1. Pack:

>>Can you please answer one question. When you say pack(), do you mean
ULCShell.pack() or do you mean JFrame.pack()?

When we do a pack on ULCShell (which is window or a dialog) it ultimately
does a pack on underlying the JFrame or JDialog. It is the image of the
underlying Swing widget which is displayed on the canvas in the IDE.

>>You shouldn't have to call pack like you are doing. The managerExtension
like I showed you should handle the pack and the images >>without anything
else special.

>>Please implement my suggestion AND remove the other pack()'s that you are
doing. They are not necessary.

I will try your suggestion of ComponentManger extension and get back.


2. I would like to understand why the button is NOT shown on open while it
IS shown in case of drop, especially because:
- in both cases refresh is called
- in both cases after instantiation of the bean in the VM, I can see the
button on the free form dialog (i have adjusted the location of our free
form dialog such that it is visible on screen).
- and since the button is there on the free form dialog, it should be
visible on the canvas too (this is what I think - correct me if I am wrong)
in both the scenarios.

It seems to me that the image is not getting collected some how in the case
of Open Visual Class while it works fine in case of Drop.

As I understand image is collected during refreshImage() on
ComponentManager. ANd this is called in both the cases after the bean has
been instntiated in the target VM and is visible on Free form dialog.

So why is the open case not working?

These are the two scenarios I described below.

Case 1: When I drop a ULCButton it shows up fine.

Case 2: When I close the visual class and open it, the button is not
visible.

I checked in the debugger the sequence of calls in both the cases.

In Case1:

CompositionProxyAdapter.notifyChanged calls initSetting() which creates
BeanProxies.

After the command is executed, ModelChangeController.doModelChanges() and
transactionEnded() are called.
Which in turn calls ComponentsGraphicalEditPart.queRefreshChildren() which
calls SubClassCompositionComponentsGEP.refreshChildren() which leads to
addChild() which subsequently calls activate() on
ULCComponentGraphicalEditPart.

The activate() method calls setImageNotifier on the ImageFigureController.
In this method refreshImage() is called on the ProxyAdapter class which
delegates to ComponentManager.

In Case 2:

JavaVisualEditorPart first builds the model and then CopositionProxyAdapter
is created and subsequently its initSetting() method is called which creates
BeanProxy.

Then JavaVisualEditorPart calls initializeViewers() wherein setRootModel is
called.This calls SubClassComponentGraphicalEditPart's activate() which
results in the call to ULCComponentGraphicalEditPart.activate().

The activate() method calls setImageNotifier on the ImageFigureController.
In this method refreshImage() is called on the ProxyAdapter class which
delegates to ComponentManager.

--------

As can be seen, in both the cases, refreshImage() is called. Then why does
the image not show up in Case 2?

Thanks and regards,

Janak



Back to the top