Normand Briere
2019-11-17 cb37a129d1adb403019c96e798e86e2da9667f15
BiparamEditor.java
....@@ -67,11 +67,16 @@
6767 oe.aConstraints.gridwidth = 1;
6868 */
6969 super.SetupUI2(oe);
70
-
71
- uDivsField = AddSlider(oe.ctrlPanel, "U #", biparam.minUDivs, 250+biparam.minUDivs, biparam.uDivs);
72
- Return();
73
- vDivsField = AddSlider(oe.ctrlPanel, "V #", biparam.minVDivs, (int)(500/3.14)+biparam.minVDivs, biparam.vDivs);
74
- Return();
70
+
71
+ uvPanel = new cGridBag().setVertical(true);
72
+
73
+ int count = 50;
74
+
75
+ uDivsField = (cNumberSlider)AddSlider(uvPanel, "U #", biparam.minUDivs, (int)(count*this.biparam.uStretch()) + biparam.minUDivs, biparam.uDivs).getComponent(1);
76
+ vDivsField = (cNumberSlider)AddSlider(uvPanel, "V #", biparam.minVDivs, (int)(count) + biparam.minVDivs, biparam.vDivs).getComponent(1);
77
+
78
+ oe.ctrlPanel.add(uvPanel);
79
+ oe.ctrlPanel.Return();
7580 // oe.aConstraints.gridwidth = 1;
7681 // oe.aConstraints.fill = GridBagConstraints.VERTICAL;
7782 // oe.ctrlPanel.add(uDivsLabel = new JLabel("U #"), oe.aConstraints, oe.ctrlPanel.getComponentCount()-2);
....@@ -98,17 +103,11 @@
98103 // oe.aConstraints.gridwidth = 1;
99104 if (biparam instanceof Cone) // ends)
100105 {
101
- oe.aConstraints.gridy += 1;
102
- oe.aConstraints.gridwidth = 3;
103
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
104
- oe.ctrlPanel.add(optionCB = new JCheckBox("Close Surface", biparam.endcaps), oe.aConstraints, oe.ctrlPanel.getComponentCount()-2);
105
- optionCB.addItemListener(this);
106
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
107
- oe.aConstraints.gridwidth = 1;
106
+ oe.ctrlPanel.add(optionCB = new JCheckBox("Close Surface", biparam.endcaps)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount()-2);
107
+ optionCB.addItemListener(this);
108
+ oe.ctrlPanel.Return();
108109 //endcaps.setState(!biparam.endcaps);
109110 }
110
- oe.aConstraints.gridy += 1;
111
- oe.aConstraints.gridx = 0;
112111 }
113112
114113 void Clear()
....@@ -143,6 +142,7 @@
143142 if (//e.getSource() == nameField ||
144143 e.getSource() == optionCB)
145144 {
145
+ new Exception().printStackTrace();
146146 //System.out.println(e);
147147 applySelf();
148148 //super.applySelf();
....@@ -246,8 +246,9 @@
246246 // oe.ctrlPanel.remove(uDivsLabel);
247247 // oe.ctrlPanel.remove(vDivsLabel);
248248 // //oe.ctrlPanel.repaint();
249
- Remove(uDivsField);
250
- Remove(vDivsField);
249
+// Remove(uDivsField);
250
+// Remove(vDivsField);
251
+ oe.ctrlPanel.remove(uvPanel);
251252
252253 super.closeUI();
253254 }
....@@ -269,6 +270,8 @@
269270 cNumberSlider vDivsField;
270271 JCheckBox optionCB;
271272
273
+ cGridBag uvPanel;
274
+
272275 ObjectUI parent;
273276
274277 //ObjEditor objEditor;