.. | .. |
---|
8 | 8 | import javax.swing.*; |
---|
9 | 9 | import javax.swing.event.*; |
---|
10 | 10 | |
---|
| 11 | +import grafeme.ui.*; |
---|
| 12 | + |
---|
11 | 13 | class SuperEditor extends BiparamEditor implements ChangeListener, ObjectUI // ActionListener |
---|
12 | 14 | { |
---|
13 | 15 | /* |
---|
.. | .. |
---|
46 | 48 | void SetupUI2(ObjEditor oe) |
---|
47 | 49 | { |
---|
48 | 50 | super.SetupUI2(oe); |
---|
49 | | - ObjEditor.aConstraints.gridwidth = 1; |
---|
50 | | - oe.ctrlPanel.add(northLabel = new JLabel("XY Exp"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount()-2); |
---|
51 | | - ObjEditor.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
52 | | - ObjEditor.aConstraints.gridx += 1; |
---|
53 | | - ObjEditor.aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
54 | | - oe.ctrlPanel.add(northField = new NumberSlider(0.0001,20,-1), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount()-2); |
---|
55 | | - ObjEditor.aConstraints.gridx = 0; |
---|
56 | | - ObjEditor.aConstraints.gridy += 1; |
---|
57 | | - ObjEditor.aConstraints.gridwidth = 1; |
---|
58 | | - ObjEditor.aConstraints.fill = GridBagConstraints.NONE; |
---|
59 | | - oe.ctrlPanel.add(eastLabel = new JLabel("Z Exp"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount()-2); |
---|
60 | | - ObjEditor.aConstraints.gridx += 1; |
---|
61 | | - ObjEditor.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
62 | | - ObjEditor.aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
63 | | - oe.ctrlPanel.add(eastField = new NumberSlider(0.0001,20,-1), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount()-2); |
---|
64 | | - ObjEditor.aConstraints.gridx = 0; |
---|
65 | | - ObjEditor.aConstraints.gridy += 1; |
---|
66 | | - ObjEditor.aConstraints.gridwidth = 1; |
---|
67 | | - ObjEditor.aConstraints.gridwidth = 3; |
---|
68 | | -// ObjEditor.aConstraints.anchor = GridBagConstraints.WEST; |
---|
69 | | - oe.ctrlPanel.add(optionCB = new JCheckBox("Reverse", (superE.radius<0)), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount()-2); |
---|
| 51 | + |
---|
| 52 | + northPanel = new cGridBag(); |
---|
| 53 | + |
---|
| 54 | + northPanel.add(northLabel = new JLabel("XY factor")); //, ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount()-2); |
---|
| 55 | + northPanel.add(northField = new cNumberSlider(this, 0.0001,20, -1)); //, ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount()-2); |
---|
| 56 | + oe.ctrlPanel.add(northPanel); |
---|
| 57 | + |
---|
| 58 | + oe.ctrlPanel.Return(); |
---|
| 59 | + eastPanel = new cGridBag(); |
---|
| 60 | + eastPanel.add(eastLabel = new JLabel("Z factor")); //, ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount()-2); |
---|
| 61 | + eastPanel.add(eastField = new cNumberSlider(this, 0.0001,20, -1)); //, ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount()-2); |
---|
| 62 | + oe.ctrlPanel.add(eastPanel); |
---|
| 63 | + |
---|
| 64 | + oe.ctrlPanel.Return(); |
---|
| 65 | + // ObjEditor.aConstraints.anchor = GridBagConstraints.WEST; |
---|
| 66 | + oe.ctrlPanel.add(optionCB = new JCheckBox("Reverse", (superE.radius<0))); //, ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount()-2); |
---|
70 | 67 | optionCB.addItemListener(this); |
---|
71 | | -// ObjEditor.aConstraints.anchor = GridBagConstraints.EAST; |
---|
72 | | - ObjEditor.aConstraints.gridwidth = 1; |
---|
73 | | - ObjEditor.aConstraints.gridx = 0; |
---|
74 | | - ObjEditor.aConstraints.gridy += 1; |
---|
75 | | - northField.setFloat(superE.north); |
---|
| 68 | + |
---|
| 69 | + oe.ctrlPanel.Return(); |
---|
| 70 | + |
---|
| 71 | + northField.setFloat(superE.north); |
---|
76 | 72 | eastField.setFloat(superE.east); |
---|
77 | | - northField.addChangeListener(this); |
---|
78 | | - eastField.addChangeListener(this); |
---|
79 | | - ObjEditor.aConstraints.fill = GridBagConstraints.NONE; |
---|
80 | | - } |
---|
| 73 | + } |
---|
81 | 74 | |
---|
82 | 75 | public void closeUI() |
---|
83 | 76 | { |
---|
.. | .. |
---|
87 | 80 | eastField.removeChangeListener(this); |
---|
88 | 81 | optionCB.removeItemListener(this); |
---|
89 | 82 | oe.ctrlPanel.remove(optionCB); |
---|
90 | | - oe.ctrlPanel.remove(northField); |
---|
91 | | - oe.ctrlPanel.remove(eastField); |
---|
92 | | - oe.ctrlPanel.remove(northLabel); |
---|
93 | | - oe.ctrlPanel.remove(eastLabel); |
---|
| 83 | + oe.ctrlPanel.remove(northPanel); |
---|
| 84 | + oe.ctrlPanel.remove(eastPanel); |
---|
| 85 | +// oe.ctrlPanel.remove(northField); |
---|
| 86 | +// oe.ctrlPanel.remove(eastField); |
---|
| 87 | +// oe.ctrlPanel.remove(northLabel); |
---|
| 88 | +// oe.ctrlPanel.remove(eastLabel); |
---|
94 | 89 | //oe.ctrlPanel.repaint(); |
---|
95 | 90 | |
---|
96 | 91 | super.closeUI(); |
---|
.. | .. |
---|
184 | 179 | Superellipsoid superE; |
---|
185 | 180 | JLabel northLabel; |
---|
186 | 181 | JLabel eastLabel; |
---|
187 | | - NumberSlider northField; |
---|
188 | | - NumberSlider eastField; |
---|
| 182 | + cNumberSlider northField; |
---|
| 183 | + cNumberSlider eastField; |
---|
189 | 184 | |
---|
| 185 | + cGridBag northPanel; |
---|
| 186 | + cGridBag eastPanel; |
---|
190 | 187 | //BiparamEditor objEditor; |
---|
191 | 188 | } |
---|
192 | 189 | |
---|