[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [ve-dev] Read/Write of complex LayoutManager values
|
Joe -
The formlayout manager on the remote VM stores all of the live cell
constraints in a single hashmap, using Java object references to the
actual components (jLabel, jButton, etc) as the keys and correspnding
cell constraints objects as values. No problem accessing the
hashmap and digging out individual constraint values. I have this
code implemented and working.
Just stopped short by the need to somehow correlate a bare Java object
reference (ex: JLabel, id=81) in the remote VM to a specific local VE
component reference that can be used in a VE command to rewrite that
specific line of code.
For example, given *only* a user indication of a desire to insert a
column at 3, this source code
jPanel.add(jLabel3,
new
CellConstraints(2, 2, 3, 1)); // args: col, row, spanX, spanY
jPanel.add(jLabel1,
new
CellConstraints(4, 2)); // args: col, row
will need to be rewritten as
jPanel.add(jLabel3,
new
CellConstraints(2, 2, 4, 1)); // increase spanX
jPanel.add(jLabel1,
new
CellConstraints(5, 2)); // shift column right
I can figure out which remote components are affected from the
constraint data in the remote VM, but I then need to *somehow* correlate
those remote components to existing local VE objects that can be used in
VE commands to implement the rewrite.
Did not see a way to solve this problem, so thought to explore retriving
the constraint data fully within the context of the local VM (really
expected that it would not be much of a problem for VE).
So, is there a VE way to correlate remote component instances to local VE
objects? Something else that I am missing?
At 12:46 PM 6/7/2006, you wrote:
Hi Gerald,
First - why do you want the constructor args ?
In the generated source, the unique values of a constraint are specified
as constructor values (no getter/setters are available).
The only reason I can think to
want to do this [parse tree stuff] ... is because ... you want to do
something clever in code gen.
Clever, no. At least no more clever than ordinary VE stuff.
Just looking for the simplest implementation that can actually
work.
Do you see the problem with closing the component identification loop
from the remote VM? Is there a way to surmount, dodge or finese this
problem? Another alternative? I certainly hope so.
Appreciate any help and advice,
Gerald