.. | .. |
---|
150 | 150 | |
---|
151 | 151 | void SetupMenu2(GroupEditor oe) |
---|
152 | 152 | { |
---|
| 153 | + oe.jTree = new cTree(); |
---|
| 154 | + |
---|
153 | 155 | Menu menu; |
---|
154 | 156 | oe.menuBar.add(menu = new Menu("Edit")); |
---|
155 | 157 | //editItem = menu.add(new MenuItem("Edit")); |
---|
.. | .. |
---|
160 | 162 | // redoItem = menu.add(new MenuItem("Redo")); |
---|
161 | 163 | // redoItem.addActionListener(this); |
---|
162 | 164 | // menu.add("-"); |
---|
163 | | - duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
| 165 | + duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); |
---|
164 | 166 | duplicateItem.addActionListener(this); |
---|
165 | 167 | cloneItem = menu.add(new MenuItem("Clone")); |
---|
166 | 168 | cloneItem.addActionListener(this); |
---|
.. | .. |
---|
202 | 204 | //zBufferItem.addActionListener(this); |
---|
203 | 205 | //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
204 | 206 | //normalLensItem.addActionListener(this); |
---|
205 | | - cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint")); |
---|
206 | | - revertCameraItem.addActionListener(this); |
---|
| 207 | + cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint")); |
---|
| 208 | + restoreCameraItem.addActionListener(this); |
---|
207 | 209 | |
---|
208 | | - cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
209 | | - toggleFullScreenItem.addItemListener(this); |
---|
210 | | - toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
211 | | - cameraMenu.add("-"); |
---|
| 210 | +// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 211 | +// toggleFullScreenItem.addItemListener(this); |
---|
| 212 | +// toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
| 213 | +// cameraMenu.add("-"); |
---|
| 214 | +// |
---|
| 215 | +// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
| 216 | +// toggleTextureItem.addItemListener(this); |
---|
| 217 | +// toggleTextureItem.setState(CameraPane.textureon); |
---|
| 218 | +// |
---|
| 219 | +// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 220 | +// toggleSwitchItem.addItemListener(this); |
---|
| 221 | +// toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
212 | 222 | |
---|
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")); |
---|
| 223 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles")); |
---|
222 | 224 | toggleHandleItem.addItemListener(this); |
---|
223 | 225 | toggleHandleItem.setState(CameraPane.HANDLES); |
---|
224 | 226 | |
---|
.. | .. |
---|
273 | 275 | { |
---|
274 | 276 | oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
275 | 277 | //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
276 | | - //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
| 278 | + //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); |
---|
277 | 279 | editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
278 | 280 | oe.cameraMenu.add("-"); |
---|
279 | 281 | openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
.. | .. |
---|
281 | 283 | editLeafItem.addActionListener(this); |
---|
282 | 284 | lookAtItem.addActionListener(this); |
---|
283 | 285 | //lookFromItem.addActinoListener(this); |
---|
284 | | - //switchItem.addActionListener(this); |
---|
| 286 | + //switchViewItem.addActionListener(this); |
---|
285 | 287 | } |
---|
286 | 288 | |
---|
287 | 289 | oe.menuBar.add(menu = new Menu("Setting")); |
---|
.. | .. |
---|
326 | 328 | } |
---|
327 | 329 | |
---|
328 | 330 | oe.menuBar.add(menu = new Menu("Group")); |
---|
329 | | - grabItem = menu.add(new MenuItem("Grab")); |
---|
330 | | - grabItem.addActionListener(this); |
---|
| 331 | +// grabItem = menu.add(new MenuItem("Grab")); |
---|
| 332 | +// grabItem.addActionListener(this); |
---|
331 | 333 | backItem = menu.add(new MenuItem("Back")); |
---|
332 | 334 | backItem.addActionListener(this); |
---|
333 | 335 | frontItem = menu.add(new MenuItem("Front")); |
---|
334 | 336 | frontItem.addActionListener(this); |
---|
335 | | - compositeItem = menu.add(new MenuItem("Composite")); |
---|
336 | | - compositeItem.addActionListener(this); |
---|
| 337 | +// compositeItem = menu.add(new MenuItem("Composite")); |
---|
| 338 | +// compositeItem.addActionListener(this); |
---|
| 339 | + |
---|
| 340 | + if (Globals.ADVANCED) |
---|
| 341 | + { |
---|
337 | 342 | hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
338 | 343 | hideItem.addActionListener(this); |
---|
| 344 | + } |
---|
339 | 345 | ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
340 | 346 | ungroupItem.addActionListener(this); |
---|
341 | | - menu.add("-"); |
---|
342 | | - randomItem = menu.add(new MenuItem("Switch node")); |
---|
343 | | - randomItem.addActionListener(this); |
---|
| 347 | + |
---|
| 348 | +// menu.add("-"); |
---|
| 349 | +// |
---|
| 350 | +// switchItem = menu.add(new MenuItem("Switch node")); |
---|
| 351 | +// switchItem.addActionListener(this); |
---|
| 352 | + if (Globals.ADVANCED) |
---|
| 353 | + { |
---|
344 | 354 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
345 | 355 | switchGeoItem.addActionListener(this); |
---|
346 | 356 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
.. | .. |
---|
348 | 358 | morphItem = menu.add(new MenuItem("Morph Group")); |
---|
349 | 359 | morphItem.addActionListener(this); |
---|
350 | 360 | |
---|
351 | | - if (Globals.ADVANCED) |
---|
352 | | - { |
---|
353 | 361 | menu.add("-"); |
---|
354 | 362 | physicsItem = menu.add(new MenuItem("Physics")); |
---|
355 | 363 | physicsItem.addActionListener(this); |
---|
.. | .. |
---|
357 | 365 | frameselectorItem.addActionListener(this); |
---|
358 | 366 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
359 | 367 | scriptNodeItem.addActionListener(this); |
---|
360 | | - cameraItem = menu.add(new MenuItem("Camera")); |
---|
361 | | - cameraItem.addActionListener(this); |
---|
362 | 368 | } |
---|
363 | 369 | |
---|
364 | 370 | oe.menuBar.add(menu = new Menu("Object")); |
---|
365 | | - textureItem = menu.add(new MenuItem("Texture")); |
---|
366 | | - textureItem.addActionListener(this); |
---|
| 371 | +// textureItem = menu.add(new MenuItem("Texture")); |
---|
| 372 | +// textureItem.addActionListener(this); |
---|
367 | 373 | billboardItem = menu.add(new MenuItem("Billboard")); |
---|
368 | 374 | billboardItem.addActionListener(this); |
---|
369 | 375 | csgItem = menu.add(new MenuItem("CSG")); |
---|
.. | .. |
---|
574 | 580 | oe.radioPanel.add(dummyButton); |
---|
575 | 581 | oe.buttonGroup.add(dummyButton); |
---|
576 | 582 | */ |
---|
| 583 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 584 | + |
---|
| 585 | + copyOptionsPanel.preferredHeight = 1; |
---|
| 586 | + |
---|
577 | 587 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
578 | 588 | |
---|
579 | 589 | //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
580 | 590 | //minButton.setToolTipText("Minimize window"); |
---|
581 | 591 | //minButton.addActionListener(this); |
---|
582 | 592 | |
---|
583 | | - oe.toolbarPanel.add(maxButton = new cButton("\u271A", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
584 | | - maxButton.setToolTipText("Maximize window"); |
---|
585 | | - maxButton.addActionListener(this); |
---|
| 593 | + if (Globals.ADVANCED) |
---|
| 594 | + { |
---|
| 595 | + oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 596 | + maxButton.setToolTipText("Maximize window"); |
---|
| 597 | + maxButton.addActionListener(this); |
---|
| 598 | + } |
---|
586 | 599 | |
---|
587 | | - oe.toolbarPanel.add(fullButton = new cButton("\u2b1c", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 600 | + oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
588 | 601 | fullButton.setToolTipText("Full-screen window"); |
---|
589 | 602 | fullButton.addActionListener(this); |
---|
590 | 603 | |
---|
591 | | - oe.toolbarPanel.add(undoButton = new cButton("\u21a9", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 604 | + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 605 | + restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
| 606 | + restoreCameraButton.addActionListener(this); |
---|
| 607 | + |
---|
| 608 | + copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
592 | 609 | undoButton.setToolTipText("Undo changes"); |
---|
593 | 610 | undoButton.addActionListener(this); |
---|
| 611 | + undoButton.setEnabled(false); |
---|
594 | 612 | |
---|
595 | | - oe.toolbarPanel.add(redoButton = new cButton("\u21aa", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 613 | + copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
596 | 614 | redoButton.setToolTipText("Redo changes"); |
---|
597 | 615 | redoButton.addActionListener(this); |
---|
| 616 | + redoButton.setEnabled(false); |
---|
598 | 617 | |
---|
599 | | - oe.toolbarPanel.add(saveButton = new cButton("\u21e3", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 618 | + copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
600 | 619 | saveButton.setToolTipText("Save changes"); |
---|
601 | 620 | saveButton.addActionListener(this); |
---|
602 | 621 | |
---|
603 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 622 | + copyOptionsPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
604 | 623 | liveCB.setToolTipText("Enable animation"); |
---|
605 | 624 | liveCB.addItemListener(this); |
---|
606 | 625 | |
---|
607 | | - oe.toolbarPanel.add(oneStepButton = new cButton("\u29f4", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 626 | + copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
608 | 627 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
609 | 628 | oneStepButton.addActionListener(this); |
---|
610 | 629 | |
---|
611 | | - oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
| 630 | + copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
612 | 631 | fastCB.setToolTipText("Fast mode"); |
---|
613 | 632 | fastCB.addItemListener(this); |
---|
614 | 633 | |
---|
615 | | - oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK)); //, oe.aConstraints); |
---|
616 | | - trackCB.setToolTipText("Enable tracking"); |
---|
617 | | - trackCB.addItemListener(this); |
---|
618 | | - |
---|
619 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 634 | + //oe.toolboxPanel.Return(); |
---|
| 635 | + |
---|
| 636 | + copyOptionsPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
620 | 637 | screenfitButton.setToolTipText("Screen fit"); |
---|
621 | 638 | screenfitButton.addActionListener(this); |
---|
| 639 | + |
---|
| 640 | +// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 641 | +// trackCB.setToolTipText("Enable tracking"); |
---|
| 642 | +// trackCB.addItemListener(this); |
---|
622 | 643 | |
---|
623 | 644 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
624 | 645 | // screenfitpointButton.addActionListener(this); |
---|
.. | .. |
---|
630 | 651 | snapobjectButton.setToolTipText("Snap Object"); |
---|
631 | 652 | } |
---|
632 | 653 | |
---|
633 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
634 | | - flashSelectionButton.setToolTipText("Show selection"); |
---|
635 | | - flashSelectionButton.addActionListener(this); |
---|
636 | | - |
---|
637 | | - oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
| 654 | + //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
638 | 655 | |
---|
639 | 656 | oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
640 | 657 | twoButton.setToolTipText("Show center view only"); |
---|
641 | 658 | twoButton.addActionListener(this); |
---|
| 659 | + this.fullscreenLayout = twoButton; |
---|
| 660 | + |
---|
642 | 661 | oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
643 | 662 | fourButton.addActionListener(this); |
---|
644 | 663 | fourButton.setToolTipText("Show left panel only"); |
---|
.. | .. |
---|
653 | 672 | sevenButton.addActionListener(this); |
---|
654 | 673 | // |
---|
655 | 674 | |
---|
656 | | - oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 675 | + oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
657 | 676 | rootButton.setToolTipText("Edit selection in new tab"); |
---|
658 | 677 | rootButton.addActionListener(this); |
---|
659 | 678 | |
---|
660 | | - oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 679 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
661 | 680 | closeButton.setToolTipText("Close tab"); |
---|
662 | 681 | closeButton.addActionListener(this); |
---|
663 | 682 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
664 | 683 | //clearButton.addActionListener(this); |
---|
665 | | - |
---|
666 | | - editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
667 | | - editButton.setToolTipText("Edit selection"); |
---|
| 684 | + |
---|
| 685 | + // INSERT |
---|
| 686 | + oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 687 | + gridButton.setToolTipText("Create grid"); |
---|
| 688 | + gridButton.addActionListener(this); |
---|
| 689 | + |
---|
| 690 | + oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 691 | + boxButton.setToolTipText("Create box"); |
---|
| 692 | + boxButton.addActionListener(this); |
---|
| 693 | + |
---|
| 694 | + oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 695 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 696 | + sphereButton.addActionListener(this); |
---|
| 697 | + |
---|
| 698 | + oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 699 | + coneButton.setToolTipText("Create cone"); |
---|
| 700 | + coneButton.addActionListener(this); |
---|
| 701 | + |
---|
| 702 | + oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 703 | + torusButton.setToolTipText("Create torus"); |
---|
| 704 | + torusButton.addActionListener(this); |
---|
| 705 | + |
---|
| 706 | + oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 707 | + superButton.setToolTipText("Create superellipsoid"); |
---|
| 708 | + superButton.addActionListener(this); |
---|
| 709 | + |
---|
| 710 | + if (Globals.ADVANCED) |
---|
| 711 | + { |
---|
| 712 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 713 | + kleinButton.setToolTipText("Create Klein bottle"); |
---|
| 714 | + kleinButton.addActionListener(this); |
---|
| 715 | + } |
---|
| 716 | + |
---|
| 717 | + oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 718 | + particlesButton.setToolTipText("Create particle system"); |
---|
| 719 | + particlesButton.addActionListener(this); |
---|
| 720 | + |
---|
| 721 | + oe.toolboxPanel.Return(); |
---|
| 722 | + |
---|
| 723 | + oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 724 | + groupButton.setToolTipText("Create group"); |
---|
| 725 | + groupButton.addActionListener(this); |
---|
| 726 | + |
---|
| 727 | + oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 728 | + compositeButton.setToolTipText("Create composite"); |
---|
| 729 | + compositeButton.addActionListener(this); |
---|
| 730 | + |
---|
| 731 | + oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 732 | + switchButton.setToolTipText("Create item switcher"); |
---|
| 733 | + switchButton.addActionListener(this); |
---|
| 734 | + |
---|
| 735 | + oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 736 | + loopButton.setToolTipText("Create loop"); |
---|
| 737 | + loopButton.addActionListener(this); |
---|
| 738 | + |
---|
| 739 | + oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 740 | + textureButton.setToolTipText("Create texture"); |
---|
| 741 | + textureButton.addActionListener(this); |
---|
| 742 | + |
---|
| 743 | + oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 744 | + overlayButton.setToolTipText("Create overlay"); |
---|
| 745 | + overlayButton.addActionListener(this); |
---|
| 746 | + |
---|
| 747 | + oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 748 | + lightButton.setToolTipText("Create light"); |
---|
| 749 | + lightButton.addActionListener(this); |
---|
| 750 | + |
---|
| 751 | + for (int i=6; --i>=0;) |
---|
| 752 | + { |
---|
| 753 | + oe.toolboxPanel.Return(); |
---|
| 754 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 755 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 756 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 757 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 758 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 759 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 760 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 761 | + } |
---|
| 762 | + |
---|
| 763 | + // EDIT panel |
---|
| 764 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 765 | + editButton.setToolTipText("Pin selection controls"); |
---|
668 | 766 | editButton.addActionListener(this); |
---|
669 | 767 | |
---|
670 | | - editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
671 | | - uneditButton.setToolTipText("Unedit selection"); |
---|
| 768 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 769 | + uneditButton.setToolTipText("Remove selection controls"); |
---|
672 | 770 | uneditButton.addActionListener(this); |
---|
673 | 771 | |
---|
674 | 772 | editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
675 | | - allParamsButton.setToolTipText("Edit all params"); |
---|
| 773 | + allParamsButton.setToolTipText("Show all controle"); |
---|
676 | 774 | allParamsButton.addActionListener(this); |
---|
677 | 775 | |
---|
678 | 776 | editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
.. | .. |
---|
683 | 781 | unselectButton.setToolTipText("Unselect"); |
---|
684 | 782 | unselectButton.addActionListener(this); |
---|
685 | 783 | |
---|
| 784 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 785 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
| 786 | + flashSelectionButton.addActionListener(this); |
---|
| 787 | + |
---|
686 | 788 | editCommandsPanel.preferredHeight = 1; |
---|
687 | 789 | |
---|
| 790 | + SetPinStates(false); |
---|
688 | 791 | // oe.treePanel.add(commandsPanel); |
---|
689 | 792 | // oe.treePanel.Return(); |
---|
690 | 793 | |
---|
.. | .. |
---|
703 | 806 | |
---|
704 | 807 | JScrollPane jSP; |
---|
705 | 808 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
706 | | - jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints); |
---|
| 809 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
707 | 810 | ResetModel(); |
---|
708 | 811 | |
---|
709 | 812 | oe.treePanel.add(jSPPanel); |
---|
710 | 813 | oe.treePanel.Return(); |
---|
711 | 814 | |
---|
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 | 815 | oe.treePanel.add(copyOptionsPanel); |
---|
728 | 816 | oe.treePanel.Return(); |
---|
729 | 817 | |
---|
.. | .. |
---|
754 | 842 | |
---|
755 | 843 | void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
756 | 844 | { |
---|
| 845 | + panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 846 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
| 847 | + colorCB.addItemListener(this); |
---|
| 848 | + |
---|
| 849 | + panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 850 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
| 851 | + materialCB.addItemListener(this); |
---|
| 852 | + |
---|
| 853 | + panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 854 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
| 855 | + textureCB.addItemListener(this); |
---|
| 856 | + |
---|
| 857 | + panel.Return(); |
---|
| 858 | + |
---|
757 | 859 | panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
758 | 860 | boxCB.setToolTipText("Display bounding boxes"); |
---|
759 | 861 | boxCB.addItemListener(this); |
---|
760 | 862 | |
---|
761 | 863 | panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
762 | | - zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 864 | + zoomBoxCB.setToolTipText("Display only for wheel"); |
---|
763 | 865 | zoomBoxCB.addItemListener(this); |
---|
764 | 866 | |
---|
765 | 867 | if (true) // Globals.ADVANCED) |
---|
766 | 868 | { |
---|
767 | | - panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
768 | | - supportCB.setToolTipText("Enable rigging"); |
---|
769 | | - supportCB.addItemListener(this); |
---|
| 869 | +// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 870 | +// supportCB.setToolTipText("Enable rigging"); |
---|
| 871 | +// supportCB.addItemListener(this); |
---|
| 872 | + |
---|
| 873 | + panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 874 | + freezeCB.setToolTipText("Fast moving camera"); |
---|
| 875 | + freezeCB.addItemListener(this); |
---|
770 | 876 | |
---|
771 | 877 | // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
772 | 878 | // localCB.addItemListener(this); |
---|
773 | 879 | |
---|
| 880 | + panel.Return(); |
---|
| 881 | + |
---|
774 | 882 | panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
775 | 883 | crowdCB.setToolTipText("Used for crowds"); |
---|
776 | 884 | crowdCB.addItemListener(this); |
---|
.. | .. |
---|
787 | 895 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
788 | 896 | // speakerMocapCB.addItemListener(this); |
---|
789 | 897 | |
---|
| 898 | + panel.Return(); |
---|
| 899 | + |
---|
790 | 900 | if (false) |
---|
791 | 901 | { |
---|
792 | 902 | // handled in scripts |
---|
.. | .. |
---|
801 | 911 | //constraints.gridy += 1; |
---|
802 | 912 | panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
803 | 913 | smoothfocusCB.addItemListener(this); |
---|
| 914 | + panel.Return(); |
---|
804 | 915 | } |
---|
805 | 916 | |
---|
806 | 917 | //constraints.gridx += 1; |
---|
807 | 918 | //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
808 | 919 | // debugCB.addItemListener(this); |
---|
809 | 920 | |
---|
| 921 | + panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 922 | + trackCB.setToolTipText("Enable tracking target"); |
---|
| 923 | + trackCB.addItemListener(this); |
---|
| 924 | + |
---|
810 | 925 | panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
811 | | - oeilCB.setToolTipText("Move camera when tracking target"); |
---|
| 926 | + oeilCB.setToolTipText("Move camera when tracking"); |
---|
812 | 927 | oeilCB.addItemListener(this); |
---|
813 | 928 | |
---|
814 | 929 | panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
815 | | - shadowCB.setToolTipText("Compute shadows when live"); |
---|
| 930 | + shadowCB.setToolTipText("When live compute shadows"); |
---|
816 | 931 | shadowCB.addItemListener(this); |
---|
817 | 932 | |
---|
| 933 | + panel.Return(); |
---|
| 934 | + panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints); |
---|
| 935 | + toggleTextureCB.setToolTipText("Load textures"); |
---|
| 936 | + toggleTextureCB.addItemListener(this); |
---|
| 937 | + |
---|
| 938 | + panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints); |
---|
| 939 | + toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
| 940 | + toggleSwitchCB.addItemListener(this); |
---|
| 941 | + |
---|
| 942 | + panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints); |
---|
| 943 | + autosaveCB.setToolTipText("On structure change"); |
---|
| 944 | + autosaveCB.addItemListener(this); |
---|
| 945 | + |
---|
| 946 | + panel.Return(); |
---|
818 | 947 | if (Globals.ADVANCED) |
---|
819 | 948 | { |
---|
820 | 949 | panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
.. | .. |
---|
825 | 954 | } |
---|
826 | 955 | |
---|
827 | 956 | cGridBag fill = new cGridBag(); |
---|
828 | | - |
---|
829 | 957 | fill.preferredHeight = 200; |
---|
| 958 | + cGridBag fill2 = new cGridBag(); |
---|
| 959 | + fill2.preferredHeight = 200; |
---|
| 960 | + cGridBag fill3 = new cGridBag(); |
---|
| 961 | + fill3.preferredHeight = 200; |
---|
830 | 962 | |
---|
831 | 963 | panel.add(fill); |
---|
| 964 | + panel.add(fill2); |
---|
| 965 | + panel.add(fill3); |
---|
832 | 966 | |
---|
833 | 967 | } |
---|
834 | 968 | |
---|
.. | .. |
---|
864 | 998 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
865 | 999 | } |
---|
866 | 1000 | |
---|
867 | | - JCheckBox liveCB; |
---|
868 | | - JCheckBox supportCB; |
---|
869 | | - JCheckBox localCB; |
---|
870 | | - JCheckBox crowdCB; |
---|
871 | | - JCheckBox smoothCB; |
---|
872 | | - JCheckBox fastCB; |
---|
873 | | - JCheckBox slowCB; |
---|
874 | | - JCheckBox boxCB; |
---|
875 | | - JCheckBox zoomBoxCB; |
---|
876 | | - JCheckBox trackCB; |
---|
877 | | - JCheckBox smoothfocusCB; |
---|
| 1001 | + cToggleButton liveCB; |
---|
| 1002 | + cCheckBox supportCB; |
---|
| 1003 | + cCheckBox localCB; |
---|
| 1004 | + cCheckBox crowdCB; |
---|
| 1005 | + cCheckBox smoothCB; |
---|
| 1006 | + cToggleButton fastCB; |
---|
| 1007 | + cCheckBox slowCB; |
---|
| 1008 | + cCheckBox boxCB; |
---|
| 1009 | + cCheckBox zoomBoxCB; |
---|
| 1010 | + cCheckBox freezeCB; |
---|
| 1011 | + //cToggleButton trackCB; |
---|
| 1012 | + cCheckBox trackCB; |
---|
| 1013 | + cCheckBox smoothfocusCB; |
---|
878 | 1014 | // JCheckBox speakerMocapCB; |
---|
879 | | - JCheckBox speakerCameraCB; |
---|
880 | | - JCheckBox speakerFocusCB; |
---|
881 | | - JCheckBox debugCB; |
---|
| 1015 | + cCheckBox speakerCameraCB; |
---|
| 1016 | + cCheckBox speakerFocusCB; |
---|
| 1017 | + cCheckBox debugCB; |
---|
882 | 1018 | |
---|
883 | | - JCheckBox oeilCB; |
---|
884 | | - JCheckBox shadowCB; |
---|
885 | | - JCheckBox lookAtCB; |
---|
| 1019 | + cCheckBox oeilCB; |
---|
| 1020 | + cCheckBox shadowCB; |
---|
| 1021 | + cCheckBox autosaveCB; |
---|
| 1022 | + cCheckBox lookAtCB; |
---|
886 | 1023 | |
---|
887 | 1024 | // static int COLOR = 1; |
---|
888 | 1025 | // static int MATERIAL = 2; |
---|
.. | .. |
---|
890 | 1027 | |
---|
891 | 1028 | int dropAttributes = Object3D.COLOR | Object3D.MATERIAL; |
---|
892 | 1029 | |
---|
893 | | - JCheckBox colorCB; |
---|
894 | | - JCheckBox materialCB; |
---|
895 | | - JCheckBox textureCB; |
---|
| 1030 | + cCheckBox colorCB; |
---|
| 1031 | + cCheckBox materialCB; |
---|
| 1032 | + cCheckBox textureCB; |
---|
896 | 1033 | |
---|
897 | 1034 | public void itemStateChanged(ItemEvent e) |
---|
898 | 1035 | { |
---|
.. | .. |
---|
989 | 1126 | { |
---|
990 | 1127 | Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
991 | 1128 | } |
---|
| 1129 | + else if(e.getSource() == freezeCB) |
---|
| 1130 | + { |
---|
| 1131 | + Globals.FREEZEONMOVE ^= true; |
---|
| 1132 | + } |
---|
| 1133 | + else if(e.getSource() == autosaveCB) |
---|
| 1134 | + { |
---|
| 1135 | + Globals.SAVEONMAKE ^= true; |
---|
| 1136 | + } |
---|
992 | 1137 | else if(e.getSource() == lookAtCB) |
---|
993 | 1138 | { |
---|
994 | 1139 | cameraView.ToggleLookAt(); |
---|
.. | .. |
---|
1005 | 1150 | |
---|
1006 | 1151 | /**/ |
---|
1007 | 1152 | //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this); |
---|
1008 | | - TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1153 | + //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1154 | + TreePath path = objEditor.jTree.getSelectionPath(); |
---|
1009 | 1155 | if ((path == null) || (path.getPathCount() <= 1)) { |
---|
1010 | 1156 | // We can't move the root node or an empty selection |
---|
1011 | 1157 | return; |
---|
.. | .. |
---|
1122 | 1268 | |
---|
1123 | 1269 | assert target == objEditor.jTree; |
---|
1124 | 1270 | TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y); |
---|
| 1271 | + Object3D destinationLeaf; |
---|
1125 | 1272 | try { |
---|
1126 | | - Object3D dummy = (Composite) destinationPath.getLastPathComponent(); |
---|
| 1273 | + destinationLeaf = (Composite) destinationPath.getLastPathComponent(); |
---|
1127 | 1274 | } catch (Exception e) { |
---|
1128 | 1275 | System.out.println("destinationPath : " + destinationPath); |
---|
1129 | 1276 | return; |
---|
1130 | 1277 | } |
---|
1131 | 1278 | |
---|
1132 | | - if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1279 | + for (int i=group.selection.size(); --i>=0;) |
---|
1133 | 1280 | { |
---|
| 1281 | + Object3D child = (Object3D)group.selection.elementAt(i); |
---|
| 1282 | + |
---|
| 1283 | + // Cannot move into itself |
---|
| 1284 | + if (child == destinationLeaf) |
---|
| 1285 | + return; |
---|
| 1286 | + } |
---|
| 1287 | + |
---|
| 1288 | +// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1289 | +// { |
---|
1134 | 1290 | loadClipboard(true); |
---|
1135 | 1291 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
1136 | 1292 | pasteInto(false, false); |
---|
1137 | | - } else { |
---|
1138 | | - loadClipboard(false); |
---|
1139 | | - objEditor.jTree.setSelectionPath(destinationPath); |
---|
1140 | | - pasteInto(false, false); // true); // ??? |
---|
1141 | | - } |
---|
| 1293 | +// } else { |
---|
| 1294 | +// loadClipboard(false); |
---|
| 1295 | +// objEditor.jTree.setSelectionPath(destinationPath); |
---|
| 1296 | +// pasteInto(false, false); // true); // ??? |
---|
| 1297 | +// } |
---|
1142 | 1298 | } |
---|
1143 | 1299 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
1144 | 1300 | // Called if the user has modified the current drop gesture |
---|
.. | .. |
---|
1243 | 1399 | { |
---|
1244 | 1400 | //heightFieldItem = menu.add(new MenuItem("Height Field")); |
---|
1245 | 1401 | //heightFieldItem.addActionListener(this); |
---|
1246 | | - gridItem = menu.add(new MenuItem("Grid")); |
---|
1247 | | - gridItem.addActionListener(this); |
---|
1248 | | - rectoidItem = menu.add(new MenuItem("Box")); |
---|
1249 | | - rectoidItem.addActionListener(this); |
---|
1250 | | - ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
1251 | | - ellipsoidItem.addActionListener(this); |
---|
1252 | | - coneItem = menu.add(new MenuItem("Cone")); |
---|
1253 | | - coneItem.addActionListener(this); |
---|
1254 | | - torusItem = menu.add(new MenuItem("Torus")); |
---|
1255 | | - torusItem.addActionListener(this); |
---|
1256 | | - superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
1257 | | - superItem.addActionListener(this); |
---|
| 1402 | +// gridItem = menu.add(new MenuItem("Grid")); |
---|
| 1403 | +// gridItem.addActionListener(this); |
---|
| 1404 | +// rectoidItem = menu.add(new MenuItem("Box")); |
---|
| 1405 | +// rectoidItem.addActionListener(this); |
---|
| 1406 | +// ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
| 1407 | +// ellipsoidItem.addActionListener(this); |
---|
| 1408 | +// coneItem = menu.add(new MenuItem("Cone")); |
---|
| 1409 | +// coneItem.addActionListener(this); |
---|
| 1410 | +// torusItem = menu.add(new MenuItem("Torus")); |
---|
| 1411 | +// torusItem.addActionListener(this); |
---|
| 1412 | +// superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
| 1413 | +// superItem.addActionListener(this); |
---|
| 1414 | + |
---|
| 1415 | + cameraItem = menu.add(new MenuItem("Camera")); |
---|
| 1416 | + cameraItem.addActionListener(this); |
---|
| 1417 | + |
---|
| 1418 | + if (!Globals.ADVANCED) |
---|
| 1419 | + { |
---|
1258 | 1420 | kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
1259 | 1421 | kleinItem.addActionListener(this); |
---|
1260 | | - particleItem = menu.add(new MenuItem("Particle system")); |
---|
1261 | | - particleItem.addActionListener(this); |
---|
| 1422 | + } |
---|
| 1423 | + |
---|
| 1424 | +// particleItem = menu.add(new MenuItem("Particle system")); |
---|
| 1425 | +// particleItem.addActionListener(this); |
---|
1262 | 1426 | if (Globals.ADVANCED) |
---|
1263 | 1427 | { |
---|
1264 | 1428 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
.. | .. |
---|
1284 | 1448 | } |
---|
1285 | 1449 | bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
1286 | 1450 | bezierItem.addActionListener(this); |
---|
1287 | | - overlayItem = menu.add(new MenuItem("Overlay")); |
---|
1288 | | - overlayItem.addActionListener(this); |
---|
1289 | | - lightItem = menu.add(new MenuItem("Light")); |
---|
1290 | | - lightItem.addActionListener(this); |
---|
| 1451 | +// overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1452 | +// overlayItem.addActionListener(this); |
---|
| 1453 | +// lightItem = menu.add(new MenuItem("Light")); |
---|
| 1454 | +// lightItem.addActionListener(this); |
---|
1291 | 1455 | menu.add("-"); |
---|
1292 | 1456 | //superLoopItem = menu.add(new MenuItem("Super Loop")); |
---|
1293 | 1457 | //superLoopItem.addActionListener(this); |
---|
1294 | | - loopItem = menu.add(new MenuItem("Loop")); |
---|
1295 | | - loopItem.addActionListener(this); |
---|
| 1458 | +// loopItem = menu.add(new MenuItem("Loop")); |
---|
| 1459 | +// loopItem.addActionListener(this); |
---|
1296 | 1460 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1297 | 1461 | doubleItem.addActionListener(this); |
---|
1298 | 1462 | if (Globals.ADVANCED) |
---|
.. | .. |
---|
1307 | 1471 | menu.add(animationItem = new CheckboxMenuItem("Animation...")); |
---|
1308 | 1472 | animationItem.addItemListener(this); |
---|
1309 | 1473 | animationItem.setState(Globals.ANIMATION); |
---|
| 1474 | + |
---|
| 1475 | + menu.add(archiveItem = new CheckboxMenuItem("Archive3D...")); |
---|
| 1476 | + archiveItem.addItemListener(this); |
---|
1310 | 1477 | |
---|
1311 | 1478 | menu.add("-"); |
---|
1312 | 1479 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
.. | .. |
---|
1477 | 1644 | |
---|
1478 | 1645 | makeSomething(shadow); |
---|
1479 | 1646 | } |
---|
| 1647 | + |
---|
| 1648 | + private void ClearUnpinned() |
---|
| 1649 | + { |
---|
| 1650 | + //for (Object3D obj : listUI) |
---|
| 1651 | + for (int i=listUI.size(); --i>=0;) |
---|
| 1652 | + { |
---|
| 1653 | + Object3D obj = listUI.elementAt(i); |
---|
| 1654 | + if (!obj.pinned) |
---|
| 1655 | + { |
---|
| 1656 | + obj.CloseUI(); |
---|
| 1657 | + listUI.remove(i); |
---|
| 1658 | + } |
---|
| 1659 | + } |
---|
| 1660 | + } |
---|
1480 | 1661 | |
---|
1481 | 1662 | /** |
---|
1482 | 1663 | * applyExample |
---|
.. | .. |
---|
1721 | 1902 | { |
---|
1722 | 1903 | ScreenFit(); |
---|
1723 | 1904 | } else |
---|
1724 | | - if (source == switchItem) |
---|
| 1905 | + if (source == switchViewItem) |
---|
1725 | 1906 | { |
---|
1726 | 1907 | cVector v1 = new cVector(); |
---|
1727 | 1908 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1730 | 1911 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1731 | 1912 | objEditor.cameraView.repaint(); |
---|
1732 | 1913 | } else |
---|
1733 | | - if (source == rectoidItem) |
---|
| 1914 | + if (source == rectoidItem || source == boxButton) |
---|
1734 | 1915 | { |
---|
1735 | 1916 | makeSomething(new Box()); |
---|
1736 | 1917 | } else |
---|
1737 | | - if (source == particleItem) |
---|
| 1918 | + if (source == particleItem || source == particlesButton) |
---|
1738 | 1919 | { |
---|
1739 | 1920 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1740 | 1921 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1813 | 1994 | |
---|
1814 | 1995 | makeSomething(obj); |
---|
1815 | 1996 | } else |
---|
1816 | | - if (source == gridItem) |
---|
| 1997 | + if (source == gridItem || source == gridButton) |
---|
1817 | 1998 | { |
---|
1818 | 1999 | makeSomething(new Grid()); |
---|
1819 | 2000 | } else |
---|
1820 | | - if (source == ellipsoidItem) |
---|
| 2001 | + if (source == ellipsoidItem || source == sphereButton) |
---|
1821 | 2002 | { |
---|
1822 | 2003 | makeSomething(new Sphere()); |
---|
1823 | 2004 | } else |
---|
1824 | | - if (source == coneItem) |
---|
| 2005 | + if (source == coneItem || source == coneButton) |
---|
1825 | 2006 | { |
---|
1826 | 2007 | makeSomething(new Cone()); |
---|
1827 | 2008 | } else |
---|
1828 | | - if (source == torusItem) |
---|
| 2009 | + if (source == torusItem || source == torusButton) |
---|
1829 | 2010 | { |
---|
1830 | 2011 | makeSomething(new Torus()); |
---|
1831 | 2012 | } else |
---|
1832 | | - if (source == superItem) |
---|
| 2013 | + if (source == superItem || source == superButton) |
---|
1833 | 2014 | { |
---|
1834 | 2015 | makeSomething(new Superellipsoid()); |
---|
1835 | 2016 | } else |
---|
1836 | | - if (source == kleinItem) |
---|
| 2017 | + if (source == kleinItem || source == kleinButton) |
---|
1837 | 2018 | { |
---|
1838 | 2019 | makeSomething(new Klein()); |
---|
1839 | 2020 | } else |
---|
.. | .. |
---|
1853 | 2034 | { |
---|
1854 | 2035 | makeSomething(new BezierSurface()); |
---|
1855 | 2036 | } else |
---|
1856 | | - if (source == overlayItem) |
---|
| 2037 | + if (source == overlayItem || source == overlayButton) |
---|
1857 | 2038 | { |
---|
1858 | 2039 | /* |
---|
1859 | 2040 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1901 | 2082 | s.setup(); |
---|
1902 | 2083 | makeSomething(s); |
---|
1903 | 2084 | } else |
---|
1904 | | - if (source == lightItem) |
---|
| 2085 | + if (source == lightItem || source == lightButton) |
---|
1905 | 2086 | { |
---|
1906 | 2087 | makeSomething(new Light()); |
---|
1907 | 2088 | } else |
---|
.. | .. |
---|
1951 | 2132 | |
---|
1952 | 2133 | group(g); |
---|
1953 | 2134 | } else |
---|
1954 | | - if (source == loopItem) |
---|
| 2135 | + if (source == loopItem || source == loopButton) |
---|
1955 | 2136 | { |
---|
1956 | 2137 | Composite csg = new GroupLeaf(); |
---|
1957 | 2138 | csg.count = 5; |
---|
1958 | 2139 | group(csg); |
---|
1959 | | - Composite child = new cGroup(); |
---|
| 2140 | + Composite child = new cGroup("Branch"); |
---|
1960 | 2141 | csg.addChild(child); |
---|
1961 | 2142 | child.addChild(csg); |
---|
1962 | 2143 | } else |
---|
1963 | 2144 | if (source == doubleItem) |
---|
1964 | 2145 | { |
---|
1965 | | - Composite csg = new GroupLeaf(); |
---|
| 2146 | + Composite csg = new GroupLeaf("Fork"); |
---|
1966 | 2147 | csg.count = 5; |
---|
1967 | 2148 | group(csg); |
---|
1968 | | - Composite child = new cGroup(); |
---|
| 2149 | + Composite child = new cGroup("Branch A"); |
---|
1969 | 2150 | csg.addChild(child); |
---|
1970 | 2151 | child.addChild(csg); |
---|
1971 | | - child = new cGroup(); |
---|
| 2152 | + child = new cGroup("Branch B"); |
---|
1972 | 2153 | csg.addChild(child); |
---|
1973 | 2154 | child.addChild(csg); |
---|
1974 | 2155 | } else |
---|
1975 | 2156 | if (source == tripleItem) |
---|
1976 | 2157 | { |
---|
1977 | | - Composite csg = new GroupLeaf(); |
---|
| 2158 | + Composite csg = new GroupLeaf("Trident"); |
---|
1978 | 2159 | csg.count = 4; |
---|
1979 | 2160 | group(csg); |
---|
1980 | 2161 | Composite child = new cGroup(); |
---|
.. | .. |
---|
2441 | 2622 | { |
---|
2442 | 2623 | ClearSelection(true); |
---|
2443 | 2624 | } else |
---|
2444 | | - if (source == grabItem) |
---|
| 2625 | + if (source == grabItem || source == groupButton) |
---|
2445 | 2626 | { |
---|
2446 | | - group(new cGroup(), true); |
---|
| 2627 | + group(new cGroup(), false); // true); |
---|
2447 | 2628 | } else |
---|
2448 | 2629 | if (source == hideItem) |
---|
2449 | 2630 | { |
---|
.. | .. |
---|
2461 | 2642 | { |
---|
2462 | 2643 | makeSomething(new Camera()); |
---|
2463 | 2644 | } else |
---|
2464 | | - if (source == compositeItem) |
---|
| 2645 | + if (source == compositeItem || source == compositeButton) |
---|
2465 | 2646 | { |
---|
2466 | 2647 | group(new Composite()); |
---|
2467 | 2648 | } else |
---|
2468 | | - if (source == randomItem) |
---|
| 2649 | + if (source == switchItem || source == switchButton) |
---|
2469 | 2650 | { |
---|
2470 | 2651 | RandomNode random = new RandomNode(); |
---|
2471 | 2652 | group(random); |
---|
.. | .. |
---|
2567 | 2748 | { |
---|
2568 | 2749 | group(new cLinker()); |
---|
2569 | 2750 | } else |
---|
2570 | | - if (source == textureItem) |
---|
| 2751 | + if (source == textureItem || source == textureButton) |
---|
2571 | 2752 | { |
---|
2572 | 2753 | group(new TextureNode()); |
---|
2573 | 2754 | } else |
---|
.. | .. |
---|
2587 | 2768 | { |
---|
2588 | 2769 | CastShadow(2); |
---|
2589 | 2770 | } else |
---|
2590 | | - if (source == ungroupItem) |
---|
| 2771 | + if (source == ungroupItem || source == ungroupButton) |
---|
2591 | 2772 | { |
---|
2592 | | - //ungroup(); |
---|
| 2773 | + boolean hasRoot = false; |
---|
| 2774 | + |
---|
2593 | 2775 | for (int i=0; i<group.selection.size(); i++) |
---|
2594 | 2776 | { |
---|
2595 | | - Ungroup(group.selection.get(i)); |
---|
| 2777 | + if (group.selection.get(i) == group) |
---|
| 2778 | + { |
---|
| 2779 | + hasRoot = true; |
---|
| 2780 | + break; |
---|
| 2781 | + } |
---|
2596 | 2782 | } |
---|
2597 | 2783 | |
---|
2598 | | - ClearSelection(false); |
---|
2599 | | - |
---|
2600 | | - refreshContents(); |
---|
| 2784 | + if (!hasRoot) |
---|
| 2785 | + { |
---|
| 2786 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 2787 | + { |
---|
| 2788 | + Ungroup(group.selection.get(i)); |
---|
| 2789 | + } |
---|
| 2790 | + |
---|
| 2791 | + ClearSelection(false); |
---|
| 2792 | + |
---|
| 2793 | + refreshContents(); |
---|
| 2794 | + } |
---|
2601 | 2795 | } else |
---|
2602 | 2796 | if (source == genUVItem) |
---|
2603 | 2797 | { |
---|
.. | .. |
---|
2925 | 3119 | if (source == twoButton) |
---|
2926 | 3120 | { |
---|
2927 | 3121 | radio.layout = twoButton; |
---|
| 3122 | + |
---|
| 3123 | + if (CameraPane.FULLSCREEN) |
---|
| 3124 | + fullscreenLayout = radio.layout; |
---|
| 3125 | + |
---|
2928 | 3126 | // bug |
---|
2929 | 3127 | //gridPanel.setDividerLocation(1.0); |
---|
2930 | 3128 | //bigPanel.setDividerLocation(0.0); |
---|
.. | .. |
---|
2980 | 3178 | { |
---|
2981 | 3179 | radio.layout = threeButton; |
---|
2982 | 3180 | |
---|
| 3181 | + if (CameraPane.FULLSCREEN) |
---|
| 3182 | + fullscreenLayout = radio.layout; |
---|
| 3183 | + |
---|
2983 | 3184 | // bigThree.remove(scenePanel); |
---|
2984 | 3185 | // bigThree.remove(centralPanel); |
---|
2985 | 3186 | // bigThree.remove(XYZPanel); |
---|
.. | .. |
---|
3018 | 3219 | { |
---|
3019 | 3220 | radio.layout = fourButton; |
---|
3020 | 3221 | |
---|
| 3222 | + if (CameraPane.FULLSCREEN) |
---|
| 3223 | + fullscreenLayout = radio.layout; |
---|
| 3224 | + |
---|
3021 | 3225 | // bigThree.remove(scenePanel); |
---|
3022 | 3226 | // bigThree.remove(centralPanel); |
---|
3023 | 3227 | // bigThree.remove(XYZPanel); |
---|
.. | .. |
---|
3054 | 3258 | if (source == sixButton) |
---|
3055 | 3259 | { |
---|
3056 | 3260 | radio.layout = sixButton; |
---|
| 3261 | + |
---|
| 3262 | + if (CameraPane.FULLSCREEN) |
---|
| 3263 | + fullscreenLayout = radio.layout; |
---|
3057 | 3264 | |
---|
3058 | 3265 | // bigThree.remove(scenePanel); |
---|
3059 | 3266 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
3092 | 3299 | if (source == sevenButton) |
---|
3093 | 3300 | { |
---|
3094 | 3301 | radio.layout = sevenButton; |
---|
| 3302 | + |
---|
| 3303 | + if (CameraPane.FULLSCREEN) |
---|
| 3304 | + fullscreenLayout = radio.layout; |
---|
3095 | 3305 | |
---|
3096 | 3306 | // bigThree.remove(scenePanel); |
---|
3097 | 3307 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
3159 | 3369 | buttonGroup.remove(ab); |
---|
3160 | 3370 | radioPanel.remove(ab); |
---|
3161 | 3371 | |
---|
3162 | | - ab.GetObject().editWindow = null; |
---|
| 3372 | + //ab.GetObject().editWindow = null; |
---|
| 3373 | + ab.GetObject().manipWindow = null; |
---|
3163 | 3374 | // ab.GetObject().objectUI = null; // ????????? |
---|
3164 | 3375 | |
---|
3165 | 3376 | ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick(); |
---|
.. | .. |
---|
3172 | 3383 | } else |
---|
3173 | 3384 | if (source == editItem || source == editButton) |
---|
3174 | 3385 | { |
---|
| 3386 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3387 | + { |
---|
| 3388 | + Object3D child = (Object3D)e.nextElement(); |
---|
| 3389 | + child.pinned = true; |
---|
| 3390 | + } |
---|
| 3391 | + |
---|
3175 | 3392 | EditSelection(false); |
---|
3176 | 3393 | } else |
---|
3177 | 3394 | if (source == uneditButton) |
---|
.. | .. |
---|
3181 | 3398 | Object3D child = (Object3D)e.nextElement(); |
---|
3182 | 3399 | if(child.editWindow != null) |
---|
3183 | 3400 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3401 | + child.pinned = false; |
---|
3184 | 3402 | child.CloseUI(); |
---|
3185 | 3403 | listUI.remove(child); |
---|
3186 | 3404 | |
---|
.. | .. |
---|
3197 | 3415 | //copy.ClearUI(); |
---|
3198 | 3416 | for (Object3D obj : listUI) |
---|
3199 | 3417 | { |
---|
| 3418 | + obj.pinned = false; |
---|
3200 | 3419 | obj.CloseUI(); |
---|
3201 | 3420 | } |
---|
3202 | 3421 | listUI.clear(); |
---|
.. | .. |
---|
3206 | 3425 | { |
---|
3207 | 3426 | assert(copy == group); |
---|
3208 | 3427 | |
---|
3209 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3428 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3210 | 3429 | |
---|
3211 | 3430 | for (Object3D obj : listUI) |
---|
3212 | 3431 | { |
---|
.. | .. |
---|
3273 | 3492 | |
---|
3274 | 3493 | // fix "+" issue |
---|
3275 | 3494 | //group.editWindow = this; |
---|
| 3495 | + group.manipWindow = this; |
---|
3276 | 3496 | |
---|
3277 | 3497 | /* |
---|
3278 | 3498 | currentLayout = radio.layout; |
---|
.. | .. |
---|
3280 | 3500 | currentLayout = sevenButton; |
---|
3281 | 3501 | */ |
---|
3282 | 3502 | radio.layout.doClick(); |
---|
| 3503 | + |
---|
| 3504 | + ClearUnpinned(); |
---|
| 3505 | + SetPinStates(group.selection.size() > 0); |
---|
| 3506 | + if (group.selection.size() == 1) |
---|
| 3507 | + EditSelection(false); |
---|
3283 | 3508 | keepparent = group.parent; |
---|
3284 | 3509 | // PARENT = NULL or not??? |
---|
3285 | 3510 | //group.parent = null; // ROOT |
---|
.. | .. |
---|
3293 | 3518 | cameraView.ProtectCamera(); |
---|
3294 | 3519 | cameraView.repaint(); |
---|
3295 | 3520 | return; |
---|
3296 | | - } else if (event.getSource() == revertCameraItem) |
---|
| 3521 | + } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton) |
---|
3297 | 3522 | { |
---|
3298 | 3523 | cameraView.RevertCamera(); |
---|
3299 | 3524 | cameraView.repaint(); |
---|
.. | .. |
---|
4347 | 4572 | // } |
---|
4348 | 4573 | // } |
---|
4349 | 4574 | |
---|
4350 | | - static boolean allparams = true; |
---|
4351 | | - |
---|
4352 | | - static Vector<Object3D> listUI = new Vector<Object3D>(); |
---|
4353 | | - |
---|
4354 | 4575 | void EditSelection(boolean newWindow) |
---|
4355 | 4576 | { |
---|
4356 | 4577 | // aConstraints.gridy = 0; |
---|
.. | .. |
---|
4358 | 4579 | { |
---|
4359 | 4580 | //System.out.println("edit : " + objectPanel.indexOfTab("Material")); |
---|
4360 | 4581 | //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false); |
---|
4361 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 4582 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
4362 | 4583 | |
---|
4363 | 4584 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4364 | 4585 | if(elem != group || !newWindow) |
---|
.. | .. |
---|
4443 | 4664 | //new Exception().printStackTrace(); |
---|
4444 | 4665 | |
---|
4445 | 4666 | freezemodel = true; |
---|
4446 | | - |
---|
| 4667 | + ClearUnpinned(); |
---|
| 4668 | + |
---|
4447 | 4669 | /**/ |
---|
4448 | 4670 | //switch (event.id) |
---|
4449 | 4671 | { |
---|
.. | .. |
---|
4476 | 4698 | if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4477 | 4699 | // a camera |
---|
4478 | 4700 | { |
---|
4479 | | - if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 4701 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
4480 | 4702 | { |
---|
4481 | 4703 | CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4482 | 4704 | Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
.. | .. |
---|
4485 | 4707 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4486 | 4708 | } |
---|
4487 | 4709 | |
---|
| 4710 | + if (tps != null && tps.length == 1) |
---|
| 4711 | + { |
---|
| 4712 | + EditSelection(false); |
---|
| 4713 | + } |
---|
| 4714 | + |
---|
| 4715 | + SetPinStates(tps != null && tps.length > 0); |
---|
| 4716 | + |
---|
4488 | 4717 | refreshContents(); |
---|
4489 | 4718 | //return true; |
---|
4490 | 4719 | } |
---|
.. | .. |
---|
4494 | 4723 | freezemodel = false; |
---|
4495 | 4724 | } |
---|
4496 | 4725 | |
---|
| 4726 | + void SetPinStates(boolean enabled) |
---|
| 4727 | + { |
---|
| 4728 | + editButton.setEnabled(enabled); |
---|
| 4729 | + uneditButton.setEnabled(enabled); |
---|
| 4730 | + unselectButton.setEnabled(enabled); |
---|
| 4731 | + flashSelectionButton.setEnabled(enabled); |
---|
| 4732 | + } |
---|
| 4733 | + |
---|
4497 | 4734 | void refreshContents(boolean cp) |
---|
4498 | 4735 | { |
---|
4499 | | - if (!Globals.MOUSEDRAGGED) |
---|
| 4736 | + if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info")) |
---|
| 4737 | + if (!Globals.MOUSEDRAGGED) // && !Globals.TIMERRUNNING) |
---|
4500 | 4738 | { |
---|
4501 | 4739 | objEditor.ClearInfo(); // .GetMaterial()); |
---|
4502 | 4740 | |
---|
.. | .. |
---|
4595 | 4833 | |
---|
4596 | 4834 | if (cut) |
---|
4597 | 4835 | { |
---|
| 4836 | + if (Globals.SAVEONMAKE) |
---|
4598 | 4837 | Save(); |
---|
4599 | 4838 | //int indices[] = jList.getSelectedIndices(); |
---|
4600 | 4839 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
5313 | 5552 | cButton clearpanelButton; |
---|
5314 | 5553 | cButton unselectButton; |
---|
5315 | 5554 | |
---|
5316 | | - cButton minButton; |
---|
5317 | | - cButton maxButton; |
---|
5318 | | - cButton fullButton; |
---|
5319 | | - cButton undoButton; |
---|
5320 | | - cButton redoButton; |
---|
| 5555 | + cButton restoreCameraButton; |
---|
| 5556 | + |
---|
5321 | 5557 | cButton saveButton; |
---|
5322 | 5558 | cButton oneStepButton; |
---|
| 5559 | + |
---|
| 5560 | + cButton groupButton; |
---|
| 5561 | + cButton ungroupButton; |
---|
| 5562 | + cButton compositeButton; |
---|
| 5563 | + cButton switchButton; |
---|
| 5564 | + cButton loopButton; |
---|
| 5565 | + cButton textureButton; |
---|
| 5566 | + |
---|
| 5567 | + cButton gridButton; |
---|
| 5568 | + cButton boxButton; |
---|
| 5569 | + cButton sphereButton; |
---|
| 5570 | + cButton coneButton; |
---|
| 5571 | + cButton torusButton; |
---|
| 5572 | + cButton superButton; |
---|
| 5573 | + cButton kleinButton; |
---|
| 5574 | + cButton particlesButton; |
---|
| 5575 | + cButton overlayButton; |
---|
| 5576 | + cButton lightButton; |
---|
5323 | 5577 | |
---|
5324 | 5578 | cButton screenfitButton; |
---|
5325 | 5579 | cButton screenfitpointButton; |
---|
.. | .. |
---|
5341 | 5595 | //JTree jTree; |
---|
5342 | 5596 | private MenuItem lookAtItem; |
---|
5343 | 5597 | private MenuItem lookFromItem; |
---|
5344 | | - private MenuItem switchItem; |
---|
| 5598 | + private MenuItem switchViewItem; |
---|
5345 | 5599 | private MenuItem cutItem; |
---|
5346 | 5600 | private MenuItem undoItem; |
---|
5347 | 5601 | private MenuItem redoItem; |
---|
5348 | | - private MenuItem duplicateItem; |
---|
| 5602 | + private JMenuItem duplicateItem; |
---|
5349 | 5603 | private MenuItem cloneItem; |
---|
5350 | 5604 | private MenuItem cloneSupportItem; |
---|
5351 | 5605 | private MenuItem overwriteGeoItem; |
---|
.. | .. |
---|
5433 | 5687 | private MenuItem frontItem; |
---|
5434 | 5688 | private MenuItem cameraItem; |
---|
5435 | 5689 | private MenuItem compositeItem; |
---|
5436 | | - private MenuItem randomItem; |
---|
| 5690 | + private MenuItem switchItem; |
---|
5437 | 5691 | private MenuItem physicsItem; |
---|
5438 | 5692 | private MenuItem frameselectorItem; |
---|
5439 | 5693 | private MenuItem scriptNodeItem; |
---|
.. | .. |
---|
5507 | 5761 | |
---|
5508 | 5762 | Menu cameraMenu; |
---|
5509 | 5763 | MenuItem editCameraItem; |
---|
5510 | | - MenuItem revertCameraItem; |
---|
| 5764 | + MenuItem restoreCameraItem; |
---|
5511 | 5765 | } |
---|