.. | .. |
---|
84 | 84 | |
---|
85 | 85 | void CloneSelection(boolean supports) |
---|
86 | 86 | { |
---|
| 87 | + if (Globals.REPLACEONMAKE) |
---|
| 88 | + Save(); |
---|
| 89 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 90 | + Globals.REPLACEONMAKE = false; |
---|
87 | 91 | // Object3D keep = GrafreeD.clipboard; |
---|
88 | 92 | //Object3D obj; |
---|
89 | 93 | for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
94 | 98 | |
---|
95 | 99 | makeSomething(clone, i==group.selection.size()-1); |
---|
96 | 100 | } |
---|
| 101 | + Globals.REPLACEONMAKE = keep; |
---|
97 | 102 | } |
---|
98 | 103 | |
---|
99 | 104 | void CloneClipboard(boolean supports) |
---|
.. | .. |
---|
150 | 155 | |
---|
151 | 156 | void SetupMenu2(GroupEditor oe) |
---|
152 | 157 | { |
---|
| 158 | + oe.jTree = new cTree(); |
---|
| 159 | + |
---|
153 | 160 | Menu menu; |
---|
154 | 161 | oe.menuBar.add(menu = new Menu("Edit")); |
---|
155 | 162 | //editItem = menu.add(new MenuItem("Edit")); |
---|
.. | .. |
---|
160 | 167 | // redoItem = menu.add(new MenuItem("Redo")); |
---|
161 | 168 | // redoItem.addActionListener(this); |
---|
162 | 169 | // menu.add("-"); |
---|
163 | | - duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
| 170 | + duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); |
---|
164 | 171 | duplicateItem.addActionListener(this); |
---|
165 | 172 | cloneItem = menu.add(new MenuItem("Clone")); |
---|
166 | 173 | cloneItem.addActionListener(this); |
---|
.. | .. |
---|
202 | 209 | //zBufferItem.addActionListener(this); |
---|
203 | 210 | //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
204 | 211 | //normalLensItem.addActionListener(this); |
---|
205 | | - cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint")); |
---|
206 | | - revertCameraItem.addActionListener(this); |
---|
| 212 | + cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint")); |
---|
| 213 | + restoreCameraItem.addActionListener(this); |
---|
207 | 214 | |
---|
208 | | - cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
209 | | - toggleFullScreenItem.addItemListener(this); |
---|
210 | | - toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
211 | | - cameraMenu.add("-"); |
---|
| 215 | +// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 216 | +// toggleFullScreenItem.addItemListener(this); |
---|
| 217 | +// toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
| 218 | +// cameraMenu.add("-"); |
---|
| 219 | +// |
---|
| 220 | +// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
| 221 | +// toggleTextureItem.addItemListener(this); |
---|
| 222 | +// toggleTextureItem.setState(CameraPane.textureon); |
---|
| 223 | +// |
---|
| 224 | +// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 225 | +// toggleSwitchItem.addItemListener(this); |
---|
| 226 | +// toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
212 | 227 | |
---|
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")); |
---|
| 228 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles")); |
---|
222 | 229 | toggleHandleItem.addItemListener(this); |
---|
223 | 230 | toggleHandleItem.setState(CameraPane.HANDLES); |
---|
224 | 231 | |
---|
.. | .. |
---|
273 | 280 | { |
---|
274 | 281 | oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
275 | 282 | //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
276 | | - //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
| 283 | + //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); |
---|
277 | 284 | editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
278 | 285 | oe.cameraMenu.add("-"); |
---|
279 | 286 | openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
.. | .. |
---|
281 | 288 | editLeafItem.addActionListener(this); |
---|
282 | 289 | lookAtItem.addActionListener(this); |
---|
283 | 290 | //lookFromItem.addActinoListener(this); |
---|
284 | | - //switchItem.addActionListener(this); |
---|
| 291 | + //switchViewItem.addActionListener(this); |
---|
285 | 292 | } |
---|
286 | 293 | |
---|
287 | 294 | oe.menuBar.add(menu = new Menu("Setting")); |
---|
.. | .. |
---|
326 | 333 | } |
---|
327 | 334 | |
---|
328 | 335 | oe.menuBar.add(menu = new Menu("Group")); |
---|
329 | | - grabItem = menu.add(new MenuItem("Grab")); |
---|
330 | | - grabItem.addActionListener(this); |
---|
| 336 | +// grabItem = menu.add(new MenuItem("Grab")); |
---|
| 337 | +// grabItem.addActionListener(this); |
---|
331 | 338 | backItem = menu.add(new MenuItem("Back")); |
---|
332 | 339 | backItem.addActionListener(this); |
---|
333 | 340 | frontItem = menu.add(new MenuItem("Front")); |
---|
334 | 341 | frontItem.addActionListener(this); |
---|
335 | | - compositeItem = menu.add(new MenuItem("Composite")); |
---|
336 | | - compositeItem.addActionListener(this); |
---|
| 342 | +// compositeItem = menu.add(new MenuItem("Composite")); |
---|
| 343 | +// compositeItem.addActionListener(this); |
---|
| 344 | + |
---|
| 345 | + if (Globals.ADVANCED) |
---|
| 346 | + { |
---|
337 | 347 | hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
338 | 348 | hideItem.addActionListener(this); |
---|
| 349 | + } |
---|
339 | 350 | ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
340 | 351 | ungroupItem.addActionListener(this); |
---|
341 | | - menu.add("-"); |
---|
342 | | - randomItem = menu.add(new MenuItem("Switch node")); |
---|
343 | | - randomItem.addActionListener(this); |
---|
| 352 | + |
---|
| 353 | +// menu.add("-"); |
---|
| 354 | +// |
---|
| 355 | +// switchItem = menu.add(new MenuItem("Switch node")); |
---|
| 356 | +// switchItem.addActionListener(this); |
---|
| 357 | + if (Globals.ADVANCED) |
---|
| 358 | + { |
---|
344 | 359 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
345 | 360 | switchGeoItem.addActionListener(this); |
---|
346 | 361 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
.. | .. |
---|
348 | 363 | morphItem = menu.add(new MenuItem("Morph Group")); |
---|
349 | 364 | morphItem.addActionListener(this); |
---|
350 | 365 | |
---|
351 | | - if (Globals.ADVANCED) |
---|
352 | | - { |
---|
353 | 366 | menu.add("-"); |
---|
354 | 367 | physicsItem = menu.add(new MenuItem("Physics")); |
---|
355 | 368 | physicsItem.addActionListener(this); |
---|
.. | .. |
---|
357 | 370 | frameselectorItem.addActionListener(this); |
---|
358 | 371 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
359 | 372 | scriptNodeItem.addActionListener(this); |
---|
360 | | - cameraItem = menu.add(new MenuItem("Camera")); |
---|
361 | | - cameraItem.addActionListener(this); |
---|
362 | 373 | } |
---|
363 | 374 | |
---|
364 | 375 | oe.menuBar.add(menu = new Menu("Object")); |
---|
365 | | - textureItem = menu.add(new MenuItem("Texture")); |
---|
366 | | - textureItem.addActionListener(this); |
---|
| 376 | +// textureItem = menu.add(new MenuItem("Texture")); |
---|
| 377 | +// textureItem.addActionListener(this); |
---|
367 | 378 | billboardItem = menu.add(new MenuItem("Billboard")); |
---|
368 | 379 | billboardItem.addActionListener(this); |
---|
369 | 380 | csgItem = menu.add(new MenuItem("CSG")); |
---|
.. | .. |
---|
374 | 385 | shadowYItem.addActionListener(this); |
---|
375 | 386 | shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
376 | 387 | shadowZItem.addActionListener(this); |
---|
| 388 | + attributeItem = menu.add(new MenuItem("Attribute")); |
---|
| 389 | + attributeItem.addActionListener(this); |
---|
| 390 | + |
---|
377 | 391 | if (Globals.ADVANCED) |
---|
378 | 392 | { |
---|
379 | 393 | menu.add("-"); |
---|
380 | 394 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
381 | 395 | linkerItem.addActionListener(this); |
---|
382 | | - attributeItem = menu.add(new MenuItem("Attribute")); |
---|
383 | | - attributeItem.addActionListener(this); |
---|
384 | 396 | templateItem = menu.add(new MenuItem("Template")); |
---|
385 | 397 | templateItem.addActionListener(this); |
---|
386 | 398 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
.. | .. |
---|
532 | 544 | buildToolsMenu(menu); |
---|
533 | 545 | } |
---|
534 | 546 | |
---|
| 547 | + |
---|
535 | 548 | void SetupUI2(ObjEditor oe) |
---|
536 | 549 | { |
---|
537 | 550 | // June 2019 |
---|
.. | .. |
---|
574 | 587 | oe.radioPanel.add(dummyButton); |
---|
575 | 588 | oe.buttonGroup.add(dummyButton); |
---|
576 | 589 | */ |
---|
| 590 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 591 | + |
---|
| 592 | + copyOptionsPanel.preferredHeight = 1; |
---|
| 593 | + |
---|
577 | 594 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
578 | 595 | |
---|
579 | 596 | //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
580 | 597 | //minButton.setToolTipText("Minimize window"); |
---|
581 | 598 | //minButton.addActionListener(this); |
---|
582 | 599 | |
---|
583 | | - oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
584 | | - maxButton.setToolTipText("Maximize window"); |
---|
585 | | - maxButton.addActionListener(this); |
---|
| 600 | + if (Globals.ADVANCED) |
---|
| 601 | + { |
---|
| 602 | + oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 603 | + maxButton.setToolTipText("Maximize window"); |
---|
| 604 | + maxButton.addActionListener(this); |
---|
| 605 | + } |
---|
586 | 606 | |
---|
587 | 607 | oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
588 | 608 | fullButton.setToolTipText("Full-screen window"); |
---|
589 | 609 | fullButton.addActionListener(this); |
---|
590 | 610 | |
---|
591 | | - oe.toolbarPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
592 | | - undoButton.setToolTipText("Undo changes"); |
---|
593 | | - undoButton.addActionListener(this); |
---|
| 611 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 612 | + screenfitButton.setToolTipText("Screen fit"); |
---|
| 613 | + screenfitButton.addActionListener(this); |
---|
| 614 | + |
---|
| 615 | + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 616 | + restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
| 617 | + restoreCameraButton.addActionListener(this); |
---|
594 | 618 | |
---|
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"); |
---|
| 619 | + copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 620 | + saveButton.setToolTipText("New version"); |
---|
601 | 621 | saveButton.addActionListener(this); |
---|
| 622 | + |
---|
| 623 | + copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 624 | + undoButton.setToolTipText("Previous version"); |
---|
| 625 | + undoButton.addActionListener(this); |
---|
| 626 | + undoButton.setEnabled(false); |
---|
602 | 627 | |
---|
603 | | - oe.toolbarPanel.add(liveCB = GetCheckBox("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 628 | + cGridBag updown = new cGridBag().setVertical(true); |
---|
| 629 | + updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 630 | + restoreButton.setToolTipText("Restore current"); |
---|
| 631 | + restoreButton.addActionListener(this); |
---|
| 632 | + restoreButton.setEnabled(false); |
---|
| 633 | + |
---|
| 634 | + updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 635 | + replaceButton.setToolTipText("Replace current"); |
---|
| 636 | + replaceButton.addActionListener(this); |
---|
| 637 | + replaceButton.setEnabled(false); |
---|
| 638 | + |
---|
| 639 | + copyOptionsPanel.add(updown); |
---|
| 640 | + |
---|
| 641 | + copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 642 | + redoButton.setToolTipText("Next version"); |
---|
| 643 | + redoButton.addActionListener(this); |
---|
| 644 | + redoButton.setEnabled(false); |
---|
| 645 | + |
---|
| 646 | + oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
604 | 647 | liveCB.setToolTipText("Enable animation"); |
---|
605 | 648 | liveCB.addItemListener(this); |
---|
606 | 649 | |
---|
607 | | - oe.toolbarPanel.add(fastCB = GetCheckBox("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
608 | | - fastCB.setToolTipText("Fast mode"); |
---|
609 | | - fastCB.addItemListener(this); |
---|
610 | | - |
---|
611 | 650 | oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
612 | 651 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
613 | 652 | oneStepButton.addActionListener(this); |
---|
614 | 653 | |
---|
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); |
---|
| 654 | + oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
| 655 | + fastCB.setToolTipText("Fast mode"); |
---|
| 656 | + fastCB.addItemListener(this); |
---|
| 657 | + |
---|
| 658 | + //oe.toolboxPanel.Return(); |
---|
| 659 | + |
---|
| 660 | +// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 661 | +// trackCB.setToolTipText("Enable tracking"); |
---|
| 662 | +// trackCB.addItemListener(this); |
---|
622 | 663 | |
---|
623 | 664 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
624 | 665 | // screenfitpointButton.addActionListener(this); |
---|
.. | .. |
---|
630 | 671 | snapobjectButton.setToolTipText("Snap Object"); |
---|
631 | 672 | } |
---|
632 | 673 | |
---|
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)); |
---|
| 674 | + //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
638 | 675 | |
---|
639 | 676 | oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
640 | 677 | twoButton.setToolTipText("Show center view only"); |
---|
641 | 678 | twoButton.addActionListener(this); |
---|
| 679 | + this.fullscreenLayout = twoButton; |
---|
| 680 | + |
---|
642 | 681 | oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
643 | 682 | fourButton.addActionListener(this); |
---|
644 | 683 | fourButton.setToolTipText("Show left panel only"); |
---|
.. | .. |
---|
653 | 692 | sevenButton.addActionListener(this); |
---|
654 | 693 | // |
---|
655 | 694 | |
---|
656 | | - oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 695 | + oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
657 | 696 | rootButton.setToolTipText("Edit selection in new tab"); |
---|
658 | 697 | rootButton.addActionListener(this); |
---|
659 | 698 | |
---|
660 | | - oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 699 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
661 | 700 | closeButton.setToolTipText("Close tab"); |
---|
662 | 701 | closeButton.addActionListener(this); |
---|
663 | 702 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
664 | 703 | //clearButton.addActionListener(this); |
---|
665 | | - |
---|
666 | | - editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
667 | | - editButton.setToolTipText("Edit selection"); |
---|
| 704 | + |
---|
| 705 | + // INSERT |
---|
| 706 | + oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 707 | + gridButton.setToolTipText("Create grid"); |
---|
| 708 | + gridButton.addActionListener(this); |
---|
| 709 | + |
---|
| 710 | + oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 711 | + boxButton.setToolTipText("Create box"); |
---|
| 712 | + boxButton.addActionListener(this); |
---|
| 713 | + |
---|
| 714 | + oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 715 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 716 | + sphereButton.addActionListener(this); |
---|
| 717 | + |
---|
| 718 | + oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 719 | + coneButton.setToolTipText("Create cone"); |
---|
| 720 | + coneButton.addActionListener(this); |
---|
| 721 | + |
---|
| 722 | + oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 723 | + torusButton.setToolTipText("Create torus"); |
---|
| 724 | + torusButton.addActionListener(this); |
---|
| 725 | + |
---|
| 726 | + oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 727 | + superButton.setToolTipText("Create superellipsoid"); |
---|
| 728 | + superButton.addActionListener(this); |
---|
| 729 | + |
---|
| 730 | + if (Globals.ADVANCED) |
---|
| 731 | + { |
---|
| 732 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 733 | + kleinButton.setToolTipText("Create Klein bottle"); |
---|
| 734 | + kleinButton.addActionListener(this); |
---|
| 735 | + } |
---|
| 736 | + |
---|
| 737 | + oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 738 | + particlesButton.setToolTipText("Create particle system"); |
---|
| 739 | + particlesButton.addActionListener(this); |
---|
| 740 | + |
---|
| 741 | + oe.toolboxPanel.Return(); |
---|
| 742 | + |
---|
| 743 | + oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 744 | + groupButton.setToolTipText("Create group"); |
---|
| 745 | + groupButton.addActionListener(this); |
---|
| 746 | + |
---|
| 747 | + oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 748 | + compositeButton.setToolTipText("Create composite"); |
---|
| 749 | + compositeButton.addActionListener(this); |
---|
| 750 | + |
---|
| 751 | + oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 752 | + switchButton.setToolTipText("Create item switcher"); |
---|
| 753 | + switchButton.addActionListener(this); |
---|
| 754 | + |
---|
| 755 | + oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 756 | + loopButton.setToolTipText("Create loop"); |
---|
| 757 | + loopButton.addActionListener(this); |
---|
| 758 | + |
---|
| 759 | + oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 760 | + textureButton.setToolTipText("Create texture"); |
---|
| 761 | + textureButton.addActionListener(this); |
---|
| 762 | + |
---|
| 763 | + oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 764 | + overlayButton.setToolTipText("Create overlay"); |
---|
| 765 | + overlayButton.addActionListener(this); |
---|
| 766 | + |
---|
| 767 | + oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 768 | + lightButton.setToolTipText("Create light"); |
---|
| 769 | + lightButton.addActionListener(this); |
---|
| 770 | + |
---|
| 771 | + for (int i=6; --i>=0;) |
---|
| 772 | + { |
---|
| 773 | + oe.toolboxPanel.Return(); |
---|
| 774 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 775 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 776 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 777 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 778 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 779 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 780 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 781 | + } |
---|
| 782 | + |
---|
| 783 | + // EDIT panel |
---|
| 784 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 785 | + editButton.setToolTipText("Pin selection controls"); |
---|
668 | 786 | editButton.addActionListener(this); |
---|
669 | 787 | |
---|
670 | | - editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
671 | | - uneditButton.setToolTipText("Unedit selection"); |
---|
| 788 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 789 | + uneditButton.setToolTipText("Remove selection controls"); |
---|
672 | 790 | uneditButton.addActionListener(this); |
---|
673 | 791 | |
---|
674 | 792 | editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
675 | | - allParamsButton.setToolTipText("Edit all params"); |
---|
| 793 | + allParamsButton.setToolTipText("Show all controle"); |
---|
676 | 794 | allParamsButton.addActionListener(this); |
---|
677 | 795 | |
---|
678 | 796 | editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
.. | .. |
---|
683 | 801 | unselectButton.setToolTipText("Unselect"); |
---|
684 | 802 | unselectButton.addActionListener(this); |
---|
685 | 803 | |
---|
| 804 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 805 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
| 806 | + flashSelectionButton.addActionListener(this); |
---|
| 807 | + |
---|
686 | 808 | editCommandsPanel.preferredHeight = 1; |
---|
687 | 809 | |
---|
| 810 | + SetPinStates(false); |
---|
688 | 811 | // oe.treePanel.add(commandsPanel); |
---|
689 | 812 | // oe.treePanel.Return(); |
---|
690 | 813 | |
---|
.. | .. |
---|
703 | 826 | |
---|
704 | 827 | JScrollPane jSP; |
---|
705 | 828 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
706 | | - jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints); |
---|
| 829 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
707 | 830 | ResetModel(); |
---|
708 | 831 | |
---|
709 | 832 | oe.treePanel.add(jSPPanel); |
---|
710 | 833 | oe.treePanel.Return(); |
---|
711 | 834 | |
---|
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 | 835 | oe.treePanel.add(copyOptionsPanel); |
---|
728 | 836 | oe.treePanel.Return(); |
---|
| 837 | + cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 10, 0); |
---|
| 838 | + versionField = (cNumberSlider)sliderPane.getComponent(1); |
---|
| 839 | + sliderPane.preferredHeight = 1; |
---|
729 | 840 | |
---|
730 | 841 | // mainPanel.setDividerLocation(0.5); //1.0); |
---|
731 | 842 | // mainPanel.setResizeWeight(0.5); |
---|
.. | .. |
---|
754 | 865 | |
---|
755 | 866 | void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
756 | 867 | { |
---|
| 868 | + panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 869 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
| 870 | + colorCB.addItemListener(this); |
---|
| 871 | + |
---|
| 872 | + panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 873 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
| 874 | + materialCB.addItemListener(this); |
---|
| 875 | + |
---|
| 876 | + panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 877 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
| 878 | + textureCB.addItemListener(this); |
---|
| 879 | + |
---|
| 880 | + panel.Return(); |
---|
| 881 | + |
---|
757 | 882 | panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
758 | 883 | boxCB.setToolTipText("Display bounding boxes"); |
---|
759 | 884 | boxCB.addItemListener(this); |
---|
760 | 885 | |
---|
761 | 886 | panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
762 | | - zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 887 | + zoomBoxCB.setToolTipText("Display only for wheel"); |
---|
763 | 888 | zoomBoxCB.addItemListener(this); |
---|
764 | 889 | |
---|
765 | 890 | if (true) // Globals.ADVANCED) |
---|
766 | 891 | { |
---|
767 | | - panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
768 | | - supportCB.setToolTipText("Enable rigging"); |
---|
769 | | - supportCB.addItemListener(this); |
---|
| 892 | +// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 893 | +// supportCB.setToolTipText("Enable rigging"); |
---|
| 894 | +// supportCB.addItemListener(this); |
---|
| 895 | + |
---|
| 896 | + panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 897 | + freezeCB.setToolTipText("Fast moving camera"); |
---|
| 898 | + freezeCB.addItemListener(this); |
---|
770 | 899 | |
---|
771 | 900 | // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
772 | 901 | // localCB.addItemListener(this); |
---|
773 | 902 | |
---|
| 903 | + panel.Return(); |
---|
| 904 | + |
---|
774 | 905 | panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
775 | 906 | crowdCB.setToolTipText("Used for crowds"); |
---|
776 | 907 | crowdCB.addItemListener(this); |
---|
.. | .. |
---|
787 | 918 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
788 | 919 | // speakerMocapCB.addItemListener(this); |
---|
789 | 920 | |
---|
| 921 | + panel.Return(); |
---|
| 922 | + |
---|
790 | 923 | if (false) |
---|
791 | 924 | { |
---|
792 | 925 | // handled in scripts |
---|
.. | .. |
---|
801 | 934 | //constraints.gridy += 1; |
---|
802 | 935 | panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
803 | 936 | smoothfocusCB.addItemListener(this); |
---|
| 937 | + panel.Return(); |
---|
804 | 938 | } |
---|
805 | 939 | |
---|
806 | 940 | //constraints.gridx += 1; |
---|
807 | 941 | //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
808 | 942 | // debugCB.addItemListener(this); |
---|
809 | 943 | |
---|
| 944 | + panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 945 | + trackCB.setToolTipText("Enable tracking target"); |
---|
| 946 | + trackCB.addItemListener(this); |
---|
| 947 | + |
---|
810 | 948 | panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
811 | | - oeilCB.setToolTipText("Move camera when tracking target"); |
---|
| 949 | + oeilCB.setToolTipText("Move camera when tracking"); |
---|
812 | 950 | oeilCB.addItemListener(this); |
---|
813 | 951 | |
---|
814 | 952 | panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
815 | | - shadowCB.setToolTipText("Compute shadows when live"); |
---|
| 953 | + shadowCB.setToolTipText("When live compute shadows"); |
---|
816 | 954 | shadowCB.addItemListener(this); |
---|
817 | 955 | |
---|
818 | | - panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints); |
---|
819 | | - autosaveCB.setToolTipText("Auto-save on structure change"); |
---|
820 | | - autosaveCB.addItemListener(this); |
---|
| 956 | + panel.Return(); |
---|
| 957 | + panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints); |
---|
| 958 | + toggleTextureCB.setToolTipText("Load textures"); |
---|
| 959 | + toggleTextureCB.addItemListener(this); |
---|
| 960 | + |
---|
| 961 | + panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints); |
---|
| 962 | + toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
| 963 | + toggleSwitchCB.addItemListener(this); |
---|
| 964 | + |
---|
| 965 | + panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints); |
---|
| 966 | + autokeepCB.setToolTipText("On structure change"); |
---|
| 967 | + autokeepCB.addItemListener(this); |
---|
821 | 968 | |
---|
| 969 | + panel.Return(); |
---|
822 | 970 | if (Globals.ADVANCED) |
---|
823 | 971 | { |
---|
824 | 972 | panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
.. | .. |
---|
829 | 977 | } |
---|
830 | 978 | |
---|
831 | 979 | cGridBag fill = new cGridBag(); |
---|
832 | | - |
---|
833 | 980 | fill.preferredHeight = 200; |
---|
| 981 | + cGridBag fill2 = new cGridBag(); |
---|
| 982 | + fill2.preferredHeight = 200; |
---|
| 983 | + cGridBag fill3 = new cGridBag(); |
---|
| 984 | + fill3.preferredHeight = 200; |
---|
834 | 985 | |
---|
835 | 986 | panel.add(fill); |
---|
| 987 | + panel.add(fill2); |
---|
| 988 | + panel.add(fill3); |
---|
836 | 989 | |
---|
837 | 990 | } |
---|
838 | 991 | |
---|
.. | .. |
---|
840 | 993 | { |
---|
841 | 994 | cRadio radioButton = new cRadio(obj.name); |
---|
842 | 995 | |
---|
843 | | - // Patch to avoid bug with transparency. |
---|
| 996 | + // June 2019. Patch to avoid bug with transparency. |
---|
844 | 997 | radioButton.hadMaterial = obj.material != null; |
---|
845 | 998 | if (!radioButton.hadMaterial) |
---|
846 | 999 | { |
---|
.. | .. |
---|
868 | 1021 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
869 | 1022 | } |
---|
870 | 1023 | |
---|
871 | | - cCheckBox liveCB; |
---|
| 1024 | + cToggleButton liveCB; |
---|
872 | 1025 | cCheckBox supportCB; |
---|
873 | 1026 | cCheckBox localCB; |
---|
874 | 1027 | cCheckBox crowdCB; |
---|
875 | 1028 | cCheckBox smoothCB; |
---|
876 | | - cCheckBox fastCB; |
---|
| 1029 | + cToggleButton fastCB; |
---|
877 | 1030 | cCheckBox slowCB; |
---|
878 | 1031 | cCheckBox boxCB; |
---|
879 | 1032 | cCheckBox zoomBoxCB; |
---|
| 1033 | + cCheckBox freezeCB; |
---|
| 1034 | + //cToggleButton trackCB; |
---|
880 | 1035 | cCheckBox trackCB; |
---|
881 | 1036 | cCheckBox smoothfocusCB; |
---|
882 | 1037 | // JCheckBox speakerMocapCB; |
---|
.. | .. |
---|
886 | 1041 | |
---|
887 | 1042 | cCheckBox oeilCB; |
---|
888 | 1043 | cCheckBox shadowCB; |
---|
889 | | - cCheckBox autosaveCB; |
---|
| 1044 | + cCheckBox autokeepCB; |
---|
890 | 1045 | cCheckBox lookAtCB; |
---|
891 | 1046 | |
---|
892 | 1047 | // static int COLOR = 1; |
---|
.. | .. |
---|
994 | 1149 | { |
---|
995 | 1150 | Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
996 | 1151 | } |
---|
997 | | - else if(e.getSource() == autosaveCB) |
---|
| 1152 | + else if(e.getSource() == freezeCB) |
---|
998 | 1153 | { |
---|
999 | | - Globals.SAVEONMAKE ^= true; |
---|
| 1154 | + Globals.FREEZEONMOVE ^= true; |
---|
| 1155 | + } |
---|
| 1156 | + else if(e.getSource() == autokeepCB) |
---|
| 1157 | + { |
---|
| 1158 | + Globals.REPLACEONMAKE ^= true; |
---|
1000 | 1159 | } |
---|
1001 | 1160 | else if(e.getSource() == lookAtCB) |
---|
1002 | 1161 | { |
---|
.. | .. |
---|
1014 | 1173 | |
---|
1015 | 1174 | /**/ |
---|
1016 | 1175 | //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this); |
---|
1017 | | - TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1176 | + //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1177 | + TreePath path = objEditor.jTree.getSelectionPath(); |
---|
1018 | 1178 | if ((path == null) || (path.getPathCount() <= 1)) { |
---|
1019 | 1179 | // We can't move the root node or an empty selection |
---|
1020 | 1180 | return; |
---|
.. | .. |
---|
1077 | 1237 | } |
---|
1078 | 1238 | } |
---|
1079 | 1239 | |
---|
1080 | | - String string = (String) object; |
---|
1081 | | - |
---|
1082 | 1240 | System.out.println("Transfer = " + object + "; drop : " + target); |
---|
1083 | 1241 | // if( object instanceof java.io.File[]) |
---|
1084 | 1242 | // { |
---|
.. | .. |
---|
1086 | 1244 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
1087 | 1245 | // return; |
---|
1088 | 1246 | // } |
---|
| 1247 | + |
---|
| 1248 | + String string = object.toString(); |
---|
1089 | 1249 | |
---|
1090 | 1250 | // File path for Mac and Windows |
---|
1091 | 1251 | if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
.. | .. |
---|
1131 | 1291 | |
---|
1132 | 1292 | assert target == objEditor.jTree; |
---|
1133 | 1293 | TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y); |
---|
| 1294 | + Object3D destinationLeaf; |
---|
1134 | 1295 | try { |
---|
1135 | | - Object3D dummy = (Composite) destinationPath.getLastPathComponent(); |
---|
| 1296 | + destinationLeaf = (Composite) destinationPath.getLastPathComponent(); |
---|
1136 | 1297 | } catch (Exception e) { |
---|
1137 | 1298 | System.out.println("destinationPath : " + destinationPath); |
---|
1138 | 1299 | return; |
---|
1139 | 1300 | } |
---|
1140 | 1301 | |
---|
1141 | | - if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1302 | + for (int i=group.selection.size(); --i>=0;) |
---|
1142 | 1303 | { |
---|
| 1304 | + Object3D child = (Object3D)group.selection.elementAt(i); |
---|
| 1305 | + |
---|
| 1306 | + // Cannot move into itself |
---|
| 1307 | + if (child == destinationLeaf) |
---|
| 1308 | + return; |
---|
| 1309 | + } |
---|
| 1310 | + |
---|
| 1311 | +// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1312 | +// { |
---|
1143 | 1313 | loadClipboard(true); |
---|
1144 | 1314 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
1145 | 1315 | pasteInto(false, false); |
---|
1146 | | - } else { |
---|
1147 | | - loadClipboard(false); |
---|
1148 | | - objEditor.jTree.setSelectionPath(destinationPath); |
---|
1149 | | - pasteInto(false, false); // true); // ??? |
---|
1150 | | - } |
---|
| 1316 | +// } else { |
---|
| 1317 | +// loadClipboard(false); |
---|
| 1318 | +// objEditor.jTree.setSelectionPath(destinationPath); |
---|
| 1319 | +// pasteInto(false, false); // true); // ??? |
---|
| 1320 | +// } |
---|
1151 | 1321 | } |
---|
1152 | 1322 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
1153 | 1323 | // Called if the user has modified the current drop gesture |
---|
.. | .. |
---|
1252 | 1422 | { |
---|
1253 | 1423 | //heightFieldItem = menu.add(new MenuItem("Height Field")); |
---|
1254 | 1424 | //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); |
---|
| 1425 | +// gridItem = menu.add(new MenuItem("Grid")); |
---|
| 1426 | +// gridItem.addActionListener(this); |
---|
| 1427 | +// rectoidItem = menu.add(new MenuItem("Box")); |
---|
| 1428 | +// rectoidItem.addActionListener(this); |
---|
| 1429 | +// ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
| 1430 | +// ellipsoidItem.addActionListener(this); |
---|
| 1431 | +// coneItem = menu.add(new MenuItem("Cone")); |
---|
| 1432 | +// coneItem.addActionListener(this); |
---|
| 1433 | +// torusItem = menu.add(new MenuItem("Torus")); |
---|
| 1434 | +// torusItem.addActionListener(this); |
---|
| 1435 | +// superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
| 1436 | +// superItem.addActionListener(this); |
---|
| 1437 | + |
---|
| 1438 | + cameraItem = menu.add(new MenuItem("Camera")); |
---|
| 1439 | + cameraItem.addActionListener(this); |
---|
| 1440 | + |
---|
| 1441 | + if (!Globals.ADVANCED) |
---|
| 1442 | + { |
---|
1267 | 1443 | kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
1268 | 1444 | kleinItem.addActionListener(this); |
---|
1269 | | - particleItem = menu.add(new MenuItem("Particle system")); |
---|
1270 | | - particleItem.addActionListener(this); |
---|
| 1445 | + } |
---|
| 1446 | + |
---|
| 1447 | +// particleItem = menu.add(new MenuItem("Particle system")); |
---|
| 1448 | +// particleItem.addActionListener(this); |
---|
1271 | 1449 | if (Globals.ADVANCED) |
---|
1272 | 1450 | { |
---|
1273 | 1451 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
.. | .. |
---|
1293 | 1471 | } |
---|
1294 | 1472 | bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
1295 | 1473 | 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); |
---|
| 1474 | +// overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1475 | +// overlayItem.addActionListener(this); |
---|
| 1476 | +// lightItem = menu.add(new MenuItem("Light")); |
---|
| 1477 | +// lightItem.addActionListener(this); |
---|
1300 | 1478 | menu.add("-"); |
---|
1301 | 1479 | //superLoopItem = menu.add(new MenuItem("Super Loop")); |
---|
1302 | 1480 | //superLoopItem.addActionListener(this); |
---|
1303 | | - loopItem = menu.add(new MenuItem("Loop")); |
---|
1304 | | - loopItem.addActionListener(this); |
---|
| 1481 | +// loopItem = menu.add(new MenuItem("Loop")); |
---|
| 1482 | +// loopItem.addActionListener(this); |
---|
1305 | 1483 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1306 | 1484 | doubleItem.addActionListener(this); |
---|
1307 | 1485 | if (Globals.ADVANCED) |
---|
.. | .. |
---|
1317 | 1495 | animationItem.addItemListener(this); |
---|
1318 | 1496 | animationItem.setState(Globals.ANIMATION); |
---|
1319 | 1497 | |
---|
| 1498 | + menu.add(archiveItem = new MenuItem("Archive3D...")); |
---|
| 1499 | + archiveItem.addActionListener(this); |
---|
| 1500 | + |
---|
1320 | 1501 | menu.add("-"); |
---|
1321 | 1502 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1322 | 1503 | parseverticesItem.addActionListener(this); |
---|
.. | .. |
---|
1329 | 1510 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1330 | 1511 | reduce34MorphItem.addActionListener(this); |
---|
1331 | 1512 | menu.add("-"); |
---|
| 1513 | + menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
| 1514 | + memoryItem.addActionListener(this); |
---|
1332 | 1515 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1333 | 1516 | computeAOItem.addActionListener(this); |
---|
1334 | 1517 | |
---|
.. | .. |
---|
1337 | 1520 | mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1338 | 1521 | mirrorItem.addActionListener(this); |
---|
1339 | 1522 | menu.add("-"); |
---|
1340 | | - menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1341 | | - memoryItem.addActionListener(this); |
---|
1342 | 1523 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1343 | 1524 | analyzeItem.addActionListener(this); |
---|
1344 | 1525 | menu.add(dumpItem = new MenuItem("Print")); |
---|
.. | .. |
---|
1486 | 1667 | |
---|
1487 | 1668 | makeSomething(shadow); |
---|
1488 | 1669 | } |
---|
| 1670 | + |
---|
| 1671 | + private void ClearUnpinned() |
---|
| 1672 | + { |
---|
| 1673 | + //for (Object3D obj : listUI) |
---|
| 1674 | + for (int i=listUI.size(); --i>=0;) |
---|
| 1675 | + { |
---|
| 1676 | + Object3D obj = listUI.elementAt(i); |
---|
| 1677 | + if (!obj.pinned) |
---|
| 1678 | + { |
---|
| 1679 | + obj.CloseUI(); |
---|
| 1680 | + listUI.remove(i); |
---|
| 1681 | + } |
---|
| 1682 | + } |
---|
| 1683 | + } |
---|
1489 | 1684 | |
---|
1490 | 1685 | /** |
---|
1491 | 1686 | * applyExample |
---|
.. | .. |
---|
1730 | 1925 | { |
---|
1731 | 1926 | ScreenFit(); |
---|
1732 | 1927 | } else |
---|
1733 | | - if (source == switchItem) |
---|
| 1928 | + if (source == switchViewItem) |
---|
1734 | 1929 | { |
---|
1735 | 1930 | cVector v1 = new cVector(); |
---|
1736 | 1931 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1739 | 1934 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1740 | 1935 | objEditor.cameraView.repaint(); |
---|
1741 | 1936 | } else |
---|
1742 | | - if (source == rectoidItem) |
---|
| 1937 | + if (source == rectoidItem || source == boxButton) |
---|
1743 | 1938 | { |
---|
1744 | 1939 | makeSomething(new Box()); |
---|
1745 | 1940 | } else |
---|
1746 | | - if (source == particleItem) |
---|
| 1941 | + if (source == particleItem || source == particlesButton) |
---|
1747 | 1942 | { |
---|
1748 | 1943 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1749 | 1944 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1822 | 2017 | |
---|
1823 | 2018 | makeSomething(obj); |
---|
1824 | 2019 | } else |
---|
1825 | | - if (source == gridItem) |
---|
| 2020 | + if (source == gridItem || source == gridButton) |
---|
1826 | 2021 | { |
---|
1827 | 2022 | makeSomething(new Grid()); |
---|
1828 | 2023 | } else |
---|
1829 | | - if (source == ellipsoidItem) |
---|
| 2024 | + if (source == ellipsoidItem || source == sphereButton) |
---|
1830 | 2025 | { |
---|
1831 | 2026 | makeSomething(new Sphere()); |
---|
1832 | 2027 | } else |
---|
1833 | | - if (source == coneItem) |
---|
| 2028 | + if (source == coneItem || source == coneButton) |
---|
1834 | 2029 | { |
---|
1835 | 2030 | makeSomething(new Cone()); |
---|
1836 | 2031 | } else |
---|
1837 | | - if (source == torusItem) |
---|
| 2032 | + if (source == torusItem || source == torusButton) |
---|
1838 | 2033 | { |
---|
1839 | 2034 | makeSomething(new Torus()); |
---|
1840 | 2035 | } else |
---|
1841 | | - if (source == superItem) |
---|
| 2036 | + if (source == superItem || source == superButton) |
---|
1842 | 2037 | { |
---|
1843 | 2038 | makeSomething(new Superellipsoid()); |
---|
1844 | 2039 | } else |
---|
1845 | | - if (source == kleinItem) |
---|
| 2040 | + if (source == kleinItem || source == kleinButton) |
---|
1846 | 2041 | { |
---|
1847 | 2042 | makeSomething(new Klein()); |
---|
1848 | 2043 | } else |
---|
.. | .. |
---|
1862 | 2057 | { |
---|
1863 | 2058 | makeSomething(new BezierSurface()); |
---|
1864 | 2059 | } else |
---|
1865 | | - if (source == overlayItem) |
---|
| 2060 | + if (source == overlayItem || source == overlayButton) |
---|
1866 | 2061 | { |
---|
1867 | 2062 | /* |
---|
1868 | 2063 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1910 | 2105 | s.setup(); |
---|
1911 | 2106 | makeSomething(s); |
---|
1912 | 2107 | } else |
---|
1913 | | - if (source == lightItem) |
---|
| 2108 | + if (source == lightItem || source == lightButton) |
---|
1914 | 2109 | { |
---|
1915 | 2110 | makeSomething(new Light()); |
---|
1916 | 2111 | } else |
---|
.. | .. |
---|
1960 | 2155 | |
---|
1961 | 2156 | group(g); |
---|
1962 | 2157 | } else |
---|
1963 | | - if (source == loopItem) |
---|
| 2158 | + if (source == loopItem || source == loopButton) |
---|
1964 | 2159 | { |
---|
1965 | 2160 | Composite csg = new GroupLeaf(); |
---|
1966 | 2161 | csg.count = 5; |
---|
1967 | 2162 | group(csg); |
---|
1968 | | - Composite child = new cGroup(); |
---|
| 2163 | + Composite child = new cGroup("Branch"); |
---|
1969 | 2164 | csg.addChild(child); |
---|
1970 | 2165 | child.addChild(csg); |
---|
1971 | 2166 | } else |
---|
1972 | 2167 | if (source == doubleItem) |
---|
1973 | 2168 | { |
---|
1974 | | - Composite csg = new GroupLeaf(); |
---|
| 2169 | + Composite csg = new GroupLeaf("Fork"); |
---|
1975 | 2170 | csg.count = 5; |
---|
1976 | 2171 | group(csg); |
---|
1977 | | - Composite child = new cGroup(); |
---|
| 2172 | + Composite child = new cGroup("Branch A"); |
---|
1978 | 2173 | csg.addChild(child); |
---|
1979 | 2174 | child.addChild(csg); |
---|
1980 | | - child = new cGroup(); |
---|
| 2175 | + child = new cGroup("Branch B"); |
---|
1981 | 2176 | csg.addChild(child); |
---|
1982 | 2177 | child.addChild(csg); |
---|
1983 | 2178 | } else |
---|
1984 | 2179 | if (source == tripleItem) |
---|
1985 | 2180 | { |
---|
1986 | | - Composite csg = new GroupLeaf(); |
---|
| 2181 | + Composite csg = new GroupLeaf("Trident"); |
---|
1987 | 2182 | csg.count = 4; |
---|
1988 | 2183 | group(csg); |
---|
1989 | 2184 | Composite child = new cGroup(); |
---|
.. | .. |
---|
2047 | 2242 | } else |
---|
2048 | 2243 | if (source == undoButton) |
---|
2049 | 2244 | { |
---|
| 2245 | + // Go to previous version |
---|
| 2246 | + //if (!Undo()) |
---|
| 2247 | + //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
2050 | 2248 | Undo(); |
---|
| 2249 | + } else |
---|
| 2250 | + if (source == restoreButton) |
---|
| 2251 | + { |
---|
| 2252 | + // Restore current version |
---|
| 2253 | + Restore(); |
---|
| 2254 | + } else |
---|
| 2255 | + if (source == replaceButton) |
---|
| 2256 | + { |
---|
| 2257 | + // Overwrite current version |
---|
| 2258 | + Replace(); |
---|
2051 | 2259 | } else |
---|
2052 | 2260 | if (source == redoButton) |
---|
2053 | 2261 | { |
---|
| 2262 | + // Go to next version |
---|
2054 | 2263 | Redo(); |
---|
2055 | 2264 | } else |
---|
2056 | 2265 | if (source == saveButton) |
---|
2057 | 2266 | { |
---|
2058 | | - Save(); |
---|
| 2267 | + // Save a new version |
---|
| 2268 | + if (!Save(true)) |
---|
| 2269 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
2059 | 2270 | } else |
---|
2060 | 2271 | if (source == oneStepButton) |
---|
2061 | 2272 | { |
---|
.. | .. |
---|
2064 | 2275 | } else |
---|
2065 | 2276 | if (source == screenfitButton) |
---|
2066 | 2277 | { |
---|
2067 | | - //Reload(lastConverter, lastFilename, true); |
---|
2068 | 2278 | ScreenFit(); |
---|
2069 | 2279 | } else |
---|
2070 | 2280 | if (source == screenfitpointButton) |
---|
2071 | 2281 | { |
---|
2072 | | - //Reload(lastConverter, lastFilename, true); |
---|
2073 | 2282 | ScreenFitPoint(); |
---|
2074 | 2283 | } else |
---|
2075 | 2284 | if (source == snapobjectButton) |
---|
2076 | 2285 | { |
---|
2077 | | - //Reload(lastConverter, lastFilename, true); |
---|
2078 | 2286 | SnapObject(); |
---|
2079 | 2287 | } else |
---|
2080 | 2288 | // if (event.getSource() == recompileButton) |
---|
.. | .. |
---|
2450 | 2658 | { |
---|
2451 | 2659 | ClearSelection(true); |
---|
2452 | 2660 | } else |
---|
2453 | | - if (source == grabItem) |
---|
| 2661 | + if (source == grabItem || source == groupButton) |
---|
2454 | 2662 | { |
---|
2455 | | - group(new cGroup(), true); |
---|
| 2663 | + group(new cGroup(), false); // true); |
---|
2456 | 2664 | } else |
---|
2457 | 2665 | if (source == hideItem) |
---|
2458 | 2666 | { |
---|
.. | .. |
---|
2470 | 2678 | { |
---|
2471 | 2679 | makeSomething(new Camera()); |
---|
2472 | 2680 | } else |
---|
2473 | | - if (source == compositeItem) |
---|
| 2681 | + if (source == compositeItem || source == compositeButton) |
---|
2474 | 2682 | { |
---|
2475 | 2683 | group(new Composite()); |
---|
2476 | 2684 | } else |
---|
2477 | | - if (source == randomItem) |
---|
| 2685 | + if (source == switchItem || source == switchButton) |
---|
2478 | 2686 | { |
---|
2479 | 2687 | RandomNode random = new RandomNode(); |
---|
2480 | 2688 | group(random); |
---|
.. | .. |
---|
2576 | 2784 | { |
---|
2577 | 2785 | group(new cLinker()); |
---|
2578 | 2786 | } else |
---|
2579 | | - if (source == textureItem) |
---|
| 2787 | + if (source == textureItem || source == textureButton) |
---|
2580 | 2788 | { |
---|
2581 | 2789 | group(new TextureNode()); |
---|
2582 | 2790 | } else |
---|
.. | .. |
---|
2596 | 2804 | { |
---|
2597 | 2805 | CastShadow(2); |
---|
2598 | 2806 | } else |
---|
2599 | | - if (source == ungroupItem) |
---|
| 2807 | + if (source == ungroupItem || source == ungroupButton) |
---|
2600 | 2808 | { |
---|
2601 | | - //ungroup(); |
---|
| 2809 | + boolean hasRoot = false; |
---|
| 2810 | + |
---|
2602 | 2811 | for (int i=0; i<group.selection.size(); i++) |
---|
2603 | 2812 | { |
---|
2604 | | - Ungroup(group.selection.get(i)); |
---|
| 2813 | + if (group.selection.get(i) == group) |
---|
| 2814 | + { |
---|
| 2815 | + hasRoot = true; |
---|
| 2816 | + break; |
---|
| 2817 | + } |
---|
2605 | 2818 | } |
---|
2606 | 2819 | |
---|
2607 | | - ClearSelection(false); |
---|
2608 | | - |
---|
2609 | | - refreshContents(); |
---|
| 2820 | + if (!hasRoot) |
---|
| 2821 | + { |
---|
| 2822 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 2823 | + { |
---|
| 2824 | + Ungroup(group.selection.get(i)); |
---|
| 2825 | + } |
---|
| 2826 | + |
---|
| 2827 | + ClearSelection(false); |
---|
| 2828 | + |
---|
| 2829 | + refreshContents(); |
---|
| 2830 | + } |
---|
2610 | 2831 | } else |
---|
2611 | 2832 | if (source == genUVItem) |
---|
2612 | 2833 | { |
---|
.. | .. |
---|
2934 | 3155 | if (source == twoButton) |
---|
2935 | 3156 | { |
---|
2936 | 3157 | radio.layout = twoButton; |
---|
| 3158 | + |
---|
| 3159 | + if (CameraPane.FULLSCREEN) |
---|
| 3160 | + fullscreenLayout = radio.layout; |
---|
| 3161 | + |
---|
2937 | 3162 | // bug |
---|
2938 | 3163 | //gridPanel.setDividerLocation(1.0); |
---|
2939 | 3164 | //bigPanel.setDividerLocation(0.0); |
---|
.. | .. |
---|
2989 | 3214 | { |
---|
2990 | 3215 | radio.layout = threeButton; |
---|
2991 | 3216 | |
---|
| 3217 | + if (CameraPane.FULLSCREEN) |
---|
| 3218 | + fullscreenLayout = radio.layout; |
---|
| 3219 | + |
---|
2992 | 3220 | // bigThree.remove(scenePanel); |
---|
2993 | 3221 | // bigThree.remove(centralPanel); |
---|
2994 | 3222 | // bigThree.remove(XYZPanel); |
---|
.. | .. |
---|
3027 | 3255 | { |
---|
3028 | 3256 | radio.layout = fourButton; |
---|
3029 | 3257 | |
---|
| 3258 | + if (CameraPane.FULLSCREEN) |
---|
| 3259 | + fullscreenLayout = radio.layout; |
---|
| 3260 | + |
---|
3030 | 3261 | // bigThree.remove(scenePanel); |
---|
3031 | 3262 | // bigThree.remove(centralPanel); |
---|
3032 | 3263 | // bigThree.remove(XYZPanel); |
---|
.. | .. |
---|
3063 | 3294 | if (source == sixButton) |
---|
3064 | 3295 | { |
---|
3065 | 3296 | radio.layout = sixButton; |
---|
| 3297 | + |
---|
| 3298 | + if (CameraPane.FULLSCREEN) |
---|
| 3299 | + fullscreenLayout = radio.layout; |
---|
3066 | 3300 | |
---|
3067 | 3301 | // bigThree.remove(scenePanel); |
---|
3068 | 3302 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
3101 | 3335 | if (source == sevenButton) |
---|
3102 | 3336 | { |
---|
3103 | 3337 | radio.layout = sevenButton; |
---|
| 3338 | + |
---|
| 3339 | + if (CameraPane.FULLSCREEN) |
---|
| 3340 | + fullscreenLayout = radio.layout; |
---|
3104 | 3341 | |
---|
3105 | 3342 | // bigThree.remove(scenePanel); |
---|
3106 | 3343 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
3182 | 3419 | } else |
---|
3183 | 3420 | if (source == editItem || source == editButton) |
---|
3184 | 3421 | { |
---|
| 3422 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3423 | + { |
---|
| 3424 | + Object3D child = (Object3D)e.nextElement(); |
---|
| 3425 | + child.pinned = true; |
---|
| 3426 | + } |
---|
| 3427 | + |
---|
3185 | 3428 | EditSelection(false); |
---|
3186 | 3429 | } else |
---|
3187 | 3430 | if (source == uneditButton) |
---|
.. | .. |
---|
3191 | 3434 | Object3D child = (Object3D)e.nextElement(); |
---|
3192 | 3435 | if(child.editWindow != null) |
---|
3193 | 3436 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3437 | + child.pinned = false; |
---|
3194 | 3438 | child.CloseUI(); |
---|
3195 | 3439 | listUI.remove(child); |
---|
3196 | 3440 | |
---|
.. | .. |
---|
3207 | 3451 | //copy.ClearUI(); |
---|
3208 | 3452 | for (Object3D obj : listUI) |
---|
3209 | 3453 | { |
---|
| 3454 | + obj.pinned = false; |
---|
3210 | 3455 | obj.CloseUI(); |
---|
3211 | 3456 | } |
---|
3212 | 3457 | listUI.clear(); |
---|
.. | .. |
---|
3216 | 3461 | { |
---|
3217 | 3462 | assert(copy == group); |
---|
3218 | 3463 | |
---|
3219 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3464 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3220 | 3465 | |
---|
3221 | 3466 | for (Object3D obj : listUI) |
---|
3222 | 3467 | { |
---|
.. | .. |
---|
3265 | 3510 | } |
---|
3266 | 3511 | |
---|
3267 | 3512 | copy = group; |
---|
| 3513 | + |
---|
| 3514 | + SetUndoStates(); |
---|
| 3515 | + |
---|
3268 | 3516 | //Globals.theRenderer.object = group; |
---|
3269 | 3517 | if(!useclient) |
---|
3270 | 3518 | { |
---|
.. | .. |
---|
3291 | 3539 | currentLayout = sevenButton; |
---|
3292 | 3540 | */ |
---|
3293 | 3541 | radio.layout.doClick(); |
---|
| 3542 | + |
---|
| 3543 | + ClearUnpinned(); |
---|
| 3544 | + SetPinStates(group.selection.size() > 0); |
---|
| 3545 | + if (group.selection.size() == 1) |
---|
| 3546 | + EditSelection(false); |
---|
3294 | 3547 | keepparent = group.parent; |
---|
3295 | 3548 | // PARENT = NULL or not??? |
---|
3296 | 3549 | //group.parent = null; // ROOT |
---|
.. | .. |
---|
3304 | 3557 | cameraView.ProtectCamera(); |
---|
3305 | 3558 | cameraView.repaint(); |
---|
3306 | 3559 | return; |
---|
3307 | | - } else if (event.getSource() == revertCameraItem) |
---|
| 3560 | + } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton) |
---|
3308 | 3561 | { |
---|
3309 | 3562 | cameraView.RevertCamera(); |
---|
3310 | 3563 | cameraView.repaint(); |
---|
.. | .. |
---|
4358 | 4611 | // } |
---|
4359 | 4612 | // } |
---|
4360 | 4613 | |
---|
4361 | | - static boolean allparams = true; |
---|
4362 | | - |
---|
4363 | | - static Vector<Object3D> listUI = new Vector<Object3D>(); |
---|
4364 | | - |
---|
4365 | 4614 | void EditSelection(boolean newWindow) |
---|
4366 | 4615 | { |
---|
4367 | 4616 | // aConstraints.gridy = 0; |
---|
.. | .. |
---|
4369 | 4618 | { |
---|
4370 | 4619 | //System.out.println("edit : " + objectPanel.indexOfTab("Material")); |
---|
4371 | 4620 | //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false); |
---|
4372 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 4621 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
4373 | 4622 | |
---|
4374 | 4623 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4375 | 4624 | if(elem != group || !newWindow) |
---|
.. | .. |
---|
4454 | 4703 | //new Exception().printStackTrace(); |
---|
4455 | 4704 | |
---|
4456 | 4705 | freezemodel = true; |
---|
4457 | | - |
---|
| 4706 | + ClearUnpinned(); |
---|
| 4707 | + |
---|
4458 | 4708 | /**/ |
---|
4459 | 4709 | //switch (event.id) |
---|
4460 | 4710 | { |
---|
.. | .. |
---|
4487 | 4737 | if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4488 | 4738 | // a camera |
---|
4489 | 4739 | { |
---|
4490 | | - if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 4740 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
4491 | 4741 | { |
---|
4492 | 4742 | CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4493 | 4743 | Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
.. | .. |
---|
4496 | 4746 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4497 | 4747 | } |
---|
4498 | 4748 | |
---|
| 4749 | + if (tps != null && tps.length == 1) |
---|
| 4750 | + { |
---|
| 4751 | + EditSelection(false); |
---|
| 4752 | + } |
---|
| 4753 | + |
---|
| 4754 | + SetPinStates(tps != null && tps.length > 0); |
---|
| 4755 | + |
---|
4499 | 4756 | refreshContents(); |
---|
4500 | 4757 | //return true; |
---|
4501 | 4758 | } |
---|
.. | .. |
---|
4505 | 4762 | freezemodel = false; |
---|
4506 | 4763 | } |
---|
4507 | 4764 | |
---|
| 4765 | + void SetPinStates(boolean enabled) |
---|
| 4766 | + { |
---|
| 4767 | + editButton.setEnabled(enabled); |
---|
| 4768 | + uneditButton.setEnabled(enabled); |
---|
| 4769 | + unselectButton.setEnabled(enabled); |
---|
| 4770 | + flashSelectionButton.setEnabled(enabled); |
---|
| 4771 | + } |
---|
| 4772 | + |
---|
4508 | 4773 | void refreshContents(boolean cp) |
---|
4509 | 4774 | { |
---|
4510 | | - if (!Globals.MOUSEDRAGGED) |
---|
| 4775 | + if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info")) |
---|
| 4776 | + if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
4511 | 4777 | { |
---|
4512 | 4778 | objEditor.ClearInfo(); // .GetMaterial()); |
---|
4513 | 4779 | |
---|
.. | .. |
---|
4606 | 4872 | |
---|
4607 | 4873 | if (cut) |
---|
4608 | 4874 | { |
---|
4609 | | - if (Globals.SAVEONMAKE) |
---|
4610 | | - Save(); |
---|
| 4875 | +// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save. |
---|
| 4876 | +// Save(); |
---|
4611 | 4877 | //int indices[] = jList.getSelectedIndices(); |
---|
4612 | 4878 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4613 | 4879 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4710 | 4976 | |
---|
4711 | 4977 | void paste(boolean expand) |
---|
4712 | 4978 | { |
---|
| 4979 | + if (Globals.REPLACEONMAKE) |
---|
| 4980 | + Save(); |
---|
| 4981 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 4982 | + Globals.REPLACEONMAKE = false; |
---|
4713 | 4983 | // if (GrafreeD.clipboard == null) |
---|
4714 | 4984 | // return; |
---|
4715 | 4985 | boolean first = true; |
---|
.. | .. |
---|
4769 | 5039 | Grafreed.clipboard.get(0).parent = keepparent; |
---|
4770 | 5040 | } |
---|
4771 | 5041 | |
---|
| 5042 | + Globals.REPLACEONMAKE = keep; |
---|
4772 | 5043 | ResetModel(); |
---|
4773 | 5044 | refreshContents(); |
---|
4774 | 5045 | } |
---|
.. | .. |
---|
4904 | 5175 | |
---|
4905 | 5176 | void group(Object3D csg, boolean grab) |
---|
4906 | 5177 | { |
---|
| 5178 | + if (Globals.REPLACEONMAKE) |
---|
| 5179 | + Save(); |
---|
| 5180 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5181 | + Globals.REPLACEONMAKE = false; |
---|
4907 | 5182 | if (//false) // why?? |
---|
4908 | 5183 | !group.selection.isEmpty()) |
---|
4909 | 5184 | { |
---|
.. | .. |
---|
5017 | 5292 | //node.add(csg); |
---|
5018 | 5293 | //makeSomething(node); |
---|
5019 | 5294 | makeSomething(csg); |
---|
| 5295 | + Globals.REPLACEONMAKE = keep; |
---|
5020 | 5296 | } |
---|
5021 | 5297 | |
---|
5022 | 5298 | void Ungroup(Object3D g) |
---|
5023 | 5299 | { |
---|
| 5300 | + if (Globals.REPLACEONMAKE) |
---|
| 5301 | + Save(); |
---|
| 5302 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5303 | + Globals.REPLACEONMAKE = false; |
---|
5024 | 5304 | if (g instanceof HiddenObject) |
---|
5025 | 5305 | { |
---|
5026 | 5306 | HiddenObject h = (HiddenObject) g; |
---|
.. | .. |
---|
5037 | 5317 | objEditor.makeSomething(g.get(i), false); |
---|
5038 | 5318 | } |
---|
5039 | 5319 | } |
---|
| 5320 | + Globals.REPLACEONMAKE = keep; |
---|
5040 | 5321 | } |
---|
5041 | 5322 | |
---|
5042 | 5323 | void ungroup() |
---|
.. | .. |
---|
5325 | 5606 | cButton clearpanelButton; |
---|
5326 | 5607 | cButton unselectButton; |
---|
5327 | 5608 | |
---|
5328 | | - cButton minButton; |
---|
5329 | | - cButton maxButton; |
---|
5330 | | - cButton fullButton; |
---|
5331 | | - cButton undoButton; |
---|
5332 | | - cButton redoButton; |
---|
| 5609 | + cButton restoreCameraButton; |
---|
| 5610 | + |
---|
5333 | 5611 | cButton saveButton; |
---|
5334 | 5612 | cButton oneStepButton; |
---|
| 5613 | + |
---|
| 5614 | + cButton groupButton; |
---|
| 5615 | + cButton ungroupButton; |
---|
| 5616 | + cButton compositeButton; |
---|
| 5617 | + cButton switchButton; |
---|
| 5618 | + cButton loopButton; |
---|
| 5619 | + cButton textureButton; |
---|
| 5620 | + |
---|
| 5621 | + cButton gridButton; |
---|
| 5622 | + cButton boxButton; |
---|
| 5623 | + cButton sphereButton; |
---|
| 5624 | + cButton coneButton; |
---|
| 5625 | + cButton torusButton; |
---|
| 5626 | + cButton superButton; |
---|
| 5627 | + cButton kleinButton; |
---|
| 5628 | + cButton particlesButton; |
---|
| 5629 | + cButton overlayButton; |
---|
| 5630 | + cButton lightButton; |
---|
5335 | 5631 | |
---|
5336 | 5632 | cButton screenfitButton; |
---|
5337 | 5633 | cButton screenfitpointButton; |
---|
.. | .. |
---|
5353 | 5649 | //JTree jTree; |
---|
5354 | 5650 | private MenuItem lookAtItem; |
---|
5355 | 5651 | private MenuItem lookFromItem; |
---|
5356 | | - private MenuItem switchItem; |
---|
| 5652 | + private MenuItem switchViewItem; |
---|
5357 | 5653 | private MenuItem cutItem; |
---|
5358 | 5654 | private MenuItem undoItem; |
---|
5359 | 5655 | private MenuItem redoItem; |
---|
5360 | | - private MenuItem duplicateItem; |
---|
| 5656 | + private JMenuItem duplicateItem; |
---|
5361 | 5657 | private MenuItem cloneItem; |
---|
5362 | 5658 | private MenuItem cloneSupportItem; |
---|
5363 | 5659 | private MenuItem overwriteGeoItem; |
---|
.. | .. |
---|
5445 | 5741 | private MenuItem frontItem; |
---|
5446 | 5742 | private MenuItem cameraItem; |
---|
5447 | 5743 | private MenuItem compositeItem; |
---|
5448 | | - private MenuItem randomItem; |
---|
| 5744 | + private MenuItem switchItem; |
---|
5449 | 5745 | private MenuItem physicsItem; |
---|
5450 | 5746 | private MenuItem frameselectorItem; |
---|
5451 | 5747 | private MenuItem scriptNodeItem; |
---|
.. | .. |
---|
5519 | 5815 | |
---|
5520 | 5816 | Menu cameraMenu; |
---|
5521 | 5817 | MenuItem editCameraItem; |
---|
5522 | | - MenuItem revertCameraItem; |
---|
| 5818 | + MenuItem restoreCameraItem; |
---|
5523 | 5819 | } |
---|