.. | .. |
---|
8 | 8 | import javax.swing.*; |
---|
9 | 9 | import javax.swing.event.*; |
---|
10 | 10 | |
---|
| 11 | +import grafeme.ui.*; |
---|
| 12 | + |
---|
11 | 13 | class ConeEditor extends BiparamEditor implements ChangeListener, ObjectUI |
---|
12 | 14 | { |
---|
13 | 15 | |
---|
.. | .. |
---|
49 | 51 | { |
---|
50 | 52 | super.SetupUI2(oe); |
---|
51 | 53 | |
---|
52 | | - oe.aConstraints.fill = 0; |
---|
53 | 54 | /* |
---|
54 | 55 | ctrlPanel.add(baseLabel = new JLabel("Base"), aConstraints); |
---|
55 | 56 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
.. | .. |
---|
58 | 59 | ctrlPanel.add(baseField = new NumberField(), aConstraints); |
---|
59 | 60 | baseField.setVector(cone.base); |
---|
60 | 61 | baseField.addActionListener(this); |
---|
61 | | - aConstraints.fill = 0; |
---|
62 | | - aConstraints.gridy += 1; |
---|
63 | | - aConstraints.gridx -= 1; |
---|
64 | 62 | */ |
---|
65 | | - oe.aConstraints.gridwidth = 1; |
---|
66 | | - oe.ctrlPanel.add(baseRadLabel = new JLabel("Top"), oe.aConstraints, oe.ctrlPanel.getComponentCount()-2); |
---|
67 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
68 | | - oe.aConstraints.gridx += 1; |
---|
69 | | - oe.aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
70 | | - oe.ctrlPanel.add(baseRadField = new NumberSlider(0.001,10,1), oe.aConstraints, oe.ctrlPanel.getComponentCount()-2); |
---|
| 63 | + topPanel = new cGridBag(); |
---|
| 64 | + topPanel.add(baseRadLabel = new JLabel("Top")); //, oe.aConstraints, oe.ctrlPanel.getComponentCount()-2); |
---|
| 65 | + topPanel.add(baseRadField = new cNumberSlider(this, 0.001,10,1)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount()-2); |
---|
71 | 66 | baseRadField.setFloat(cone.baseRadius); |
---|
72 | | - baseRadField.addChangeListener(this); |
---|
73 | | - /* |
---|
| 67 | + |
---|
| 68 | + oe.ctrlPanel.add(topPanel); |
---|
| 69 | + oe.ctrlPanel.Return(); |
---|
| 70 | + /* |
---|
74 | 71 | aConstraints.fill = 0; |
---|
75 | 72 | aConstraints.gridx -= 1; |
---|
76 | 73 | aConstraints.gridy += 1; |
---|
.. | .. |
---|
83 | 80 | apexField.setVector(cone.apex); |
---|
84 | 81 | apexField.addActionListener(this); |
---|
85 | 82 | */ |
---|
86 | | - oe.aConstraints.fill = 0; |
---|
87 | | - oe.aConstraints.gridx -= 1; |
---|
88 | | - oe.aConstraints.gridy += 1; |
---|
89 | | - oe.aConstraints.gridwidth = 1; |
---|
90 | | - oe.ctrlPanel.add(apexRadLabel = new JLabel("Base"), oe.aConstraints, oe.ctrlPanel.getComponentCount()-2); |
---|
91 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
92 | | - oe.aConstraints.gridx += 1; |
---|
93 | | - oe.aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
94 | | - oe.ctrlPanel.add(apexRadField = new NumberSlider(0.001,10,1), oe.aConstraints, oe.ctrlPanel.getComponentCount()-2); |
---|
95 | | - oe.aConstraints.gridwidth = 1; |
---|
96 | | - oe.aConstraints.gridx -= 1; |
---|
97 | | - oe.aConstraints.fill = 0; |
---|
| 83 | + basePanel = new cGridBag(); |
---|
| 84 | + basePanel.add(apexRadLabel = new JLabel("Base")); //, oe.aConstraints, oe.ctrlPanel.getComponentCount()-2); |
---|
| 85 | + basePanel.add(apexRadField = new cNumberSlider(this, 0.001,10,1)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount()-2); |
---|
98 | 86 | apexRadField.setFloat(cone.apexRadius); |
---|
99 | | - apexRadField.addChangeListener(this); |
---|
100 | | - oe.aConstraints.gridy += 1; |
---|
| 87 | + |
---|
| 88 | + oe.ctrlPanel.add(basePanel); |
---|
| 89 | + oe.ctrlPanel.Return(); |
---|
101 | 90 | } |
---|
102 | 91 | |
---|
103 | 92 | public void closeUI() |
---|
.. | .. |
---|
106 | 95 | |
---|
107 | 96 | apexRadField.removeChangeListener(this); |
---|
108 | 97 | baseRadField.removeChangeListener(this); |
---|
109 | | - oe.ctrlPanel.remove(apexRadField); |
---|
110 | | - oe.ctrlPanel.remove(baseRadField); |
---|
111 | | - oe.ctrlPanel.remove(apexRadLabel); |
---|
112 | | - oe.ctrlPanel.remove(baseRadLabel); |
---|
| 98 | +// oe.ctrlPanel.remove(apexRadField); |
---|
| 99 | +// oe.ctrlPanel.remove(baseRadField); |
---|
| 100 | +// oe.ctrlPanel.remove(apexRadLabel); |
---|
| 101 | +// oe.ctrlPanel.remove(baseRadLabel); |
---|
| 102 | + oe.ctrlPanel.remove(topPanel); |
---|
| 103 | + oe.ctrlPanel.remove(basePanel); |
---|
113 | 104 | //oe.ctrlPanel.repaint(); |
---|
114 | 105 | |
---|
115 | 106 | super.closeUI(); |
---|
.. | .. |
---|
192 | 183 | JLabel apexRadLabel; |
---|
193 | 184 | //NumberField baseField; |
---|
194 | 185 | //NumberField apexField; |
---|
195 | | - NumberSlider baseRadField; |
---|
196 | | - NumberSlider apexRadField; |
---|
| 186 | + cNumberSlider baseRadField; |
---|
| 187 | + cNumberSlider apexRadField; |
---|
197 | 188 | |
---|
| 189 | + cGridBag topPanel; |
---|
| 190 | + cGridBag basePanel; |
---|
198 | 191 | //BiparamEditor objEditor; |
---|
199 | 192 | } |
---|
200 | 193 | |
---|