.. | .. |
---|
23 | 23 | DragGestureListener, DragSourceListener, DropTargetListener, |
---|
24 | 24 | ItemListener // ListSelectionListener |
---|
25 | 25 | { |
---|
| 26 | + |
---|
| 27 | + public void AddSkyboxButton(String f, String s, cGridBag row) |
---|
| 28 | + { |
---|
| 29 | + cButton skyboxButton; |
---|
| 30 | + final String path = "cubemaps/" + f + "-skyboxes/" + s; |
---|
| 31 | + row.add(skyboxButton = GetButton(path + "/preview.jpg", !Grafreed.NIMBUSLAF)); |
---|
| 32 | + //row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF)); |
---|
| 33 | + skyboxButton.setToolTipText(s); |
---|
| 34 | + skyboxButton.addActionListener(new ActionListener() |
---|
| 35 | + { |
---|
| 36 | + @Override |
---|
| 37 | + public void actionPerformed(ActionEvent e) |
---|
| 38 | + { |
---|
| 39 | + ChangeSkybox(path); |
---|
| 40 | + } |
---|
| 41 | + }); |
---|
| 42 | + } |
---|
| 43 | + |
---|
| 44 | + public void AddSkyboxTab0(JTabbedPane skyboxpanel) |
---|
| 45 | + { |
---|
| 46 | + cGridBag tab0 = new cGridBag().setVertical(true); |
---|
| 47 | + |
---|
| 48 | + tab0.setName("Urban"); |
---|
| 49 | + skyboxpanel.add(tab0); |
---|
| 50 | + |
---|
| 51 | + cGridBag row0 = new cGridBag(); |
---|
| 52 | + cGridBag row1 = new cGridBag(); |
---|
| 53 | + cGridBag row2 = new cGridBag(); |
---|
| 54 | + cGridBag row3 = new cGridBag(); |
---|
| 55 | + cGridBag row4 = new cGridBag(); |
---|
| 56 | + cGridBag row5 = new cGridBag(); |
---|
| 57 | + cGridBag row6 = new cGridBag(); |
---|
| 58 | + |
---|
| 59 | + AddSkyboxButton("default", "rgb", row0); |
---|
| 60 | + //AddSkyboxButton("default", "cornell", row0); |
---|
| 61 | + AddSkyboxButton("penguins", "dust", row0); |
---|
| 62 | + AddSkyboxButton("penguins", "tropic", row0); |
---|
| 63 | + AddSkyboxButton("default", "skycube", row0); |
---|
| 64 | + |
---|
| 65 | + AddSkyboxButton("default", "uffizi", row1); |
---|
| 66 | + AddSkyboxButton("bridge", "Bridge", row1); |
---|
| 67 | + AddSkyboxButton("bridge", "Bridge2", row1); |
---|
| 68 | + AddSkyboxButton("urban", "GamlaStan2", row1); |
---|
| 69 | + |
---|
| 70 | + AddSkyboxButton("urban", "Parliament", row2); |
---|
| 71 | + AddSkyboxButton("urban", "Roundabout", row2); |
---|
| 72 | + AddSkyboxButton("urban", "SaintLazarusChurch", row2); |
---|
| 73 | + AddSkyboxButton("urban", "SaintLazarusChurch2", row2); |
---|
| 74 | + |
---|
| 75 | + AddSkyboxButton("urban", "SaintLazarusChurch3", row3); |
---|
| 76 | + AddSkyboxButton("urban", "UnionSquare", row3); |
---|
| 77 | + AddSkyboxButton("urban", "Medborgarplatsen", row3); |
---|
| 78 | + AddSkyboxButton("park", "BerzeliiPark", row3); |
---|
| 79 | + |
---|
| 80 | + AddSkyboxButton("park", "Buddha", row4); |
---|
| 81 | + AddSkyboxButton("park", "CNTower2", row4); |
---|
| 82 | + AddSkyboxButton("park", "NiagaraFalls1", row4); |
---|
| 83 | + AddSkyboxButton("park", "NiagaraFalls3", row4); |
---|
| 84 | + |
---|
| 85 | + AddSkyboxButton("park", "Park", row5); |
---|
| 86 | + AddSkyboxButton("park", "Pond", row5); |
---|
| 87 | + AddSkyboxButton("park", "Skansen", row5); |
---|
| 88 | + AddSkyboxButton("park", "Skansen2", row5); |
---|
| 89 | + |
---|
| 90 | + AddSkyboxButton("park", "Skansen3", row6); |
---|
| 91 | + AddSkyboxButton("park", "Skansen4", row6); |
---|
| 92 | + AddSkyboxButton("park", "Skansen5", row6); |
---|
| 93 | + AddSkyboxButton("park", "Stairs", row6); |
---|
| 94 | + |
---|
| 95 | + tab0.add(row0); |
---|
| 96 | + tab0.add(row1); |
---|
| 97 | + tab0.add(row2); |
---|
| 98 | + tab0.add(row3); |
---|
| 99 | + tab0.add(row4); |
---|
| 100 | + tab0.add(row5); |
---|
| 101 | + tab0.add(row6); |
---|
| 102 | + |
---|
| 103 | + for (int i=5; --i>=0;) |
---|
| 104 | + { |
---|
| 105 | + //oe.toolboxPanel.Return(); |
---|
| 106 | + //tab0.add(new cGridBag()); |
---|
| 107 | + } |
---|
| 108 | + } |
---|
| 109 | + |
---|
| 110 | + public void AddSkyboxTab1(JTabbedPane skyboxpanel) |
---|
| 111 | + { |
---|
| 112 | + cGridBag tab0 = new cGridBag().setVertical(true); |
---|
| 113 | + |
---|
| 114 | + tab0.setName("Nature"); |
---|
| 115 | + skyboxpanel.add(tab0); |
---|
| 116 | + |
---|
| 117 | + cGridBag row0 = new cGridBag(); |
---|
| 118 | + cGridBag row1 = new cGridBag(); |
---|
| 119 | + cGridBag row2 = new cGridBag(); |
---|
| 120 | + cGridBag row3 = new cGridBag(); |
---|
| 121 | + cGridBag row4 = new cGridBag(); |
---|
| 122 | + cGridBag row5 = new cGridBag(); |
---|
| 123 | + cGridBag row6 = new cGridBag(); |
---|
| 124 | + |
---|
| 125 | + AddSkyboxButton("beach", "HeartInTheSand", row0); |
---|
| 126 | + AddSkyboxButton("beach", "LarnacaBeach", row0); |
---|
| 127 | + AddSkyboxButton("beach", "PalmTrees", row0); |
---|
| 128 | + AddSkyboxButton("beach", "Tenerife", row0); |
---|
| 129 | + |
---|
| 130 | + AddSkyboxButton("beach", "Tenerife2", row1); |
---|
| 131 | + AddSkyboxButton("beach", "Tenerife3", row1); |
---|
| 132 | + AddSkyboxButton("field", "FishPond", row1); |
---|
| 133 | + AddSkyboxButton("field", "Footballfield", row1); |
---|
| 134 | + |
---|
| 135 | + AddSkyboxButton("field", "Meadow", row2); |
---|
| 136 | + AddSkyboxButton("field", "Sorsele", row2); |
---|
| 137 | + AddSkyboxButton("field", "Sorsele2", row2); |
---|
| 138 | + AddSkyboxButton("field", "Sorsele3", row2); |
---|
| 139 | + |
---|
| 140 | + AddSkyboxButton("forest", "Brudslojan", row3); |
---|
| 141 | + AddSkyboxButton("forest", "Langholmen2", row3); |
---|
| 142 | + AddSkyboxButton("forest", "Plants", row3); |
---|
| 143 | + AddSkyboxButton("mountain", "Maskonaive", row3); |
---|
| 144 | + |
---|
| 145 | + AddSkyboxButton("mountain", "Maskonaive2", row4); |
---|
| 146 | + AddSkyboxButton("mountain", "Maskonaive3", row4); |
---|
| 147 | + AddSkyboxButton("mountain", "Ryfjallet", row4); |
---|
| 148 | + AddSkyboxButton("mountain", "Teide", row4); |
---|
| 149 | + AddSkyboxButton("park", "Tantolunden4", row4); |
---|
| 150 | + |
---|
| 151 | + AddSkyboxButton("penguins", "wrath", row5); |
---|
| 152 | + AddSkyboxButton("penguins", "yonder", row5); |
---|
| 153 | + AddSkyboxButton("rocky", "Langholmen", row5); |
---|
| 154 | + AddSkyboxButton("rocky", "Skinnarviksberget", row5); |
---|
| 155 | + AddSkyboxButton("rocky", "Tantolunden6", row5); |
---|
| 156 | + |
---|
| 157 | + AddSkyboxButton("default", "CloudyHills", row6); |
---|
| 158 | + AddSkyboxButton("daz", "Autumn", row6); |
---|
| 159 | + AddSkyboxButton("daz", "Greenlands", row6); |
---|
| 160 | + AddSkyboxButton("daz", "MountainTrail", row6); |
---|
| 161 | + AddSkyboxButton("daz", "Oasis", row6); |
---|
| 162 | + /* |
---|
| 163 | +Autumn |
---|
| 164 | +Greenlands |
---|
| 165 | +MountainTrail |
---|
| 166 | +Oasis |
---|
| 167 | +TheRock |
---|
| 168 | +TopOfTheWorld |
---|
| 169 | +Winter |
---|
| 170 | + */ |
---|
| 171 | + |
---|
| 172 | + tab0.add(row0); |
---|
| 173 | + tab0.add(row1); |
---|
| 174 | + tab0.add(row2); |
---|
| 175 | + tab0.add(row3); |
---|
| 176 | + tab0.add(row4); |
---|
| 177 | + tab0.add(row5); |
---|
| 178 | + tab0.add(row6); |
---|
| 179 | + |
---|
| 180 | + for (int i=5; --i>=0;) |
---|
| 181 | + { |
---|
| 182 | + //oe.toolboxPanel.Return(); |
---|
| 183 | + //tab0.add(new cGridBag()); |
---|
| 184 | + } |
---|
| 185 | + } |
---|
| 186 | + |
---|
| 187 | + public void AddSkyboxTab2(JTabbedPane skyboxpanel) |
---|
| 188 | + { |
---|
| 189 | + cGridBag tab0 = new cGridBag().setVertical(true); |
---|
| 190 | + |
---|
| 191 | + tab0.setName("Night"); |
---|
| 192 | + skyboxpanel.add(tab0); |
---|
| 193 | + |
---|
| 194 | + cGridBag row0 = new cGridBag(); |
---|
| 195 | + cGridBag row1 = new cGridBag(); |
---|
| 196 | + cGridBag row2 = new cGridBag(); |
---|
| 197 | + cGridBag row3 = new cGridBag(); |
---|
| 198 | + cGridBag row4 = new cGridBag(); |
---|
| 199 | + cGridBag row5 = new cGridBag(); |
---|
| 200 | + cGridBag row6 = new cGridBag(); |
---|
| 201 | + |
---|
| 202 | + AddSkyboxButton("night", "NightPath", row0); |
---|
| 203 | + AddSkyboxButton("night", "PondNight", row0); |
---|
| 204 | + AddSkyboxButton("night", "Powerlines", row0); |
---|
| 205 | + AddSkyboxButton("night", "SwedishRoyalCastle", row0); |
---|
| 206 | + |
---|
| 207 | + AddSkyboxButton("urban", "CNTower", row1); |
---|
| 208 | + AddSkyboxButton("bridge", "ArstaBridge", row1); |
---|
| 209 | + AddSkyboxButton("rocky", "Riddarfjarden", row1); |
---|
| 210 | + AddSkyboxButton("penguins", "sleepyhollow", row1); |
---|
| 211 | + |
---|
| 212 | + AddSkyboxButton("penguins", "kenon_star", row2); |
---|
| 213 | + AddSkyboxButton("indoors", "DallasW", row2); |
---|
| 214 | + AddSkyboxButton("indoors", "MarriottMadisonWest", row2); |
---|
| 215 | + AddSkyboxButton("indoors", "Vasa", row2); |
---|
| 216 | + |
---|
| 217 | + AddSkyboxButton("winter", "Backyard", row3); |
---|
| 218 | + AddSkyboxButton("winter", "Creek", row3); |
---|
| 219 | + AddSkyboxButton("winter", "FootballField3", row3); |
---|
| 220 | + AddSkyboxButton("winter", "Forest", row3); |
---|
| 221 | + |
---|
| 222 | + AddSkyboxButton("winter", "HornstullsStrand2", row4); |
---|
| 223 | + AddSkyboxButton("winter", "House", row4); |
---|
| 224 | + AddSkyboxButton("winter", "IceLake", row4); |
---|
| 225 | + AddSkyboxButton("winter", "IceRiver", row4); |
---|
| 226 | + |
---|
| 227 | + AddSkyboxButton("winter", "Park3", row5); |
---|
| 228 | + AddSkyboxButton("winter", "PondWinter", row5); |
---|
| 229 | + AddSkyboxButton("winter", "Tantolunden5", row5); |
---|
| 230 | + AddSkyboxButton("winter", "Vindelalven", row5); |
---|
| 231 | + |
---|
| 232 | + AddSkyboxButton("daz", "TheRock", row6); |
---|
| 233 | + AddSkyboxButton("daz", "TopOfTheWorld", row6); |
---|
| 234 | + AddSkyboxButton("daz", "Winter", row6); |
---|
| 235 | + AddSkyboxButton("penguins", "desertdawn", row6); |
---|
| 236 | + |
---|
| 237 | + tab0.add(row0); |
---|
| 238 | + tab0.add(row1); |
---|
| 239 | + tab0.add(row2); |
---|
| 240 | + tab0.add(row3); |
---|
| 241 | + tab0.add(row4); |
---|
| 242 | + tab0.add(row5); |
---|
| 243 | + tab0.add(row6); |
---|
| 244 | + |
---|
| 245 | + for (int i=5; --i>=0;) |
---|
| 246 | + { |
---|
| 247 | + //oe.toolboxPanel.Return(); |
---|
| 248 | + //tab0.add(new cGridBag()); |
---|
| 249 | + } |
---|
| 250 | + } |
---|
| 251 | + |
---|
| 252 | + public void ChangeSkybox(String name) |
---|
| 253 | + { |
---|
| 254 | + //cameraView.envyoff = false; |
---|
| 255 | + group.skyboxname = name; |
---|
| 256 | + group.skyboxext = "jpg"; |
---|
| 257 | + cameraView.repaint(); |
---|
| 258 | + } |
---|
| 259 | + |
---|
26 | 260 | //ObjEditor objEditor; |
---|
27 | 261 | public void closeUI2() |
---|
28 | 262 | { |
---|
.. | .. |
---|
60 | 294 | this.copy = this.group = group; |
---|
61 | 295 | //selectees = this.group.selectees; |
---|
62 | 296 | |
---|
| 297 | + if (copy.versions == null) |
---|
| 298 | + { |
---|
| 299 | + copy.versions = new byte[100][]; |
---|
| 300 | + copy.versionindex = -1; |
---|
| 301 | + } |
---|
| 302 | + |
---|
63 | 303 | if(ui) |
---|
64 | 304 | SetupUI(objEditor); |
---|
65 | 305 | } |
---|
.. | .. |
---|
80 | 320 | SetupViews(objEditor); |
---|
81 | 321 | |
---|
82 | 322 | ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true); |
---|
| 323 | + |
---|
| 324 | + if (copy.versions == null) |
---|
| 325 | + { |
---|
| 326 | + copy.versions = new byte[100][]; |
---|
| 327 | + copy.versionindex = -1; |
---|
| 328 | + |
---|
| 329 | + Save(true); |
---|
| 330 | + } |
---|
83 | 331 | } |
---|
84 | 332 | |
---|
85 | 333 | void CloneSelection(boolean supports) |
---|
86 | 334 | { |
---|
| 335 | + if (Globals.REPLACEONMAKE) |
---|
| 336 | + Save(); |
---|
| 337 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 338 | + Globals.REPLACEONMAKE = false; |
---|
87 | 339 | // Object3D keep = GrafreeD.clipboard; |
---|
88 | 340 | //Object3D obj; |
---|
89 | 341 | for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
94 | 346 | |
---|
95 | 347 | makeSomething(clone, i==group.selection.size()-1); |
---|
96 | 348 | } |
---|
| 349 | + Globals.REPLACEONMAKE = keep; |
---|
97 | 350 | } |
---|
98 | 351 | |
---|
99 | 352 | void CloneClipboard(boolean supports) |
---|
.. | .. |
---|
150 | 403 | |
---|
151 | 404 | void SetupMenu2(GroupEditor oe) |
---|
152 | 405 | { |
---|
| 406 | + oe.jTree = new cTree(); |
---|
| 407 | + |
---|
153 | 408 | Menu menu; |
---|
154 | 409 | oe.menuBar.add(menu = new Menu("Edit")); |
---|
155 | 410 | //editItem = menu.add(new MenuItem("Edit")); |
---|
156 | 411 | //editItem.addActionListener(this); |
---|
157 | | - undoItem = menu.add(new MenuItem("Undo")); |
---|
158 | | - undoItem.addActionListener(this); |
---|
159 | | - redoItem = menu.add(new MenuItem("Redo")); |
---|
160 | | - redoItem.addActionListener(this); |
---|
161 | | - menu.add("-"); |
---|
162 | | - duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
| 412 | + |
---|
| 413 | +// undoItem = menu.add(new MenuItem("Undo")); |
---|
| 414 | +// undoItem.addActionListener(this); |
---|
| 415 | +// redoItem = menu.add(new MenuItem("Redo")); |
---|
| 416 | +// redoItem.addActionListener(this); |
---|
| 417 | +// menu.add("-"); |
---|
| 418 | + duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); |
---|
163 | 419 | duplicateItem.addActionListener(this); |
---|
164 | 420 | cloneItem = menu.add(new MenuItem("Clone")); |
---|
165 | 421 | cloneItem.addActionListener(this); |
---|
.. | .. |
---|
175 | 431 | copyItem.addActionListener(this); |
---|
176 | 432 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
177 | 433 | pasteItem.addActionListener(this); |
---|
178 | | - menu.add("-"); |
---|
179 | 434 | |
---|
180 | 435 | menu.add("-"); |
---|
181 | 436 | pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
.. | .. |
---|
187 | 442 | // pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
188 | 443 | // pasteExpandItem.addActionListener(this); |
---|
189 | 444 | menu.add("-"); |
---|
190 | | - clearItem = menu.add(new MenuItem("Clear")); |
---|
191 | | - clearItem.addActionListener(this); |
---|
| 445 | + deleteItem = menu.add(new MenuItem("Delete")); |
---|
| 446 | + deleteItem.addActionListener(this); |
---|
192 | 447 | |
---|
193 | 448 | if (Globals.ADVANCED) |
---|
194 | 449 | { |
---|
.. | .. |
---|
202 | 457 | //zBufferItem.addActionListener(this); |
---|
203 | 458 | //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
204 | 459 | //normalLensItem.addActionListener(this); |
---|
205 | | - cameraMenu.add(revertCameraItem = new MenuItem("Restore Camera")); |
---|
206 | | - revertCameraItem.addActionListener(this); |
---|
| 460 | + cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint")); |
---|
| 461 | + restoreCameraItem.addActionListener(this); |
---|
207 | 462 | |
---|
208 | | - cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
209 | | - toggleFullScreenItem.addItemListener(this); |
---|
210 | | - toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
211 | | - cameraMenu.add("-"); |
---|
| 463 | +// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 464 | +// toggleFullScreenItem.addItemListener(this); |
---|
| 465 | +// toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
| 466 | +// cameraMenu.add("-"); |
---|
| 467 | +// |
---|
| 468 | +// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
| 469 | +// toggleTextureItem.addItemListener(this); |
---|
| 470 | +// toggleTextureItem.setState(CameraPane.textureon); |
---|
| 471 | +// |
---|
| 472 | +// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 473 | +// toggleSwitchItem.addItemListener(this); |
---|
| 474 | +// toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
212 | 475 | |
---|
213 | | - cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
214 | | - toggleTextureItem.addItemListener(this); |
---|
215 | | - toggleTextureItem.setState(CameraPane.textureon); |
---|
216 | | - |
---|
217 | | - cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
218 | | - toggleSwitchItem.addItemListener(this); |
---|
219 | | - toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
220 | | - |
---|
221 | | - cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
| 476 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles")); |
---|
222 | 477 | toggleHandleItem.addItemListener(this); |
---|
223 | 478 | toggleHandleItem.setState(CameraPane.HANDLES); |
---|
224 | 479 | |
---|
.. | .. |
---|
245 | 500 | |
---|
246 | 501 | cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
247 | 502 | toggleDebugItem.addItemListener(this); |
---|
248 | | - toggleDebugItem.setState(CameraPane.DEBUG); |
---|
| 503 | + toggleDebugItem.setState(Globals.DEBUG); |
---|
249 | 504 | |
---|
250 | 505 | cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
251 | 506 | toggleFrustumItem.addItemListener(this); |
---|
.. | .. |
---|
266 | 521 | // animationItem.addItemListener(this); |
---|
267 | 522 | // animationItem.setState(CameraPane.ANIMATION); |
---|
268 | 523 | cameraMenu.add("-"); |
---|
269 | | - cameraMenu.add(editCameraItem = new MenuItem("Save Camera")); |
---|
| 524 | + cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint")); |
---|
270 | 525 | editCameraItem.addActionListener(this); |
---|
271 | 526 | |
---|
272 | 527 | if (Globals.ADVANCED) |
---|
273 | 528 | { |
---|
274 | 529 | oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
275 | 530 | //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
276 | | - //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
| 531 | + //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); |
---|
277 | 532 | editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
278 | 533 | oe.cameraMenu.add("-"); |
---|
279 | 534 | openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
.. | .. |
---|
281 | 536 | editLeafItem.addActionListener(this); |
---|
282 | 537 | lookAtItem.addActionListener(this); |
---|
283 | 538 | //lookFromItem.addActinoListener(this); |
---|
284 | | - //switchItem.addActionListener(this); |
---|
| 539 | + //switchViewItem.addActionListener(this); |
---|
285 | 540 | } |
---|
286 | 541 | |
---|
287 | 542 | oe.menuBar.add(menu = new Menu("Setting")); |
---|
.. | .. |
---|
326 | 581 | } |
---|
327 | 582 | |
---|
328 | 583 | oe.menuBar.add(menu = new Menu("Group")); |
---|
329 | | - grabItem = menu.add(new MenuItem("Grab")); |
---|
330 | | - grabItem.addActionListener(this); |
---|
| 584 | +// grabItem = menu.add(new MenuItem("Grab")); |
---|
| 585 | +// grabItem.addActionListener(this); |
---|
331 | 586 | backItem = menu.add(new MenuItem("Back")); |
---|
332 | 587 | backItem.addActionListener(this); |
---|
333 | 588 | frontItem = menu.add(new MenuItem("Front")); |
---|
334 | 589 | frontItem.addActionListener(this); |
---|
335 | | - compositeItem = menu.add(new MenuItem("Composite")); |
---|
336 | | - compositeItem.addActionListener(this); |
---|
| 590 | +// compositeItem = menu.add(new MenuItem("Composite")); |
---|
| 591 | +// compositeItem.addActionListener(this); |
---|
| 592 | + |
---|
| 593 | + if (Globals.ADVANCED) |
---|
| 594 | + { |
---|
337 | 595 | hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
338 | 596 | hideItem.addActionListener(this); |
---|
| 597 | + } |
---|
339 | 598 | ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
340 | 599 | ungroupItem.addActionListener(this); |
---|
341 | | - menu.add("-"); |
---|
342 | | - randomItem = menu.add(new MenuItem("Switch node")); |
---|
343 | | - randomItem.addActionListener(this); |
---|
| 600 | + |
---|
| 601 | +// menu.add("-"); |
---|
| 602 | +// |
---|
| 603 | +// switchItem = menu.add(new MenuItem("Switch node")); |
---|
| 604 | +// switchItem.addActionListener(this); |
---|
| 605 | + if (Globals.ADVANCED) |
---|
| 606 | + { |
---|
344 | 607 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
345 | 608 | switchGeoItem.addActionListener(this); |
---|
346 | 609 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
.. | .. |
---|
348 | 611 | morphItem = menu.add(new MenuItem("Morph Group")); |
---|
349 | 612 | morphItem.addActionListener(this); |
---|
350 | 613 | |
---|
351 | | - if (Globals.ADVANCED) |
---|
352 | | - { |
---|
353 | 614 | menu.add("-"); |
---|
354 | 615 | physicsItem = menu.add(new MenuItem("Physics")); |
---|
355 | 616 | physicsItem.addActionListener(this); |
---|
.. | .. |
---|
357 | 618 | frameselectorItem.addActionListener(this); |
---|
358 | 619 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
359 | 620 | scriptNodeItem.addActionListener(this); |
---|
360 | | - cameraItem = menu.add(new MenuItem("Camera")); |
---|
361 | | - cameraItem.addActionListener(this); |
---|
362 | 621 | } |
---|
363 | 622 | |
---|
364 | 623 | oe.menuBar.add(menu = new Menu("Object")); |
---|
365 | | - textureItem = menu.add(new MenuItem("Texture")); |
---|
366 | | - textureItem.addActionListener(this); |
---|
| 624 | +// textureItem = menu.add(new MenuItem("Texture")); |
---|
| 625 | +// textureItem.addActionListener(this); |
---|
367 | 626 | billboardItem = menu.add(new MenuItem("Billboard")); |
---|
368 | 627 | billboardItem.addActionListener(this); |
---|
369 | 628 | csgItem = menu.add(new MenuItem("CSG")); |
---|
370 | 629 | csgItem.addActionListener(this); |
---|
371 | | - shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
| 630 | + shadowXItem = menu.add(new MenuItem("Shadow Red")); |
---|
372 | 631 | shadowXItem.addActionListener(this); |
---|
373 | | - shadowYItem = menu.add(new MenuItem("Shadow Y")); |
---|
| 632 | + shadowYItem = menu.add(new MenuItem("Shadow Green")); |
---|
374 | 633 | shadowYItem.addActionListener(this); |
---|
375 | | - shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
| 634 | + shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
376 | 635 | shadowZItem.addActionListener(this); |
---|
| 636 | + attributeItem = menu.add(new MenuItem("Attribute")); |
---|
| 637 | + attributeItem.addActionListener(this); |
---|
| 638 | + |
---|
377 | 639 | if (Globals.ADVANCED) |
---|
378 | 640 | { |
---|
379 | 641 | menu.add("-"); |
---|
380 | 642 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
381 | 643 | linkerItem.addActionListener(this); |
---|
382 | | - attributeItem = menu.add(new MenuItem("Attribute")); |
---|
383 | | - attributeItem.addActionListener(this); |
---|
384 | 644 | templateItem = menu.add(new MenuItem("Template")); |
---|
385 | 645 | templateItem.addActionListener(this); |
---|
386 | 646 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
.. | .. |
---|
409 | 669 | genNormalsMESHItem.addActionListener(this); |
---|
410 | 670 | if (Globals.ADVANCED) |
---|
411 | 671 | { |
---|
412 | | - genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
| 672 | + genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals")); |
---|
413 | 673 | genNormalsMINEItem.addActionListener(this); |
---|
414 | 674 | } |
---|
415 | 675 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
.. | .. |
---|
469 | 729 | markleavesItem.addActionListener(this); |
---|
470 | 730 | unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
471 | 731 | unmarkleavesItem.addActionListener(this); |
---|
| 732 | + rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
| 733 | + rewindleavesItem.addActionListener(this); |
---|
| 734 | + unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves")); |
---|
| 735 | + unrewindleavesItem.addActionListener(this); |
---|
| 736 | + randomleavesItem = menu.add(new MenuItem("Random Leaves")); |
---|
| 737 | + randomleavesItem.addActionListener(this); |
---|
| 738 | + unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves")); |
---|
| 739 | + unrandomleavesItem.addActionListener(this); |
---|
472 | 740 | menu.add("-"); |
---|
473 | 741 | flipVItem = menu.add(new MenuItem("Flip V")); |
---|
474 | 742 | flipVItem.addActionListener(this); |
---|
.. | .. |
---|
494 | 762 | attachBumpItem.addActionListener(this); |
---|
495 | 763 | pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump")); |
---|
496 | 764 | pigmentBumpItem.addActionListener(this); |
---|
| 765 | + //embedTexturesItem |
---|
497 | 766 | detachPigmentItem = menu.add(new MenuItem("Detach Pigment")); |
---|
498 | 767 | detachPigmentItem.addActionListener(this); |
---|
499 | 768 | detachBumpItem = menu.add(new MenuItem("Detach Bump")); |
---|
500 | 769 | detachBumpItem.addActionListener(this); |
---|
| 770 | + embedTexturesItem = menu.add(new MenuItem("Embed Textures")); |
---|
| 771 | + embedTexturesItem.addActionListener(this); |
---|
| 772 | + deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures")); |
---|
| 773 | + deEmbedTexturesItem.addActionListener(this); |
---|
501 | 774 | menu.add("-"); |
---|
502 | 775 | sortbysizeItem = menu.add(new MenuItem("Sort by size")); |
---|
503 | 776 | sortbysizeItem.addActionListener(this); |
---|
.. | .. |
---|
524 | 797 | buildToolsMenu(menu); |
---|
525 | 798 | } |
---|
526 | 799 | |
---|
| 800 | + |
---|
527 | 801 | void SetupUI2(ObjEditor oe) |
---|
528 | 802 | { |
---|
| 803 | + // June 2019 |
---|
| 804 | + if (oe == null) |
---|
| 805 | + { |
---|
| 806 | + //super.SetupUI2(this); |
---|
| 807 | + //return; |
---|
| 808 | + } |
---|
| 809 | + |
---|
| 810 | + if (copy != group) |
---|
| 811 | + { |
---|
| 812 | + //super.SetupUI2(this); |
---|
| 813 | + } |
---|
| 814 | + |
---|
529 | 815 | //new Exception().printStackTrace(); |
---|
530 | 816 | |
---|
531 | 817 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
.. | .. |
---|
554 | 840 | oe.radioPanel.add(dummyButton); |
---|
555 | 841 | oe.buttonGroup.add(dummyButton); |
---|
556 | 842 | */ |
---|
| 843 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 844 | + |
---|
| 845 | + copyOptionsPanel.preferredHeight = 2; |
---|
| 846 | + |
---|
557 | 847 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
558 | 848 | |
---|
559 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 849 | + //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 850 | + //minButton.setToolTipText("Minimize window"); |
---|
| 851 | + //minButton.addActionListener(this); |
---|
| 852 | + |
---|
| 853 | + if (Globals.ADVANCED) |
---|
| 854 | + { |
---|
| 855 | + oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 856 | + maxButton.setToolTipText("Maximize window"); |
---|
| 857 | + maxButton.addActionListener(this); |
---|
| 858 | + } |
---|
| 859 | + |
---|
| 860 | + oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 861 | + fullButton.setToolTipText("Full-screen window"); |
---|
| 862 | + fullButton.addActionListener(this); |
---|
| 863 | + |
---|
| 864 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 865 | + screenfitButton.setToolTipText("Screen fit"); |
---|
| 866 | + screenfitButton.addActionListener(this); |
---|
| 867 | + |
---|
| 868 | + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 869 | + restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
| 870 | + restoreCameraButton.addActionListener(this); |
---|
| 871 | + |
---|
| 872 | + copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 873 | + saveButton.setToolTipText("New version"); |
---|
| 874 | + saveButton.addActionListener(this); |
---|
| 875 | + |
---|
| 876 | + copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 877 | + undoButton.setToolTipText("Previous version"); |
---|
| 878 | + undoButton.addActionListener(this); |
---|
| 879 | + undoButton.setEnabled(false); |
---|
| 880 | + |
---|
| 881 | + cGridBag updown = new cGridBag().setVertical(true); |
---|
| 882 | + updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 883 | + restoreButton.setToolTipText("Restore current"); |
---|
| 884 | + restoreButton.addActionListener(this); |
---|
| 885 | + restoreButton.setEnabled(false); |
---|
| 886 | + |
---|
| 887 | + updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 888 | + replaceButton.setToolTipText("Replace current"); |
---|
| 889 | + replaceButton.addActionListener(this); |
---|
| 890 | + replaceButton.setEnabled(false); |
---|
| 891 | + |
---|
| 892 | + copyOptionsPanel.add(updown); |
---|
| 893 | + |
---|
| 894 | + copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 895 | + redoButton.setToolTipText("Next version"); |
---|
| 896 | + redoButton.addActionListener(this); |
---|
| 897 | + redoButton.setEnabled(false); |
---|
| 898 | + |
---|
| 899 | + oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
560 | 900 | liveCB.setToolTipText("Enable animation"); |
---|
561 | 901 | liveCB.addItemListener(this); |
---|
562 | 902 | |
---|
563 | | - oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 903 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
564 | 904 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
565 | 905 | oneStepButton.addActionListener(this); |
---|
566 | 906 | |
---|
567 | | - oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
| 907 | + oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
568 | 908 | fastCB.setToolTipText("Fast mode"); |
---|
569 | 909 | fastCB.addItemListener(this); |
---|
570 | 910 | |
---|
571 | | - oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
572 | | - trackCB.setToolTipText("Enable tracking"); |
---|
573 | | - trackCB.addItemListener(this); |
---|
574 | | - |
---|
575 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
576 | | - screenfitButton.setToolTipText("Screen fit"); |
---|
577 | | - screenfitButton.addActionListener(this); |
---|
| 911 | + //oe.toolboxPanel.Return(); |
---|
| 912 | + |
---|
| 913 | +// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 914 | +// trackCB.setToolTipText("Enable tracking"); |
---|
| 915 | +// trackCB.addItemListener(this); |
---|
578 | 916 | |
---|
579 | 917 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
580 | 918 | // screenfitpointButton.addActionListener(this); |
---|
.. | .. |
---|
584 | 922 | oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
585 | 923 | snapobjectButton.addActionListener(this); |
---|
586 | 924 | snapobjectButton.setToolTipText("Snap Object"); |
---|
| 925 | + |
---|
| 926 | + oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 927 | + fourButton.addActionListener(this); |
---|
| 928 | + fourButton.setToolTipText("Show control panel only"); |
---|
587 | 929 | } |
---|
588 | 930 | |
---|
589 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
590 | | - flashSelectionButton.setToolTipText("Show selection"); |
---|
591 | | - flashSelectionButton.addActionListener(this); |
---|
| 931 | + //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
592 | 932 | |
---|
593 | | - oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
594 | | - |
---|
595 | | - oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
596 | | - twoButton.setToolTipText("Show center view only"); |
---|
| 933 | + oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 934 | + twoButton.setToolTipText("Show 3D view only"); |
---|
597 | 935 | twoButton.addActionListener(this); |
---|
598 | | - oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
599 | | - fourButton.addActionListener(this); |
---|
600 | | - fourButton.setToolTipText("Show left panel only"); |
---|
601 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
602 | | - sixButton.setToolTipText("2-column layout left"); |
---|
603 | | - sixButton.addActionListener(this); |
---|
604 | | - oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
605 | | - threeButton.setToolTipText("2-column layout right"); |
---|
| 936 | + this.fullscreenLayout = twoButton; |
---|
| 937 | + |
---|
| 938 | + oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 939 | + threeButton.setToolTipText("Show controls and 3D view"); |
---|
606 | 940 | threeButton.addActionListener(this); |
---|
607 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
608 | | - sevenButton.setToolTipText("3-column layout"); |
---|
609 | | - sevenButton.addActionListener(this); |
---|
| 941 | + oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 942 | + sixButton.setToolTipText("Show 3D view and controls"); |
---|
| 943 | + sixButton.addActionListener(this); |
---|
| 944 | +// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 945 | +// sevenButton.setToolTipText("3-column layout"); |
---|
| 946 | +// sevenButton.addActionListener(this); |
---|
610 | 947 | // |
---|
611 | 948 | |
---|
612 | | - oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
613 | | - rootButton.setToolTipText("Edit selection in new tab"); |
---|
| 949 | + oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 950 | + rootButton.setToolTipText("Open selection in new tab"); |
---|
614 | 951 | rootButton.addActionListener(this); |
---|
615 | 952 | |
---|
616 | | - oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 953 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
617 | 954 | closeButton.setToolTipText("Close tab"); |
---|
618 | 955 | closeButton.addActionListener(this); |
---|
619 | 956 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
620 | 957 | //clearButton.addActionListener(this); |
---|
621 | | - |
---|
622 | | - cGridBag commandsPanel = new cGridBag(); |
---|
| 958 | + |
---|
| 959 | + cGridBag row1 = new cGridBag(); |
---|
623 | 960 | |
---|
624 | | - commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
625 | | - editButton.setToolTipText("Edit selection"); |
---|
| 961 | + // INSERT |
---|
| 962 | + row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 963 | + gridButton.setToolTipText("Create grid"); |
---|
| 964 | + gridButton.addActionListener(this); |
---|
| 965 | + |
---|
| 966 | + row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 967 | + boxButton.setToolTipText("Create box"); |
---|
| 968 | + boxButton.addActionListener(this); |
---|
| 969 | + |
---|
| 970 | + row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 971 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 972 | + sphereButton.addActionListener(this); |
---|
| 973 | + |
---|
| 974 | + row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 975 | + coneButton.setToolTipText("Create cone"); |
---|
| 976 | + coneButton.addActionListener(this); |
---|
| 977 | + |
---|
| 978 | + row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 979 | + torusButton.setToolTipText("Create torus"); |
---|
| 980 | + torusButton.addActionListener(this); |
---|
| 981 | + |
---|
| 982 | + row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 983 | + superButton.setToolTipText("Create superellipsoid"); |
---|
| 984 | + superButton.addActionListener(this); |
---|
| 985 | + |
---|
| 986 | + if (Globals.ADVANCED) |
---|
| 987 | + { |
---|
| 988 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 989 | + kleinButton.setToolTipText("Create Klein bottle"); |
---|
| 990 | + kleinButton.addActionListener(this); |
---|
| 991 | + } |
---|
| 992 | + |
---|
| 993 | + row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 994 | + particlesButton.setToolTipText("Create particle system"); |
---|
| 995 | + particlesButton.addActionListener(this); |
---|
| 996 | + |
---|
| 997 | + oe.toolboxPanel.add(row1); |
---|
| 998 | + |
---|
| 999 | + cGridBag row2 = new cGridBag(); |
---|
| 1000 | + |
---|
| 1001 | + row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1002 | + groupButton.setToolTipText("Create group"); |
---|
| 1003 | + groupButton.addActionListener(this); |
---|
| 1004 | + |
---|
| 1005 | + row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1006 | + compositeButton.setToolTipText("Create composite"); |
---|
| 1007 | + compositeButton.addActionListener(this); |
---|
| 1008 | + |
---|
| 1009 | + row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1010 | + switchButton.setToolTipText("Create item switcher"); |
---|
| 1011 | + switchButton.addActionListener(this); |
---|
| 1012 | + |
---|
| 1013 | + row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1014 | + loopButton.setToolTipText("Create loop"); |
---|
| 1015 | + loopButton.addActionListener(this); |
---|
| 1016 | + |
---|
| 1017 | + row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1018 | + textureButton.setToolTipText("Create texture"); |
---|
| 1019 | + textureButton.addActionListener(this); |
---|
| 1020 | + |
---|
| 1021 | + row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1022 | + overlayButton.setToolTipText("Create overlay"); |
---|
| 1023 | + overlayButton.addActionListener(this); |
---|
| 1024 | + |
---|
| 1025 | + row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1026 | + lightButton.setToolTipText("Create light"); |
---|
| 1027 | + lightButton.addActionListener(this); |
---|
| 1028 | + |
---|
| 1029 | + oe.toolboxPanel.add(row2); |
---|
| 1030 | + |
---|
| 1031 | + // ENVYMAPS |
---|
| 1032 | + cGridBag skyboxpane = new cGridBag(); |
---|
| 1033 | + skyboxpane.preferredHeight = 100; |
---|
| 1034 | + |
---|
| 1035 | + oe.toolboxPanel.add(skyboxpane); |
---|
| 1036 | + |
---|
| 1037 | + JTabbedPane skyboxpanel = new JTabbedPane(); |
---|
| 1038 | + skyboxpane.add(skyboxpanel); |
---|
| 1039 | + |
---|
| 1040 | + AddSkyboxTab0(skyboxpanel); |
---|
| 1041 | + AddSkyboxTab1(skyboxpanel); |
---|
| 1042 | + AddSkyboxTab2(skyboxpanel); |
---|
| 1043 | + |
---|
| 1044 | + // EDIT panel |
---|
| 1045 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1046 | + editButton.setToolTipText("Pin selection controls"); |
---|
626 | 1047 | editButton.addActionListener(this); |
---|
627 | 1048 | |
---|
628 | | - commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
629 | | - uneditButton.setToolTipText("Unedit selection"); |
---|
| 1049 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1050 | + uneditButton.setToolTipText("Remove selection controls"); |
---|
630 | 1051 | uneditButton.addActionListener(this); |
---|
631 | 1052 | |
---|
632 | | - commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
633 | | - allParamsButton.setToolTipText("Edit all params"); |
---|
| 1053 | + editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 1054 | + allParamsButton.setToolTipText("Show all controle"); |
---|
634 | 1055 | allParamsButton.addActionListener(this); |
---|
635 | 1056 | |
---|
636 | | - commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1057 | + editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
637 | 1058 | clearPanelButton.setToolTipText("Clear edit panel"); |
---|
638 | 1059 | clearPanelButton.addActionListener(this); |
---|
639 | 1060 | |
---|
640 | | - commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1061 | + editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
641 | 1062 | unselectButton.setToolTipText("Unselect"); |
---|
642 | 1063 | unselectButton.addActionListener(this); |
---|
643 | 1064 | |
---|
644 | | - commandsPanel.preferredHeight = 1; |
---|
| 1065 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1066 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
| 1067 | + flashSelectionButton.addActionListener(this); |
---|
645 | 1068 | |
---|
646 | | - oe.treePanel.add(commandsPanel); |
---|
647 | | - oe.treePanel.Return(); |
---|
| 1069 | + editCommandsPanel.preferredHeight = 1; |
---|
| 1070 | + |
---|
| 1071 | + SetPinStates(false); |
---|
| 1072 | +// oe.treePanel.add(commandsPanel); |
---|
| 1073 | +// oe.treePanel.Return(); |
---|
648 | 1074 | |
---|
649 | 1075 | // oe.aConstraints.gridx += 1; |
---|
650 | 1076 | // oe.aConstraints.weighty = 0; |
---|
.. | .. |
---|
661 | 1087 | |
---|
662 | 1088 | JScrollPane jSP; |
---|
663 | 1089 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
664 | | - jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints); |
---|
| 1090 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
665 | 1091 | ResetModel(); |
---|
666 | 1092 | |
---|
667 | 1093 | oe.treePanel.add(jSPPanel); |
---|
668 | 1094 | oe.treePanel.Return(); |
---|
669 | 1095 | |
---|
670 | | - cGridBag copyOptionsPanel = new cGridBag(); |
---|
671 | | - |
---|
672 | | - copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
673 | | - colorCB.setToolTipText("Copy color when dropped"); |
---|
674 | | - colorCB.addItemListener(this); |
---|
675 | | - |
---|
676 | | - copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
677 | | - materialCB.setToolTipText("Copy material when dropped"); |
---|
678 | | - materialCB.addItemListener(this); |
---|
679 | | - |
---|
680 | | - copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
681 | | - textureCB.setToolTipText("Copy texture when dropped"); |
---|
682 | | - textureCB.addItemListener(this); |
---|
683 | | - |
---|
684 | | - copyOptionsPanel.preferredHeight = 1; |
---|
685 | 1096 | oe.treePanel.add(copyOptionsPanel); |
---|
686 | 1097 | oe.treePanel.Return(); |
---|
| 1098 | + cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 1099 | + versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
| 1100 | + sliderPane.preferredHeight = 1; |
---|
687 | 1101 | |
---|
688 | | -// mainPanel.setDividerLocation(0.5); //1.0); |
---|
689 | | -// mainPanel.setResizeWeight(0.5); |
---|
| 1102 | +// mainPanel.setDividerLocation(0.1); //1.0); |
---|
| 1103 | + mainPanel.setResizeWeight(0.4); |
---|
690 | 1104 | |
---|
691 | 1105 | //jList.addListSelectionListener(this); |
---|
692 | 1106 | oe.jTree.addTreeSelectionListener(this); |
---|
.. | .. |
---|
694 | 1108 | //jTree.setEditable(true); |
---|
695 | 1109 | oe.jTree.setDragEnabled(true); |
---|
696 | 1110 | //jTree.setPreferredSize(new Dimension(10,10)); |
---|
697 | | - jSP.setPreferredSize(new Dimension(100,200)); |
---|
| 1111 | + //jSP.setPreferredSize(new Dimension(100,200)); |
---|
698 | 1112 | |
---|
699 | 1113 | oe.jTree.setCellRenderer(new cTreeModel.Renderer()); |
---|
700 | 1114 | |
---|
.. | .. |
---|
706 | 1120 | dgr.addDragGestureListener(this); |
---|
707 | 1121 | }catch(Exception e) {} |
---|
708 | 1122 | */ |
---|
709 | | - radio.layout = sevenButton; |
---|
| 1123 | + radio.layout = sixButton; // sevenButton; |
---|
710 | 1124 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
711 | 1125 | } |
---|
712 | 1126 | |
---|
713 | 1127 | void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
714 | 1128 | { |
---|
| 1129 | + panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 1130 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
| 1131 | + colorCB.addItemListener(this); |
---|
| 1132 | + |
---|
| 1133 | + panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 1134 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
| 1135 | + materialCB.addItemListener(this); |
---|
| 1136 | + |
---|
| 1137 | + panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 1138 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
| 1139 | + textureCB.addItemListener(this); |
---|
| 1140 | + |
---|
| 1141 | + panel.Return(); |
---|
| 1142 | + |
---|
715 | 1143 | panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
716 | 1144 | boxCB.setToolTipText("Display bounding boxes"); |
---|
717 | 1145 | boxCB.addItemListener(this); |
---|
718 | 1146 | |
---|
719 | 1147 | panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
720 | | - zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 1148 | + zoomBoxCB.setToolTipText("Display only for wheel"); |
---|
721 | 1149 | zoomBoxCB.addItemListener(this); |
---|
722 | 1150 | |
---|
723 | 1151 | if (true) // Globals.ADVANCED) |
---|
724 | 1152 | { |
---|
725 | | - panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
726 | | - supportCB.setToolTipText("Enable rigging"); |
---|
727 | | - supportCB.addItemListener(this); |
---|
| 1153 | +// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 1154 | +// supportCB.setToolTipText("Enable rigging"); |
---|
| 1155 | +// supportCB.addItemListener(this); |
---|
| 1156 | + |
---|
| 1157 | + panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 1158 | + freezeCB.setToolTipText("Fast moving camera"); |
---|
| 1159 | + freezeCB.addItemListener(this); |
---|
728 | 1160 | |
---|
729 | 1161 | // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
730 | 1162 | // localCB.addItemListener(this); |
---|
731 | 1163 | |
---|
| 1164 | + panel.Return(); |
---|
| 1165 | + |
---|
732 | 1166 | panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
733 | 1167 | crowdCB.setToolTipText("Used for crowds"); |
---|
734 | 1168 | crowdCB.addItemListener(this); |
---|
.. | .. |
---|
745 | 1179 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
746 | 1180 | // speakerMocapCB.addItemListener(this); |
---|
747 | 1181 | |
---|
| 1182 | + panel.Return(); |
---|
| 1183 | + |
---|
748 | 1184 | if (false) |
---|
749 | 1185 | { |
---|
750 | 1186 | // handled in scripts |
---|
.. | .. |
---|
759 | 1195 | //constraints.gridy += 1; |
---|
760 | 1196 | panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
761 | 1197 | smoothfocusCB.addItemListener(this); |
---|
| 1198 | + panel.Return(); |
---|
762 | 1199 | } |
---|
763 | 1200 | |
---|
764 | 1201 | //constraints.gridx += 1; |
---|
765 | 1202 | //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
766 | 1203 | // debugCB.addItemListener(this); |
---|
767 | 1204 | |
---|
| 1205 | + panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 1206 | + trackCB.setToolTipText("Enable tracking target"); |
---|
| 1207 | + trackCB.addItemListener(this); |
---|
| 1208 | + |
---|
768 | 1209 | panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 1210 | + oeilCB.setToolTipText("Move camera when tracking"); |
---|
769 | 1211 | oeilCB.addItemListener(this); |
---|
770 | 1212 | |
---|
| 1213 | + panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
| 1214 | + shadowCB.setToolTipText("When live compute shadows"); |
---|
| 1215 | + shadowCB.addItemListener(this); |
---|
| 1216 | + |
---|
| 1217 | + panel.Return(); |
---|
| 1218 | + panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints); |
---|
| 1219 | + toggleTextureCB.setToolTipText("Load textures"); |
---|
| 1220 | + toggleTextureCB.addItemListener(this); |
---|
| 1221 | + |
---|
| 1222 | + panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints); |
---|
| 1223 | + toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
| 1224 | + toggleSwitchCB.addItemListener(this); |
---|
| 1225 | + |
---|
| 1226 | + panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints); |
---|
| 1227 | + autokeepCB.setToolTipText("On structure change"); |
---|
| 1228 | + autokeepCB.addItemListener(this); |
---|
| 1229 | + |
---|
| 1230 | + panel.Return(); |
---|
| 1231 | + if (Globals.ADVANCED) |
---|
| 1232 | + { |
---|
771 | 1233 | panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
772 | 1234 | lookAtCB.setToolTipText("Look-at target"); |
---|
773 | 1235 | lookAtCB.addItemListener(this); |
---|
| 1236 | + } |
---|
774 | 1237 | |
---|
775 | 1238 | } |
---|
776 | 1239 | |
---|
777 | 1240 | cGridBag fill = new cGridBag(); |
---|
778 | | - |
---|
779 | 1241 | fill.preferredHeight = 200; |
---|
| 1242 | + cGridBag fill2 = new cGridBag(); |
---|
| 1243 | + fill2.preferredHeight = 200; |
---|
| 1244 | + cGridBag fill3 = new cGridBag(); |
---|
| 1245 | + fill3.preferredHeight = 200; |
---|
780 | 1246 | |
---|
781 | 1247 | panel.add(fill); |
---|
| 1248 | + panel.add(fill2); |
---|
| 1249 | + panel.add(fill3); |
---|
782 | 1250 | |
---|
783 | 1251 | } |
---|
784 | 1252 | |
---|
785 | 1253 | void EditObject(Object3D obj) |
---|
786 | 1254 | { |
---|
787 | 1255 | cRadio radioButton = new cRadio(obj.name); |
---|
| 1256 | + |
---|
| 1257 | + // June 2019. Patch to avoid bug with transparency. |
---|
| 1258 | + radioButton.hadMaterial = obj.material != null; |
---|
| 1259 | + if (!radioButton.hadMaterial) |
---|
| 1260 | + { |
---|
| 1261 | + obj.material = new cMaterial(); |
---|
| 1262 | + } |
---|
| 1263 | + |
---|
788 | 1264 | radioButton.SetObject(obj); |
---|
789 | | - radioButton.layout = sevenButton; |
---|
| 1265 | + radioButton.layout = sixButton; // sevenButton; |
---|
790 | 1266 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
791 | 1267 | radioButton.addActionListener(this); |
---|
792 | 1268 | radioPanel.add(radioButton); |
---|
.. | .. |
---|
796 | 1272 | |
---|
797 | 1273 | void SetupViews(ObjEditor oe) |
---|
798 | 1274 | { |
---|
| 1275 | + theFrame = this; |
---|
| 1276 | + |
---|
799 | 1277 | oe.SetupViews(); |
---|
800 | 1278 | |
---|
801 | 1279 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
804 | 1282 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
805 | 1283 | } |
---|
806 | 1284 | |
---|
807 | | - JCheckBox liveCB; |
---|
808 | | - JCheckBox supportCB; |
---|
809 | | - JCheckBox localCB; |
---|
810 | | - JCheckBox crowdCB; |
---|
811 | | - JCheckBox smoothCB; |
---|
812 | | - JCheckBox fastCB; |
---|
813 | | - JCheckBox slowCB; |
---|
814 | | - JCheckBox boxCB; |
---|
815 | | - JCheckBox zoomBoxCB; |
---|
816 | | - JCheckBox trackCB; |
---|
817 | | - JCheckBox smoothfocusCB; |
---|
| 1285 | + cToggleButton liveCB; |
---|
| 1286 | + cCheckBox supportCB; |
---|
| 1287 | + cCheckBox localCB; |
---|
| 1288 | + cCheckBox crowdCB; |
---|
| 1289 | + cCheckBox smoothCB; |
---|
| 1290 | + cToggleButton fastCB; |
---|
| 1291 | + cCheckBox slowCB; |
---|
| 1292 | + cCheckBox boxCB; |
---|
| 1293 | + cCheckBox zoomBoxCB; |
---|
| 1294 | + cCheckBox freezeCB; |
---|
| 1295 | + //cToggleButton trackCB; |
---|
| 1296 | + cCheckBox trackCB; |
---|
| 1297 | + cCheckBox smoothfocusCB; |
---|
818 | 1298 | // JCheckBox speakerMocapCB; |
---|
819 | | - JCheckBox speakerCameraCB; |
---|
820 | | - JCheckBox speakerFocusCB; |
---|
821 | | - JCheckBox debugCB; |
---|
822 | | - JCheckBox oeilCB; |
---|
823 | | - JCheckBox lookAtCB; |
---|
| 1299 | + cCheckBox speakerCameraCB; |
---|
| 1300 | + cCheckBox speakerFocusCB; |
---|
| 1301 | + cCheckBox debugCB; |
---|
| 1302 | + |
---|
| 1303 | + cCheckBox oeilCB; |
---|
| 1304 | + cCheckBox shadowCB; |
---|
| 1305 | + cCheckBox autokeepCB; |
---|
| 1306 | + cCheckBox lookAtCB; |
---|
824 | 1307 | |
---|
825 | 1308 | // static int COLOR = 1; |
---|
826 | 1309 | // static int MATERIAL = 2; |
---|
.. | .. |
---|
828 | 1311 | |
---|
829 | 1312 | int dropAttributes = Object3D.COLOR | Object3D.MATERIAL; |
---|
830 | 1313 | |
---|
831 | | - JCheckBox colorCB; |
---|
832 | | - JCheckBox materialCB; |
---|
833 | | - JCheckBox textureCB; |
---|
| 1314 | + cCheckBox colorCB; |
---|
| 1315 | + cCheckBox materialCB; |
---|
| 1316 | + cCheckBox textureCB; |
---|
834 | 1317 | |
---|
835 | 1318 | public void itemStateChanged(ItemEvent e) |
---|
836 | 1319 | { |
---|
.. | .. |
---|
858 | 1341 | } else if(e.getSource() == liveCB) |
---|
859 | 1342 | { |
---|
860 | 1343 | cameraView.ToggleLive(); |
---|
| 1344 | + refreshContents(false); |
---|
861 | 1345 | } |
---|
862 | 1346 | else if(e.getSource() == supportCB) |
---|
863 | 1347 | { |
---|
.. | .. |
---|
922 | 1406 | { |
---|
923 | 1407 | cameraView.ToggleOeil(); |
---|
924 | 1408 | } |
---|
| 1409 | + else if(e.getSource() == shadowCB) |
---|
| 1410 | + { |
---|
| 1411 | + Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
| 1412 | + } |
---|
| 1413 | + else if(e.getSource() == freezeCB) |
---|
| 1414 | + { |
---|
| 1415 | + Globals.FREEZEONMOVE ^= true; |
---|
| 1416 | + } |
---|
| 1417 | + else if(e.getSource() == autokeepCB) |
---|
| 1418 | + { |
---|
| 1419 | + Globals.REPLACEONMAKE ^= true; |
---|
| 1420 | + } |
---|
925 | 1421 | else if(e.getSource() == lookAtCB) |
---|
926 | 1422 | { |
---|
927 | 1423 | cameraView.ToggleLookAt(); |
---|
.. | .. |
---|
938 | 1434 | |
---|
939 | 1435 | /**/ |
---|
940 | 1436 | //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this); |
---|
941 | | - TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1437 | + //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1438 | + TreePath path = objEditor.jTree.getSelectionPath(); |
---|
942 | 1439 | if ((path == null) || (path.getPathCount() <= 1)) { |
---|
943 | 1440 | // We can't move the root node or an empty selection |
---|
944 | 1441 | return; |
---|
.. | .. |
---|
1001 | 1498 | } |
---|
1002 | 1499 | } |
---|
1003 | 1500 | |
---|
1004 | | - String string = (String) object; |
---|
1005 | | - |
---|
1006 | 1501 | System.out.println("Transfer = " + object + "; drop : " + target); |
---|
1007 | 1502 | // if( object instanceof java.io.File[]) |
---|
1008 | 1503 | // { |
---|
.. | .. |
---|
1010 | 1505 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
1011 | 1506 | // return; |
---|
1012 | 1507 | // } |
---|
| 1508 | + |
---|
| 1509 | + String string = object.toString(); |
---|
1013 | 1510 | |
---|
1014 | 1511 | // File path for Mac and Windows |
---|
1015 | 1512 | if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
.. | .. |
---|
1055 | 1552 | |
---|
1056 | 1553 | assert target == objEditor.jTree; |
---|
1057 | 1554 | TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y); |
---|
| 1555 | + Object3D destinationLeaf; |
---|
1058 | 1556 | try { |
---|
1059 | | - Object3D dummy = (Composite) destinationPath.getLastPathComponent(); |
---|
| 1557 | + destinationLeaf = (Composite) destinationPath.getLastPathComponent(); |
---|
1060 | 1558 | } catch (Exception e) { |
---|
1061 | 1559 | System.out.println("destinationPath : " + destinationPath); |
---|
1062 | 1560 | return; |
---|
1063 | 1561 | } |
---|
1064 | 1562 | |
---|
1065 | | - if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1563 | + for (int i=group.selection.size(); --i>=0;) |
---|
1066 | 1564 | { |
---|
| 1565 | + Object3D child = (Object3D)group.selection.elementAt(i); |
---|
| 1566 | + |
---|
| 1567 | + // Cannot move into itself |
---|
| 1568 | + if (child == destinationLeaf) |
---|
| 1569 | + return; |
---|
| 1570 | + } |
---|
| 1571 | + |
---|
| 1572 | +// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1573 | +// { |
---|
1067 | 1574 | loadClipboard(true); |
---|
1068 | 1575 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
1069 | 1576 | pasteInto(false, false); |
---|
1070 | | - } else { |
---|
1071 | | - loadClipboard(false); |
---|
1072 | | - objEditor.jTree.setSelectionPath(destinationPath); |
---|
1073 | | - pasteInto(false, false); // true); // ??? |
---|
1074 | | - } |
---|
| 1577 | +// } else { |
---|
| 1578 | +// loadClipboard(false); |
---|
| 1579 | +// objEditor.jTree.setSelectionPath(destinationPath); |
---|
| 1580 | +// pasteInto(false, false); // true); // ??? |
---|
| 1581 | +// } |
---|
1075 | 1582 | } |
---|
1076 | 1583 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
1077 | 1584 | // Called if the user has modified the current drop gesture |
---|
.. | .. |
---|
1176 | 1683 | { |
---|
1177 | 1684 | //heightFieldItem = menu.add(new MenuItem("Height Field")); |
---|
1178 | 1685 | //heightFieldItem.addActionListener(this); |
---|
1179 | | - gridItem = menu.add(new MenuItem("Grid")); |
---|
1180 | | - gridItem.addActionListener(this); |
---|
1181 | | - rectoidItem = menu.add(new MenuItem("Box")); |
---|
1182 | | - rectoidItem.addActionListener(this); |
---|
1183 | | - ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
1184 | | - ellipsoidItem.addActionListener(this); |
---|
1185 | | - coneItem = menu.add(new MenuItem("Cone")); |
---|
1186 | | - coneItem.addActionListener(this); |
---|
1187 | | - torusItem = menu.add(new MenuItem("Torus")); |
---|
1188 | | - torusItem.addActionListener(this); |
---|
1189 | | - superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
1190 | | - superItem.addActionListener(this); |
---|
| 1686 | +// gridItem = menu.add(new MenuItem("Grid")); |
---|
| 1687 | +// gridItem.addActionListener(this); |
---|
| 1688 | +// rectoidItem = menu.add(new MenuItem("Box")); |
---|
| 1689 | +// rectoidItem.addActionListener(this); |
---|
| 1690 | +// ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
| 1691 | +// ellipsoidItem.addActionListener(this); |
---|
| 1692 | +// coneItem = menu.add(new MenuItem("Cone")); |
---|
| 1693 | +// coneItem.addActionListener(this); |
---|
| 1694 | +// torusItem = menu.add(new MenuItem("Torus")); |
---|
| 1695 | +// torusItem.addActionListener(this); |
---|
| 1696 | +// superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
| 1697 | +// superItem.addActionListener(this); |
---|
| 1698 | + |
---|
| 1699 | + cameraItem = menu.add(new MenuItem("Camera")); |
---|
| 1700 | + cameraItem.addActionListener(this); |
---|
| 1701 | + |
---|
| 1702 | + if (!Globals.ADVANCED) |
---|
| 1703 | + { |
---|
1191 | 1704 | kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
1192 | 1705 | kleinItem.addActionListener(this); |
---|
1193 | | - particleItem = menu.add(new MenuItem("Particle system")); |
---|
1194 | | - particleItem.addActionListener(this); |
---|
| 1706 | + } |
---|
| 1707 | + |
---|
| 1708 | +// particleItem = menu.add(new MenuItem("Particle system")); |
---|
| 1709 | +// particleItem.addActionListener(this); |
---|
1195 | 1710 | if (Globals.ADVANCED) |
---|
1196 | 1711 | { |
---|
1197 | 1712 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
.. | .. |
---|
1217 | 1732 | } |
---|
1218 | 1733 | bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
1219 | 1734 | bezierItem.addActionListener(this); |
---|
1220 | | - overlayItem = menu.add(new MenuItem("Overlay")); |
---|
1221 | | - overlayItem.addActionListener(this); |
---|
1222 | | - lightItem = menu.add(new MenuItem("Light")); |
---|
1223 | | - lightItem.addActionListener(this); |
---|
| 1735 | +// overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1736 | +// overlayItem.addActionListener(this); |
---|
| 1737 | +// lightItem = menu.add(new MenuItem("Light")); |
---|
| 1738 | +// lightItem.addActionListener(this); |
---|
1224 | 1739 | menu.add("-"); |
---|
1225 | 1740 | //superLoopItem = menu.add(new MenuItem("Super Loop")); |
---|
1226 | 1741 | //superLoopItem.addActionListener(this); |
---|
1227 | | - loopItem = menu.add(new MenuItem("Loop")); |
---|
1228 | | - loopItem.addActionListener(this); |
---|
| 1742 | +// loopItem = menu.add(new MenuItem("Loop")); |
---|
| 1743 | +// loopItem.addActionListener(this); |
---|
1229 | 1744 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1230 | 1745 | doubleItem.addActionListener(this); |
---|
1231 | 1746 | if (Globals.ADVANCED) |
---|
.. | .. |
---|
1241 | 1756 | animationItem.addItemListener(this); |
---|
1242 | 1757 | animationItem.setState(Globals.ANIMATION); |
---|
1243 | 1758 | |
---|
| 1759 | + menu.add(archiveItem = new MenuItem("Archive3D...")); |
---|
| 1760 | + archiveItem.addActionListener(this); |
---|
| 1761 | + |
---|
1244 | 1762 | menu.add("-"); |
---|
1245 | 1763 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1246 | 1764 | parseverticesItem.addActionListener(this); |
---|
.. | .. |
---|
1253 | 1771 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1254 | 1772 | reduce34MorphItem.addActionListener(this); |
---|
1255 | 1773 | menu.add("-"); |
---|
| 1774 | + menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
| 1775 | + memoryItem.addActionListener(this); |
---|
1256 | 1776 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1257 | 1777 | computeAOItem.addActionListener(this); |
---|
1258 | 1778 | |
---|
.. | .. |
---|
1261 | 1781 | mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1262 | 1782 | mirrorItem.addActionListener(this); |
---|
1263 | 1783 | menu.add("-"); |
---|
1264 | | - menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1265 | | - memoryItem.addActionListener(this); |
---|
1266 | 1784 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1267 | 1785 | analyzeItem.addActionListener(this); |
---|
1268 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1786 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1269 | 1787 | dumpItem.addActionListener(this); |
---|
1270 | 1788 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1271 | 1789 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1406 | 1924 | shadow.material = new cMaterial(obj.material); |
---|
1407 | 1925 | shadow.material.diffuse = 0.0001f; |
---|
1408 | 1926 | shadow.material.specular = 0.0001f; |
---|
| 1927 | + //shadow.projectedVertices[1].x = 300; |
---|
1409 | 1928 | |
---|
1410 | 1929 | makeSomething(shadow); |
---|
1411 | 1930 | } |
---|
| 1931 | + |
---|
| 1932 | + private void ClearUnpinned() |
---|
| 1933 | + { |
---|
| 1934 | + //for (Object3D obj : listUI) |
---|
| 1935 | + for (int i=listUI.size(); --i>=0;) |
---|
| 1936 | + { |
---|
| 1937 | + Object3D obj = listUI.elementAt(i); |
---|
| 1938 | + if (!obj.pinned) |
---|
| 1939 | + { |
---|
| 1940 | + obj.CloseUI(); |
---|
| 1941 | + listUI.remove(i); |
---|
| 1942 | + } |
---|
| 1943 | + } |
---|
| 1944 | + } |
---|
| 1945 | + |
---|
| 1946 | + private void EditElement(Object3D elem, boolean newWindow) |
---|
| 1947 | + { |
---|
| 1948 | + // if (!(elem instanceof Composite)) |
---|
| 1949 | + // newWindow = false; |
---|
| 1950 | + listUI.add(elem); |
---|
| 1951 | + elem.openEditWindow(this, newWindow); //, false); |
---|
| 1952 | + System.out.println("edit : " + elem); |
---|
| 1953 | + elem.editWindow.refreshContents(true); // ? new |
---|
| 1954 | + } |
---|
1412 | 1955 | |
---|
1413 | 1956 | /** |
---|
1414 | 1957 | * applyExample |
---|
.. | .. |
---|
1653 | 2196 | { |
---|
1654 | 2197 | ScreenFit(); |
---|
1655 | 2198 | } else |
---|
1656 | | - if (source == switchItem) |
---|
| 2199 | + if (source == switchViewItem) |
---|
1657 | 2200 | { |
---|
1658 | 2201 | cVector v1 = new cVector(); |
---|
1659 | 2202 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1662 | 2205 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1663 | 2206 | objEditor.cameraView.repaint(); |
---|
1664 | 2207 | } else |
---|
1665 | | - if (source == rectoidItem) |
---|
| 2208 | + if (source == rectoidItem || source == boxButton) |
---|
1666 | 2209 | { |
---|
1667 | 2210 | makeSomething(new Box()); |
---|
1668 | 2211 | } else |
---|
1669 | | - if (source == particleItem) |
---|
| 2212 | + if (source == particleItem || source == particlesButton) |
---|
1670 | 2213 | { |
---|
1671 | 2214 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1672 | 2215 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1745 | 2288 | |
---|
1746 | 2289 | makeSomething(obj); |
---|
1747 | 2290 | } else |
---|
1748 | | - if (source == gridItem) |
---|
| 2291 | + if (source == gridItem || source == gridButton) |
---|
1749 | 2292 | { |
---|
1750 | 2293 | makeSomething(new Grid()); |
---|
1751 | 2294 | } else |
---|
1752 | | - if (source == ellipsoidItem) |
---|
| 2295 | + if (source == ellipsoidItem || source == sphereButton) |
---|
1753 | 2296 | { |
---|
1754 | 2297 | makeSomething(new Sphere()); |
---|
1755 | 2298 | } else |
---|
1756 | | - if (source == coneItem) |
---|
| 2299 | + if (source == coneItem || source == coneButton) |
---|
1757 | 2300 | { |
---|
1758 | 2301 | makeSomething(new Cone()); |
---|
1759 | 2302 | } else |
---|
1760 | | - if (source == torusItem) |
---|
| 2303 | + if (source == torusItem || source == torusButton) |
---|
1761 | 2304 | { |
---|
1762 | 2305 | makeSomething(new Torus()); |
---|
1763 | 2306 | } else |
---|
1764 | | - if (source == superItem) |
---|
| 2307 | + if (source == superItem || source == superButton) |
---|
1765 | 2308 | { |
---|
1766 | 2309 | makeSomething(new Superellipsoid()); |
---|
1767 | 2310 | } else |
---|
1768 | | - if (source == kleinItem) |
---|
| 2311 | + if (source == kleinItem || source == kleinButton) |
---|
1769 | 2312 | { |
---|
1770 | 2313 | makeSomething(new Klein()); |
---|
1771 | 2314 | } else |
---|
.. | .. |
---|
1785 | 2328 | { |
---|
1786 | 2329 | makeSomething(new BezierSurface()); |
---|
1787 | 2330 | } else |
---|
1788 | | - if (source == overlayItem) |
---|
| 2331 | + if (source == overlayItem || source == overlayButton) |
---|
1789 | 2332 | { |
---|
1790 | 2333 | /* |
---|
1791 | 2334 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1833 | 2376 | s.setup(); |
---|
1834 | 2377 | makeSomething(s); |
---|
1835 | 2378 | } else |
---|
1836 | | - if (source == lightItem) |
---|
| 2379 | + if (source == lightItem || source == lightButton) |
---|
1837 | 2380 | { |
---|
1838 | 2381 | makeSomething(new Light()); |
---|
1839 | 2382 | } else |
---|
| 2383 | +// if (source == skybox1Button || |
---|
| 2384 | +// source == skybox2Button || |
---|
| 2385 | +// source == skybox3Button || |
---|
| 2386 | +// source == skybox4Button || |
---|
| 2387 | +// source == skybox5Button || |
---|
| 2388 | +// source == skybox6Button || |
---|
| 2389 | +// source == skybox7Button || |
---|
| 2390 | +// source == skybox11Button || |
---|
| 2391 | +// source == skybox12Button || |
---|
| 2392 | +// source == skybox13Button || |
---|
| 2393 | +// source == skybox14Button || |
---|
| 2394 | +// source == skybox15Button || |
---|
| 2395 | +// source == skybox16Button || |
---|
| 2396 | +// source == skybox17Button) |
---|
| 2397 | +// { |
---|
| 2398 | +// ChangeSkybox(source); |
---|
| 2399 | +// } else |
---|
1840 | 2400 | if (source == csgItem) |
---|
1841 | 2401 | { |
---|
1842 | 2402 | group(new CSG()); |
---|
.. | .. |
---|
1883 | 2443 | |
---|
1884 | 2444 | group(g); |
---|
1885 | 2445 | } else |
---|
1886 | | - if (source == loopItem) |
---|
| 2446 | + if (source == loopItem || source == loopButton) |
---|
1887 | 2447 | { |
---|
1888 | 2448 | Composite csg = new GroupLeaf(); |
---|
1889 | 2449 | csg.count = 5; |
---|
1890 | 2450 | group(csg); |
---|
1891 | | - Composite child = new cGroup(); |
---|
| 2451 | + Composite child = new cGroup("Branch"); |
---|
1892 | 2452 | csg.addChild(child); |
---|
1893 | 2453 | child.addChild(csg); |
---|
1894 | 2454 | } else |
---|
1895 | 2455 | if (source == doubleItem) |
---|
1896 | 2456 | { |
---|
1897 | | - Composite csg = new GroupLeaf(); |
---|
| 2457 | + Composite csg = new GroupLeaf("Fork"); |
---|
1898 | 2458 | csg.count = 5; |
---|
1899 | 2459 | group(csg); |
---|
1900 | | - Composite child = new cGroup(); |
---|
| 2460 | + Composite child = new cGroup("Branch A"); |
---|
1901 | 2461 | csg.addChild(child); |
---|
1902 | 2462 | child.addChild(csg); |
---|
1903 | | - child = new cGroup(); |
---|
| 2463 | + child = new cGroup("Branch B"); |
---|
1904 | 2464 | csg.addChild(child); |
---|
1905 | 2465 | child.addChild(csg); |
---|
1906 | 2466 | } else |
---|
1907 | 2467 | if (source == tripleItem) |
---|
1908 | 2468 | { |
---|
1909 | | - Composite csg = new GroupLeaf(); |
---|
| 2469 | + Composite csg = new GroupLeaf("Trident"); |
---|
1910 | 2470 | csg.count = 4; |
---|
1911 | 2471 | group(csg); |
---|
1912 | 2472 | Composite child = new cGroup(); |
---|
.. | .. |
---|
1922 | 2482 | if (source == computeAOItem) |
---|
1923 | 2483 | { |
---|
1924 | 2484 | Globals.drawMode = CameraPane.OCCLUSION; |
---|
1925 | | - Globals.theRenderer.repaint(); |
---|
| 2485 | + cameraView.repaint(); |
---|
1926 | 2486 | } else |
---|
1927 | 2487 | if (source == recompileItem) |
---|
1928 | 2488 | { |
---|
.. | .. |
---|
1956 | 2516 | { |
---|
1957 | 2517 | DumpObject(); |
---|
1958 | 2518 | } else |
---|
| 2519 | + if (source == minButton) |
---|
| 2520 | + { |
---|
| 2521 | + Minimize(); |
---|
| 2522 | + } else |
---|
| 2523 | + if (source == maxButton) |
---|
| 2524 | + { |
---|
| 2525 | + Maximize(); |
---|
| 2526 | + } else |
---|
| 2527 | + if (source == fullButton) |
---|
| 2528 | + { |
---|
| 2529 | + ToggleFullScreen(); |
---|
| 2530 | + } else |
---|
| 2531 | + if (source == undoButton) |
---|
| 2532 | + { |
---|
| 2533 | + // Go to previous version |
---|
| 2534 | + //if (!Undo()) |
---|
| 2535 | + //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2536 | + Undo(); |
---|
| 2537 | + } else |
---|
| 2538 | + if (source == restoreButton) |
---|
| 2539 | + { |
---|
| 2540 | + // Restore current version |
---|
| 2541 | + Restore(); |
---|
| 2542 | + } else |
---|
| 2543 | + if (source == replaceButton) |
---|
| 2544 | + { |
---|
| 2545 | + // Overwrite current version |
---|
| 2546 | + Replace(); |
---|
| 2547 | + } else |
---|
| 2548 | + if (source == redoButton) |
---|
| 2549 | + { |
---|
| 2550 | + // Go to next version |
---|
| 2551 | + Redo(); |
---|
| 2552 | + } else |
---|
| 2553 | + if (source == saveButton) |
---|
| 2554 | + { |
---|
| 2555 | + // Save a new version |
---|
| 2556 | + if (!Save(true)) |
---|
| 2557 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2558 | + } else |
---|
1959 | 2559 | if (source == oneStepButton) |
---|
1960 | 2560 | { |
---|
1961 | 2561 | Globals.ONESTEP = true; |
---|
.. | .. |
---|
1963 | 2563 | } else |
---|
1964 | 2564 | if (source == screenfitButton) |
---|
1965 | 2565 | { |
---|
1966 | | - //Reload(lastConverter, lastFilename, true); |
---|
1967 | 2566 | ScreenFit(); |
---|
1968 | 2567 | } else |
---|
1969 | 2568 | if (source == screenfitpointButton) |
---|
1970 | 2569 | { |
---|
1971 | | - //Reload(lastConverter, lastFilename, true); |
---|
1972 | 2570 | ScreenFitPoint(); |
---|
1973 | 2571 | } else |
---|
1974 | 2572 | if (source == snapobjectButton) |
---|
1975 | 2573 | { |
---|
1976 | | - //Reload(lastConverter, lastFilename, true); |
---|
1977 | 2574 | SnapObject(); |
---|
1978 | 2575 | } else |
---|
1979 | 2576 | // if (event.getSource() == recompileButton) |
---|
.. | .. |
---|
2337 | 2934 | { |
---|
2338 | 2935 | StepAll(); |
---|
2339 | 2936 | } else |
---|
2340 | | - if (source == clearItem) // || event.getSource() == clearButton) |
---|
| 2937 | + if (source == deleteItem) // || event.getSource() == clearButton) |
---|
2341 | 2938 | { |
---|
2342 | 2939 | //int indices[] = jList.getSelectedIndices(); |
---|
2343 | 2940 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
2349 | 2946 | { |
---|
2350 | 2947 | ClearSelection(true); |
---|
2351 | 2948 | } else |
---|
2352 | | - if (source == grabItem) |
---|
| 2949 | + if (source == grabItem || source == groupButton) |
---|
2353 | 2950 | { |
---|
2354 | | - group(new cGroup(), true); |
---|
| 2951 | + group(new cGroup(), false); // true); |
---|
2355 | 2952 | } else |
---|
2356 | 2953 | if (source == hideItem) |
---|
2357 | 2954 | { |
---|
.. | .. |
---|
2369 | 2966 | { |
---|
2370 | 2967 | makeSomething(new Camera()); |
---|
2371 | 2968 | } else |
---|
2372 | | - if (source == compositeItem) |
---|
| 2969 | + if (source == compositeItem || source == compositeButton) |
---|
2373 | 2970 | { |
---|
2374 | 2971 | group(new Composite()); |
---|
2375 | 2972 | } else |
---|
2376 | | - if (source == randomItem) |
---|
| 2973 | + if (source == switchItem || source == switchButton) |
---|
2377 | 2974 | { |
---|
2378 | 2975 | RandomNode random = new RandomNode(); |
---|
2379 | 2976 | group(random); |
---|
.. | .. |
---|
2475 | 3072 | { |
---|
2476 | 3073 | group(new cLinker()); |
---|
2477 | 3074 | } else |
---|
2478 | | - if (source == textureItem) |
---|
| 3075 | + if (source == textureItem || source == textureButton) |
---|
2479 | 3076 | { |
---|
2480 | 3077 | group(new TextureNode()); |
---|
2481 | 3078 | } else |
---|
.. | .. |
---|
2495 | 3092 | { |
---|
2496 | 3093 | CastShadow(2); |
---|
2497 | 3094 | } else |
---|
2498 | | - if (source == ungroupItem) |
---|
| 3095 | + if (source == ungroupItem || source == ungroupButton) |
---|
2499 | 3096 | { |
---|
2500 | | - //ungroup(); |
---|
| 3097 | + boolean hasRoot = false; |
---|
| 3098 | + |
---|
2501 | 3099 | for (int i=0; i<group.selection.size(); i++) |
---|
2502 | 3100 | { |
---|
2503 | | - Ungroup(group.selection.get(i)); |
---|
| 3101 | + if (group.selection.get(i) == group) |
---|
| 3102 | + { |
---|
| 3103 | + hasRoot = true; |
---|
| 3104 | + break; |
---|
| 3105 | + } |
---|
2504 | 3106 | } |
---|
2505 | 3107 | |
---|
2506 | | - ClearSelection(false); |
---|
2507 | | - |
---|
2508 | | - refreshContents(); |
---|
| 3108 | + if (!hasRoot) |
---|
| 3109 | + { |
---|
| 3110 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 3111 | + { |
---|
| 3112 | + Ungroup(group.selection.get(i)); |
---|
| 3113 | + } |
---|
| 3114 | + |
---|
| 3115 | + ClearSelection(false); |
---|
| 3116 | + |
---|
| 3117 | + refreshContents(); |
---|
| 3118 | + } |
---|
2509 | 3119 | } else |
---|
2510 | 3120 | if (source == genUVItem) |
---|
2511 | 3121 | { |
---|
.. | .. |
---|
2517 | 3127 | } else |
---|
2518 | 3128 | if (source == genNormalsMESHItem) |
---|
2519 | 3129 | { |
---|
2520 | | - GenNormals(true); // TODO |
---|
| 3130 | + GenNormalsMESH(); |
---|
2521 | 3131 | } else |
---|
2522 | 3132 | if (source == genNormalsORGANItem) |
---|
2523 | 3133 | { |
---|
.. | .. |
---|
2582 | 3192 | if (source == unmarkleavesItem) |
---|
2583 | 3193 | { |
---|
2584 | 3194 | MarkLeaves(false); |
---|
| 3195 | + } else |
---|
| 3196 | + if (source == rewindleavesItem) |
---|
| 3197 | + { |
---|
| 3198 | + RewindLeaves(true); |
---|
| 3199 | + } else |
---|
| 3200 | + if (source == unrewindleavesItem) |
---|
| 3201 | + { |
---|
| 3202 | + RewindLeaves(false); |
---|
| 3203 | + } else |
---|
| 3204 | + if (source == randomleavesItem) |
---|
| 3205 | + { |
---|
| 3206 | + RandomLeaves(true); |
---|
| 3207 | + } else |
---|
| 3208 | + if (source == unrandomleavesItem) |
---|
| 3209 | + { |
---|
| 3210 | + RandomLeaves(false); |
---|
2585 | 3211 | } else |
---|
2586 | 3212 | if (source == flipVItem) |
---|
2587 | 3213 | { |
---|
.. | .. |
---|
2790 | 3416 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2791 | 3417 | { |
---|
2792 | 3418 | obj = (Object3D)e.nextElement(); |
---|
2793 | | - obj.SetBumpTexture(null); |
---|
| 3419 | + obj.ResetBumpTexture(); |
---|
2794 | 3420 | } |
---|
2795 | 3421 | |
---|
2796 | 3422 | refreshContents(); |
---|
.. | .. |
---|
2806 | 3432 | |
---|
2807 | 3433 | refreshContents(); |
---|
2808 | 3434 | } else |
---|
| 3435 | + if (source == embedTexturesItem) |
---|
| 3436 | + { |
---|
| 3437 | + Object3D obj; |
---|
| 3438 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3439 | + { |
---|
| 3440 | + obj = (Object3D)e.nextElement(); |
---|
| 3441 | + obj.EmbedTextures(true); |
---|
| 3442 | + } |
---|
| 3443 | + |
---|
| 3444 | + refreshContents(); |
---|
| 3445 | + } else |
---|
| 3446 | + if (source == deEmbedTexturesItem) |
---|
| 3447 | + { |
---|
| 3448 | + Object3D obj; |
---|
| 3449 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3450 | + { |
---|
| 3451 | + obj = (Object3D)e.nextElement(); |
---|
| 3452 | + obj.EmbedTextures(false); |
---|
| 3453 | + } |
---|
| 3454 | + |
---|
| 3455 | + CameraPane.texturepigment.clear(); |
---|
| 3456 | + CameraPane.texturebump.clear(); |
---|
| 3457 | + |
---|
| 3458 | + refreshContents(); |
---|
| 3459 | + } else |
---|
2809 | 3460 | if (source == flashSelectionButton) |
---|
2810 | 3461 | { |
---|
2811 | 3462 | CameraPane.flash = true; |
---|
.. | .. |
---|
2817 | 3468 | if (source == twoButton) |
---|
2818 | 3469 | { |
---|
2819 | 3470 | radio.layout = twoButton; |
---|
| 3471 | + |
---|
| 3472 | + if (CameraPane.FULLSCREEN) |
---|
| 3473 | + fullscreenLayout = radio.layout; |
---|
| 3474 | + |
---|
2820 | 3475 | // bug |
---|
2821 | 3476 | //gridPanel.setDividerLocation(1.0); |
---|
2822 | 3477 | //bigPanel.setDividerLocation(0.0); |
---|
.. | .. |
---|
2849 | 3504 | bigThree.ClearUI(); |
---|
2850 | 3505 | bigThree.add(centralPanel); |
---|
2851 | 3506 | bigThree.FlushUI(); |
---|
| 3507 | + |
---|
| 3508 | + cameraView.requestFocusInWindow(); |
---|
| 3509 | + |
---|
| 3510 | +// refreshContents(true); |
---|
| 3511 | +// |
---|
| 3512 | +// try |
---|
| 3513 | +// { |
---|
| 3514 | +// java.awt.Robot bot = new java.awt.Robot(); |
---|
| 3515 | +// int mask = InputEvent.BUTTON1_MASK; |
---|
| 3516 | +// bot.mouseMove(100, 100); |
---|
| 3517 | +// bot.mousePress(mask); |
---|
| 3518 | +// bot.mouseRelease(mask); |
---|
| 3519 | +// } |
---|
| 3520 | +// catch (Exception e) |
---|
| 3521 | +// { |
---|
| 3522 | +// |
---|
| 3523 | +// } |
---|
| 3524 | + |
---|
2852 | 3525 | } else |
---|
2853 | 3526 | if (source == threeButton) |
---|
2854 | 3527 | { |
---|
2855 | 3528 | radio.layout = threeButton; |
---|
| 3529 | + |
---|
| 3530 | + if (CameraPane.FULLSCREEN) |
---|
| 3531 | + fullscreenLayout = radio.layout; |
---|
2856 | 3532 | |
---|
2857 | 3533 | // bigThree.remove(scenePanel); |
---|
2858 | 3534 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2882 | 3558 | // centralPanel.setVisible(true); |
---|
2883 | 3559 | // XYZPanel.setVisible(true); |
---|
2884 | 3560 | bigThree.ClearUI(); |
---|
| 3561 | + bigThree.add(scenePanel); |
---|
2885 | 3562 | bigThree.add(centralPanel); |
---|
2886 | | - bigThree.add(XYZPanel); |
---|
2887 | 3563 | bigThree.FlushUI(); |
---|
| 3564 | + |
---|
| 3565 | + cameraView.requestFocusInWindow(); |
---|
2888 | 3566 | } else |
---|
2889 | 3567 | if (source == fourButton) |
---|
2890 | 3568 | { |
---|
2891 | 3569 | radio.layout = fourButton; |
---|
| 3570 | + |
---|
| 3571 | + if (CameraPane.FULLSCREEN) |
---|
| 3572 | + fullscreenLayout = radio.layout; |
---|
2892 | 3573 | |
---|
2893 | 3574 | // bigThree.remove(scenePanel); |
---|
2894 | 3575 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2920 | 3601 | bigThree.ClearUI(); |
---|
2921 | 3602 | bigThree.add(scenePanel); |
---|
2922 | 3603 | bigThree.FlushUI(); |
---|
| 3604 | + |
---|
| 3605 | + cameraView.requestFocusInWindow(); |
---|
2923 | 3606 | } else |
---|
2924 | 3607 | if (source == sixButton) |
---|
2925 | 3608 | { |
---|
2926 | 3609 | radio.layout = sixButton; |
---|
| 3610 | + |
---|
| 3611 | + if (CameraPane.FULLSCREEN) |
---|
| 3612 | + fullscreenLayout = radio.layout; |
---|
2927 | 3613 | |
---|
2928 | 3614 | // bigThree.remove(scenePanel); |
---|
2929 | 3615 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2953 | 3639 | // centralPanel.setVisible(true); |
---|
2954 | 3640 | // XYZPanel.setVisible(false); |
---|
2955 | 3641 | bigThree.ClearUI(); |
---|
2956 | | - bigThree.add(scenePanel); |
---|
2957 | 3642 | bigThree.add(centralPanel); |
---|
| 3643 | + bigThree.add(scenePanel); |
---|
2958 | 3644 | bigThree.FlushUI(); |
---|
| 3645 | + |
---|
| 3646 | + cameraView.requestFocusInWindow(); |
---|
2959 | 3647 | } else |
---|
2960 | 3648 | if (source == sevenButton) |
---|
2961 | 3649 | { |
---|
2962 | 3650 | radio.layout = sevenButton; |
---|
| 3651 | + |
---|
| 3652 | + if (CameraPane.FULLSCREEN) |
---|
| 3653 | + fullscreenLayout = radio.layout; |
---|
2963 | 3654 | |
---|
2964 | 3655 | // bigThree.remove(scenePanel); |
---|
2965 | 3656 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2993 | 3684 | bigThree.add(centralPanel); |
---|
2994 | 3685 | bigThree.add(XYZPanel); |
---|
2995 | 3686 | bigThree.FlushUI(); |
---|
| 3687 | + |
---|
| 3688 | + cameraView.requestFocusInWindow(); |
---|
2996 | 3689 | } else |
---|
2997 | 3690 | if (source == rootButton) |
---|
2998 | 3691 | { |
---|
.. | .. |
---|
3004 | 3697 | EditObject(obj); |
---|
3005 | 3698 | } |
---|
3006 | 3699 | |
---|
| 3700 | + cameraView.requestFocusInWindow(); |
---|
3007 | 3701 | refreshContents(true); |
---|
3008 | 3702 | } else |
---|
3009 | 3703 | if (source == closeButton) |
---|
.. | .. |
---|
3013 | 3707 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
3014 | 3708 | { |
---|
3015 | 3709 | ab = (cRadio)e.nextElement(); |
---|
3016 | | - if(ab.getModel().isSelected() && ab.GetObject() != client) |
---|
| 3710 | + if (ab.getModel().isSelected() && ab.GetObject() != client) |
---|
3017 | 3711 | { |
---|
| 3712 | + // Patch to avoid bug with transparency. |
---|
| 3713 | + if (!ab.hadMaterial) |
---|
| 3714 | + { |
---|
| 3715 | + ab.object.material = null; |
---|
| 3716 | + } |
---|
| 3717 | + |
---|
3018 | 3718 | buttonGroup.remove(ab); |
---|
3019 | 3719 | radioPanel.remove(ab); |
---|
3020 | 3720 | |
---|
3021 | | - ab.GetObject().editWindow = null; |
---|
| 3721 | + //ab.GetObject().editWindow = null; |
---|
| 3722 | + ab.GetObject().manipWindow = null; |
---|
3022 | 3723 | // ab.GetObject().objectUI = null; // ????????? |
---|
3023 | 3724 | |
---|
3024 | 3725 | ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick(); |
---|
3025 | 3726 | break; |
---|
3026 | 3727 | } |
---|
3027 | 3728 | } |
---|
| 3729 | + |
---|
| 3730 | + cameraView.requestFocusInWindow(); |
---|
3028 | 3731 | refreshContents(true); |
---|
3029 | 3732 | } else |
---|
3030 | 3733 | if (source == editItem || source == editButton) |
---|
3031 | 3734 | { |
---|
| 3735 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3736 | + { |
---|
| 3737 | + Object3D child = (Object3D)e.nextElement(); |
---|
| 3738 | + child.pinned = true; |
---|
| 3739 | + } |
---|
| 3740 | + |
---|
3032 | 3741 | EditSelection(false); |
---|
3033 | 3742 | } else |
---|
3034 | 3743 | if (source == uneditButton) |
---|
.. | .. |
---|
3038 | 3747 | Object3D child = (Object3D)e.nextElement(); |
---|
3039 | 3748 | if(child.editWindow != null) |
---|
3040 | 3749 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3750 | + child.pinned = false; |
---|
3041 | 3751 | child.CloseUI(); |
---|
3042 | 3752 | listUI.remove(child); |
---|
3043 | 3753 | |
---|
.. | .. |
---|
3054 | 3764 | //copy.ClearUI(); |
---|
3055 | 3765 | for (Object3D obj : listUI) |
---|
3056 | 3766 | { |
---|
| 3767 | + obj.pinned = false; |
---|
3057 | 3768 | obj.CloseUI(); |
---|
3058 | 3769 | } |
---|
3059 | 3770 | listUI.clear(); |
---|
.. | .. |
---|
3063 | 3774 | { |
---|
3064 | 3775 | assert(copy == group); |
---|
3065 | 3776 | |
---|
3066 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3777 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3067 | 3778 | |
---|
3068 | 3779 | for (Object3D obj : listUI) |
---|
3069 | 3780 | { |
---|
.. | .. |
---|
3112 | 3823 | } |
---|
3113 | 3824 | |
---|
3114 | 3825 | copy = group; |
---|
| 3826 | + |
---|
| 3827 | + SetUndoStates(); |
---|
| 3828 | + |
---|
3115 | 3829 | //Globals.theRenderer.object = group; |
---|
3116 | 3830 | if(!useclient) |
---|
3117 | 3831 | { |
---|
.. | .. |
---|
3128 | 3842 | sideView.object = group; |
---|
3129 | 3843 | } |
---|
3130 | 3844 | |
---|
3131 | | -// fix "+" issue group.editWindow = this; |
---|
| 3845 | +// fix "+" issue |
---|
| 3846 | + //group.editWindow = this; |
---|
| 3847 | + group.manipWindow = this; |
---|
3132 | 3848 | |
---|
3133 | 3849 | /* |
---|
3134 | 3850 | currentLayout = radio.layout; |
---|
.. | .. |
---|
3136 | 3852 | currentLayout = sevenButton; |
---|
3137 | 3853 | */ |
---|
3138 | 3854 | radio.layout.doClick(); |
---|
| 3855 | + |
---|
| 3856 | + ClearUnpinned(); |
---|
| 3857 | + //Grafreed.Assert(group != null); |
---|
| 3858 | + //Grafreed.Assert(group.selection != null); |
---|
| 3859 | + SetPinStates(group.selection == null || group.selection.size() > 0); |
---|
| 3860 | + if (group.selection == null || group.selection.size() == 1) |
---|
| 3861 | + EditSelection(false); |
---|
3139 | 3862 | keepparent = group.parent; |
---|
3140 | 3863 | // PARENT = NULL or not??? |
---|
3141 | 3864 | //group.parent = null; // ROOT |
---|
3142 | 3865 | //group.attributes = -1; |
---|
3143 | 3866 | ResetModel(); |
---|
| 3867 | + |
---|
| 3868 | + cameraView.requestFocusInWindow(); |
---|
3144 | 3869 | refreshContents(true); |
---|
3145 | 3870 | } else if (event.getSource() == editCameraItem) |
---|
3146 | 3871 | { |
---|
3147 | 3872 | cameraView.ProtectCamera(); |
---|
3148 | 3873 | cameraView.repaint(); |
---|
3149 | 3874 | return; |
---|
3150 | | - } else if (event.getSource() == revertCameraItem) |
---|
| 3875 | + } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton) |
---|
3151 | 3876 | { |
---|
3152 | 3877 | cameraView.RevertCamera(); |
---|
3153 | 3878 | cameraView.repaint(); |
---|
.. | .. |
---|
3164 | 3889 | } |
---|
3165 | 3890 | |
---|
3166 | 3891 | boolean useclient = false; |
---|
3167 | | - cRadio radio; |
---|
3168 | 3892 | |
---|
3169 | 3893 | void ToggleRoot() |
---|
3170 | 3894 | { |
---|
.. | .. |
---|
3403 | 4127 | |
---|
3404 | 4128 | int size = obj.MemorySize(); |
---|
3405 | 4129 | |
---|
3406 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 4130 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 4131 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3407 | 4132 | } |
---|
3408 | 4133 | } |
---|
3409 | 4134 | catch (Exception e) |
---|
.. | .. |
---|
3484 | 4209 | void GenNormals(boolean crease) |
---|
3485 | 4210 | { |
---|
3486 | 4211 | group.GenNormalsS(crease); |
---|
| 4212 | + |
---|
| 4213 | + refreshContents(); |
---|
| 4214 | + } |
---|
| 4215 | + |
---|
| 4216 | + void GenNormalsMESH() |
---|
| 4217 | + { |
---|
| 4218 | + group.GenNormalsMeshS(); |
---|
3487 | 4219 | |
---|
3488 | 4220 | refreshContents(); |
---|
3489 | 4221 | } |
---|
.. | .. |
---|
3719 | 4451 | |
---|
3720 | 4452 | try |
---|
3721 | 4453 | { |
---|
3722 | | - texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 4454 | + texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres); |
---|
3723 | 4455 | } |
---|
3724 | 4456 | catch (Exception e) |
---|
3725 | 4457 | { |
---|
.. | .. |
---|
4111 | 4843 | refreshContents(); |
---|
4112 | 4844 | } |
---|
4113 | 4845 | |
---|
| 4846 | + void RewindLeaves(boolean hide) |
---|
| 4847 | + { |
---|
| 4848 | + group.selection.RewindLeaves(hide); |
---|
| 4849 | + refreshContents(); |
---|
| 4850 | + } |
---|
| 4851 | + |
---|
| 4852 | + void RandomLeaves(boolean hide) |
---|
| 4853 | + { |
---|
| 4854 | + group.selection.RandomLeaves(hide); |
---|
| 4855 | + refreshContents(); |
---|
| 4856 | + } |
---|
| 4857 | + |
---|
4114 | 4858 | void SetTexRes(int tr) |
---|
4115 | 4859 | { |
---|
4116 | 4860 | group.selection.SetTexRes(tr); |
---|
.. | .. |
---|
4182 | 4926 | // } |
---|
4183 | 4927 | // } |
---|
4184 | 4928 | |
---|
4185 | | - static boolean allparams = true; |
---|
4186 | | - |
---|
4187 | | - static Vector<Object3D> listUI = new Vector<Object3D>(); |
---|
4188 | | - |
---|
4189 | 4929 | void EditSelection(boolean newWindow) |
---|
4190 | 4930 | { |
---|
| 4931 | + if (group.selection == null) |
---|
| 4932 | + { |
---|
| 4933 | + EditElement(group, newWindow); // ? new |
---|
| 4934 | + return; |
---|
| 4935 | + } |
---|
| 4936 | + |
---|
4191 | 4937 | // aConstraints.gridy = 0; |
---|
4192 | 4938 | for (int i=0; i<group.selection.size(); i++) |
---|
4193 | 4939 | { |
---|
4194 | 4940 | //System.out.println("edit : " + objectPanel.indexOfTab("Material")); |
---|
4195 | 4941 | //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false); |
---|
4196 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 4942 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
4197 | 4943 | |
---|
4198 | 4944 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4199 | 4945 | if(elem != group || !newWindow) |
---|
4200 | 4946 | { |
---|
4201 | | - // if (!(elem instanceof Composite)) |
---|
4202 | | - // newWindow = false; |
---|
4203 | | - listUI.add(elem); |
---|
4204 | | - elem.openEditWindow(this, newWindow); //, false); |
---|
4205 | | - System.out.println("edit : " + elem); |
---|
4206 | | - elem.editWindow.refreshContents(true); // ? new |
---|
| 4947 | + EditElement(elem, newWindow); // ? new |
---|
4207 | 4948 | } |
---|
4208 | 4949 | } |
---|
4209 | 4950 | } |
---|
.. | .. |
---|
4278 | 5019 | //new Exception().printStackTrace(); |
---|
4279 | 5020 | |
---|
4280 | 5021 | freezemodel = true; |
---|
4281 | | - |
---|
| 5022 | + ClearUnpinned(); |
---|
| 5023 | + |
---|
4282 | 5024 | /**/ |
---|
4283 | 5025 | //switch (event.id) |
---|
4284 | 5026 | { |
---|
.. | .. |
---|
4286 | 5028 | //case 702: // Event.LIST_DESELECT |
---|
4287 | 5029 | group.deselectAll(); |
---|
4288 | 5030 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4289 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4290 | 5031 | if (tps != null) |
---|
4291 | 5032 | { |
---|
4292 | 5033 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4295 | 5036 | |
---|
4296 | 5037 | //if (child.parent != null) |
---|
4297 | 5038 | //child.parent.addSelectee(child); |
---|
| 5039 | + objEditor.SetMaterial(child); |
---|
4298 | 5040 | group.addSelectee(child); |
---|
4299 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4300 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4301 | | - System.err.println("info : " + child.GetPath()); |
---|
4302 | 5041 | } |
---|
4303 | 5042 | } |
---|
4304 | 5043 | // else |
---|
.. | .. |
---|
4308 | 5047 | // System.err.println("info : " + group.GetPath()); |
---|
4309 | 5048 | // } |
---|
4310 | 5049 | |
---|
4311 | | - objEditor.SetText(); // jan 2014 |
---|
4312 | | - |
---|
4313 | 5050 | if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4314 | 5051 | CameraPane.flash = true; |
---|
4315 | 5052 | |
---|
4316 | 5053 | if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4317 | 5054 | // a camera |
---|
4318 | 5055 | { |
---|
4319 | | - if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 5056 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
4320 | 5057 | { |
---|
4321 | 5058 | CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4322 | 5059 | Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
.. | .. |
---|
4325 | 5062 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4326 | 5063 | } |
---|
4327 | 5064 | |
---|
| 5065 | + if (tps != null && tps.length == 1) |
---|
| 5066 | + { |
---|
| 5067 | + EditSelection(false); |
---|
| 5068 | + } |
---|
| 5069 | + |
---|
| 5070 | + SetPinStates(tps != null && tps.length > 0); |
---|
| 5071 | + |
---|
4328 | 5072 | refreshContents(); |
---|
4329 | 5073 | //return true; |
---|
4330 | 5074 | } |
---|
.. | .. |
---|
4333 | 5077 | |
---|
4334 | 5078 | freezemodel = false; |
---|
4335 | 5079 | } |
---|
| 5080 | + |
---|
| 5081 | + void SetPinStates(boolean enabled) |
---|
| 5082 | + { |
---|
| 5083 | + editButton.setEnabled(enabled); |
---|
| 5084 | + uneditButton.setEnabled(enabled); |
---|
| 5085 | + unselectButton.setEnabled(enabled); |
---|
| 5086 | + flashSelectionButton.setEnabled(enabled); |
---|
| 5087 | + } |
---|
| 5088 | + |
---|
| 5089 | + void refreshContents(boolean cp) |
---|
| 5090 | + { |
---|
| 5091 | + if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
| 5092 | + if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
| 5093 | + { |
---|
| 5094 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 5095 | + |
---|
| 5096 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 5097 | + { |
---|
| 5098 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 5099 | + |
---|
| 5100 | + objEditor.AddInfo(child, this, true); |
---|
| 5101 | + System.err.println("info : " + child.GetPath()); |
---|
| 5102 | + } |
---|
| 5103 | + |
---|
| 5104 | + objEditor.SetText(); // jan 2014 |
---|
| 5105 | + } |
---|
| 5106 | + |
---|
| 5107 | + super.refreshContents(cp); |
---|
| 5108 | + } |
---|
4336 | 5109 | |
---|
4337 | 5110 | void linkSomething(Object3D thing) |
---|
4338 | 5111 | { |
---|
.. | .. |
---|
4404 | 5177 | { |
---|
4405 | 5178 | if (group.selection.isEmpty()) |
---|
4406 | 5179 | return; |
---|
| 5180 | + |
---|
4407 | 5181 | Grafreed.clipboardIsTempGroup = false; |
---|
4408 | 5182 | Composite tGroup = null; |
---|
4409 | 5183 | if (group.selection.size() > 0) // 1) |
---|
.. | .. |
---|
4414 | 5188 | |
---|
4415 | 5189 | if (cut) |
---|
4416 | 5190 | { |
---|
| 5191 | +// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save. |
---|
| 5192 | +// Save(); |
---|
4417 | 5193 | //int indices[] = jList.getSelectedIndices(); |
---|
4418 | 5194 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4419 | 5195 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4503 | 5279 | } |
---|
4504 | 5280 | |
---|
4505 | 5281 | } |
---|
| 5282 | + |
---|
4506 | 5283 | if (Grafreed.clipboardIsTempGroup) |
---|
4507 | 5284 | Grafreed.clipboard = tGroup; |
---|
| 5285 | + |
---|
4508 | 5286 | if (cut) |
---|
4509 | 5287 | { |
---|
4510 | 5288 | ResetModel(); |
---|
.. | .. |
---|
4514 | 5292 | |
---|
4515 | 5293 | void paste(boolean expand) |
---|
4516 | 5294 | { |
---|
| 5295 | + if (Globals.REPLACEONMAKE) |
---|
| 5296 | + Save(); |
---|
| 5297 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5298 | + Globals.REPLACEONMAKE = false; |
---|
4517 | 5299 | // if (GrafreeD.clipboard == null) |
---|
4518 | 5300 | // return; |
---|
4519 | 5301 | boolean first = true; |
---|
.. | .. |
---|
4573 | 5355 | Grafreed.clipboard.get(0).parent = keepparent; |
---|
4574 | 5356 | } |
---|
4575 | 5357 | |
---|
| 5358 | + Globals.REPLACEONMAKE = keep; |
---|
4576 | 5359 | ResetModel(); |
---|
4577 | 5360 | refreshContents(); |
---|
4578 | 5361 | } |
---|
.. | .. |
---|
4708 | 5491 | |
---|
4709 | 5492 | void group(Object3D csg, boolean grab) |
---|
4710 | 5493 | { |
---|
| 5494 | + if (Globals.REPLACEONMAKE) |
---|
| 5495 | + Save(); |
---|
| 5496 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5497 | + Globals.REPLACEONMAKE = false; |
---|
4711 | 5498 | if (//false) // why?? |
---|
4712 | 5499 | !group.selection.isEmpty()) |
---|
4713 | 5500 | { |
---|
.. | .. |
---|
4821 | 5608 | //node.add(csg); |
---|
4822 | 5609 | //makeSomething(node); |
---|
4823 | 5610 | makeSomething(csg); |
---|
| 5611 | + Globals.REPLACEONMAKE = keep; |
---|
4824 | 5612 | } |
---|
4825 | 5613 | |
---|
4826 | 5614 | void Ungroup(Object3D g) |
---|
4827 | 5615 | { |
---|
| 5616 | + if (Globals.REPLACEONMAKE) |
---|
| 5617 | + Save(); |
---|
| 5618 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5619 | + Globals.REPLACEONMAKE = false; |
---|
4828 | 5620 | if (g instanceof HiddenObject) |
---|
4829 | 5621 | { |
---|
4830 | 5622 | HiddenObject h = (HiddenObject) g; |
---|
.. | .. |
---|
4841 | 5633 | objEditor.makeSomething(g.get(i), false); |
---|
4842 | 5634 | } |
---|
4843 | 5635 | } |
---|
| 5636 | + Globals.REPLACEONMAKE = keep; |
---|
4844 | 5637 | } |
---|
4845 | 5638 | |
---|
4846 | 5639 | void ungroup() |
---|
.. | .. |
---|
5129 | 5922 | cButton clearpanelButton; |
---|
5130 | 5923 | cButton unselectButton; |
---|
5131 | 5924 | |
---|
| 5925 | + cButton restoreCameraButton; |
---|
| 5926 | + |
---|
| 5927 | + cButton saveButton; |
---|
5132 | 5928 | cButton oneStepButton; |
---|
| 5929 | + |
---|
| 5930 | + cButton groupButton; |
---|
| 5931 | + cButton ungroupButton; |
---|
| 5932 | + cButton compositeButton; |
---|
| 5933 | + cButton switchButton; |
---|
| 5934 | + cButton loopButton; |
---|
| 5935 | + cButton textureButton; |
---|
| 5936 | + |
---|
| 5937 | + cButton skybox1Button; |
---|
| 5938 | + cButton skybox2Button; |
---|
| 5939 | + cButton skybox3Button; |
---|
| 5940 | + cButton skybox4Button; |
---|
| 5941 | + cButton skybox5Button; |
---|
| 5942 | + cButton skybox6Button; |
---|
| 5943 | + cButton skybox7Button; |
---|
| 5944 | + |
---|
| 5945 | + cButton skybox11Button; |
---|
| 5946 | + cButton skybox12Button; |
---|
| 5947 | + cButton skybox13Button; |
---|
| 5948 | + cButton skybox14Button; |
---|
| 5949 | + cButton skybox15Button; |
---|
| 5950 | + cButton skybox16Button; |
---|
| 5951 | + cButton skybox17Button; |
---|
| 5952 | + |
---|
| 5953 | + cButton gridButton; |
---|
| 5954 | + cButton boxButton; |
---|
| 5955 | + cButton sphereButton; |
---|
| 5956 | + cButton coneButton; |
---|
| 5957 | + cButton torusButton; |
---|
| 5958 | + cButton superButton; |
---|
| 5959 | + cButton kleinButton; |
---|
| 5960 | + cButton particlesButton; |
---|
| 5961 | + cButton overlayButton; |
---|
| 5962 | + cButton lightButton; |
---|
5133 | 5963 | |
---|
5134 | 5964 | cButton screenfitButton; |
---|
5135 | 5965 | cButton screenfitpointButton; |
---|
.. | .. |
---|
5142 | 5972 | |
---|
5143 | 5973 | cButton setsupportButton; |
---|
5144 | 5974 | |
---|
5145 | | - cButton twoButton; |
---|
5146 | | - cButton sixButton; |
---|
5147 | | - cButton threeButton; |
---|
5148 | | - cButton sevenButton; |
---|
5149 | | - cButton fourButton; // full panel |
---|
5150 | | - cButton oneButton; // full XYZ |
---|
5151 | | - //cButton currentLayout; |
---|
5152 | | - |
---|
5153 | 5975 | // |
---|
5154 | 5976 | //Composite |
---|
5155 | 5977 | Object3D // to do !! |
---|
.. | .. |
---|
5159 | 5981 | //JTree jTree; |
---|
5160 | 5982 | private MenuItem lookAtItem; |
---|
5161 | 5983 | private MenuItem lookFromItem; |
---|
5162 | | - private MenuItem switchItem; |
---|
| 5984 | + private MenuItem switchViewItem; |
---|
5163 | 5985 | private MenuItem cutItem; |
---|
5164 | 5986 | private MenuItem undoItem; |
---|
5165 | 5987 | private MenuItem redoItem; |
---|
5166 | | - private MenuItem duplicateItem; |
---|
| 5988 | + private JMenuItem duplicateItem; |
---|
5167 | 5989 | private MenuItem cloneItem; |
---|
5168 | 5990 | private MenuItem cloneSupportItem; |
---|
5169 | 5991 | private MenuItem overwriteGeoItem; |
---|
.. | .. |
---|
5191 | 6013 | private MenuItem pasteLinkItem; |
---|
5192 | 6014 | private MenuItem pasteCloneItem; |
---|
5193 | 6015 | private MenuItem pasteExpandItem; |
---|
5194 | | - private MenuItem clearItem; |
---|
| 6016 | + private MenuItem deleteItem; |
---|
5195 | 6017 | private MenuItem clearAllItem; |
---|
5196 | 6018 | private MenuItem genUVItem; |
---|
5197 | 6019 | private MenuItem genNormalsMESHItem; |
---|
.. | .. |
---|
5226 | 6048 | private MenuItem showleavesItem; |
---|
5227 | 6049 | private MenuItem markleavesItem; |
---|
5228 | 6050 | private MenuItem unmarkleavesItem; |
---|
| 6051 | + private MenuItem rewindleavesItem; |
---|
| 6052 | + private MenuItem unrewindleavesItem; |
---|
| 6053 | + private MenuItem randomleavesItem; |
---|
| 6054 | + private MenuItem unrandomleavesItem; |
---|
5229 | 6055 | |
---|
5230 | 6056 | private MenuItem flipVItem; |
---|
5231 | 6057 | private MenuItem unflipVItem; |
---|
.. | .. |
---|
5247 | 6073 | private MenuItem frontItem; |
---|
5248 | 6074 | private MenuItem cameraItem; |
---|
5249 | 6075 | private MenuItem compositeItem; |
---|
5250 | | - private MenuItem randomItem; |
---|
| 6076 | + private MenuItem switchItem; |
---|
5251 | 6077 | private MenuItem physicsItem; |
---|
5252 | 6078 | private MenuItem frameselectorItem; |
---|
5253 | 6079 | private MenuItem scriptNodeItem; |
---|
.. | .. |
---|
5271 | 6097 | private MenuItem attachBumpItem; |
---|
5272 | 6098 | private MenuItem detachBumpItem; |
---|
5273 | 6099 | private MenuItem pigmentBumpItem; |
---|
| 6100 | + private MenuItem embedTexturesItem; |
---|
| 6101 | + private MenuItem deEmbedTexturesItem; |
---|
5274 | 6102 | |
---|
5275 | 6103 | private MenuItem particleItem; |
---|
5276 | 6104 | private MenuItem ragdollItem; |
---|
.. | .. |
---|
5321 | 6149 | |
---|
5322 | 6150 | Menu cameraMenu; |
---|
5323 | 6151 | MenuItem editCameraItem; |
---|
5324 | | - MenuItem revertCameraItem; |
---|
| 6152 | + MenuItem restoreCameraItem; |
---|
5325 | 6153 | } |
---|