Normand Briere
2019-12-25 3d30e720e6f012f2d9996b136154dd551844998a
BoxEditor.java
....@@ -9,31 +9,46 @@
99
1010 class BoxEditor extends ObjEditor
1111 {
12
+ BoxEditor(Box inBox, GroupEditor callee)
13
+ {
14
+ super(inBox, callee);
15
+
16
+ //objEditor = new BiparamEditor(inCone, this, callee);
17
+ objEditor = callee.GetEditor();
18
+
19
+ this.box = inBox;
20
+
21
+ SetupUI2(GetEditor());
22
+ }
23
+
1224
1325 BoxEditor(Box inBox, Object3D copy, GroupEditor callee)
1426 {
1527 super(inBox, copy, callee);
28
+
29
+ new Exception().printStackTrace();
30
+
1631 box = (Box) copy;
17
- ctrlPanel.add(minLabel = new JLabel("Minima"), aConstraints);
18
- aConstraints.gridx += 1;
19
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
20
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
21
- ctrlPanel.add(minimaField = new NumberField(), aConstraints);
22
- aConstraints.gridwidth = 1;
23
- minimaField.setVector(box.minima);
24
- aConstraints.gridx = 0;
25
- aConstraints.gridy += 1;
26
- aConstraints.fill = GridBagConstraints.NONE;
27
- ctrlPanel.add(maxLabel = new JLabel("Maxima"), aConstraints);
28
- aConstraints.gridx += 1;
29
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
30
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
31
- ctrlPanel.add(maximaField = new NumberField(), aConstraints);
32
- aConstraints.gridwidth = 1;
33
- maximaField.setVector(box.maxima);
34
- aConstraints.fill = GridBagConstraints.NONE;
35
- aConstraints.gridx = 0;
36
- aConstraints.gridy += 1;
32
+// ctrlPanel.add(minLabel = new JLabel("Minima"), aConstraints);
33
+// aConstraints.gridx += 1;
34
+// aConstraints.fill = GridBagConstraints.HORIZONTAL;
35
+// aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
36
+// ctrlPanel.add(minimaField = new NumberField(), aConstraints);
37
+// aConstraints.gridwidth = 1;
38
+// minimaField.setVector(box.minima);
39
+// aConstraints.gridx = 0;
40
+// aConstraints.gridy += 1;
41
+// aConstraints.fill = GridBagConstraints.NONE;
42
+// ctrlPanel.add(maxLabel = new JLabel("Maxima"), aConstraints);
43
+// aConstraints.gridx += 1;
44
+// aConstraints.fill = GridBagConstraints.HORIZONTAL;
45
+// aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
46
+// ctrlPanel.add(maximaField = new NumberField(), aConstraints);
47
+// aConstraints.gridwidth = 1;
48
+// maximaField.setVector(box.maxima);
49
+// aConstraints.fill = GridBagConstraints.NONE;
50
+// aConstraints.gridx = 0;
51
+// aConstraints.gridy += 1;
3752 }
3853
3954 void Clear()
....@@ -53,17 +68,56 @@
5368 }
5469 */
5570
71
+ void SetupUI2(ObjEditor oe)
72
+ {
73
+ super.SetupUI2(oe);
74
+
75
+ oe.ctrlPanel.add(optionCB = new JCheckBox("Close Surface", !box.open)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount()-2);
76
+ optionCB.addItemListener(this);
77
+ oe.ctrlPanel.Return();
78
+ }
79
+
80
+ public void itemStateChanged(ItemEvent e)
81
+ {
82
+ if (//e.getSource() == nameField ||
83
+ e.getSource() == optionCB)
84
+ {
85
+ box.open = (e.getStateChange() != ItemEvent.SELECTED);
86
+
87
+ applySelf();
88
+
89
+ objEditor.refreshContents();
90
+ }
91
+ else
92
+ {
93
+ super.itemStateChanged(e);
94
+ }
95
+ }
96
+
97
+
98
+ public void closeUI()
99
+ {
100
+ ObjEditor oe = GetEditor();
101
+
102
+ oe.ctrlPanel.remove(optionCB);
103
+
104
+ super.closeUI();
105
+ }
106
+
56107 public void applySelf()
57108 {
58109 // june 2013 super.applySelf();
59
- minimaField.getVector(box.minima);
60
- maximaField.getVector(box.maxima);
110
+// minimaField.getVector(box.minima);
111
+// maximaField.getVector(box.maxima);
61112 box.recalculate();
62113 }
63114
64115 Box box;
65
- JLabel minLabel;
66
- JLabel maxLabel;
67
- NumberField minimaField;
68
- NumberField maximaField;
116
+
117
+// JLabel minLabel;
118
+// JLabel maxLabel;
119
+// NumberField minimaField;
120
+// NumberField maximaField;
121
+
122
+ JCheckBox optionCB;
69123 }