.. | .. |
---|
9 | 9 | |
---|
10 | 10 | class BoxEditor extends ObjEditor |
---|
11 | 11 | { |
---|
| 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 | + |
---|
12 | 24 | |
---|
13 | 25 | BoxEditor(Box inBox, Object3D copy, GroupEditor callee) |
---|
14 | 26 | { |
---|
15 | 27 | super(inBox, copy, callee); |
---|
| 28 | + |
---|
| 29 | + new Exception().printStackTrace(); |
---|
| 30 | + |
---|
16 | 31 | 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; |
---|
37 | 52 | } |
---|
38 | 53 | |
---|
39 | 54 | void Clear() |
---|
.. | .. |
---|
53 | 68 | } |
---|
54 | 69 | */ |
---|
55 | 70 | |
---|
| 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 | + |
---|
56 | 107 | public void applySelf() |
---|
57 | 108 | { |
---|
58 | 109 | // june 2013 super.applySelf(); |
---|
59 | | - minimaField.getVector(box.minima); |
---|
60 | | - maximaField.getVector(box.maxima); |
---|
| 110 | +// minimaField.getVector(box.minima); |
---|
| 111 | +// maximaField.getVector(box.maxima); |
---|
61 | 112 | box.recalculate(); |
---|
62 | 113 | } |
---|
63 | 114 | |
---|
64 | 115 | 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; |
---|
69 | 123 | } |
---|