Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[ve-dev] Help with generating complex constraint objects

Working on implementing

protected IJavaObjectInstance convertConstraint(Object constraint) {

in FormLayoutPolicyHelper.  Given that the "constraint" parameter is of type CellConstraints, and is a singleton, how do I specify the further qualification of the constraint

1) to use a particular method, in this case ".xy(int col, int row)",
2) with assigned method parameters of my choice, and
3) yield an IJavaObjectsInstance. 

None of the existing layouts provide a reasonably close example. 

An example of the desired form of the jPanel.add(Component c, Constraint cc) statements to be generated by VE:

private JPanel getJPanel() {
if (jPanel == null) {
String colSpec = "...";
String rowSpec = "...";
FormLayout formLayout = new FormLayout(colSpec, rowSpec);
CellConstraints cc = new CellConstraints();
jPanel = new JPanel();
jPanel.setLayout(formLayout);
jPanel.add(getJButton1(), cc.xy(1,1)); // add at col 1, row 1
jPanel.add(getJButton2(), cc.xy(2,1)); // add at col 2, row 1
}
return jPanel;
}

Thanks,
Gerald

----
Gerald B. Rosenberg
Certiv Analytics

www.certiv.net

Back to the top