.. | .. |
---|
60 | 60 | this.copy = this.group = group; |
---|
61 | 61 | //selectees = this.group.selectees; |
---|
62 | 62 | |
---|
| 63 | + if (copy.versions == null) |
---|
| 64 | + { |
---|
| 65 | + copy.versions = new byte[100][]; |
---|
| 66 | + copy.versionindex = -1; |
---|
| 67 | + } |
---|
| 68 | + |
---|
63 | 69 | if(ui) |
---|
64 | 70 | SetupUI(objEditor); |
---|
65 | 71 | } |
---|
.. | .. |
---|
80 | 86 | SetupViews(objEditor); |
---|
81 | 87 | |
---|
82 | 88 | ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true); |
---|
| 89 | + |
---|
| 90 | + if (copy.versions == null) |
---|
| 91 | + { |
---|
| 92 | + copy.versions = new byte[100][]; |
---|
| 93 | + copy.versionindex = -1; |
---|
| 94 | + |
---|
| 95 | + Save(true); |
---|
| 96 | + } |
---|
83 | 97 | } |
---|
84 | 98 | |
---|
85 | 99 | void CloneSelection(boolean supports) |
---|
86 | 100 | { |
---|
| 101 | + if (Globals.REPLACEONMAKE) |
---|
| 102 | + Save(); |
---|
| 103 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 104 | + Globals.REPLACEONMAKE = false; |
---|
87 | 105 | // Object3D keep = GrafreeD.clipboard; |
---|
88 | 106 | //Object3D obj; |
---|
89 | 107 | for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
94 | 112 | |
---|
95 | 113 | makeSomething(clone, i==group.selection.size()-1); |
---|
96 | 114 | } |
---|
| 115 | + Globals.REPLACEONMAKE = keep; |
---|
97 | 116 | } |
---|
98 | 117 | |
---|
99 | 118 | void CloneClipboard(boolean supports) |
---|
.. | .. |
---|
150 | 169 | |
---|
151 | 170 | void SetupMenu2(GroupEditor oe) |
---|
152 | 171 | { |
---|
| 172 | + oe.jTree = new cTree(); |
---|
| 173 | + |
---|
153 | 174 | Menu menu; |
---|
154 | 175 | oe.menuBar.add(menu = new Menu("Edit")); |
---|
155 | 176 | //editItem = menu.add(new MenuItem("Edit")); |
---|
156 | 177 | //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")); |
---|
| 178 | + |
---|
| 179 | +// undoItem = menu.add(new MenuItem("Undo")); |
---|
| 180 | +// undoItem.addActionListener(this); |
---|
| 181 | +// redoItem = menu.add(new MenuItem("Redo")); |
---|
| 182 | +// redoItem.addActionListener(this); |
---|
| 183 | +// menu.add("-"); |
---|
| 184 | + duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); |
---|
163 | 185 | duplicateItem.addActionListener(this); |
---|
164 | 186 | cloneItem = menu.add(new MenuItem("Clone")); |
---|
165 | 187 | cloneItem.addActionListener(this); |
---|
.. | .. |
---|
175 | 197 | copyItem.addActionListener(this); |
---|
176 | 198 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
177 | 199 | pasteItem.addActionListener(this); |
---|
178 | | - menu.add("-"); |
---|
179 | 200 | |
---|
180 | 201 | menu.add("-"); |
---|
181 | 202 | pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
.. | .. |
---|
187 | 208 | // pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
188 | 209 | // pasteExpandItem.addActionListener(this); |
---|
189 | 210 | menu.add("-"); |
---|
190 | | - clearItem = menu.add(new MenuItem("Clear")); |
---|
191 | | - clearItem.addActionListener(this); |
---|
| 211 | + deleteItem = menu.add(new MenuItem("Delete")); |
---|
| 212 | + deleteItem.addActionListener(this); |
---|
192 | 213 | |
---|
193 | 214 | if (Globals.ADVANCED) |
---|
194 | 215 | { |
---|
.. | .. |
---|
202 | 223 | //zBufferItem.addActionListener(this); |
---|
203 | 224 | //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
204 | 225 | //normalLensItem.addActionListener(this); |
---|
205 | | - cameraMenu.add(revertCameraItem = new MenuItem("Restore Camera")); |
---|
206 | | - revertCameraItem.addActionListener(this); |
---|
| 226 | + cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint")); |
---|
| 227 | + restoreCameraItem.addActionListener(this); |
---|
207 | 228 | |
---|
208 | | - cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
209 | | - toggleFullScreenItem.addItemListener(this); |
---|
210 | | - toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
211 | | - cameraMenu.add("-"); |
---|
| 229 | +// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 230 | +// toggleFullScreenItem.addItemListener(this); |
---|
| 231 | +// toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
| 232 | +// cameraMenu.add("-"); |
---|
| 233 | +// |
---|
| 234 | +// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
| 235 | +// toggleTextureItem.addItemListener(this); |
---|
| 236 | +// toggleTextureItem.setState(CameraPane.textureon); |
---|
| 237 | +// |
---|
| 238 | +// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 239 | +// toggleSwitchItem.addItemListener(this); |
---|
| 240 | +// toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
212 | 241 | |
---|
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")); |
---|
| 242 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles")); |
---|
222 | 243 | toggleHandleItem.addItemListener(this); |
---|
223 | 244 | toggleHandleItem.setState(CameraPane.HANDLES); |
---|
224 | 245 | |
---|
.. | .. |
---|
245 | 266 | |
---|
246 | 267 | cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
247 | 268 | toggleDebugItem.addItemListener(this); |
---|
248 | | - toggleDebugItem.setState(CameraPane.DEBUG); |
---|
| 269 | + toggleDebugItem.setState(Globals.DEBUG); |
---|
249 | 270 | |
---|
250 | 271 | cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
251 | 272 | toggleFrustumItem.addItemListener(this); |
---|
.. | .. |
---|
266 | 287 | // animationItem.addItemListener(this); |
---|
267 | 288 | // animationItem.setState(CameraPane.ANIMATION); |
---|
268 | 289 | cameraMenu.add("-"); |
---|
269 | | - cameraMenu.add(editCameraItem = new MenuItem("Save Camera")); |
---|
| 290 | + cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint")); |
---|
270 | 291 | editCameraItem.addActionListener(this); |
---|
271 | 292 | |
---|
272 | 293 | if (Globals.ADVANCED) |
---|
273 | 294 | { |
---|
274 | 295 | oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
275 | 296 | //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
276 | | - //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
| 297 | + //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); |
---|
277 | 298 | editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
278 | 299 | oe.cameraMenu.add("-"); |
---|
279 | 300 | openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
.. | .. |
---|
281 | 302 | editLeafItem.addActionListener(this); |
---|
282 | 303 | lookAtItem.addActionListener(this); |
---|
283 | 304 | //lookFromItem.addActinoListener(this); |
---|
284 | | - //switchItem.addActionListener(this); |
---|
| 305 | + //switchViewItem.addActionListener(this); |
---|
285 | 306 | } |
---|
286 | 307 | |
---|
287 | 308 | oe.menuBar.add(menu = new Menu("Setting")); |
---|
.. | .. |
---|
326 | 347 | } |
---|
327 | 348 | |
---|
328 | 349 | oe.menuBar.add(menu = new Menu("Group")); |
---|
329 | | - grabItem = menu.add(new MenuItem("Grab")); |
---|
330 | | - grabItem.addActionListener(this); |
---|
| 350 | +// grabItem = menu.add(new MenuItem("Grab")); |
---|
| 351 | +// grabItem.addActionListener(this); |
---|
331 | 352 | backItem = menu.add(new MenuItem("Back")); |
---|
332 | 353 | backItem.addActionListener(this); |
---|
333 | 354 | frontItem = menu.add(new MenuItem("Front")); |
---|
334 | 355 | frontItem.addActionListener(this); |
---|
335 | | - compositeItem = menu.add(new MenuItem("Composite")); |
---|
336 | | - compositeItem.addActionListener(this); |
---|
| 356 | +// compositeItem = menu.add(new MenuItem("Composite")); |
---|
| 357 | +// compositeItem.addActionListener(this); |
---|
| 358 | + |
---|
| 359 | + if (Globals.ADVANCED) |
---|
| 360 | + { |
---|
337 | 361 | hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
338 | 362 | hideItem.addActionListener(this); |
---|
| 363 | + } |
---|
339 | 364 | ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
340 | 365 | ungroupItem.addActionListener(this); |
---|
341 | | - menu.add("-"); |
---|
342 | | - randomItem = menu.add(new MenuItem("Switch node")); |
---|
343 | | - randomItem.addActionListener(this); |
---|
| 366 | + |
---|
| 367 | +// menu.add("-"); |
---|
| 368 | +// |
---|
| 369 | +// switchItem = menu.add(new MenuItem("Switch node")); |
---|
| 370 | +// switchItem.addActionListener(this); |
---|
| 371 | + if (Globals.ADVANCED) |
---|
| 372 | + { |
---|
344 | 373 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
345 | 374 | switchGeoItem.addActionListener(this); |
---|
346 | 375 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
.. | .. |
---|
348 | 377 | morphItem = menu.add(new MenuItem("Morph Group")); |
---|
349 | 378 | morphItem.addActionListener(this); |
---|
350 | 379 | |
---|
351 | | - if (Globals.ADVANCED) |
---|
352 | | - { |
---|
353 | 380 | menu.add("-"); |
---|
354 | 381 | physicsItem = menu.add(new MenuItem("Physics")); |
---|
355 | 382 | physicsItem.addActionListener(this); |
---|
.. | .. |
---|
357 | 384 | frameselectorItem.addActionListener(this); |
---|
358 | 385 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
359 | 386 | scriptNodeItem.addActionListener(this); |
---|
360 | | - cameraItem = menu.add(new MenuItem("Camera")); |
---|
361 | | - cameraItem.addActionListener(this); |
---|
362 | 387 | } |
---|
363 | 388 | |
---|
364 | 389 | oe.menuBar.add(menu = new Menu("Object")); |
---|
365 | | - textureItem = menu.add(new MenuItem("Texture")); |
---|
366 | | - textureItem.addActionListener(this); |
---|
| 390 | +// textureItem = menu.add(new MenuItem("Texture")); |
---|
| 391 | +// textureItem.addActionListener(this); |
---|
367 | 392 | billboardItem = menu.add(new MenuItem("Billboard")); |
---|
368 | 393 | billboardItem.addActionListener(this); |
---|
369 | 394 | csgItem = menu.add(new MenuItem("CSG")); |
---|
370 | 395 | csgItem.addActionListener(this); |
---|
371 | | - shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
| 396 | + shadowXItem = menu.add(new MenuItem("Shadow Red")); |
---|
372 | 397 | shadowXItem.addActionListener(this); |
---|
373 | | - shadowYItem = menu.add(new MenuItem("Shadow Y")); |
---|
| 398 | + shadowYItem = menu.add(new MenuItem("Shadow Green")); |
---|
374 | 399 | shadowYItem.addActionListener(this); |
---|
375 | | - shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
| 400 | + shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
376 | 401 | shadowZItem.addActionListener(this); |
---|
| 402 | + attributeItem = menu.add(new MenuItem("Attribute")); |
---|
| 403 | + attributeItem.addActionListener(this); |
---|
| 404 | + |
---|
377 | 405 | if (Globals.ADVANCED) |
---|
378 | 406 | { |
---|
379 | 407 | menu.add("-"); |
---|
380 | 408 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
381 | 409 | linkerItem.addActionListener(this); |
---|
382 | | - attributeItem = menu.add(new MenuItem("Attribute")); |
---|
383 | | - attributeItem.addActionListener(this); |
---|
384 | 410 | templateItem = menu.add(new MenuItem("Template")); |
---|
385 | 411 | templateItem.addActionListener(this); |
---|
386 | 412 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
.. | .. |
---|
409 | 435 | genNormalsMESHItem.addActionListener(this); |
---|
410 | 436 | if (Globals.ADVANCED) |
---|
411 | 437 | { |
---|
412 | | - genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
| 438 | + genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals")); |
---|
413 | 439 | genNormalsMINEItem.addActionListener(this); |
---|
414 | 440 | } |
---|
415 | 441 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
.. | .. |
---|
469 | 495 | markleavesItem.addActionListener(this); |
---|
470 | 496 | unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
471 | 497 | unmarkleavesItem.addActionListener(this); |
---|
| 498 | + rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
| 499 | + rewindleavesItem.addActionListener(this); |
---|
| 500 | + unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves")); |
---|
| 501 | + unrewindleavesItem.addActionListener(this); |
---|
| 502 | + randomleavesItem = menu.add(new MenuItem("Random Leaves")); |
---|
| 503 | + randomleavesItem.addActionListener(this); |
---|
| 504 | + unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves")); |
---|
| 505 | + unrandomleavesItem.addActionListener(this); |
---|
472 | 506 | menu.add("-"); |
---|
473 | 507 | flipVItem = menu.add(new MenuItem("Flip V")); |
---|
474 | 508 | flipVItem.addActionListener(this); |
---|
.. | .. |
---|
494 | 528 | attachBumpItem.addActionListener(this); |
---|
495 | 529 | pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump")); |
---|
496 | 530 | pigmentBumpItem.addActionListener(this); |
---|
| 531 | + //embedTexturesItem |
---|
497 | 532 | detachPigmentItem = menu.add(new MenuItem("Detach Pigment")); |
---|
498 | 533 | detachPigmentItem.addActionListener(this); |
---|
499 | 534 | detachBumpItem = menu.add(new MenuItem("Detach Bump")); |
---|
500 | 535 | detachBumpItem.addActionListener(this); |
---|
| 536 | + embedTexturesItem = menu.add(new MenuItem("Embed Textures")); |
---|
| 537 | + embedTexturesItem.addActionListener(this); |
---|
| 538 | + deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures")); |
---|
| 539 | + deEmbedTexturesItem.addActionListener(this); |
---|
501 | 540 | menu.add("-"); |
---|
502 | 541 | sortbysizeItem = menu.add(new MenuItem("Sort by size")); |
---|
503 | 542 | sortbysizeItem.addActionListener(this); |
---|
.. | .. |
---|
524 | 563 | buildToolsMenu(menu); |
---|
525 | 564 | } |
---|
526 | 565 | |
---|
| 566 | + |
---|
527 | 567 | void SetupUI2(ObjEditor oe) |
---|
528 | 568 | { |
---|
| 569 | + // June 2019 |
---|
| 570 | + if (oe == null) |
---|
| 571 | + { |
---|
| 572 | + //super.SetupUI2(this); |
---|
| 573 | + //return; |
---|
| 574 | + } |
---|
| 575 | + |
---|
| 576 | + if (copy != group) |
---|
| 577 | + { |
---|
| 578 | + //super.SetupUI2(this); |
---|
| 579 | + } |
---|
| 580 | + |
---|
529 | 581 | //new Exception().printStackTrace(); |
---|
530 | 582 | |
---|
531 | 583 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
.. | .. |
---|
554 | 606 | oe.radioPanel.add(dummyButton); |
---|
555 | 607 | oe.buttonGroup.add(dummyButton); |
---|
556 | 608 | */ |
---|
| 609 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 610 | + |
---|
| 611 | + copyOptionsPanel.preferredHeight = 1; |
---|
| 612 | + |
---|
557 | 613 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
558 | 614 | |
---|
559 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 615 | + //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 616 | + //minButton.setToolTipText("Minimize window"); |
---|
| 617 | + //minButton.addActionListener(this); |
---|
| 618 | + |
---|
| 619 | + if (Globals.ADVANCED) |
---|
| 620 | + { |
---|
| 621 | + oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 622 | + maxButton.setToolTipText("Maximize window"); |
---|
| 623 | + maxButton.addActionListener(this); |
---|
| 624 | + } |
---|
| 625 | + |
---|
| 626 | + oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 627 | + fullButton.setToolTipText("Full-screen window"); |
---|
| 628 | + fullButton.addActionListener(this); |
---|
| 629 | + |
---|
| 630 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 631 | + screenfitButton.setToolTipText("Screen fit"); |
---|
| 632 | + screenfitButton.addActionListener(this); |
---|
| 633 | + |
---|
| 634 | + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 635 | + restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
| 636 | + restoreCameraButton.addActionListener(this); |
---|
| 637 | + |
---|
| 638 | + copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 639 | + saveButton.setToolTipText("New version"); |
---|
| 640 | + saveButton.addActionListener(this); |
---|
| 641 | + |
---|
| 642 | + copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 643 | + undoButton.setToolTipText("Previous version"); |
---|
| 644 | + undoButton.addActionListener(this); |
---|
| 645 | + undoButton.setEnabled(false); |
---|
| 646 | + |
---|
| 647 | + cGridBag updown = new cGridBag().setVertical(true); |
---|
| 648 | + updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 649 | + restoreButton.setToolTipText("Restore current"); |
---|
| 650 | + restoreButton.addActionListener(this); |
---|
| 651 | + restoreButton.setEnabled(false); |
---|
| 652 | + |
---|
| 653 | + updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 654 | + replaceButton.setToolTipText("Replace current"); |
---|
| 655 | + replaceButton.addActionListener(this); |
---|
| 656 | + replaceButton.setEnabled(false); |
---|
| 657 | + |
---|
| 658 | + copyOptionsPanel.add(updown); |
---|
| 659 | + |
---|
| 660 | + copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 661 | + redoButton.setToolTipText("Next version"); |
---|
| 662 | + redoButton.addActionListener(this); |
---|
| 663 | + redoButton.setEnabled(false); |
---|
| 664 | + |
---|
| 665 | + oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
560 | 666 | liveCB.setToolTipText("Enable animation"); |
---|
561 | 667 | liveCB.addItemListener(this); |
---|
562 | 668 | |
---|
563 | | - oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 669 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
564 | 670 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
565 | 671 | oneStepButton.addActionListener(this); |
---|
566 | 672 | |
---|
567 | | - oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
| 673 | + oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
568 | 674 | fastCB.setToolTipText("Fast mode"); |
---|
569 | 675 | fastCB.addItemListener(this); |
---|
570 | 676 | |
---|
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); |
---|
| 677 | + //oe.toolboxPanel.Return(); |
---|
| 678 | + |
---|
| 679 | +// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 680 | +// trackCB.setToolTipText("Enable tracking"); |
---|
| 681 | +// trackCB.addItemListener(this); |
---|
578 | 682 | |
---|
579 | 683 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
580 | 684 | // screenfitpointButton.addActionListener(this); |
---|
.. | .. |
---|
584 | 688 | oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
585 | 689 | snapobjectButton.addActionListener(this); |
---|
586 | 690 | snapobjectButton.setToolTipText("Snap Object"); |
---|
| 691 | + |
---|
| 692 | + oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 693 | + fourButton.addActionListener(this); |
---|
| 694 | + fourButton.setToolTipText("Show control panel only"); |
---|
587 | 695 | } |
---|
588 | 696 | |
---|
589 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
590 | | - flashSelectionButton.setToolTipText("Show selection"); |
---|
591 | | - flashSelectionButton.addActionListener(this); |
---|
| 697 | + //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
592 | 698 | |
---|
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"); |
---|
| 699 | + oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 700 | + twoButton.setToolTipText("Show 3D view only"); |
---|
597 | 701 | 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"); |
---|
| 702 | + this.fullscreenLayout = twoButton; |
---|
| 703 | + |
---|
| 704 | + oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 705 | + threeButton.setToolTipText("Show controls and 3D view"); |
---|
606 | 706 | threeButton.addActionListener(this); |
---|
607 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
608 | | - sevenButton.setToolTipText("3-column layout"); |
---|
609 | | - sevenButton.addActionListener(this); |
---|
| 707 | + oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 708 | + sixButton.setToolTipText("Show 3D view and controls"); |
---|
| 709 | + sixButton.addActionListener(this); |
---|
| 710 | +// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 711 | +// sevenButton.setToolTipText("3-column layout"); |
---|
| 712 | +// sevenButton.addActionListener(this); |
---|
610 | 713 | // |
---|
611 | 714 | |
---|
612 | | - oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
613 | | - rootButton.setToolTipText("Edit selection in new tab"); |
---|
| 715 | + oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 716 | + rootButton.setToolTipText("Open selection in new tab"); |
---|
614 | 717 | rootButton.addActionListener(this); |
---|
615 | 718 | |
---|
616 | | - oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 719 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
617 | 720 | closeButton.setToolTipText("Close tab"); |
---|
618 | 721 | closeButton.addActionListener(this); |
---|
619 | 722 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
620 | 723 | //clearButton.addActionListener(this); |
---|
621 | | - |
---|
622 | | - cGridBag commandsPanel = new cGridBag(); |
---|
| 724 | + |
---|
| 725 | + // INSERT |
---|
| 726 | + oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 727 | + gridButton.setToolTipText("Create grid"); |
---|
| 728 | + gridButton.addActionListener(this); |
---|
| 729 | + |
---|
| 730 | + oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 731 | + boxButton.setToolTipText("Create box"); |
---|
| 732 | + boxButton.addActionListener(this); |
---|
| 733 | + |
---|
| 734 | + oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 735 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 736 | + sphereButton.addActionListener(this); |
---|
| 737 | + |
---|
| 738 | + oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 739 | + coneButton.setToolTipText("Create cone"); |
---|
| 740 | + coneButton.addActionListener(this); |
---|
| 741 | + |
---|
| 742 | + oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 743 | + torusButton.setToolTipText("Create torus"); |
---|
| 744 | + torusButton.addActionListener(this); |
---|
| 745 | + |
---|
| 746 | + oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 747 | + superButton.setToolTipText("Create superellipsoid"); |
---|
| 748 | + superButton.addActionListener(this); |
---|
| 749 | + |
---|
| 750 | + if (Globals.ADVANCED) |
---|
| 751 | + { |
---|
| 752 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 753 | + kleinButton.setToolTipText("Create Klein bottle"); |
---|
| 754 | + kleinButton.addActionListener(this); |
---|
| 755 | + } |
---|
623 | 756 | |
---|
624 | | - commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
625 | | - editButton.setToolTipText("Edit selection"); |
---|
| 757 | + oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 758 | + particlesButton.setToolTipText("Create particle system"); |
---|
| 759 | + particlesButton.addActionListener(this); |
---|
| 760 | + |
---|
| 761 | + oe.toolboxPanel.Return(); |
---|
| 762 | + |
---|
| 763 | + oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 764 | + groupButton.setToolTipText("Create group"); |
---|
| 765 | + groupButton.addActionListener(this); |
---|
| 766 | + |
---|
| 767 | + oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 768 | + compositeButton.setToolTipText("Create composite"); |
---|
| 769 | + compositeButton.addActionListener(this); |
---|
| 770 | + |
---|
| 771 | + oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 772 | + switchButton.setToolTipText("Create item switcher"); |
---|
| 773 | + switchButton.addActionListener(this); |
---|
| 774 | + |
---|
| 775 | + oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 776 | + loopButton.setToolTipText("Create loop"); |
---|
| 777 | + loopButton.addActionListener(this); |
---|
| 778 | + |
---|
| 779 | + oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 780 | + textureButton.setToolTipText("Create texture"); |
---|
| 781 | + textureButton.addActionListener(this); |
---|
| 782 | + |
---|
| 783 | + oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 784 | + overlayButton.setToolTipText("Create overlay"); |
---|
| 785 | + overlayButton.addActionListener(this); |
---|
| 786 | + |
---|
| 787 | + oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 788 | + lightButton.setToolTipText("Create light"); |
---|
| 789 | + lightButton.addActionListener(this); |
---|
| 790 | + |
---|
| 791 | + for (int i=6; --i>=0;) |
---|
| 792 | + { |
---|
| 793 | + oe.toolboxPanel.Return(); |
---|
| 794 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 795 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 796 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 797 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 798 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 799 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 800 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 801 | + } |
---|
| 802 | + |
---|
| 803 | + // EDIT panel |
---|
| 804 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 805 | + editButton.setToolTipText("Pin selection controls"); |
---|
626 | 806 | editButton.addActionListener(this); |
---|
627 | 807 | |
---|
628 | | - commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
629 | | - uneditButton.setToolTipText("Unedit selection"); |
---|
| 808 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 809 | + uneditButton.setToolTipText("Remove selection controls"); |
---|
630 | 810 | uneditButton.addActionListener(this); |
---|
631 | 811 | |
---|
632 | | - commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
633 | | - allParamsButton.setToolTipText("Edit all params"); |
---|
| 812 | + editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 813 | + allParamsButton.setToolTipText("Show all controle"); |
---|
634 | 814 | allParamsButton.addActionListener(this); |
---|
635 | 815 | |
---|
636 | | - commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 816 | + editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
637 | 817 | clearPanelButton.setToolTipText("Clear edit panel"); |
---|
638 | 818 | clearPanelButton.addActionListener(this); |
---|
639 | 819 | |
---|
640 | | - commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 820 | + editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
641 | 821 | unselectButton.setToolTipText("Unselect"); |
---|
642 | 822 | unselectButton.addActionListener(this); |
---|
643 | 823 | |
---|
644 | | - commandsPanel.preferredHeight = 1; |
---|
| 824 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 825 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
| 826 | + flashSelectionButton.addActionListener(this); |
---|
645 | 827 | |
---|
646 | | - oe.treePanel.add(commandsPanel); |
---|
647 | | - oe.treePanel.Return(); |
---|
| 828 | + editCommandsPanel.preferredHeight = 1; |
---|
| 829 | + |
---|
| 830 | + SetPinStates(false); |
---|
| 831 | +// oe.treePanel.add(commandsPanel); |
---|
| 832 | +// oe.treePanel.Return(); |
---|
648 | 833 | |
---|
649 | 834 | // oe.aConstraints.gridx += 1; |
---|
650 | 835 | // oe.aConstraints.weighty = 0; |
---|
.. | .. |
---|
661 | 846 | |
---|
662 | 847 | JScrollPane jSP; |
---|
663 | 848 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
664 | | - jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints); |
---|
| 849 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
665 | 850 | ResetModel(); |
---|
666 | 851 | |
---|
667 | 852 | oe.treePanel.add(jSPPanel); |
---|
668 | 853 | oe.treePanel.Return(); |
---|
669 | 854 | |
---|
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 | 855 | oe.treePanel.add(copyOptionsPanel); |
---|
686 | 856 | oe.treePanel.Return(); |
---|
| 857 | + cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 858 | + versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
| 859 | + sliderPane.preferredHeight = 1; |
---|
687 | 860 | |
---|
688 | 861 | // mainPanel.setDividerLocation(0.5); //1.0); |
---|
689 | 862 | // mainPanel.setResizeWeight(0.5); |
---|
.. | .. |
---|
706 | 879 | dgr.addDragGestureListener(this); |
---|
707 | 880 | }catch(Exception e) {} |
---|
708 | 881 | */ |
---|
709 | | - radio.layout = sevenButton; |
---|
| 882 | + radio.layout = sixButton; // sevenButton; |
---|
710 | 883 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
711 | 884 | } |
---|
712 | 885 | |
---|
713 | 886 | void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
714 | 887 | { |
---|
| 888 | + panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 889 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
| 890 | + colorCB.addItemListener(this); |
---|
| 891 | + |
---|
| 892 | + panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 893 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
| 894 | + materialCB.addItemListener(this); |
---|
| 895 | + |
---|
| 896 | + panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 897 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
| 898 | + textureCB.addItemListener(this); |
---|
| 899 | + |
---|
| 900 | + panel.Return(); |
---|
| 901 | + |
---|
715 | 902 | panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
716 | 903 | boxCB.setToolTipText("Display bounding boxes"); |
---|
717 | 904 | boxCB.addItemListener(this); |
---|
718 | 905 | |
---|
719 | 906 | panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
720 | | - zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 907 | + zoomBoxCB.setToolTipText("Display only for wheel"); |
---|
721 | 908 | zoomBoxCB.addItemListener(this); |
---|
722 | 909 | |
---|
723 | 910 | if (true) // Globals.ADVANCED) |
---|
724 | 911 | { |
---|
725 | | - panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
726 | | - supportCB.setToolTipText("Enable rigging"); |
---|
727 | | - supportCB.addItemListener(this); |
---|
| 912 | +// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 913 | +// supportCB.setToolTipText("Enable rigging"); |
---|
| 914 | +// supportCB.addItemListener(this); |
---|
| 915 | + |
---|
| 916 | + panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 917 | + freezeCB.setToolTipText("Fast moving camera"); |
---|
| 918 | + freezeCB.addItemListener(this); |
---|
728 | 919 | |
---|
729 | 920 | // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
730 | 921 | // localCB.addItemListener(this); |
---|
731 | 922 | |
---|
| 923 | + panel.Return(); |
---|
| 924 | + |
---|
732 | 925 | panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
733 | 926 | crowdCB.setToolTipText("Used for crowds"); |
---|
734 | 927 | crowdCB.addItemListener(this); |
---|
.. | .. |
---|
745 | 938 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
746 | 939 | // speakerMocapCB.addItemListener(this); |
---|
747 | 940 | |
---|
| 941 | + panel.Return(); |
---|
| 942 | + |
---|
748 | 943 | if (false) |
---|
749 | 944 | { |
---|
750 | 945 | // handled in scripts |
---|
.. | .. |
---|
759 | 954 | //constraints.gridy += 1; |
---|
760 | 955 | panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
761 | 956 | smoothfocusCB.addItemListener(this); |
---|
| 957 | + panel.Return(); |
---|
762 | 958 | } |
---|
763 | 959 | |
---|
764 | 960 | //constraints.gridx += 1; |
---|
765 | 961 | //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
766 | 962 | // debugCB.addItemListener(this); |
---|
767 | 963 | |
---|
| 964 | + panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 965 | + trackCB.setToolTipText("Enable tracking target"); |
---|
| 966 | + trackCB.addItemListener(this); |
---|
| 967 | + |
---|
768 | 968 | panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 969 | + oeilCB.setToolTipText("Move camera when tracking"); |
---|
769 | 970 | oeilCB.addItemListener(this); |
---|
770 | 971 | |
---|
| 972 | + panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
| 973 | + shadowCB.setToolTipText("When live compute shadows"); |
---|
| 974 | + shadowCB.addItemListener(this); |
---|
| 975 | + |
---|
| 976 | + panel.Return(); |
---|
| 977 | + panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints); |
---|
| 978 | + toggleTextureCB.setToolTipText("Load textures"); |
---|
| 979 | + toggleTextureCB.addItemListener(this); |
---|
| 980 | + |
---|
| 981 | + panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints); |
---|
| 982 | + toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
| 983 | + toggleSwitchCB.addItemListener(this); |
---|
| 984 | + |
---|
| 985 | + panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints); |
---|
| 986 | + autokeepCB.setToolTipText("On structure change"); |
---|
| 987 | + autokeepCB.addItemListener(this); |
---|
| 988 | + |
---|
| 989 | + panel.Return(); |
---|
| 990 | + if (Globals.ADVANCED) |
---|
| 991 | + { |
---|
771 | 992 | panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
772 | 993 | lookAtCB.setToolTipText("Look-at target"); |
---|
773 | 994 | lookAtCB.addItemListener(this); |
---|
| 995 | + } |
---|
774 | 996 | |
---|
775 | 997 | } |
---|
776 | 998 | |
---|
777 | 999 | cGridBag fill = new cGridBag(); |
---|
778 | | - |
---|
779 | 1000 | fill.preferredHeight = 200; |
---|
| 1001 | + cGridBag fill2 = new cGridBag(); |
---|
| 1002 | + fill2.preferredHeight = 200; |
---|
| 1003 | + cGridBag fill3 = new cGridBag(); |
---|
| 1004 | + fill3.preferredHeight = 200; |
---|
780 | 1005 | |
---|
781 | 1006 | panel.add(fill); |
---|
| 1007 | + panel.add(fill2); |
---|
| 1008 | + panel.add(fill3); |
---|
782 | 1009 | |
---|
783 | 1010 | } |
---|
784 | 1011 | |
---|
785 | 1012 | void EditObject(Object3D obj) |
---|
786 | 1013 | { |
---|
787 | 1014 | cRadio radioButton = new cRadio(obj.name); |
---|
| 1015 | + |
---|
| 1016 | + // June 2019. Patch to avoid bug with transparency. |
---|
| 1017 | + radioButton.hadMaterial = obj.material != null; |
---|
| 1018 | + if (!radioButton.hadMaterial) |
---|
| 1019 | + { |
---|
| 1020 | + obj.material = new cMaterial(); |
---|
| 1021 | + } |
---|
| 1022 | + |
---|
788 | 1023 | radioButton.SetObject(obj); |
---|
789 | | - radioButton.layout = sevenButton; |
---|
| 1024 | + radioButton.layout = sixButton; // sevenButton; |
---|
790 | 1025 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
791 | 1026 | radioButton.addActionListener(this); |
---|
792 | 1027 | radioPanel.add(radioButton); |
---|
.. | .. |
---|
796 | 1031 | |
---|
797 | 1032 | void SetupViews(ObjEditor oe) |
---|
798 | 1033 | { |
---|
| 1034 | + theFrame = this; |
---|
| 1035 | + |
---|
799 | 1036 | oe.SetupViews(); |
---|
800 | 1037 | |
---|
801 | 1038 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
804 | 1041 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
805 | 1042 | } |
---|
806 | 1043 | |
---|
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; |
---|
| 1044 | + cToggleButton liveCB; |
---|
| 1045 | + cCheckBox supportCB; |
---|
| 1046 | + cCheckBox localCB; |
---|
| 1047 | + cCheckBox crowdCB; |
---|
| 1048 | + cCheckBox smoothCB; |
---|
| 1049 | + cToggleButton fastCB; |
---|
| 1050 | + cCheckBox slowCB; |
---|
| 1051 | + cCheckBox boxCB; |
---|
| 1052 | + cCheckBox zoomBoxCB; |
---|
| 1053 | + cCheckBox freezeCB; |
---|
| 1054 | + //cToggleButton trackCB; |
---|
| 1055 | + cCheckBox trackCB; |
---|
| 1056 | + cCheckBox smoothfocusCB; |
---|
818 | 1057 | // JCheckBox speakerMocapCB; |
---|
819 | | - JCheckBox speakerCameraCB; |
---|
820 | | - JCheckBox speakerFocusCB; |
---|
821 | | - JCheckBox debugCB; |
---|
822 | | - JCheckBox oeilCB; |
---|
823 | | - JCheckBox lookAtCB; |
---|
| 1058 | + cCheckBox speakerCameraCB; |
---|
| 1059 | + cCheckBox speakerFocusCB; |
---|
| 1060 | + cCheckBox debugCB; |
---|
| 1061 | + |
---|
| 1062 | + cCheckBox oeilCB; |
---|
| 1063 | + cCheckBox shadowCB; |
---|
| 1064 | + cCheckBox autokeepCB; |
---|
| 1065 | + cCheckBox lookAtCB; |
---|
824 | 1066 | |
---|
825 | 1067 | // static int COLOR = 1; |
---|
826 | 1068 | // static int MATERIAL = 2; |
---|
.. | .. |
---|
828 | 1070 | |
---|
829 | 1071 | int dropAttributes = Object3D.COLOR | Object3D.MATERIAL; |
---|
830 | 1072 | |
---|
831 | | - JCheckBox colorCB; |
---|
832 | | - JCheckBox materialCB; |
---|
833 | | - JCheckBox textureCB; |
---|
| 1073 | + cCheckBox colorCB; |
---|
| 1074 | + cCheckBox materialCB; |
---|
| 1075 | + cCheckBox textureCB; |
---|
834 | 1076 | |
---|
835 | 1077 | public void itemStateChanged(ItemEvent e) |
---|
836 | 1078 | { |
---|
.. | .. |
---|
858 | 1100 | } else if(e.getSource() == liveCB) |
---|
859 | 1101 | { |
---|
860 | 1102 | cameraView.ToggleLive(); |
---|
| 1103 | + refreshContents(false); |
---|
861 | 1104 | } |
---|
862 | 1105 | else if(e.getSource() == supportCB) |
---|
863 | 1106 | { |
---|
.. | .. |
---|
922 | 1165 | { |
---|
923 | 1166 | cameraView.ToggleOeil(); |
---|
924 | 1167 | } |
---|
| 1168 | + else if(e.getSource() == shadowCB) |
---|
| 1169 | + { |
---|
| 1170 | + Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
| 1171 | + } |
---|
| 1172 | + else if(e.getSource() == freezeCB) |
---|
| 1173 | + { |
---|
| 1174 | + Globals.FREEZEONMOVE ^= true; |
---|
| 1175 | + } |
---|
| 1176 | + else if(e.getSource() == autokeepCB) |
---|
| 1177 | + { |
---|
| 1178 | + Globals.REPLACEONMAKE ^= true; |
---|
| 1179 | + } |
---|
925 | 1180 | else if(e.getSource() == lookAtCB) |
---|
926 | 1181 | { |
---|
927 | 1182 | cameraView.ToggleLookAt(); |
---|
.. | .. |
---|
938 | 1193 | |
---|
939 | 1194 | /**/ |
---|
940 | 1195 | //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this); |
---|
941 | | - TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1196 | + //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1197 | + TreePath path = objEditor.jTree.getSelectionPath(); |
---|
942 | 1198 | if ((path == null) || (path.getPathCount() <= 1)) { |
---|
943 | 1199 | // We can't move the root node or an empty selection |
---|
944 | 1200 | return; |
---|
.. | .. |
---|
1001 | 1257 | } |
---|
1002 | 1258 | } |
---|
1003 | 1259 | |
---|
1004 | | - String string = (String) object; |
---|
1005 | | - |
---|
1006 | 1260 | System.out.println("Transfer = " + object + "; drop : " + target); |
---|
1007 | 1261 | // if( object instanceof java.io.File[]) |
---|
1008 | 1262 | // { |
---|
.. | .. |
---|
1010 | 1264 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
1011 | 1265 | // return; |
---|
1012 | 1266 | // } |
---|
| 1267 | + |
---|
| 1268 | + String string = object.toString(); |
---|
1013 | 1269 | |
---|
1014 | 1270 | // File path for Mac and Windows |
---|
1015 | 1271 | if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
.. | .. |
---|
1055 | 1311 | |
---|
1056 | 1312 | assert target == objEditor.jTree; |
---|
1057 | 1313 | TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y); |
---|
| 1314 | + Object3D destinationLeaf; |
---|
1058 | 1315 | try { |
---|
1059 | | - Object3D dummy = (Composite) destinationPath.getLastPathComponent(); |
---|
| 1316 | + destinationLeaf = (Composite) destinationPath.getLastPathComponent(); |
---|
1060 | 1317 | } catch (Exception e) { |
---|
1061 | 1318 | System.out.println("destinationPath : " + destinationPath); |
---|
1062 | 1319 | return; |
---|
1063 | 1320 | } |
---|
1064 | 1321 | |
---|
1065 | | - if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1322 | + for (int i=group.selection.size(); --i>=0;) |
---|
1066 | 1323 | { |
---|
| 1324 | + Object3D child = (Object3D)group.selection.elementAt(i); |
---|
| 1325 | + |
---|
| 1326 | + // Cannot move into itself |
---|
| 1327 | + if (child == destinationLeaf) |
---|
| 1328 | + return; |
---|
| 1329 | + } |
---|
| 1330 | + |
---|
| 1331 | +// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1332 | +// { |
---|
1067 | 1333 | loadClipboard(true); |
---|
1068 | 1334 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
1069 | 1335 | pasteInto(false, false); |
---|
1070 | | - } else { |
---|
1071 | | - loadClipboard(false); |
---|
1072 | | - objEditor.jTree.setSelectionPath(destinationPath); |
---|
1073 | | - pasteInto(false, false); // true); // ??? |
---|
1074 | | - } |
---|
| 1336 | +// } else { |
---|
| 1337 | +// loadClipboard(false); |
---|
| 1338 | +// objEditor.jTree.setSelectionPath(destinationPath); |
---|
| 1339 | +// pasteInto(false, false); // true); // ??? |
---|
| 1340 | +// } |
---|
1075 | 1341 | } |
---|
1076 | 1342 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
1077 | 1343 | // Called if the user has modified the current drop gesture |
---|
.. | .. |
---|
1176 | 1442 | { |
---|
1177 | 1443 | //heightFieldItem = menu.add(new MenuItem("Height Field")); |
---|
1178 | 1444 | //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); |
---|
| 1445 | +// gridItem = menu.add(new MenuItem("Grid")); |
---|
| 1446 | +// gridItem.addActionListener(this); |
---|
| 1447 | +// rectoidItem = menu.add(new MenuItem("Box")); |
---|
| 1448 | +// rectoidItem.addActionListener(this); |
---|
| 1449 | +// ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
| 1450 | +// ellipsoidItem.addActionListener(this); |
---|
| 1451 | +// coneItem = menu.add(new MenuItem("Cone")); |
---|
| 1452 | +// coneItem.addActionListener(this); |
---|
| 1453 | +// torusItem = menu.add(new MenuItem("Torus")); |
---|
| 1454 | +// torusItem.addActionListener(this); |
---|
| 1455 | +// superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
| 1456 | +// superItem.addActionListener(this); |
---|
| 1457 | + |
---|
| 1458 | + cameraItem = menu.add(new MenuItem("Camera")); |
---|
| 1459 | + cameraItem.addActionListener(this); |
---|
| 1460 | + |
---|
| 1461 | + if (!Globals.ADVANCED) |
---|
| 1462 | + { |
---|
1191 | 1463 | kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
1192 | 1464 | kleinItem.addActionListener(this); |
---|
1193 | | - particleItem = menu.add(new MenuItem("Particle system")); |
---|
1194 | | - particleItem.addActionListener(this); |
---|
| 1465 | + } |
---|
| 1466 | + |
---|
| 1467 | +// particleItem = menu.add(new MenuItem("Particle system")); |
---|
| 1468 | +// particleItem.addActionListener(this); |
---|
1195 | 1469 | if (Globals.ADVANCED) |
---|
1196 | 1470 | { |
---|
1197 | 1471 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
.. | .. |
---|
1217 | 1491 | } |
---|
1218 | 1492 | bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
1219 | 1493 | 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); |
---|
| 1494 | +// overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1495 | +// overlayItem.addActionListener(this); |
---|
| 1496 | +// lightItem = menu.add(new MenuItem("Light")); |
---|
| 1497 | +// lightItem.addActionListener(this); |
---|
1224 | 1498 | menu.add("-"); |
---|
1225 | 1499 | //superLoopItem = menu.add(new MenuItem("Super Loop")); |
---|
1226 | 1500 | //superLoopItem.addActionListener(this); |
---|
1227 | | - loopItem = menu.add(new MenuItem("Loop")); |
---|
1228 | | - loopItem.addActionListener(this); |
---|
| 1501 | +// loopItem = menu.add(new MenuItem("Loop")); |
---|
| 1502 | +// loopItem.addActionListener(this); |
---|
1229 | 1503 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1230 | 1504 | doubleItem.addActionListener(this); |
---|
1231 | 1505 | if (Globals.ADVANCED) |
---|
.. | .. |
---|
1241 | 1515 | animationItem.addItemListener(this); |
---|
1242 | 1516 | animationItem.setState(Globals.ANIMATION); |
---|
1243 | 1517 | |
---|
| 1518 | + menu.add(archiveItem = new MenuItem("Archive3D...")); |
---|
| 1519 | + archiveItem.addActionListener(this); |
---|
| 1520 | + |
---|
1244 | 1521 | menu.add("-"); |
---|
1245 | 1522 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1246 | 1523 | parseverticesItem.addActionListener(this); |
---|
.. | .. |
---|
1253 | 1530 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1254 | 1531 | reduce34MorphItem.addActionListener(this); |
---|
1255 | 1532 | menu.add("-"); |
---|
| 1533 | + menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
| 1534 | + memoryItem.addActionListener(this); |
---|
1256 | 1535 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1257 | 1536 | computeAOItem.addActionListener(this); |
---|
1258 | 1537 | |
---|
.. | .. |
---|
1261 | 1540 | mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1262 | 1541 | mirrorItem.addActionListener(this); |
---|
1263 | 1542 | menu.add("-"); |
---|
1264 | | - menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1265 | | - memoryItem.addActionListener(this); |
---|
1266 | 1543 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1267 | 1544 | analyzeItem.addActionListener(this); |
---|
1268 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1545 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1269 | 1546 | dumpItem.addActionListener(this); |
---|
1270 | 1547 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1271 | 1548 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1406 | 1683 | shadow.material = new cMaterial(obj.material); |
---|
1407 | 1684 | shadow.material.diffuse = 0.0001f; |
---|
1408 | 1685 | shadow.material.specular = 0.0001f; |
---|
| 1686 | + //shadow.projectedVertices[1].x = 300; |
---|
1409 | 1687 | |
---|
1410 | 1688 | makeSomething(shadow); |
---|
1411 | 1689 | } |
---|
| 1690 | + |
---|
| 1691 | + private void ClearUnpinned() |
---|
| 1692 | + { |
---|
| 1693 | + //for (Object3D obj : listUI) |
---|
| 1694 | + for (int i=listUI.size(); --i>=0;) |
---|
| 1695 | + { |
---|
| 1696 | + Object3D obj = listUI.elementAt(i); |
---|
| 1697 | + if (!obj.pinned) |
---|
| 1698 | + { |
---|
| 1699 | + obj.CloseUI(); |
---|
| 1700 | + listUI.remove(i); |
---|
| 1701 | + } |
---|
| 1702 | + } |
---|
| 1703 | + } |
---|
| 1704 | + |
---|
| 1705 | + private void EditElement(Object3D elem, boolean newWindow) |
---|
| 1706 | + { |
---|
| 1707 | + // if (!(elem instanceof Composite)) |
---|
| 1708 | + // newWindow = false; |
---|
| 1709 | + listUI.add(elem); |
---|
| 1710 | + elem.openEditWindow(this, newWindow); //, false); |
---|
| 1711 | + System.out.println("edit : " + elem); |
---|
| 1712 | + elem.editWindow.refreshContents(true); // ? new |
---|
| 1713 | + } |
---|
1412 | 1714 | |
---|
1413 | 1715 | /** |
---|
1414 | 1716 | * applyExample |
---|
.. | .. |
---|
1653 | 1955 | { |
---|
1654 | 1956 | ScreenFit(); |
---|
1655 | 1957 | } else |
---|
1656 | | - if (source == switchItem) |
---|
| 1958 | + if (source == switchViewItem) |
---|
1657 | 1959 | { |
---|
1658 | 1960 | cVector v1 = new cVector(); |
---|
1659 | 1961 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1662 | 1964 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1663 | 1965 | objEditor.cameraView.repaint(); |
---|
1664 | 1966 | } else |
---|
1665 | | - if (source == rectoidItem) |
---|
| 1967 | + if (source == rectoidItem || source == boxButton) |
---|
1666 | 1968 | { |
---|
1667 | 1969 | makeSomething(new Box()); |
---|
1668 | 1970 | } else |
---|
1669 | | - if (source == particleItem) |
---|
| 1971 | + if (source == particleItem || source == particlesButton) |
---|
1670 | 1972 | { |
---|
1671 | 1973 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1672 | 1974 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1745 | 2047 | |
---|
1746 | 2048 | makeSomething(obj); |
---|
1747 | 2049 | } else |
---|
1748 | | - if (source == gridItem) |
---|
| 2050 | + if (source == gridItem || source == gridButton) |
---|
1749 | 2051 | { |
---|
1750 | 2052 | makeSomething(new Grid()); |
---|
1751 | 2053 | } else |
---|
1752 | | - if (source == ellipsoidItem) |
---|
| 2054 | + if (source == ellipsoidItem || source == sphereButton) |
---|
1753 | 2055 | { |
---|
1754 | 2056 | makeSomething(new Sphere()); |
---|
1755 | 2057 | } else |
---|
1756 | | - if (source == coneItem) |
---|
| 2058 | + if (source == coneItem || source == coneButton) |
---|
1757 | 2059 | { |
---|
1758 | 2060 | makeSomething(new Cone()); |
---|
1759 | 2061 | } else |
---|
1760 | | - if (source == torusItem) |
---|
| 2062 | + if (source == torusItem || source == torusButton) |
---|
1761 | 2063 | { |
---|
1762 | 2064 | makeSomething(new Torus()); |
---|
1763 | 2065 | } else |
---|
1764 | | - if (source == superItem) |
---|
| 2066 | + if (source == superItem || source == superButton) |
---|
1765 | 2067 | { |
---|
1766 | 2068 | makeSomething(new Superellipsoid()); |
---|
1767 | 2069 | } else |
---|
1768 | | - if (source == kleinItem) |
---|
| 2070 | + if (source == kleinItem || source == kleinButton) |
---|
1769 | 2071 | { |
---|
1770 | 2072 | makeSomething(new Klein()); |
---|
1771 | 2073 | } else |
---|
.. | .. |
---|
1785 | 2087 | { |
---|
1786 | 2088 | makeSomething(new BezierSurface()); |
---|
1787 | 2089 | } else |
---|
1788 | | - if (source == overlayItem) |
---|
| 2090 | + if (source == overlayItem || source == overlayButton) |
---|
1789 | 2091 | { |
---|
1790 | 2092 | /* |
---|
1791 | 2093 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1833 | 2135 | s.setup(); |
---|
1834 | 2136 | makeSomething(s); |
---|
1835 | 2137 | } else |
---|
1836 | | - if (source == lightItem) |
---|
| 2138 | + if (source == lightItem || source == lightButton) |
---|
1837 | 2139 | { |
---|
1838 | 2140 | makeSomething(new Light()); |
---|
1839 | 2141 | } else |
---|
.. | .. |
---|
1883 | 2185 | |
---|
1884 | 2186 | group(g); |
---|
1885 | 2187 | } else |
---|
1886 | | - if (source == loopItem) |
---|
| 2188 | + if (source == loopItem || source == loopButton) |
---|
1887 | 2189 | { |
---|
1888 | 2190 | Composite csg = new GroupLeaf(); |
---|
1889 | 2191 | csg.count = 5; |
---|
1890 | 2192 | group(csg); |
---|
1891 | | - Composite child = new cGroup(); |
---|
| 2193 | + Composite child = new cGroup("Branch"); |
---|
1892 | 2194 | csg.addChild(child); |
---|
1893 | 2195 | child.addChild(csg); |
---|
1894 | 2196 | } else |
---|
1895 | 2197 | if (source == doubleItem) |
---|
1896 | 2198 | { |
---|
1897 | | - Composite csg = new GroupLeaf(); |
---|
| 2199 | + Composite csg = new GroupLeaf("Fork"); |
---|
1898 | 2200 | csg.count = 5; |
---|
1899 | 2201 | group(csg); |
---|
1900 | | - Composite child = new cGroup(); |
---|
| 2202 | + Composite child = new cGroup("Branch A"); |
---|
1901 | 2203 | csg.addChild(child); |
---|
1902 | 2204 | child.addChild(csg); |
---|
1903 | | - child = new cGroup(); |
---|
| 2205 | + child = new cGroup("Branch B"); |
---|
1904 | 2206 | csg.addChild(child); |
---|
1905 | 2207 | child.addChild(csg); |
---|
1906 | 2208 | } else |
---|
1907 | 2209 | if (source == tripleItem) |
---|
1908 | 2210 | { |
---|
1909 | | - Composite csg = new GroupLeaf(); |
---|
| 2211 | + Composite csg = new GroupLeaf("Trident"); |
---|
1910 | 2212 | csg.count = 4; |
---|
1911 | 2213 | group(csg); |
---|
1912 | 2214 | Composite child = new cGroup(); |
---|
.. | .. |
---|
1956 | 2258 | { |
---|
1957 | 2259 | DumpObject(); |
---|
1958 | 2260 | } else |
---|
| 2261 | + if (source == minButton) |
---|
| 2262 | + { |
---|
| 2263 | + Minimize(); |
---|
| 2264 | + } else |
---|
| 2265 | + if (source == maxButton) |
---|
| 2266 | + { |
---|
| 2267 | + Maximize(); |
---|
| 2268 | + } else |
---|
| 2269 | + if (source == fullButton) |
---|
| 2270 | + { |
---|
| 2271 | + ToggleFullScreen(); |
---|
| 2272 | + } else |
---|
| 2273 | + if (source == undoButton) |
---|
| 2274 | + { |
---|
| 2275 | + // Go to previous version |
---|
| 2276 | + //if (!Undo()) |
---|
| 2277 | + //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2278 | + Undo(); |
---|
| 2279 | + } else |
---|
| 2280 | + if (source == restoreButton) |
---|
| 2281 | + { |
---|
| 2282 | + // Restore current version |
---|
| 2283 | + Restore(); |
---|
| 2284 | + } else |
---|
| 2285 | + if (source == replaceButton) |
---|
| 2286 | + { |
---|
| 2287 | + // Overwrite current version |
---|
| 2288 | + Replace(); |
---|
| 2289 | + } else |
---|
| 2290 | + if (source == redoButton) |
---|
| 2291 | + { |
---|
| 2292 | + // Go to next version |
---|
| 2293 | + Redo(); |
---|
| 2294 | + } else |
---|
| 2295 | + if (source == saveButton) |
---|
| 2296 | + { |
---|
| 2297 | + // Save a new version |
---|
| 2298 | + if (!Save(true)) |
---|
| 2299 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2300 | + } else |
---|
1959 | 2301 | if (source == oneStepButton) |
---|
1960 | 2302 | { |
---|
1961 | 2303 | Globals.ONESTEP = true; |
---|
.. | .. |
---|
1963 | 2305 | } else |
---|
1964 | 2306 | if (source == screenfitButton) |
---|
1965 | 2307 | { |
---|
1966 | | - //Reload(lastConverter, lastFilename, true); |
---|
1967 | 2308 | ScreenFit(); |
---|
1968 | 2309 | } else |
---|
1969 | 2310 | if (source == screenfitpointButton) |
---|
1970 | 2311 | { |
---|
1971 | | - //Reload(lastConverter, lastFilename, true); |
---|
1972 | 2312 | ScreenFitPoint(); |
---|
1973 | 2313 | } else |
---|
1974 | 2314 | if (source == snapobjectButton) |
---|
1975 | 2315 | { |
---|
1976 | | - //Reload(lastConverter, lastFilename, true); |
---|
1977 | 2316 | SnapObject(); |
---|
1978 | 2317 | } else |
---|
1979 | 2318 | // if (event.getSource() == recompileButton) |
---|
.. | .. |
---|
2337 | 2676 | { |
---|
2338 | 2677 | StepAll(); |
---|
2339 | 2678 | } else |
---|
2340 | | - if (source == clearItem) // || event.getSource() == clearButton) |
---|
| 2679 | + if (source == deleteItem) // || event.getSource() == clearButton) |
---|
2341 | 2680 | { |
---|
2342 | 2681 | //int indices[] = jList.getSelectedIndices(); |
---|
2343 | 2682 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
2349 | 2688 | { |
---|
2350 | 2689 | ClearSelection(true); |
---|
2351 | 2690 | } else |
---|
2352 | | - if (source == grabItem) |
---|
| 2691 | + if (source == grabItem || source == groupButton) |
---|
2353 | 2692 | { |
---|
2354 | | - group(new cGroup(), true); |
---|
| 2693 | + group(new cGroup(), false); // true); |
---|
2355 | 2694 | } else |
---|
2356 | 2695 | if (source == hideItem) |
---|
2357 | 2696 | { |
---|
.. | .. |
---|
2369 | 2708 | { |
---|
2370 | 2709 | makeSomething(new Camera()); |
---|
2371 | 2710 | } else |
---|
2372 | | - if (source == compositeItem) |
---|
| 2711 | + if (source == compositeItem || source == compositeButton) |
---|
2373 | 2712 | { |
---|
2374 | 2713 | group(new Composite()); |
---|
2375 | 2714 | } else |
---|
2376 | | - if (source == randomItem) |
---|
| 2715 | + if (source == switchItem || source == switchButton) |
---|
2377 | 2716 | { |
---|
2378 | 2717 | RandomNode random = new RandomNode(); |
---|
2379 | 2718 | group(random); |
---|
.. | .. |
---|
2475 | 2814 | { |
---|
2476 | 2815 | group(new cLinker()); |
---|
2477 | 2816 | } else |
---|
2478 | | - if (source == textureItem) |
---|
| 2817 | + if (source == textureItem || source == textureButton) |
---|
2479 | 2818 | { |
---|
2480 | 2819 | group(new TextureNode()); |
---|
2481 | 2820 | } else |
---|
.. | .. |
---|
2495 | 2834 | { |
---|
2496 | 2835 | CastShadow(2); |
---|
2497 | 2836 | } else |
---|
2498 | | - if (source == ungroupItem) |
---|
| 2837 | + if (source == ungroupItem || source == ungroupButton) |
---|
2499 | 2838 | { |
---|
2500 | | - //ungroup(); |
---|
| 2839 | + boolean hasRoot = false; |
---|
| 2840 | + |
---|
2501 | 2841 | for (int i=0; i<group.selection.size(); i++) |
---|
2502 | 2842 | { |
---|
2503 | | - Ungroup(group.selection.get(i)); |
---|
| 2843 | + if (group.selection.get(i) == group) |
---|
| 2844 | + { |
---|
| 2845 | + hasRoot = true; |
---|
| 2846 | + break; |
---|
| 2847 | + } |
---|
2504 | 2848 | } |
---|
2505 | 2849 | |
---|
2506 | | - ClearSelection(false); |
---|
2507 | | - |
---|
2508 | | - refreshContents(); |
---|
| 2850 | + if (!hasRoot) |
---|
| 2851 | + { |
---|
| 2852 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 2853 | + { |
---|
| 2854 | + Ungroup(group.selection.get(i)); |
---|
| 2855 | + } |
---|
| 2856 | + |
---|
| 2857 | + ClearSelection(false); |
---|
| 2858 | + |
---|
| 2859 | + refreshContents(); |
---|
| 2860 | + } |
---|
2509 | 2861 | } else |
---|
2510 | 2862 | if (source == genUVItem) |
---|
2511 | 2863 | { |
---|
.. | .. |
---|
2517 | 2869 | } else |
---|
2518 | 2870 | if (source == genNormalsMESHItem) |
---|
2519 | 2871 | { |
---|
2520 | | - GenNormals(true); // TODO |
---|
| 2872 | + GenNormalsMESH(); |
---|
2521 | 2873 | } else |
---|
2522 | 2874 | if (source == genNormalsORGANItem) |
---|
2523 | 2875 | { |
---|
.. | .. |
---|
2582 | 2934 | if (source == unmarkleavesItem) |
---|
2583 | 2935 | { |
---|
2584 | 2936 | MarkLeaves(false); |
---|
| 2937 | + } else |
---|
| 2938 | + if (source == rewindleavesItem) |
---|
| 2939 | + { |
---|
| 2940 | + RewindLeaves(true); |
---|
| 2941 | + } else |
---|
| 2942 | + if (source == unrewindleavesItem) |
---|
| 2943 | + { |
---|
| 2944 | + RewindLeaves(false); |
---|
| 2945 | + } else |
---|
| 2946 | + if (source == randomleavesItem) |
---|
| 2947 | + { |
---|
| 2948 | + RandomLeaves(true); |
---|
| 2949 | + } else |
---|
| 2950 | + if (source == unrandomleavesItem) |
---|
| 2951 | + { |
---|
| 2952 | + RandomLeaves(false); |
---|
2585 | 2953 | } else |
---|
2586 | 2954 | if (source == flipVItem) |
---|
2587 | 2955 | { |
---|
.. | .. |
---|
2790 | 3158 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2791 | 3159 | { |
---|
2792 | 3160 | obj = (Object3D)e.nextElement(); |
---|
2793 | | - obj.SetBumpTexture(null); |
---|
| 3161 | + obj.ResetBumpTexture(); |
---|
2794 | 3162 | } |
---|
2795 | 3163 | |
---|
2796 | 3164 | refreshContents(); |
---|
.. | .. |
---|
2806 | 3174 | |
---|
2807 | 3175 | refreshContents(); |
---|
2808 | 3176 | } else |
---|
| 3177 | + if (source == embedTexturesItem) |
---|
| 3178 | + { |
---|
| 3179 | + Object3D obj; |
---|
| 3180 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3181 | + { |
---|
| 3182 | + obj = (Object3D)e.nextElement(); |
---|
| 3183 | + obj.EmbedTextures(true); |
---|
| 3184 | + } |
---|
| 3185 | + |
---|
| 3186 | + refreshContents(); |
---|
| 3187 | + } else |
---|
| 3188 | + if (source == deEmbedTexturesItem) |
---|
| 3189 | + { |
---|
| 3190 | + Object3D obj; |
---|
| 3191 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3192 | + { |
---|
| 3193 | + obj = (Object3D)e.nextElement(); |
---|
| 3194 | + obj.EmbedTextures(false); |
---|
| 3195 | + } |
---|
| 3196 | + |
---|
| 3197 | + CameraPane.texturepigment.clear(); |
---|
| 3198 | + CameraPane.texturebump.clear(); |
---|
| 3199 | + |
---|
| 3200 | + refreshContents(); |
---|
| 3201 | + } else |
---|
2809 | 3202 | if (source == flashSelectionButton) |
---|
2810 | 3203 | { |
---|
2811 | 3204 | CameraPane.flash = true; |
---|
.. | .. |
---|
2817 | 3210 | if (source == twoButton) |
---|
2818 | 3211 | { |
---|
2819 | 3212 | radio.layout = twoButton; |
---|
| 3213 | + |
---|
| 3214 | + if (CameraPane.FULLSCREEN) |
---|
| 3215 | + fullscreenLayout = radio.layout; |
---|
| 3216 | + |
---|
2820 | 3217 | // bug |
---|
2821 | 3218 | //gridPanel.setDividerLocation(1.0); |
---|
2822 | 3219 | //bigPanel.setDividerLocation(0.0); |
---|
.. | .. |
---|
2849 | 3246 | bigThree.ClearUI(); |
---|
2850 | 3247 | bigThree.add(centralPanel); |
---|
2851 | 3248 | bigThree.FlushUI(); |
---|
| 3249 | + |
---|
| 3250 | + cameraView.requestFocusInWindow(); |
---|
| 3251 | + |
---|
| 3252 | +// refreshContents(true); |
---|
| 3253 | +// |
---|
| 3254 | +// try |
---|
| 3255 | +// { |
---|
| 3256 | +// java.awt.Robot bot = new java.awt.Robot(); |
---|
| 3257 | +// int mask = InputEvent.BUTTON1_MASK; |
---|
| 3258 | +// bot.mouseMove(100, 100); |
---|
| 3259 | +// bot.mousePress(mask); |
---|
| 3260 | +// bot.mouseRelease(mask); |
---|
| 3261 | +// } |
---|
| 3262 | +// catch (Exception e) |
---|
| 3263 | +// { |
---|
| 3264 | +// |
---|
| 3265 | +// } |
---|
| 3266 | + |
---|
2852 | 3267 | } else |
---|
2853 | 3268 | if (source == threeButton) |
---|
2854 | 3269 | { |
---|
2855 | 3270 | radio.layout = threeButton; |
---|
| 3271 | + |
---|
| 3272 | + if (CameraPane.FULLSCREEN) |
---|
| 3273 | + fullscreenLayout = radio.layout; |
---|
2856 | 3274 | |
---|
2857 | 3275 | // bigThree.remove(scenePanel); |
---|
2858 | 3276 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2882 | 3300 | // centralPanel.setVisible(true); |
---|
2883 | 3301 | // XYZPanel.setVisible(true); |
---|
2884 | 3302 | bigThree.ClearUI(); |
---|
| 3303 | + bigThree.add(scenePanel); |
---|
2885 | 3304 | bigThree.add(centralPanel); |
---|
2886 | | - bigThree.add(XYZPanel); |
---|
2887 | 3305 | bigThree.FlushUI(); |
---|
| 3306 | + |
---|
| 3307 | + cameraView.requestFocusInWindow(); |
---|
2888 | 3308 | } else |
---|
2889 | 3309 | if (source == fourButton) |
---|
2890 | 3310 | { |
---|
2891 | 3311 | radio.layout = fourButton; |
---|
| 3312 | + |
---|
| 3313 | + if (CameraPane.FULLSCREEN) |
---|
| 3314 | + fullscreenLayout = radio.layout; |
---|
2892 | 3315 | |
---|
2893 | 3316 | // bigThree.remove(scenePanel); |
---|
2894 | 3317 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2920 | 3343 | bigThree.ClearUI(); |
---|
2921 | 3344 | bigThree.add(scenePanel); |
---|
2922 | 3345 | bigThree.FlushUI(); |
---|
| 3346 | + |
---|
| 3347 | + cameraView.requestFocusInWindow(); |
---|
2923 | 3348 | } else |
---|
2924 | 3349 | if (source == sixButton) |
---|
2925 | 3350 | { |
---|
2926 | 3351 | radio.layout = sixButton; |
---|
| 3352 | + |
---|
| 3353 | + if (CameraPane.FULLSCREEN) |
---|
| 3354 | + fullscreenLayout = radio.layout; |
---|
2927 | 3355 | |
---|
2928 | 3356 | // bigThree.remove(scenePanel); |
---|
2929 | 3357 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2953 | 3381 | // centralPanel.setVisible(true); |
---|
2954 | 3382 | // XYZPanel.setVisible(false); |
---|
2955 | 3383 | bigThree.ClearUI(); |
---|
2956 | | - bigThree.add(scenePanel); |
---|
2957 | 3384 | bigThree.add(centralPanel); |
---|
| 3385 | + bigThree.add(scenePanel); |
---|
2958 | 3386 | bigThree.FlushUI(); |
---|
| 3387 | + |
---|
| 3388 | + cameraView.requestFocusInWindow(); |
---|
2959 | 3389 | } else |
---|
2960 | 3390 | if (source == sevenButton) |
---|
2961 | 3391 | { |
---|
2962 | 3392 | radio.layout = sevenButton; |
---|
| 3393 | + |
---|
| 3394 | + if (CameraPane.FULLSCREEN) |
---|
| 3395 | + fullscreenLayout = radio.layout; |
---|
2963 | 3396 | |
---|
2964 | 3397 | // bigThree.remove(scenePanel); |
---|
2965 | 3398 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2993 | 3426 | bigThree.add(centralPanel); |
---|
2994 | 3427 | bigThree.add(XYZPanel); |
---|
2995 | 3428 | bigThree.FlushUI(); |
---|
| 3429 | + |
---|
| 3430 | + cameraView.requestFocusInWindow(); |
---|
2996 | 3431 | } else |
---|
2997 | 3432 | if (source == rootButton) |
---|
2998 | 3433 | { |
---|
.. | .. |
---|
3004 | 3439 | EditObject(obj); |
---|
3005 | 3440 | } |
---|
3006 | 3441 | |
---|
| 3442 | + cameraView.requestFocusInWindow(); |
---|
3007 | 3443 | refreshContents(true); |
---|
3008 | 3444 | } else |
---|
3009 | 3445 | if (source == closeButton) |
---|
.. | .. |
---|
3013 | 3449 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
3014 | 3450 | { |
---|
3015 | 3451 | ab = (cRadio)e.nextElement(); |
---|
3016 | | - if(ab.getModel().isSelected() && ab.GetObject() != client) |
---|
| 3452 | + if (ab.getModel().isSelected() && ab.GetObject() != client) |
---|
3017 | 3453 | { |
---|
| 3454 | + // Patch to avoid bug with transparency. |
---|
| 3455 | + if (!ab.hadMaterial) |
---|
| 3456 | + { |
---|
| 3457 | + ab.object.material = null; |
---|
| 3458 | + } |
---|
| 3459 | + |
---|
3018 | 3460 | buttonGroup.remove(ab); |
---|
3019 | 3461 | radioPanel.remove(ab); |
---|
3020 | 3462 | |
---|
3021 | | - ab.GetObject().editWindow = null; |
---|
| 3463 | + //ab.GetObject().editWindow = null; |
---|
| 3464 | + ab.GetObject().manipWindow = null; |
---|
3022 | 3465 | // ab.GetObject().objectUI = null; // ????????? |
---|
3023 | 3466 | |
---|
3024 | 3467 | ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick(); |
---|
3025 | 3468 | break; |
---|
3026 | 3469 | } |
---|
3027 | 3470 | } |
---|
| 3471 | + |
---|
| 3472 | + cameraView.requestFocusInWindow(); |
---|
3028 | 3473 | refreshContents(true); |
---|
3029 | 3474 | } else |
---|
3030 | 3475 | if (source == editItem || source == editButton) |
---|
3031 | 3476 | { |
---|
| 3477 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3478 | + { |
---|
| 3479 | + Object3D child = (Object3D)e.nextElement(); |
---|
| 3480 | + child.pinned = true; |
---|
| 3481 | + } |
---|
| 3482 | + |
---|
3032 | 3483 | EditSelection(false); |
---|
3033 | 3484 | } else |
---|
3034 | 3485 | if (source == uneditButton) |
---|
.. | .. |
---|
3038 | 3489 | Object3D child = (Object3D)e.nextElement(); |
---|
3039 | 3490 | if(child.editWindow != null) |
---|
3040 | 3491 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3492 | + child.pinned = false; |
---|
3041 | 3493 | child.CloseUI(); |
---|
3042 | 3494 | listUI.remove(child); |
---|
3043 | 3495 | |
---|
.. | .. |
---|
3054 | 3506 | //copy.ClearUI(); |
---|
3055 | 3507 | for (Object3D obj : listUI) |
---|
3056 | 3508 | { |
---|
| 3509 | + obj.pinned = false; |
---|
3057 | 3510 | obj.CloseUI(); |
---|
3058 | 3511 | } |
---|
3059 | 3512 | listUI.clear(); |
---|
.. | .. |
---|
3063 | 3516 | { |
---|
3064 | 3517 | assert(copy == group); |
---|
3065 | 3518 | |
---|
3066 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3519 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3067 | 3520 | |
---|
3068 | 3521 | for (Object3D obj : listUI) |
---|
3069 | 3522 | { |
---|
.. | .. |
---|
3112 | 3565 | } |
---|
3113 | 3566 | |
---|
3114 | 3567 | copy = group; |
---|
| 3568 | + |
---|
| 3569 | + SetUndoStates(); |
---|
| 3570 | + |
---|
3115 | 3571 | //Globals.theRenderer.object = group; |
---|
3116 | 3572 | if(!useclient) |
---|
3117 | 3573 | { |
---|
.. | .. |
---|
3128 | 3584 | sideView.object = group; |
---|
3129 | 3585 | } |
---|
3130 | 3586 | |
---|
3131 | | -// fix "+" issue group.editWindow = this; |
---|
| 3587 | +// fix "+" issue |
---|
| 3588 | + //group.editWindow = this; |
---|
| 3589 | + group.manipWindow = this; |
---|
3132 | 3590 | |
---|
3133 | 3591 | /* |
---|
3134 | 3592 | currentLayout = radio.layout; |
---|
.. | .. |
---|
3136 | 3594 | currentLayout = sevenButton; |
---|
3137 | 3595 | */ |
---|
3138 | 3596 | radio.layout.doClick(); |
---|
| 3597 | + |
---|
| 3598 | + ClearUnpinned(); |
---|
| 3599 | + //Grafreed.Assert(group != null); |
---|
| 3600 | + //Grafreed.Assert(group.selection != null); |
---|
| 3601 | + SetPinStates(group.selection == null || group.selection.size() > 0); |
---|
| 3602 | + if (group.selection == null || group.selection.size() == 1) |
---|
| 3603 | + EditSelection(false); |
---|
3139 | 3604 | keepparent = group.parent; |
---|
3140 | 3605 | // PARENT = NULL or not??? |
---|
3141 | 3606 | //group.parent = null; // ROOT |
---|
3142 | 3607 | //group.attributes = -1; |
---|
3143 | 3608 | ResetModel(); |
---|
| 3609 | + |
---|
| 3610 | + cameraView.requestFocusInWindow(); |
---|
3144 | 3611 | refreshContents(true); |
---|
3145 | 3612 | } else if (event.getSource() == editCameraItem) |
---|
3146 | 3613 | { |
---|
3147 | 3614 | cameraView.ProtectCamera(); |
---|
3148 | 3615 | cameraView.repaint(); |
---|
3149 | 3616 | return; |
---|
3150 | | - } else if (event.getSource() == revertCameraItem) |
---|
| 3617 | + } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton) |
---|
3151 | 3618 | { |
---|
3152 | 3619 | cameraView.RevertCamera(); |
---|
3153 | 3620 | cameraView.repaint(); |
---|
.. | .. |
---|
3164 | 3631 | } |
---|
3165 | 3632 | |
---|
3166 | 3633 | boolean useclient = false; |
---|
3167 | | - cRadio radio; |
---|
3168 | 3634 | |
---|
3169 | 3635 | void ToggleRoot() |
---|
3170 | 3636 | { |
---|
.. | .. |
---|
3403 | 3869 | |
---|
3404 | 3870 | int size = obj.MemorySize(); |
---|
3405 | 3871 | |
---|
3406 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3872 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3873 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3407 | 3874 | } |
---|
3408 | 3875 | } |
---|
3409 | 3876 | catch (Exception e) |
---|
.. | .. |
---|
3484 | 3951 | void GenNormals(boolean crease) |
---|
3485 | 3952 | { |
---|
3486 | 3953 | group.GenNormalsS(crease); |
---|
| 3954 | + |
---|
| 3955 | + refreshContents(); |
---|
| 3956 | + } |
---|
| 3957 | + |
---|
| 3958 | + void GenNormalsMESH() |
---|
| 3959 | + { |
---|
| 3960 | + group.GenNormalsMeshS(); |
---|
3487 | 3961 | |
---|
3488 | 3962 | refreshContents(); |
---|
3489 | 3963 | } |
---|
.. | .. |
---|
3719 | 4193 | |
---|
3720 | 4194 | try |
---|
3721 | 4195 | { |
---|
3722 | | - texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 4196 | + texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres); |
---|
3723 | 4197 | } |
---|
3724 | 4198 | catch (Exception e) |
---|
3725 | 4199 | { |
---|
.. | .. |
---|
4111 | 4585 | refreshContents(); |
---|
4112 | 4586 | } |
---|
4113 | 4587 | |
---|
| 4588 | + void RewindLeaves(boolean hide) |
---|
| 4589 | + { |
---|
| 4590 | + group.selection.RewindLeaves(hide); |
---|
| 4591 | + refreshContents(); |
---|
| 4592 | + } |
---|
| 4593 | + |
---|
| 4594 | + void RandomLeaves(boolean hide) |
---|
| 4595 | + { |
---|
| 4596 | + group.selection.RandomLeaves(hide); |
---|
| 4597 | + refreshContents(); |
---|
| 4598 | + } |
---|
| 4599 | + |
---|
4114 | 4600 | void SetTexRes(int tr) |
---|
4115 | 4601 | { |
---|
4116 | 4602 | group.selection.SetTexRes(tr); |
---|
.. | .. |
---|
4182 | 4668 | // } |
---|
4183 | 4669 | // } |
---|
4184 | 4670 | |
---|
4185 | | - static boolean allparams = true; |
---|
4186 | | - |
---|
4187 | | - static Vector<Object3D> listUI = new Vector<Object3D>(); |
---|
4188 | | - |
---|
4189 | 4671 | void EditSelection(boolean newWindow) |
---|
4190 | 4672 | { |
---|
| 4673 | + if (group.selection == null) |
---|
| 4674 | + { |
---|
| 4675 | + EditElement(group, newWindow); // ? new |
---|
| 4676 | + return; |
---|
| 4677 | + } |
---|
| 4678 | + |
---|
4191 | 4679 | // aConstraints.gridy = 0; |
---|
4192 | 4680 | for (int i=0; i<group.selection.size(); i++) |
---|
4193 | 4681 | { |
---|
4194 | 4682 | //System.out.println("edit : " + objectPanel.indexOfTab("Material")); |
---|
4195 | 4683 | //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false); |
---|
4196 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 4684 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
4197 | 4685 | |
---|
4198 | 4686 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4199 | 4687 | if(elem != group || !newWindow) |
---|
4200 | 4688 | { |
---|
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 |
---|
| 4689 | + EditElement(elem, newWindow); // ? new |
---|
4207 | 4690 | } |
---|
4208 | 4691 | } |
---|
4209 | 4692 | } |
---|
.. | .. |
---|
4278 | 4761 | //new Exception().printStackTrace(); |
---|
4279 | 4762 | |
---|
4280 | 4763 | freezemodel = true; |
---|
4281 | | - |
---|
| 4764 | + ClearUnpinned(); |
---|
| 4765 | + |
---|
4282 | 4766 | /**/ |
---|
4283 | 4767 | //switch (event.id) |
---|
4284 | 4768 | { |
---|
.. | .. |
---|
4286 | 4770 | //case 702: // Event.LIST_DESELECT |
---|
4287 | 4771 | group.deselectAll(); |
---|
4288 | 4772 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4289 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4290 | 4773 | if (tps != null) |
---|
4291 | 4774 | { |
---|
4292 | 4775 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4295 | 4778 | |
---|
4296 | 4779 | //if (child.parent != null) |
---|
4297 | 4780 | //child.parent.addSelectee(child); |
---|
| 4781 | + objEditor.SetMaterial(child); |
---|
4298 | 4782 | group.addSelectee(child); |
---|
4299 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4300 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4301 | | - System.err.println("info : " + child.GetPath()); |
---|
4302 | 4783 | } |
---|
4303 | 4784 | } |
---|
4304 | 4785 | // else |
---|
.. | .. |
---|
4308 | 4789 | // System.err.println("info : " + group.GetPath()); |
---|
4309 | 4790 | // } |
---|
4310 | 4791 | |
---|
4311 | | - objEditor.SetText(); // jan 2014 |
---|
4312 | | - |
---|
4313 | 4792 | if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4314 | 4793 | CameraPane.flash = true; |
---|
4315 | 4794 | |
---|
4316 | 4795 | if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4317 | 4796 | // a camera |
---|
4318 | 4797 | { |
---|
4319 | | - if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 4798 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
4320 | 4799 | { |
---|
4321 | 4800 | CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4322 | 4801 | Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
.. | .. |
---|
4325 | 4804 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4326 | 4805 | } |
---|
4327 | 4806 | |
---|
| 4807 | + if (tps != null && tps.length == 1) |
---|
| 4808 | + { |
---|
| 4809 | + EditSelection(false); |
---|
| 4810 | + } |
---|
| 4811 | + |
---|
| 4812 | + SetPinStates(tps != null && tps.length > 0); |
---|
| 4813 | + |
---|
4328 | 4814 | refreshContents(); |
---|
4329 | 4815 | //return true; |
---|
4330 | 4816 | } |
---|
.. | .. |
---|
4333 | 4819 | |
---|
4334 | 4820 | freezemodel = false; |
---|
4335 | 4821 | } |
---|
| 4822 | + |
---|
| 4823 | + void SetPinStates(boolean enabled) |
---|
| 4824 | + { |
---|
| 4825 | + editButton.setEnabled(enabled); |
---|
| 4826 | + uneditButton.setEnabled(enabled); |
---|
| 4827 | + unselectButton.setEnabled(enabled); |
---|
| 4828 | + flashSelectionButton.setEnabled(enabled); |
---|
| 4829 | + } |
---|
| 4830 | + |
---|
| 4831 | + void refreshContents(boolean cp) |
---|
| 4832 | + { |
---|
| 4833 | + if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
| 4834 | + if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
| 4835 | + { |
---|
| 4836 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 4837 | + |
---|
| 4838 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 4839 | + { |
---|
| 4840 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 4841 | + |
---|
| 4842 | + objEditor.AddInfo(child, this, true); |
---|
| 4843 | + System.err.println("info : " + child.GetPath()); |
---|
| 4844 | + } |
---|
| 4845 | + |
---|
| 4846 | + objEditor.SetText(); // jan 2014 |
---|
| 4847 | + } |
---|
| 4848 | + |
---|
| 4849 | + super.refreshContents(cp); |
---|
| 4850 | + } |
---|
4336 | 4851 | |
---|
4337 | 4852 | void linkSomething(Object3D thing) |
---|
4338 | 4853 | { |
---|
.. | .. |
---|
4404 | 4919 | { |
---|
4405 | 4920 | if (group.selection.isEmpty()) |
---|
4406 | 4921 | return; |
---|
| 4922 | + |
---|
4407 | 4923 | Grafreed.clipboardIsTempGroup = false; |
---|
4408 | 4924 | Composite tGroup = null; |
---|
4409 | 4925 | if (group.selection.size() > 0) // 1) |
---|
.. | .. |
---|
4414 | 4930 | |
---|
4415 | 4931 | if (cut) |
---|
4416 | 4932 | { |
---|
| 4933 | +// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save. |
---|
| 4934 | +// Save(); |
---|
4417 | 4935 | //int indices[] = jList.getSelectedIndices(); |
---|
4418 | 4936 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4419 | 4937 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4503 | 5021 | } |
---|
4504 | 5022 | |
---|
4505 | 5023 | } |
---|
| 5024 | + |
---|
4506 | 5025 | if (Grafreed.clipboardIsTempGroup) |
---|
4507 | 5026 | Grafreed.clipboard = tGroup; |
---|
| 5027 | + |
---|
4508 | 5028 | if (cut) |
---|
4509 | 5029 | { |
---|
4510 | 5030 | ResetModel(); |
---|
.. | .. |
---|
4514 | 5034 | |
---|
4515 | 5035 | void paste(boolean expand) |
---|
4516 | 5036 | { |
---|
| 5037 | + if (Globals.REPLACEONMAKE) |
---|
| 5038 | + Save(); |
---|
| 5039 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5040 | + Globals.REPLACEONMAKE = false; |
---|
4517 | 5041 | // if (GrafreeD.clipboard == null) |
---|
4518 | 5042 | // return; |
---|
4519 | 5043 | boolean first = true; |
---|
.. | .. |
---|
4573 | 5097 | Grafreed.clipboard.get(0).parent = keepparent; |
---|
4574 | 5098 | } |
---|
4575 | 5099 | |
---|
| 5100 | + Globals.REPLACEONMAKE = keep; |
---|
4576 | 5101 | ResetModel(); |
---|
4577 | 5102 | refreshContents(); |
---|
4578 | 5103 | } |
---|
.. | .. |
---|
4708 | 5233 | |
---|
4709 | 5234 | void group(Object3D csg, boolean grab) |
---|
4710 | 5235 | { |
---|
| 5236 | + if (Globals.REPLACEONMAKE) |
---|
| 5237 | + Save(); |
---|
| 5238 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5239 | + Globals.REPLACEONMAKE = false; |
---|
4711 | 5240 | if (//false) // why?? |
---|
4712 | 5241 | !group.selection.isEmpty()) |
---|
4713 | 5242 | { |
---|
.. | .. |
---|
4821 | 5350 | //node.add(csg); |
---|
4822 | 5351 | //makeSomething(node); |
---|
4823 | 5352 | makeSomething(csg); |
---|
| 5353 | + Globals.REPLACEONMAKE = keep; |
---|
4824 | 5354 | } |
---|
4825 | 5355 | |
---|
4826 | 5356 | void Ungroup(Object3D g) |
---|
4827 | 5357 | { |
---|
| 5358 | + if (Globals.REPLACEONMAKE) |
---|
| 5359 | + Save(); |
---|
| 5360 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5361 | + Globals.REPLACEONMAKE = false; |
---|
4828 | 5362 | if (g instanceof HiddenObject) |
---|
4829 | 5363 | { |
---|
4830 | 5364 | HiddenObject h = (HiddenObject) g; |
---|
.. | .. |
---|
4841 | 5375 | objEditor.makeSomething(g.get(i), false); |
---|
4842 | 5376 | } |
---|
4843 | 5377 | } |
---|
| 5378 | + Globals.REPLACEONMAKE = keep; |
---|
4844 | 5379 | } |
---|
4845 | 5380 | |
---|
4846 | 5381 | void ungroup() |
---|
.. | .. |
---|
5129 | 5664 | cButton clearpanelButton; |
---|
5130 | 5665 | cButton unselectButton; |
---|
5131 | 5666 | |
---|
| 5667 | + cButton restoreCameraButton; |
---|
| 5668 | + |
---|
| 5669 | + cButton saveButton; |
---|
5132 | 5670 | cButton oneStepButton; |
---|
| 5671 | + |
---|
| 5672 | + cButton groupButton; |
---|
| 5673 | + cButton ungroupButton; |
---|
| 5674 | + cButton compositeButton; |
---|
| 5675 | + cButton switchButton; |
---|
| 5676 | + cButton loopButton; |
---|
| 5677 | + cButton textureButton; |
---|
| 5678 | + |
---|
| 5679 | + cButton gridButton; |
---|
| 5680 | + cButton boxButton; |
---|
| 5681 | + cButton sphereButton; |
---|
| 5682 | + cButton coneButton; |
---|
| 5683 | + cButton torusButton; |
---|
| 5684 | + cButton superButton; |
---|
| 5685 | + cButton kleinButton; |
---|
| 5686 | + cButton particlesButton; |
---|
| 5687 | + cButton overlayButton; |
---|
| 5688 | + cButton lightButton; |
---|
5133 | 5689 | |
---|
5134 | 5690 | cButton screenfitButton; |
---|
5135 | 5691 | cButton screenfitpointButton; |
---|
.. | .. |
---|
5142 | 5698 | |
---|
5143 | 5699 | cButton setsupportButton; |
---|
5144 | 5700 | |
---|
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 | 5701 | // |
---|
5154 | 5702 | //Composite |
---|
5155 | 5703 | Object3D // to do !! |
---|
.. | .. |
---|
5159 | 5707 | //JTree jTree; |
---|
5160 | 5708 | private MenuItem lookAtItem; |
---|
5161 | 5709 | private MenuItem lookFromItem; |
---|
5162 | | - private MenuItem switchItem; |
---|
| 5710 | + private MenuItem switchViewItem; |
---|
5163 | 5711 | private MenuItem cutItem; |
---|
5164 | 5712 | private MenuItem undoItem; |
---|
5165 | 5713 | private MenuItem redoItem; |
---|
5166 | | - private MenuItem duplicateItem; |
---|
| 5714 | + private JMenuItem duplicateItem; |
---|
5167 | 5715 | private MenuItem cloneItem; |
---|
5168 | 5716 | private MenuItem cloneSupportItem; |
---|
5169 | 5717 | private MenuItem overwriteGeoItem; |
---|
.. | .. |
---|
5191 | 5739 | private MenuItem pasteLinkItem; |
---|
5192 | 5740 | private MenuItem pasteCloneItem; |
---|
5193 | 5741 | private MenuItem pasteExpandItem; |
---|
5194 | | - private MenuItem clearItem; |
---|
| 5742 | + private MenuItem deleteItem; |
---|
5195 | 5743 | private MenuItem clearAllItem; |
---|
5196 | 5744 | private MenuItem genUVItem; |
---|
5197 | 5745 | private MenuItem genNormalsMESHItem; |
---|
.. | .. |
---|
5226 | 5774 | private MenuItem showleavesItem; |
---|
5227 | 5775 | private MenuItem markleavesItem; |
---|
5228 | 5776 | private MenuItem unmarkleavesItem; |
---|
| 5777 | + private MenuItem rewindleavesItem; |
---|
| 5778 | + private MenuItem unrewindleavesItem; |
---|
| 5779 | + private MenuItem randomleavesItem; |
---|
| 5780 | + private MenuItem unrandomleavesItem; |
---|
5229 | 5781 | |
---|
5230 | 5782 | private MenuItem flipVItem; |
---|
5231 | 5783 | private MenuItem unflipVItem; |
---|
.. | .. |
---|
5247 | 5799 | private MenuItem frontItem; |
---|
5248 | 5800 | private MenuItem cameraItem; |
---|
5249 | 5801 | private MenuItem compositeItem; |
---|
5250 | | - private MenuItem randomItem; |
---|
| 5802 | + private MenuItem switchItem; |
---|
5251 | 5803 | private MenuItem physicsItem; |
---|
5252 | 5804 | private MenuItem frameselectorItem; |
---|
5253 | 5805 | private MenuItem scriptNodeItem; |
---|
.. | .. |
---|
5271 | 5823 | private MenuItem attachBumpItem; |
---|
5272 | 5824 | private MenuItem detachBumpItem; |
---|
5273 | 5825 | private MenuItem pigmentBumpItem; |
---|
| 5826 | + private MenuItem embedTexturesItem; |
---|
| 5827 | + private MenuItem deEmbedTexturesItem; |
---|
5274 | 5828 | |
---|
5275 | 5829 | private MenuItem particleItem; |
---|
5276 | 5830 | private MenuItem ragdollItem; |
---|
.. | .. |
---|
5321 | 5875 | |
---|
5322 | 5876 | Menu cameraMenu; |
---|
5323 | 5877 | MenuItem editCameraItem; |
---|
5324 | | - MenuItem revertCameraItem; |
---|
| 5878 | + MenuItem restoreCameraItem; |
---|
5325 | 5879 | } |
---|