Normand Briere
2019-06-26 89b25e7cc97f6fe221dfd41c4d463500f8a31bc1
BiparamEditor.java
....@@ -4,6 +4,8 @@
44 import javax.swing.*;
55 import javax.swing.event.*;
66
7
+import grafeme.ui.*;
8
+
79 class BiparamEditor extends ObjEditor implements ItemListener, ChangeListener, ObjectUI, ActionListener
810 {
911 BiparamEditor(Biparam inBP, GroupEditor callee)
....@@ -65,11 +67,14 @@
6567 oe.aConstraints.gridwidth = 1;
6668 */
6769 super.SetupUI2(oe);
68
-
69
- uDivsField = AddSlider(oe.ctrlPanel, "U #", biparam.minUDivs, 256+biparam.minUDivs, biparam.uDivs);
70
- Return();
71
- vDivsField = AddSlider(oe.ctrlPanel, "V #", biparam.minVDivs, 256+biparam.minVDivs, biparam.vDivs);
72
- Return();
70
+
71
+ uvPanel = new cGridBag().setVertical(true);
72
+
73
+ uDivsField = (cNumberSlider)AddSlider(uvPanel, "U #", biparam.minUDivs, 250+biparam.minUDivs, biparam.uDivs).getComponent(1);
74
+ vDivsField = (cNumberSlider)AddSlider(uvPanel, "V #", biparam.minVDivs, (int)(500/3.1416)+biparam.minVDivs, biparam.vDivs).getComponent(1);
75
+
76
+ oe.ctrlPanel.add(uvPanel);
77
+ oe.ctrlPanel.Return();
7378 // oe.aConstraints.gridwidth = 1;
7479 // oe.aConstraints.fill = GridBagConstraints.VERTICAL;
7580 // oe.ctrlPanel.add(uDivsLabel = new JLabel("U #"), oe.aConstraints, oe.ctrlPanel.getComponentCount()-2);
....@@ -96,17 +101,11 @@
96101 // oe.aConstraints.gridwidth = 1;
97102 if (biparam instanceof Cone) // ends)
98103 {
99
- oe.aConstraints.gridy += 1;
100
- oe.aConstraints.gridwidth = 3;
101
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
102
- oe.ctrlPanel.add(optionCB = new JCheckBox("Close Surface", biparam.endcaps), oe.aConstraints, oe.ctrlPanel.getComponentCount()-2);
104
+ oe.ctrlPanel.add(optionCB = new JCheckBox("Close Surface", biparam.endcaps)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount()-2);
103105 optionCB.addItemListener(this);
104
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
105
- oe.aConstraints.gridwidth = 1;
106
+oe.ctrlPanel.Return();
106107 //endcaps.setState(!biparam.endcaps);
107108 }
108
- oe.aConstraints.gridy += 1;
109
- oe.aConstraints.gridx = 0;
110109 }
111110
112111 void Clear()
....@@ -205,7 +204,7 @@
205204 public void applySelf()
206205 {
207206 //System.out.println("Biparam :: applySelf");
208
- //super.applySelf();
207
+ super.applySelf();
209208 int udivs = uDivsField.getInteger(); // biparam.minUDivs, 99);
210209 int vdivs = vDivsField.getInteger(); // biparam.minUDivs, 99);
211210 //biparam.name = nameField.getText();
....@@ -244,8 +243,9 @@
244243 // oe.ctrlPanel.remove(uDivsLabel);
245244 // oe.ctrlPanel.remove(vDivsLabel);
246245 // //oe.ctrlPanel.repaint();
247
- Remove(uDivsField);
248
- Remove(vDivsField);
246
+// Remove(uDivsField);
247
+// Remove(vDivsField);
248
+ oe.ctrlPanel.remove(uvPanel);
249249
250250 super.closeUI();
251251 }
....@@ -261,12 +261,14 @@
261261 }
262262
263263 Biparam biparam;
264
- JLabel uDivsLabel;
265
- JLabel vDivsLabel;
266
- NumberSlider uDivsField;
267
- NumberSlider vDivsField;
264
+ //JLabel uDivsLabel;
265
+ //JLabel vDivsLabel;
266
+ cNumberSlider uDivsField;
267
+ cNumberSlider vDivsField;
268268 JCheckBox optionCB;
269269
270
+ cGridBag uvPanel;
271
+
270272 ObjectUI parent;
271273
272274 //ObjEditor objEditor;