.. | .. |
---|
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 | } |
---|
.. | .. |
---|
74 | 80 | this.copy = this.group = copy; |
---|
75 | 81 | //selectees = this.group.selectees; |
---|
76 | 82 | |
---|
| 83 | + if (copy.versions == null) |
---|
| 84 | + { |
---|
| 85 | + copy.versions = new byte[100][]; |
---|
| 86 | + copy.versionindex = -1; |
---|
| 87 | + } |
---|
| 88 | + |
---|
77 | 89 | SetupMenu2(this); //objEditor); |
---|
78 | 90 | SetupUI2(objEditor); |
---|
79 | 91 | objEditor.SetupUI(true); |
---|
.. | .. |
---|
84 | 96 | |
---|
85 | 97 | void CloneSelection(boolean supports) |
---|
86 | 98 | { |
---|
| 99 | + if (Globals.REPLACEONMAKE) |
---|
| 100 | + Save(); |
---|
| 101 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 102 | + Globals.REPLACEONMAKE = false; |
---|
87 | 103 | // Object3D keep = GrafreeD.clipboard; |
---|
88 | 104 | //Object3D obj; |
---|
89 | 105 | for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
94 | 110 | |
---|
95 | 111 | makeSomething(clone, i==group.selection.size()-1); |
---|
96 | 112 | } |
---|
| 113 | + Globals.REPLACEONMAKE = keep; |
---|
97 | 114 | } |
---|
98 | 115 | |
---|
99 | 116 | void CloneClipboard(boolean supports) |
---|
.. | .. |
---|
150 | 167 | |
---|
151 | 168 | void SetupMenu2(GroupEditor oe) |
---|
152 | 169 | { |
---|
| 170 | + oe.jTree = new cTree(); |
---|
| 171 | + |
---|
153 | 172 | Menu menu; |
---|
154 | 173 | oe.menuBar.add(menu = new Menu("Edit")); |
---|
155 | 174 | //editItem = menu.add(new MenuItem("Edit")); |
---|
.. | .. |
---|
160 | 179 | // redoItem = menu.add(new MenuItem("Redo")); |
---|
161 | 180 | // redoItem.addActionListener(this); |
---|
162 | 181 | // menu.add("-"); |
---|
163 | | - duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
| 182 | + duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); |
---|
164 | 183 | duplicateItem.addActionListener(this); |
---|
165 | 184 | cloneItem = menu.add(new MenuItem("Clone")); |
---|
166 | 185 | cloneItem.addActionListener(this); |
---|
.. | .. |
---|
202 | 221 | //zBufferItem.addActionListener(this); |
---|
203 | 222 | //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
204 | 223 | //normalLensItem.addActionListener(this); |
---|
205 | | - cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint")); |
---|
206 | | - revertCameraItem.addActionListener(this); |
---|
| 224 | + cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint")); |
---|
| 225 | + restoreCameraItem.addActionListener(this); |
---|
207 | 226 | |
---|
208 | | - cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
209 | | - toggleFullScreenItem.addItemListener(this); |
---|
210 | | - toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
211 | | - cameraMenu.add("-"); |
---|
| 227 | +// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 228 | +// toggleFullScreenItem.addItemListener(this); |
---|
| 229 | +// toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
| 230 | +// cameraMenu.add("-"); |
---|
| 231 | +// |
---|
| 232 | +// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
| 233 | +// toggleTextureItem.addItemListener(this); |
---|
| 234 | +// toggleTextureItem.setState(CameraPane.textureon); |
---|
| 235 | +// |
---|
| 236 | +// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 237 | +// toggleSwitchItem.addItemListener(this); |
---|
| 238 | +// toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
212 | 239 | |
---|
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")); |
---|
| 240 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles")); |
---|
222 | 241 | toggleHandleItem.addItemListener(this); |
---|
223 | 242 | toggleHandleItem.setState(CameraPane.HANDLES); |
---|
224 | 243 | |
---|
.. | .. |
---|
273 | 292 | { |
---|
274 | 293 | oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
275 | 294 | //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
276 | | - //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
| 295 | + //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); |
---|
277 | 296 | editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
278 | 297 | oe.cameraMenu.add("-"); |
---|
279 | 298 | openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
.. | .. |
---|
281 | 300 | editLeafItem.addActionListener(this); |
---|
282 | 301 | lookAtItem.addActionListener(this); |
---|
283 | 302 | //lookFromItem.addActinoListener(this); |
---|
284 | | - //switchItem.addActionListener(this); |
---|
| 303 | + //switchViewItem.addActionListener(this); |
---|
285 | 304 | } |
---|
286 | 305 | |
---|
287 | 306 | oe.menuBar.add(menu = new Menu("Setting")); |
---|
.. | .. |
---|
326 | 345 | } |
---|
327 | 346 | |
---|
328 | 347 | oe.menuBar.add(menu = new Menu("Group")); |
---|
329 | | - grabItem = menu.add(new MenuItem("Grab")); |
---|
330 | | - grabItem.addActionListener(this); |
---|
| 348 | +// grabItem = menu.add(new MenuItem("Grab")); |
---|
| 349 | +// grabItem.addActionListener(this); |
---|
331 | 350 | backItem = menu.add(new MenuItem("Back")); |
---|
332 | 351 | backItem.addActionListener(this); |
---|
333 | 352 | frontItem = menu.add(new MenuItem("Front")); |
---|
334 | 353 | frontItem.addActionListener(this); |
---|
335 | | - compositeItem = menu.add(new MenuItem("Composite")); |
---|
336 | | - compositeItem.addActionListener(this); |
---|
| 354 | +// compositeItem = menu.add(new MenuItem("Composite")); |
---|
| 355 | +// compositeItem.addActionListener(this); |
---|
| 356 | + |
---|
| 357 | + if (Globals.ADVANCED) |
---|
| 358 | + { |
---|
337 | 359 | hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
338 | 360 | hideItem.addActionListener(this); |
---|
| 361 | + } |
---|
339 | 362 | ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
340 | 363 | ungroupItem.addActionListener(this); |
---|
341 | | - menu.add("-"); |
---|
342 | | - randomItem = menu.add(new MenuItem("Switch node")); |
---|
343 | | - randomItem.addActionListener(this); |
---|
| 364 | + |
---|
| 365 | +// menu.add("-"); |
---|
| 366 | +// |
---|
| 367 | +// switchItem = menu.add(new MenuItem("Switch node")); |
---|
| 368 | +// switchItem.addActionListener(this); |
---|
| 369 | + if (Globals.ADVANCED) |
---|
| 370 | + { |
---|
344 | 371 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
345 | 372 | switchGeoItem.addActionListener(this); |
---|
346 | 373 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
.. | .. |
---|
348 | 375 | morphItem = menu.add(new MenuItem("Morph Group")); |
---|
349 | 376 | morphItem.addActionListener(this); |
---|
350 | 377 | |
---|
351 | | - if (Globals.ADVANCED) |
---|
352 | | - { |
---|
353 | 378 | menu.add("-"); |
---|
354 | 379 | physicsItem = menu.add(new MenuItem("Physics")); |
---|
355 | 380 | physicsItem.addActionListener(this); |
---|
.. | .. |
---|
357 | 382 | frameselectorItem.addActionListener(this); |
---|
358 | 383 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
359 | 384 | scriptNodeItem.addActionListener(this); |
---|
360 | | - cameraItem = menu.add(new MenuItem("Camera")); |
---|
361 | | - cameraItem.addActionListener(this); |
---|
362 | 385 | } |
---|
363 | 386 | |
---|
364 | 387 | oe.menuBar.add(menu = new Menu("Object")); |
---|
365 | | - textureItem = menu.add(new MenuItem("Texture")); |
---|
366 | | - textureItem.addActionListener(this); |
---|
| 388 | +// textureItem = menu.add(new MenuItem("Texture")); |
---|
| 389 | +// textureItem.addActionListener(this); |
---|
367 | 390 | billboardItem = menu.add(new MenuItem("Billboard")); |
---|
368 | 391 | billboardItem.addActionListener(this); |
---|
369 | 392 | csgItem = menu.add(new MenuItem("CSG")); |
---|
.. | .. |
---|
374 | 397 | shadowYItem.addActionListener(this); |
---|
375 | 398 | shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
376 | 399 | shadowZItem.addActionListener(this); |
---|
| 400 | + attributeItem = menu.add(new MenuItem("Attribute")); |
---|
| 401 | + attributeItem.addActionListener(this); |
---|
| 402 | + |
---|
377 | 403 | if (Globals.ADVANCED) |
---|
378 | 404 | { |
---|
379 | 405 | menu.add("-"); |
---|
380 | 406 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
381 | 407 | linkerItem.addActionListener(this); |
---|
382 | | - attributeItem = menu.add(new MenuItem("Attribute")); |
---|
383 | | - attributeItem.addActionListener(this); |
---|
384 | 408 | templateItem = menu.add(new MenuItem("Template")); |
---|
385 | 409 | templateItem.addActionListener(this); |
---|
386 | 410 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
.. | .. |
---|
532 | 556 | buildToolsMenu(menu); |
---|
533 | 557 | } |
---|
534 | 558 | |
---|
| 559 | + |
---|
535 | 560 | void SetupUI2(ObjEditor oe) |
---|
536 | 561 | { |
---|
537 | 562 | // June 2019 |
---|
.. | .. |
---|
574 | 599 | oe.radioPanel.add(dummyButton); |
---|
575 | 600 | oe.buttonGroup.add(dummyButton); |
---|
576 | 601 | */ |
---|
| 602 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 603 | + |
---|
| 604 | + copyOptionsPanel.preferredHeight = 1; |
---|
| 605 | + |
---|
577 | 606 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
578 | 607 | |
---|
579 | 608 | //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
580 | 609 | //minButton.setToolTipText("Minimize window"); |
---|
581 | 610 | //minButton.addActionListener(this); |
---|
582 | 611 | |
---|
583 | | - oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
584 | | - maxButton.setToolTipText("Maximize window"); |
---|
585 | | - maxButton.addActionListener(this); |
---|
| 612 | + if (Globals.ADVANCED) |
---|
| 613 | + { |
---|
| 614 | + oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 615 | + maxButton.setToolTipText("Maximize window"); |
---|
| 616 | + maxButton.addActionListener(this); |
---|
| 617 | + } |
---|
586 | 618 | |
---|
587 | 619 | oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
588 | 620 | fullButton.setToolTipText("Full-screen window"); |
---|
589 | 621 | fullButton.addActionListener(this); |
---|
590 | 622 | |
---|
591 | | - oe.toolbarPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
592 | | - undoButton.setToolTipText("Undo changes"); |
---|
593 | | - undoButton.addActionListener(this); |
---|
| 623 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 624 | + screenfitButton.setToolTipText("Screen fit"); |
---|
| 625 | + screenfitButton.addActionListener(this); |
---|
| 626 | + |
---|
| 627 | + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 628 | + restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
| 629 | + restoreCameraButton.addActionListener(this); |
---|
594 | 630 | |
---|
595 | | - oe.toolbarPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
596 | | - redoButton.setToolTipText("Redo changes"); |
---|
597 | | - redoButton.addActionListener(this); |
---|
598 | | - |
---|
599 | | - oe.toolbarPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
600 | | - saveButton.setToolTipText("Save changes"); |
---|
| 631 | + copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 632 | + saveButton.setToolTipText("New version"); |
---|
601 | 633 | saveButton.addActionListener(this); |
---|
| 634 | + |
---|
| 635 | + copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 636 | + undoButton.setToolTipText("Previous version"); |
---|
| 637 | + undoButton.addActionListener(this); |
---|
| 638 | + undoButton.setEnabled(false); |
---|
602 | 639 | |
---|
603 | | - oe.toolbarPanel.add(liveCB = GetCheckBox("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 640 | + cGridBag updown = new cGridBag().setVertical(true); |
---|
| 641 | + updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 642 | + restoreButton.setToolTipText("Restore current"); |
---|
| 643 | + restoreButton.addActionListener(this); |
---|
| 644 | + restoreButton.setEnabled(false); |
---|
| 645 | + |
---|
| 646 | + updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 647 | + replaceButton.setToolTipText("Replace current"); |
---|
| 648 | + replaceButton.addActionListener(this); |
---|
| 649 | + replaceButton.setEnabled(false); |
---|
| 650 | + |
---|
| 651 | + copyOptionsPanel.add(updown); |
---|
| 652 | + |
---|
| 653 | + copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 654 | + redoButton.setToolTipText("Next version"); |
---|
| 655 | + redoButton.addActionListener(this); |
---|
| 656 | + redoButton.setEnabled(false); |
---|
| 657 | + |
---|
| 658 | + oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
604 | 659 | liveCB.setToolTipText("Enable animation"); |
---|
605 | 660 | liveCB.addItemListener(this); |
---|
606 | 661 | |
---|
607 | | - oe.toolbarPanel.add(fastCB = GetCheckBox("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
608 | | - fastCB.setToolTipText("Fast mode"); |
---|
609 | | - fastCB.addItemListener(this); |
---|
610 | | - |
---|
611 | 662 | oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
612 | 663 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
613 | 664 | oneStepButton.addActionListener(this); |
---|
614 | 665 | |
---|
615 | | - oe.toolbarPanel.add(trackCB = GetCheckBox("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
616 | | - trackCB.setToolTipText("Enable tracking"); |
---|
617 | | - trackCB.addItemListener(this); |
---|
618 | | - |
---|
619 | | - oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
620 | | - screenfitButton.setToolTipText("Screen fit"); |
---|
621 | | - screenfitButton.addActionListener(this); |
---|
| 666 | + oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
| 667 | + fastCB.setToolTipText("Fast mode"); |
---|
| 668 | + fastCB.addItemListener(this); |
---|
| 669 | + |
---|
| 670 | + //oe.toolboxPanel.Return(); |
---|
| 671 | + |
---|
| 672 | +// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 673 | +// trackCB.setToolTipText("Enable tracking"); |
---|
| 674 | +// trackCB.addItemListener(this); |
---|
622 | 675 | |
---|
623 | 676 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
624 | 677 | // screenfitpointButton.addActionListener(this); |
---|
.. | .. |
---|
630 | 683 | snapobjectButton.setToolTipText("Snap Object"); |
---|
631 | 684 | } |
---|
632 | 685 | |
---|
633 | | - oe.toolbarPanel.add(flashSelectionButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
634 | | - flashSelectionButton.setToolTipText("Highlight selection"); |
---|
635 | | - flashSelectionButton.addActionListener(this); |
---|
636 | | - |
---|
637 | | - oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
| 686 | + //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
638 | 687 | |
---|
639 | 688 | oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
640 | 689 | twoButton.setToolTipText("Show center view only"); |
---|
641 | 690 | twoButton.addActionListener(this); |
---|
| 691 | + this.fullscreenLayout = twoButton; |
---|
| 692 | + |
---|
642 | 693 | oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
643 | 694 | fourButton.addActionListener(this); |
---|
644 | 695 | fourButton.setToolTipText("Show left panel only"); |
---|
.. | .. |
---|
653 | 704 | sevenButton.addActionListener(this); |
---|
654 | 705 | // |
---|
655 | 706 | |
---|
656 | | - oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 707 | + oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
657 | 708 | rootButton.setToolTipText("Edit selection in new tab"); |
---|
658 | 709 | rootButton.addActionListener(this); |
---|
659 | 710 | |
---|
660 | | - oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 711 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
661 | 712 | closeButton.setToolTipText("Close tab"); |
---|
662 | 713 | closeButton.addActionListener(this); |
---|
663 | 714 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
664 | 715 | //clearButton.addActionListener(this); |
---|
665 | | - |
---|
666 | | - editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
667 | | - editButton.setToolTipText("Edit selection"); |
---|
| 716 | + |
---|
| 717 | + // INSERT |
---|
| 718 | + oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 719 | + gridButton.setToolTipText("Create grid"); |
---|
| 720 | + gridButton.addActionListener(this); |
---|
| 721 | + |
---|
| 722 | + oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 723 | + boxButton.setToolTipText("Create box"); |
---|
| 724 | + boxButton.addActionListener(this); |
---|
| 725 | + |
---|
| 726 | + oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 727 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 728 | + sphereButton.addActionListener(this); |
---|
| 729 | + |
---|
| 730 | + oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 731 | + coneButton.setToolTipText("Create cone"); |
---|
| 732 | + coneButton.addActionListener(this); |
---|
| 733 | + |
---|
| 734 | + oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 735 | + torusButton.setToolTipText("Create torus"); |
---|
| 736 | + torusButton.addActionListener(this); |
---|
| 737 | + |
---|
| 738 | + oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 739 | + superButton.setToolTipText("Create superellipsoid"); |
---|
| 740 | + superButton.addActionListener(this); |
---|
| 741 | + |
---|
| 742 | + if (Globals.ADVANCED) |
---|
| 743 | + { |
---|
| 744 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 745 | + kleinButton.setToolTipText("Create Klein bottle"); |
---|
| 746 | + kleinButton.addActionListener(this); |
---|
| 747 | + } |
---|
| 748 | + |
---|
| 749 | + oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 750 | + particlesButton.setToolTipText("Create particle system"); |
---|
| 751 | + particlesButton.addActionListener(this); |
---|
| 752 | + |
---|
| 753 | + oe.toolboxPanel.Return(); |
---|
| 754 | + |
---|
| 755 | + oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 756 | + groupButton.setToolTipText("Create group"); |
---|
| 757 | + groupButton.addActionListener(this); |
---|
| 758 | + |
---|
| 759 | + oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 760 | + compositeButton.setToolTipText("Create composite"); |
---|
| 761 | + compositeButton.addActionListener(this); |
---|
| 762 | + |
---|
| 763 | + oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 764 | + switchButton.setToolTipText("Create item switcher"); |
---|
| 765 | + switchButton.addActionListener(this); |
---|
| 766 | + |
---|
| 767 | + oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 768 | + loopButton.setToolTipText("Create loop"); |
---|
| 769 | + loopButton.addActionListener(this); |
---|
| 770 | + |
---|
| 771 | + oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 772 | + textureButton.setToolTipText("Create texture"); |
---|
| 773 | + textureButton.addActionListener(this); |
---|
| 774 | + |
---|
| 775 | + oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 776 | + overlayButton.setToolTipText("Create overlay"); |
---|
| 777 | + overlayButton.addActionListener(this); |
---|
| 778 | + |
---|
| 779 | + oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 780 | + lightButton.setToolTipText("Create light"); |
---|
| 781 | + lightButton.addActionListener(this); |
---|
| 782 | + |
---|
| 783 | + for (int i=6; --i>=0;) |
---|
| 784 | + { |
---|
| 785 | + oe.toolboxPanel.Return(); |
---|
| 786 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 787 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 788 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 789 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 790 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 791 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 792 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 793 | + } |
---|
| 794 | + |
---|
| 795 | + // EDIT panel |
---|
| 796 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 797 | + editButton.setToolTipText("Pin selection controls"); |
---|
668 | 798 | editButton.addActionListener(this); |
---|
669 | 799 | |
---|
670 | | - editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
671 | | - uneditButton.setToolTipText("Unedit selection"); |
---|
| 800 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 801 | + uneditButton.setToolTipText("Remove selection controls"); |
---|
672 | 802 | uneditButton.addActionListener(this); |
---|
673 | 803 | |
---|
674 | 804 | editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
675 | | - allParamsButton.setToolTipText("Edit all params"); |
---|
| 805 | + allParamsButton.setToolTipText("Show all controle"); |
---|
676 | 806 | allParamsButton.addActionListener(this); |
---|
677 | 807 | |
---|
678 | 808 | editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
.. | .. |
---|
683 | 813 | unselectButton.setToolTipText("Unselect"); |
---|
684 | 814 | unselectButton.addActionListener(this); |
---|
685 | 815 | |
---|
| 816 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 817 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
| 818 | + flashSelectionButton.addActionListener(this); |
---|
| 819 | + |
---|
686 | 820 | editCommandsPanel.preferredHeight = 1; |
---|
687 | 821 | |
---|
| 822 | + SetPinStates(false); |
---|
688 | 823 | // oe.treePanel.add(commandsPanel); |
---|
689 | 824 | // oe.treePanel.Return(); |
---|
690 | 825 | |
---|
.. | .. |
---|
703 | 838 | |
---|
704 | 839 | JScrollPane jSP; |
---|
705 | 840 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
706 | | - jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints); |
---|
| 841 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
707 | 842 | ResetModel(); |
---|
708 | 843 | |
---|
709 | 844 | oe.treePanel.add(jSPPanel); |
---|
710 | 845 | oe.treePanel.Return(); |
---|
711 | 846 | |
---|
712 | | - cGridBag copyOptionsPanel = new cGridBag(); |
---|
713 | | - |
---|
714 | | - copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
715 | | - colorCB.setToolTipText("Copy color when dropped"); |
---|
716 | | - colorCB.addItemListener(this); |
---|
717 | | - |
---|
718 | | - copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
719 | | - materialCB.setToolTipText("Copy material when dropped"); |
---|
720 | | - materialCB.addItemListener(this); |
---|
721 | | - |
---|
722 | | - copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
723 | | - textureCB.setToolTipText("Copy texture when dropped"); |
---|
724 | | - textureCB.addItemListener(this); |
---|
725 | | - |
---|
726 | | - copyOptionsPanel.preferredHeight = 1; |
---|
727 | 847 | oe.treePanel.add(copyOptionsPanel); |
---|
728 | 848 | oe.treePanel.Return(); |
---|
| 849 | + cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 850 | + versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
| 851 | + sliderPane.preferredHeight = 1; |
---|
729 | 852 | |
---|
730 | 853 | // mainPanel.setDividerLocation(0.5); //1.0); |
---|
731 | 854 | // mainPanel.setResizeWeight(0.5); |
---|
.. | .. |
---|
754 | 877 | |
---|
755 | 878 | void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
756 | 879 | { |
---|
| 880 | + panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 881 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
| 882 | + colorCB.addItemListener(this); |
---|
| 883 | + |
---|
| 884 | + panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 885 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
| 886 | + materialCB.addItemListener(this); |
---|
| 887 | + |
---|
| 888 | + panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 889 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
| 890 | + textureCB.addItemListener(this); |
---|
| 891 | + |
---|
| 892 | + panel.Return(); |
---|
| 893 | + |
---|
757 | 894 | panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
758 | 895 | boxCB.setToolTipText("Display bounding boxes"); |
---|
759 | 896 | boxCB.addItemListener(this); |
---|
760 | 897 | |
---|
761 | 898 | panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
762 | | - zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 899 | + zoomBoxCB.setToolTipText("Display only for wheel"); |
---|
763 | 900 | zoomBoxCB.addItemListener(this); |
---|
764 | 901 | |
---|
765 | 902 | if (true) // Globals.ADVANCED) |
---|
766 | 903 | { |
---|
767 | | - panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
768 | | - supportCB.setToolTipText("Enable rigging"); |
---|
769 | | - supportCB.addItemListener(this); |
---|
| 904 | +// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 905 | +// supportCB.setToolTipText("Enable rigging"); |
---|
| 906 | +// supportCB.addItemListener(this); |
---|
| 907 | + |
---|
| 908 | + panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 909 | + freezeCB.setToolTipText("Fast moving camera"); |
---|
| 910 | + freezeCB.addItemListener(this); |
---|
770 | 911 | |
---|
771 | 912 | // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
772 | 913 | // localCB.addItemListener(this); |
---|
773 | 914 | |
---|
| 915 | + panel.Return(); |
---|
| 916 | + |
---|
774 | 917 | panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
775 | 918 | crowdCB.setToolTipText("Used for crowds"); |
---|
776 | 919 | crowdCB.addItemListener(this); |
---|
.. | .. |
---|
787 | 930 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
788 | 931 | // speakerMocapCB.addItemListener(this); |
---|
789 | 932 | |
---|
| 933 | + panel.Return(); |
---|
| 934 | + |
---|
790 | 935 | if (false) |
---|
791 | 936 | { |
---|
792 | 937 | // handled in scripts |
---|
.. | .. |
---|
801 | 946 | //constraints.gridy += 1; |
---|
802 | 947 | panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
803 | 948 | smoothfocusCB.addItemListener(this); |
---|
| 949 | + panel.Return(); |
---|
804 | 950 | } |
---|
805 | 951 | |
---|
806 | 952 | //constraints.gridx += 1; |
---|
807 | 953 | //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
808 | 954 | // debugCB.addItemListener(this); |
---|
809 | 955 | |
---|
| 956 | + panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 957 | + trackCB.setToolTipText("Enable tracking target"); |
---|
| 958 | + trackCB.addItemListener(this); |
---|
| 959 | + |
---|
810 | 960 | panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
811 | | - oeilCB.setToolTipText("Move camera when tracking target"); |
---|
| 961 | + oeilCB.setToolTipText("Move camera when tracking"); |
---|
812 | 962 | oeilCB.addItemListener(this); |
---|
813 | 963 | |
---|
814 | 964 | panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
815 | | - shadowCB.setToolTipText("Compute shadows when live"); |
---|
| 965 | + shadowCB.setToolTipText("When live compute shadows"); |
---|
816 | 966 | shadowCB.addItemListener(this); |
---|
817 | 967 | |
---|
818 | | - panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints); |
---|
819 | | - autosaveCB.setToolTipText("Auto-save on structure change"); |
---|
820 | | - autosaveCB.addItemListener(this); |
---|
| 968 | + panel.Return(); |
---|
| 969 | + panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints); |
---|
| 970 | + toggleTextureCB.setToolTipText("Load textures"); |
---|
| 971 | + toggleTextureCB.addItemListener(this); |
---|
| 972 | + |
---|
| 973 | + panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints); |
---|
| 974 | + toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
| 975 | + toggleSwitchCB.addItemListener(this); |
---|
| 976 | + |
---|
| 977 | + panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints); |
---|
| 978 | + autokeepCB.setToolTipText("On structure change"); |
---|
| 979 | + autokeepCB.addItemListener(this); |
---|
821 | 980 | |
---|
| 981 | + panel.Return(); |
---|
822 | 982 | if (Globals.ADVANCED) |
---|
823 | 983 | { |
---|
824 | 984 | panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
.. | .. |
---|
829 | 989 | } |
---|
830 | 990 | |
---|
831 | 991 | cGridBag fill = new cGridBag(); |
---|
832 | | - |
---|
833 | 992 | fill.preferredHeight = 200; |
---|
| 993 | + cGridBag fill2 = new cGridBag(); |
---|
| 994 | + fill2.preferredHeight = 200; |
---|
| 995 | + cGridBag fill3 = new cGridBag(); |
---|
| 996 | + fill3.preferredHeight = 200; |
---|
834 | 997 | |
---|
835 | 998 | panel.add(fill); |
---|
| 999 | + panel.add(fill2); |
---|
| 1000 | + panel.add(fill3); |
---|
836 | 1001 | |
---|
837 | 1002 | } |
---|
838 | 1003 | |
---|
.. | .. |
---|
840 | 1005 | { |
---|
841 | 1006 | cRadio radioButton = new cRadio(obj.name); |
---|
842 | 1007 | |
---|
843 | | - // Patch to avoid bug with transparency. |
---|
| 1008 | + // June 2019. Patch to avoid bug with transparency. |
---|
844 | 1009 | radioButton.hadMaterial = obj.material != null; |
---|
845 | 1010 | if (!radioButton.hadMaterial) |
---|
846 | 1011 | { |
---|
.. | .. |
---|
868 | 1033 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
869 | 1034 | } |
---|
870 | 1035 | |
---|
871 | | - cCheckBox liveCB; |
---|
| 1036 | + cToggleButton liveCB; |
---|
872 | 1037 | cCheckBox supportCB; |
---|
873 | 1038 | cCheckBox localCB; |
---|
874 | 1039 | cCheckBox crowdCB; |
---|
875 | 1040 | cCheckBox smoothCB; |
---|
876 | | - cCheckBox fastCB; |
---|
| 1041 | + cToggleButton fastCB; |
---|
877 | 1042 | cCheckBox slowCB; |
---|
878 | 1043 | cCheckBox boxCB; |
---|
879 | 1044 | cCheckBox zoomBoxCB; |
---|
| 1045 | + cCheckBox freezeCB; |
---|
| 1046 | + //cToggleButton trackCB; |
---|
880 | 1047 | cCheckBox trackCB; |
---|
881 | 1048 | cCheckBox smoothfocusCB; |
---|
882 | 1049 | // JCheckBox speakerMocapCB; |
---|
.. | .. |
---|
886 | 1053 | |
---|
887 | 1054 | cCheckBox oeilCB; |
---|
888 | 1055 | cCheckBox shadowCB; |
---|
889 | | - cCheckBox autosaveCB; |
---|
| 1056 | + cCheckBox autokeepCB; |
---|
890 | 1057 | cCheckBox lookAtCB; |
---|
891 | 1058 | |
---|
892 | 1059 | // static int COLOR = 1; |
---|
.. | .. |
---|
994 | 1161 | { |
---|
995 | 1162 | Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
996 | 1163 | } |
---|
997 | | - else if(e.getSource() == autosaveCB) |
---|
| 1164 | + else if(e.getSource() == freezeCB) |
---|
998 | 1165 | { |
---|
999 | | - Globals.SAVEONMAKE ^= true; |
---|
| 1166 | + Globals.FREEZEONMOVE ^= true; |
---|
| 1167 | + } |
---|
| 1168 | + else if(e.getSource() == autokeepCB) |
---|
| 1169 | + { |
---|
| 1170 | + Globals.REPLACEONMAKE ^= true; |
---|
1000 | 1171 | } |
---|
1001 | 1172 | else if(e.getSource() == lookAtCB) |
---|
1002 | 1173 | { |
---|
.. | .. |
---|
1014 | 1185 | |
---|
1015 | 1186 | /**/ |
---|
1016 | 1187 | //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this); |
---|
1017 | | - TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1188 | + //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1189 | + TreePath path = objEditor.jTree.getSelectionPath(); |
---|
1018 | 1190 | if ((path == null) || (path.getPathCount() <= 1)) { |
---|
1019 | 1191 | // We can't move the root node or an empty selection |
---|
1020 | 1192 | return; |
---|
.. | .. |
---|
1077 | 1249 | } |
---|
1078 | 1250 | } |
---|
1079 | 1251 | |
---|
1080 | | - String string = (String) object; |
---|
1081 | | - |
---|
1082 | 1252 | System.out.println("Transfer = " + object + "; drop : " + target); |
---|
1083 | 1253 | // if( object instanceof java.io.File[]) |
---|
1084 | 1254 | // { |
---|
.. | .. |
---|
1086 | 1256 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
1087 | 1257 | // return; |
---|
1088 | 1258 | // } |
---|
| 1259 | + |
---|
| 1260 | + String string = object.toString(); |
---|
1089 | 1261 | |
---|
1090 | 1262 | // File path for Mac and Windows |
---|
1091 | 1263 | if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
.. | .. |
---|
1131 | 1303 | |
---|
1132 | 1304 | assert target == objEditor.jTree; |
---|
1133 | 1305 | TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y); |
---|
| 1306 | + Object3D destinationLeaf; |
---|
1134 | 1307 | try { |
---|
1135 | | - Object3D dummy = (Composite) destinationPath.getLastPathComponent(); |
---|
| 1308 | + destinationLeaf = (Composite) destinationPath.getLastPathComponent(); |
---|
1136 | 1309 | } catch (Exception e) { |
---|
1137 | 1310 | System.out.println("destinationPath : " + destinationPath); |
---|
1138 | 1311 | return; |
---|
1139 | 1312 | } |
---|
1140 | 1313 | |
---|
1141 | | - if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1314 | + for (int i=group.selection.size(); --i>=0;) |
---|
1142 | 1315 | { |
---|
| 1316 | + Object3D child = (Object3D)group.selection.elementAt(i); |
---|
| 1317 | + |
---|
| 1318 | + // Cannot move into itself |
---|
| 1319 | + if (child == destinationLeaf) |
---|
| 1320 | + return; |
---|
| 1321 | + } |
---|
| 1322 | + |
---|
| 1323 | +// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1324 | +// { |
---|
1143 | 1325 | loadClipboard(true); |
---|
1144 | 1326 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
1145 | 1327 | pasteInto(false, false); |
---|
1146 | | - } else { |
---|
1147 | | - loadClipboard(false); |
---|
1148 | | - objEditor.jTree.setSelectionPath(destinationPath); |
---|
1149 | | - pasteInto(false, false); // true); // ??? |
---|
1150 | | - } |
---|
| 1328 | +// } else { |
---|
| 1329 | +// loadClipboard(false); |
---|
| 1330 | +// objEditor.jTree.setSelectionPath(destinationPath); |
---|
| 1331 | +// pasteInto(false, false); // true); // ??? |
---|
| 1332 | +// } |
---|
1151 | 1333 | } |
---|
1152 | 1334 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
1153 | 1335 | // Called if the user has modified the current drop gesture |
---|
.. | .. |
---|
1252 | 1434 | { |
---|
1253 | 1435 | //heightFieldItem = menu.add(new MenuItem("Height Field")); |
---|
1254 | 1436 | //heightFieldItem.addActionListener(this); |
---|
1255 | | - gridItem = menu.add(new MenuItem("Grid")); |
---|
1256 | | - gridItem.addActionListener(this); |
---|
1257 | | - rectoidItem = menu.add(new MenuItem("Box")); |
---|
1258 | | - rectoidItem.addActionListener(this); |
---|
1259 | | - ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
1260 | | - ellipsoidItem.addActionListener(this); |
---|
1261 | | - coneItem = menu.add(new MenuItem("Cone")); |
---|
1262 | | - coneItem.addActionListener(this); |
---|
1263 | | - torusItem = menu.add(new MenuItem("Torus")); |
---|
1264 | | - torusItem.addActionListener(this); |
---|
1265 | | - superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
1266 | | - superItem.addActionListener(this); |
---|
| 1437 | +// gridItem = menu.add(new MenuItem("Grid")); |
---|
| 1438 | +// gridItem.addActionListener(this); |
---|
| 1439 | +// rectoidItem = menu.add(new MenuItem("Box")); |
---|
| 1440 | +// rectoidItem.addActionListener(this); |
---|
| 1441 | +// ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
| 1442 | +// ellipsoidItem.addActionListener(this); |
---|
| 1443 | +// coneItem = menu.add(new MenuItem("Cone")); |
---|
| 1444 | +// coneItem.addActionListener(this); |
---|
| 1445 | +// torusItem = menu.add(new MenuItem("Torus")); |
---|
| 1446 | +// torusItem.addActionListener(this); |
---|
| 1447 | +// superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
| 1448 | +// superItem.addActionListener(this); |
---|
| 1449 | + |
---|
| 1450 | + cameraItem = menu.add(new MenuItem("Camera")); |
---|
| 1451 | + cameraItem.addActionListener(this); |
---|
| 1452 | + |
---|
| 1453 | + if (!Globals.ADVANCED) |
---|
| 1454 | + { |
---|
1267 | 1455 | kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
1268 | 1456 | kleinItem.addActionListener(this); |
---|
1269 | | - particleItem = menu.add(new MenuItem("Particle system")); |
---|
1270 | | - particleItem.addActionListener(this); |
---|
| 1457 | + } |
---|
| 1458 | + |
---|
| 1459 | +// particleItem = menu.add(new MenuItem("Particle system")); |
---|
| 1460 | +// particleItem.addActionListener(this); |
---|
1271 | 1461 | if (Globals.ADVANCED) |
---|
1272 | 1462 | { |
---|
1273 | 1463 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
.. | .. |
---|
1293 | 1483 | } |
---|
1294 | 1484 | bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
1295 | 1485 | bezierItem.addActionListener(this); |
---|
1296 | | - overlayItem = menu.add(new MenuItem("Overlay")); |
---|
1297 | | - overlayItem.addActionListener(this); |
---|
1298 | | - lightItem = menu.add(new MenuItem("Light")); |
---|
1299 | | - lightItem.addActionListener(this); |
---|
| 1486 | +// overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1487 | +// overlayItem.addActionListener(this); |
---|
| 1488 | +// lightItem = menu.add(new MenuItem("Light")); |
---|
| 1489 | +// lightItem.addActionListener(this); |
---|
1300 | 1490 | menu.add("-"); |
---|
1301 | 1491 | //superLoopItem = menu.add(new MenuItem("Super Loop")); |
---|
1302 | 1492 | //superLoopItem.addActionListener(this); |
---|
1303 | | - loopItem = menu.add(new MenuItem("Loop")); |
---|
1304 | | - loopItem.addActionListener(this); |
---|
| 1493 | +// loopItem = menu.add(new MenuItem("Loop")); |
---|
| 1494 | +// loopItem.addActionListener(this); |
---|
1305 | 1495 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1306 | 1496 | doubleItem.addActionListener(this); |
---|
1307 | 1497 | if (Globals.ADVANCED) |
---|
.. | .. |
---|
1317 | 1507 | animationItem.addItemListener(this); |
---|
1318 | 1508 | animationItem.setState(Globals.ANIMATION); |
---|
1319 | 1509 | |
---|
| 1510 | + menu.add(archiveItem = new MenuItem("Archive3D...")); |
---|
| 1511 | + archiveItem.addActionListener(this); |
---|
| 1512 | + |
---|
1320 | 1513 | menu.add("-"); |
---|
1321 | 1514 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1322 | 1515 | parseverticesItem.addActionListener(this); |
---|
.. | .. |
---|
1329 | 1522 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1330 | 1523 | reduce34MorphItem.addActionListener(this); |
---|
1331 | 1524 | menu.add("-"); |
---|
| 1525 | + menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
| 1526 | + memoryItem.addActionListener(this); |
---|
1332 | 1527 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1333 | 1528 | computeAOItem.addActionListener(this); |
---|
1334 | 1529 | |
---|
.. | .. |
---|
1337 | 1532 | mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1338 | 1533 | mirrorItem.addActionListener(this); |
---|
1339 | 1534 | menu.add("-"); |
---|
1340 | | - menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1341 | | - memoryItem.addActionListener(this); |
---|
1342 | 1535 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1343 | 1536 | analyzeItem.addActionListener(this); |
---|
1344 | 1537 | menu.add(dumpItem = new MenuItem("Print")); |
---|
.. | .. |
---|
1486 | 1679 | |
---|
1487 | 1680 | makeSomething(shadow); |
---|
1488 | 1681 | } |
---|
| 1682 | + |
---|
| 1683 | + private void ClearUnpinned() |
---|
| 1684 | + { |
---|
| 1685 | + //for (Object3D obj : listUI) |
---|
| 1686 | + for (int i=listUI.size(); --i>=0;) |
---|
| 1687 | + { |
---|
| 1688 | + Object3D obj = listUI.elementAt(i); |
---|
| 1689 | + if (!obj.pinned) |
---|
| 1690 | + { |
---|
| 1691 | + obj.CloseUI(); |
---|
| 1692 | + listUI.remove(i); |
---|
| 1693 | + } |
---|
| 1694 | + } |
---|
| 1695 | + } |
---|
1489 | 1696 | |
---|
1490 | 1697 | /** |
---|
1491 | 1698 | * applyExample |
---|
.. | .. |
---|
1730 | 1937 | { |
---|
1731 | 1938 | ScreenFit(); |
---|
1732 | 1939 | } else |
---|
1733 | | - if (source == switchItem) |
---|
| 1940 | + if (source == switchViewItem) |
---|
1734 | 1941 | { |
---|
1735 | 1942 | cVector v1 = new cVector(); |
---|
1736 | 1943 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1739 | 1946 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1740 | 1947 | objEditor.cameraView.repaint(); |
---|
1741 | 1948 | } else |
---|
1742 | | - if (source == rectoidItem) |
---|
| 1949 | + if (source == rectoidItem || source == boxButton) |
---|
1743 | 1950 | { |
---|
1744 | 1951 | makeSomething(new Box()); |
---|
1745 | 1952 | } else |
---|
1746 | | - if (source == particleItem) |
---|
| 1953 | + if (source == particleItem || source == particlesButton) |
---|
1747 | 1954 | { |
---|
1748 | 1955 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1749 | 1956 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1822 | 2029 | |
---|
1823 | 2030 | makeSomething(obj); |
---|
1824 | 2031 | } else |
---|
1825 | | - if (source == gridItem) |
---|
| 2032 | + if (source == gridItem || source == gridButton) |
---|
1826 | 2033 | { |
---|
1827 | 2034 | makeSomething(new Grid()); |
---|
1828 | 2035 | } else |
---|
1829 | | - if (source == ellipsoidItem) |
---|
| 2036 | + if (source == ellipsoidItem || source == sphereButton) |
---|
1830 | 2037 | { |
---|
1831 | 2038 | makeSomething(new Sphere()); |
---|
1832 | 2039 | } else |
---|
1833 | | - if (source == coneItem) |
---|
| 2040 | + if (source == coneItem || source == coneButton) |
---|
1834 | 2041 | { |
---|
1835 | 2042 | makeSomething(new Cone()); |
---|
1836 | 2043 | } else |
---|
1837 | | - if (source == torusItem) |
---|
| 2044 | + if (source == torusItem || source == torusButton) |
---|
1838 | 2045 | { |
---|
1839 | 2046 | makeSomething(new Torus()); |
---|
1840 | 2047 | } else |
---|
1841 | | - if (source == superItem) |
---|
| 2048 | + if (source == superItem || source == superButton) |
---|
1842 | 2049 | { |
---|
1843 | 2050 | makeSomething(new Superellipsoid()); |
---|
1844 | 2051 | } else |
---|
1845 | | - if (source == kleinItem) |
---|
| 2052 | + if (source == kleinItem || source == kleinButton) |
---|
1846 | 2053 | { |
---|
1847 | 2054 | makeSomething(new Klein()); |
---|
1848 | 2055 | } else |
---|
.. | .. |
---|
1862 | 2069 | { |
---|
1863 | 2070 | makeSomething(new BezierSurface()); |
---|
1864 | 2071 | } else |
---|
1865 | | - if (source == overlayItem) |
---|
| 2072 | + if (source == overlayItem || source == overlayButton) |
---|
1866 | 2073 | { |
---|
1867 | 2074 | /* |
---|
1868 | 2075 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1910 | 2117 | s.setup(); |
---|
1911 | 2118 | makeSomething(s); |
---|
1912 | 2119 | } else |
---|
1913 | | - if (source == lightItem) |
---|
| 2120 | + if (source == lightItem || source == lightButton) |
---|
1914 | 2121 | { |
---|
1915 | 2122 | makeSomething(new Light()); |
---|
1916 | 2123 | } else |
---|
.. | .. |
---|
1960 | 2167 | |
---|
1961 | 2168 | group(g); |
---|
1962 | 2169 | } else |
---|
1963 | | - if (source == loopItem) |
---|
| 2170 | + if (source == loopItem || source == loopButton) |
---|
1964 | 2171 | { |
---|
1965 | 2172 | Composite csg = new GroupLeaf(); |
---|
1966 | 2173 | csg.count = 5; |
---|
1967 | 2174 | group(csg); |
---|
1968 | | - Composite child = new cGroup(); |
---|
| 2175 | + Composite child = new cGroup("Branch"); |
---|
1969 | 2176 | csg.addChild(child); |
---|
1970 | 2177 | child.addChild(csg); |
---|
1971 | 2178 | } else |
---|
1972 | 2179 | if (source == doubleItem) |
---|
1973 | 2180 | { |
---|
1974 | | - Composite csg = new GroupLeaf(); |
---|
| 2181 | + Composite csg = new GroupLeaf("Fork"); |
---|
1975 | 2182 | csg.count = 5; |
---|
1976 | 2183 | group(csg); |
---|
1977 | | - Composite child = new cGroup(); |
---|
| 2184 | + Composite child = new cGroup("Branch A"); |
---|
1978 | 2185 | csg.addChild(child); |
---|
1979 | 2186 | child.addChild(csg); |
---|
1980 | | - child = new cGroup(); |
---|
| 2187 | + child = new cGroup("Branch B"); |
---|
1981 | 2188 | csg.addChild(child); |
---|
1982 | 2189 | child.addChild(csg); |
---|
1983 | 2190 | } else |
---|
1984 | 2191 | if (source == tripleItem) |
---|
1985 | 2192 | { |
---|
1986 | | - Composite csg = new GroupLeaf(); |
---|
| 2193 | + Composite csg = new GroupLeaf("Trident"); |
---|
1987 | 2194 | csg.count = 4; |
---|
1988 | 2195 | group(csg); |
---|
1989 | 2196 | Composite child = new cGroup(); |
---|
.. | .. |
---|
2047 | 2254 | } else |
---|
2048 | 2255 | if (source == undoButton) |
---|
2049 | 2256 | { |
---|
| 2257 | + // Go to previous version |
---|
| 2258 | + //if (!Undo()) |
---|
| 2259 | + //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
2050 | 2260 | Undo(); |
---|
| 2261 | + } else |
---|
| 2262 | + if (source == restoreButton) |
---|
| 2263 | + { |
---|
| 2264 | + // Restore current version |
---|
| 2265 | + Restore(); |
---|
| 2266 | + } else |
---|
| 2267 | + if (source == replaceButton) |
---|
| 2268 | + { |
---|
| 2269 | + // Overwrite current version |
---|
| 2270 | + Replace(); |
---|
2051 | 2271 | } else |
---|
2052 | 2272 | if (source == redoButton) |
---|
2053 | 2273 | { |
---|
| 2274 | + // Go to next version |
---|
2054 | 2275 | Redo(); |
---|
2055 | 2276 | } else |
---|
2056 | 2277 | if (source == saveButton) |
---|
2057 | 2278 | { |
---|
2058 | | - Save(); |
---|
| 2279 | + // Save a new version |
---|
| 2280 | + if (!Save(true)) |
---|
| 2281 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
2059 | 2282 | } else |
---|
2060 | 2283 | if (source == oneStepButton) |
---|
2061 | 2284 | { |
---|
.. | .. |
---|
2064 | 2287 | } else |
---|
2065 | 2288 | if (source == screenfitButton) |
---|
2066 | 2289 | { |
---|
2067 | | - //Reload(lastConverter, lastFilename, true); |
---|
2068 | 2290 | ScreenFit(); |
---|
2069 | 2291 | } else |
---|
2070 | 2292 | if (source == screenfitpointButton) |
---|
2071 | 2293 | { |
---|
2072 | | - //Reload(lastConverter, lastFilename, true); |
---|
2073 | 2294 | ScreenFitPoint(); |
---|
2074 | 2295 | } else |
---|
2075 | 2296 | if (source == snapobjectButton) |
---|
2076 | 2297 | { |
---|
2077 | | - //Reload(lastConverter, lastFilename, true); |
---|
2078 | 2298 | SnapObject(); |
---|
2079 | 2299 | } else |
---|
2080 | 2300 | // if (event.getSource() == recompileButton) |
---|
.. | .. |
---|
2450 | 2670 | { |
---|
2451 | 2671 | ClearSelection(true); |
---|
2452 | 2672 | } else |
---|
2453 | | - if (source == grabItem) |
---|
| 2673 | + if (source == grabItem || source == groupButton) |
---|
2454 | 2674 | { |
---|
2455 | | - group(new cGroup(), true); |
---|
| 2675 | + group(new cGroup(), false); // true); |
---|
2456 | 2676 | } else |
---|
2457 | 2677 | if (source == hideItem) |
---|
2458 | 2678 | { |
---|
.. | .. |
---|
2470 | 2690 | { |
---|
2471 | 2691 | makeSomething(new Camera()); |
---|
2472 | 2692 | } else |
---|
2473 | | - if (source == compositeItem) |
---|
| 2693 | + if (source == compositeItem || source == compositeButton) |
---|
2474 | 2694 | { |
---|
2475 | 2695 | group(new Composite()); |
---|
2476 | 2696 | } else |
---|
2477 | | - if (source == randomItem) |
---|
| 2697 | + if (source == switchItem || source == switchButton) |
---|
2478 | 2698 | { |
---|
2479 | 2699 | RandomNode random = new RandomNode(); |
---|
2480 | 2700 | group(random); |
---|
.. | .. |
---|
2576 | 2796 | { |
---|
2577 | 2797 | group(new cLinker()); |
---|
2578 | 2798 | } else |
---|
2579 | | - if (source == textureItem) |
---|
| 2799 | + if (source == textureItem || source == textureButton) |
---|
2580 | 2800 | { |
---|
2581 | 2801 | group(new TextureNode()); |
---|
2582 | 2802 | } else |
---|
.. | .. |
---|
2596 | 2816 | { |
---|
2597 | 2817 | CastShadow(2); |
---|
2598 | 2818 | } else |
---|
2599 | | - if (source == ungroupItem) |
---|
| 2819 | + if (source == ungroupItem || source == ungroupButton) |
---|
2600 | 2820 | { |
---|
2601 | | - //ungroup(); |
---|
| 2821 | + boolean hasRoot = false; |
---|
| 2822 | + |
---|
2602 | 2823 | for (int i=0; i<group.selection.size(); i++) |
---|
2603 | 2824 | { |
---|
2604 | | - Ungroup(group.selection.get(i)); |
---|
| 2825 | + if (group.selection.get(i) == group) |
---|
| 2826 | + { |
---|
| 2827 | + hasRoot = true; |
---|
| 2828 | + break; |
---|
| 2829 | + } |
---|
2605 | 2830 | } |
---|
2606 | 2831 | |
---|
2607 | | - ClearSelection(false); |
---|
2608 | | - |
---|
2609 | | - refreshContents(); |
---|
| 2832 | + if (!hasRoot) |
---|
| 2833 | + { |
---|
| 2834 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 2835 | + { |
---|
| 2836 | + Ungroup(group.selection.get(i)); |
---|
| 2837 | + } |
---|
| 2838 | + |
---|
| 2839 | + ClearSelection(false); |
---|
| 2840 | + |
---|
| 2841 | + refreshContents(); |
---|
| 2842 | + } |
---|
2610 | 2843 | } else |
---|
2611 | 2844 | if (source == genUVItem) |
---|
2612 | 2845 | { |
---|
.. | .. |
---|
2934 | 3167 | if (source == twoButton) |
---|
2935 | 3168 | { |
---|
2936 | 3169 | radio.layout = twoButton; |
---|
| 3170 | + |
---|
| 3171 | + if (CameraPane.FULLSCREEN) |
---|
| 3172 | + fullscreenLayout = radio.layout; |
---|
| 3173 | + |
---|
2937 | 3174 | // bug |
---|
2938 | 3175 | //gridPanel.setDividerLocation(1.0); |
---|
2939 | 3176 | //bigPanel.setDividerLocation(0.0); |
---|
.. | .. |
---|
2989 | 3226 | { |
---|
2990 | 3227 | radio.layout = threeButton; |
---|
2991 | 3228 | |
---|
| 3229 | + if (CameraPane.FULLSCREEN) |
---|
| 3230 | + fullscreenLayout = radio.layout; |
---|
| 3231 | + |
---|
2992 | 3232 | // bigThree.remove(scenePanel); |
---|
2993 | 3233 | // bigThree.remove(centralPanel); |
---|
2994 | 3234 | // bigThree.remove(XYZPanel); |
---|
.. | .. |
---|
3027 | 3267 | { |
---|
3028 | 3268 | radio.layout = fourButton; |
---|
3029 | 3269 | |
---|
| 3270 | + if (CameraPane.FULLSCREEN) |
---|
| 3271 | + fullscreenLayout = radio.layout; |
---|
| 3272 | + |
---|
3030 | 3273 | // bigThree.remove(scenePanel); |
---|
3031 | 3274 | // bigThree.remove(centralPanel); |
---|
3032 | 3275 | // bigThree.remove(XYZPanel); |
---|
.. | .. |
---|
3063 | 3306 | if (source == sixButton) |
---|
3064 | 3307 | { |
---|
3065 | 3308 | radio.layout = sixButton; |
---|
| 3309 | + |
---|
| 3310 | + if (CameraPane.FULLSCREEN) |
---|
| 3311 | + fullscreenLayout = radio.layout; |
---|
3066 | 3312 | |
---|
3067 | 3313 | // bigThree.remove(scenePanel); |
---|
3068 | 3314 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
3101 | 3347 | if (source == sevenButton) |
---|
3102 | 3348 | { |
---|
3103 | 3349 | radio.layout = sevenButton; |
---|
| 3350 | + |
---|
| 3351 | + if (CameraPane.FULLSCREEN) |
---|
| 3352 | + fullscreenLayout = radio.layout; |
---|
3104 | 3353 | |
---|
3105 | 3354 | // bigThree.remove(scenePanel); |
---|
3106 | 3355 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
3182 | 3431 | } else |
---|
3183 | 3432 | if (source == editItem || source == editButton) |
---|
3184 | 3433 | { |
---|
| 3434 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3435 | + { |
---|
| 3436 | + Object3D child = (Object3D)e.nextElement(); |
---|
| 3437 | + child.pinned = true; |
---|
| 3438 | + } |
---|
| 3439 | + |
---|
3185 | 3440 | EditSelection(false); |
---|
3186 | 3441 | } else |
---|
3187 | 3442 | if (source == uneditButton) |
---|
.. | .. |
---|
3191 | 3446 | Object3D child = (Object3D)e.nextElement(); |
---|
3192 | 3447 | if(child.editWindow != null) |
---|
3193 | 3448 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3449 | + child.pinned = false; |
---|
3194 | 3450 | child.CloseUI(); |
---|
3195 | 3451 | listUI.remove(child); |
---|
3196 | 3452 | |
---|
.. | .. |
---|
3207 | 3463 | //copy.ClearUI(); |
---|
3208 | 3464 | for (Object3D obj : listUI) |
---|
3209 | 3465 | { |
---|
| 3466 | + obj.pinned = false; |
---|
3210 | 3467 | obj.CloseUI(); |
---|
3211 | 3468 | } |
---|
3212 | 3469 | listUI.clear(); |
---|
.. | .. |
---|
3216 | 3473 | { |
---|
3217 | 3474 | assert(copy == group); |
---|
3218 | 3475 | |
---|
3219 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3476 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3220 | 3477 | |
---|
3221 | 3478 | for (Object3D obj : listUI) |
---|
3222 | 3479 | { |
---|
.. | .. |
---|
3265 | 3522 | } |
---|
3266 | 3523 | |
---|
3267 | 3524 | copy = group; |
---|
| 3525 | + |
---|
| 3526 | + SetUndoStates(); |
---|
| 3527 | + |
---|
3268 | 3528 | //Globals.theRenderer.object = group; |
---|
3269 | 3529 | if(!useclient) |
---|
3270 | 3530 | { |
---|
.. | .. |
---|
3291 | 3551 | currentLayout = sevenButton; |
---|
3292 | 3552 | */ |
---|
3293 | 3553 | radio.layout.doClick(); |
---|
| 3554 | + |
---|
| 3555 | + ClearUnpinned(); |
---|
| 3556 | + Grafreed.Assert(group != null); |
---|
| 3557 | + Grafreed.Assert(group.selection != null); |
---|
| 3558 | + SetPinStates(group.selection.size() > 0); |
---|
| 3559 | + if (group.selection.size() == 1) |
---|
| 3560 | + EditSelection(false); |
---|
3294 | 3561 | keepparent = group.parent; |
---|
3295 | 3562 | // PARENT = NULL or not??? |
---|
3296 | 3563 | //group.parent = null; // ROOT |
---|
.. | .. |
---|
3304 | 3571 | cameraView.ProtectCamera(); |
---|
3305 | 3572 | cameraView.repaint(); |
---|
3306 | 3573 | return; |
---|
3307 | | - } else if (event.getSource() == revertCameraItem) |
---|
| 3574 | + } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton) |
---|
3308 | 3575 | { |
---|
3309 | 3576 | cameraView.RevertCamera(); |
---|
3310 | 3577 | cameraView.repaint(); |
---|
.. | .. |
---|
4358 | 4625 | // } |
---|
4359 | 4626 | // } |
---|
4360 | 4627 | |
---|
4361 | | - static boolean allparams = true; |
---|
4362 | | - |
---|
4363 | | - static Vector<Object3D> listUI = new Vector<Object3D>(); |
---|
4364 | | - |
---|
4365 | 4628 | void EditSelection(boolean newWindow) |
---|
4366 | 4629 | { |
---|
4367 | 4630 | // aConstraints.gridy = 0; |
---|
.. | .. |
---|
4369 | 4632 | { |
---|
4370 | 4633 | //System.out.println("edit : " + objectPanel.indexOfTab("Material")); |
---|
4371 | 4634 | //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false); |
---|
4372 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 4635 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
4373 | 4636 | |
---|
4374 | 4637 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4375 | 4638 | if(elem != group || !newWindow) |
---|
.. | .. |
---|
4454 | 4717 | //new Exception().printStackTrace(); |
---|
4455 | 4718 | |
---|
4456 | 4719 | freezemodel = true; |
---|
4457 | | - |
---|
| 4720 | + ClearUnpinned(); |
---|
| 4721 | + |
---|
4458 | 4722 | /**/ |
---|
4459 | 4723 | //switch (event.id) |
---|
4460 | 4724 | { |
---|
.. | .. |
---|
4487 | 4751 | if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4488 | 4752 | // a camera |
---|
4489 | 4753 | { |
---|
4490 | | - if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 4754 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
4491 | 4755 | { |
---|
4492 | 4756 | CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4493 | 4757 | Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
.. | .. |
---|
4496 | 4760 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4497 | 4761 | } |
---|
4498 | 4762 | |
---|
| 4763 | + if (tps != null && tps.length == 1) |
---|
| 4764 | + { |
---|
| 4765 | + EditSelection(false); |
---|
| 4766 | + } |
---|
| 4767 | + |
---|
| 4768 | + SetPinStates(tps != null && tps.length > 0); |
---|
| 4769 | + |
---|
4499 | 4770 | refreshContents(); |
---|
4500 | 4771 | //return true; |
---|
4501 | 4772 | } |
---|
.. | .. |
---|
4505 | 4776 | freezemodel = false; |
---|
4506 | 4777 | } |
---|
4507 | 4778 | |
---|
| 4779 | + void SetPinStates(boolean enabled) |
---|
| 4780 | + { |
---|
| 4781 | + editButton.setEnabled(enabled); |
---|
| 4782 | + uneditButton.setEnabled(enabled); |
---|
| 4783 | + unselectButton.setEnabled(enabled); |
---|
| 4784 | + flashSelectionButton.setEnabled(enabled); |
---|
| 4785 | + } |
---|
| 4786 | + |
---|
4508 | 4787 | void refreshContents(boolean cp) |
---|
4509 | 4788 | { |
---|
4510 | | - if (!Globals.MOUSEDRAGGED) |
---|
| 4789 | + if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info")) |
---|
| 4790 | + if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
4511 | 4791 | { |
---|
4512 | 4792 | objEditor.ClearInfo(); // .GetMaterial()); |
---|
4513 | 4793 | |
---|
.. | .. |
---|
4606 | 4886 | |
---|
4607 | 4887 | if (cut) |
---|
4608 | 4888 | { |
---|
4609 | | - if (Globals.SAVEONMAKE) |
---|
4610 | | - Save(); |
---|
| 4889 | +// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save. |
---|
| 4890 | +// Save(); |
---|
4611 | 4891 | //int indices[] = jList.getSelectedIndices(); |
---|
4612 | 4892 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4613 | 4893 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4710 | 4990 | |
---|
4711 | 4991 | void paste(boolean expand) |
---|
4712 | 4992 | { |
---|
| 4993 | + if (Globals.REPLACEONMAKE) |
---|
| 4994 | + Save(); |
---|
| 4995 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 4996 | + Globals.REPLACEONMAKE = false; |
---|
4713 | 4997 | // if (GrafreeD.clipboard == null) |
---|
4714 | 4998 | // return; |
---|
4715 | 4999 | boolean first = true; |
---|
.. | .. |
---|
4769 | 5053 | Grafreed.clipboard.get(0).parent = keepparent; |
---|
4770 | 5054 | } |
---|
4771 | 5055 | |
---|
| 5056 | + Globals.REPLACEONMAKE = keep; |
---|
4772 | 5057 | ResetModel(); |
---|
4773 | 5058 | refreshContents(); |
---|
4774 | 5059 | } |
---|
.. | .. |
---|
4904 | 5189 | |
---|
4905 | 5190 | void group(Object3D csg, boolean grab) |
---|
4906 | 5191 | { |
---|
| 5192 | + if (Globals.REPLACEONMAKE) |
---|
| 5193 | + Save(); |
---|
| 5194 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5195 | + Globals.REPLACEONMAKE = false; |
---|
4907 | 5196 | if (//false) // why?? |
---|
4908 | 5197 | !group.selection.isEmpty()) |
---|
4909 | 5198 | { |
---|
.. | .. |
---|
5017 | 5306 | //node.add(csg); |
---|
5018 | 5307 | //makeSomething(node); |
---|
5019 | 5308 | makeSomething(csg); |
---|
| 5309 | + Globals.REPLACEONMAKE = keep; |
---|
5020 | 5310 | } |
---|
5021 | 5311 | |
---|
5022 | 5312 | void Ungroup(Object3D g) |
---|
5023 | 5313 | { |
---|
| 5314 | + if (Globals.REPLACEONMAKE) |
---|
| 5315 | + Save(); |
---|
| 5316 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5317 | + Globals.REPLACEONMAKE = false; |
---|
5024 | 5318 | if (g instanceof HiddenObject) |
---|
5025 | 5319 | { |
---|
5026 | 5320 | HiddenObject h = (HiddenObject) g; |
---|
.. | .. |
---|
5037 | 5331 | objEditor.makeSomething(g.get(i), false); |
---|
5038 | 5332 | } |
---|
5039 | 5333 | } |
---|
| 5334 | + Globals.REPLACEONMAKE = keep; |
---|
5040 | 5335 | } |
---|
5041 | 5336 | |
---|
5042 | 5337 | void ungroup() |
---|
.. | .. |
---|
5325 | 5620 | cButton clearpanelButton; |
---|
5326 | 5621 | cButton unselectButton; |
---|
5327 | 5622 | |
---|
5328 | | - cButton minButton; |
---|
5329 | | - cButton maxButton; |
---|
5330 | | - cButton fullButton; |
---|
5331 | | - cButton undoButton; |
---|
5332 | | - cButton redoButton; |
---|
| 5623 | + cButton restoreCameraButton; |
---|
| 5624 | + |
---|
5333 | 5625 | cButton saveButton; |
---|
5334 | 5626 | cButton oneStepButton; |
---|
| 5627 | + |
---|
| 5628 | + cButton groupButton; |
---|
| 5629 | + cButton ungroupButton; |
---|
| 5630 | + cButton compositeButton; |
---|
| 5631 | + cButton switchButton; |
---|
| 5632 | + cButton loopButton; |
---|
| 5633 | + cButton textureButton; |
---|
| 5634 | + |
---|
| 5635 | + cButton gridButton; |
---|
| 5636 | + cButton boxButton; |
---|
| 5637 | + cButton sphereButton; |
---|
| 5638 | + cButton coneButton; |
---|
| 5639 | + cButton torusButton; |
---|
| 5640 | + cButton superButton; |
---|
| 5641 | + cButton kleinButton; |
---|
| 5642 | + cButton particlesButton; |
---|
| 5643 | + cButton overlayButton; |
---|
| 5644 | + cButton lightButton; |
---|
5335 | 5645 | |
---|
5336 | 5646 | cButton screenfitButton; |
---|
5337 | 5647 | cButton screenfitpointButton; |
---|
.. | .. |
---|
5353 | 5663 | //JTree jTree; |
---|
5354 | 5664 | private MenuItem lookAtItem; |
---|
5355 | 5665 | private MenuItem lookFromItem; |
---|
5356 | | - private MenuItem switchItem; |
---|
| 5666 | + private MenuItem switchViewItem; |
---|
5357 | 5667 | private MenuItem cutItem; |
---|
5358 | 5668 | private MenuItem undoItem; |
---|
5359 | 5669 | private MenuItem redoItem; |
---|
5360 | | - private MenuItem duplicateItem; |
---|
| 5670 | + private JMenuItem duplicateItem; |
---|
5361 | 5671 | private MenuItem cloneItem; |
---|
5362 | 5672 | private MenuItem cloneSupportItem; |
---|
5363 | 5673 | private MenuItem overwriteGeoItem; |
---|
.. | .. |
---|
5445 | 5755 | private MenuItem frontItem; |
---|
5446 | 5756 | private MenuItem cameraItem; |
---|
5447 | 5757 | private MenuItem compositeItem; |
---|
5448 | | - private MenuItem randomItem; |
---|
| 5758 | + private MenuItem switchItem; |
---|
5449 | 5759 | private MenuItem physicsItem; |
---|
5450 | 5760 | private MenuItem frameselectorItem; |
---|
5451 | 5761 | private MenuItem scriptNodeItem; |
---|
.. | .. |
---|
5519 | 5829 | |
---|
5520 | 5830 | Menu cameraMenu; |
---|
5521 | 5831 | MenuItem editCameraItem; |
---|
5522 | | - MenuItem revertCameraItem; |
---|
| 5832 | + MenuItem restoreCameraItem; |
---|
5523 | 5833 | } |
---|