.. | .. |
---|
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); |
---|
.. | .. |
---|
176 | 178 | copyItem.addActionListener(this); |
---|
177 | 179 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
178 | 180 | pasteItem.addActionListener(this); |
---|
179 | | - menu.add("-"); |
---|
180 | 181 | |
---|
181 | 182 | menu.add("-"); |
---|
182 | 183 | pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
.. | .. |
---|
335 | 336 | frontItem.addActionListener(this); |
---|
336 | 337 | compositeItem = menu.add(new MenuItem("Composite")); |
---|
337 | 338 | compositeItem.addActionListener(this); |
---|
| 339 | + |
---|
| 340 | + if (Globals.ADVANCED) |
---|
| 341 | + { |
---|
338 | 342 | hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
339 | 343 | hideItem.addActionListener(this); |
---|
| 344 | + } |
---|
340 | 345 | ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
341 | 346 | ungroupItem.addActionListener(this); |
---|
| 347 | + |
---|
342 | 348 | menu.add("-"); |
---|
| 349 | + |
---|
343 | 350 | randomItem = menu.add(new MenuItem("Switch node")); |
---|
344 | 351 | randomItem.addActionListener(this); |
---|
| 352 | + if (Globals.ADVANCED) |
---|
| 353 | + { |
---|
345 | 354 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
346 | 355 | switchGeoItem.addActionListener(this); |
---|
347 | 356 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
.. | .. |
---|
349 | 358 | morphItem = menu.add(new MenuItem("Morph Group")); |
---|
350 | 359 | morphItem.addActionListener(this); |
---|
351 | 360 | |
---|
352 | | - if (Globals.ADVANCED) |
---|
353 | | - { |
---|
354 | 361 | menu.add("-"); |
---|
355 | 362 | physicsItem = menu.add(new MenuItem("Physics")); |
---|
356 | 363 | physicsItem.addActionListener(this); |
---|
.. | .. |
---|
369 | 376 | billboardItem.addActionListener(this); |
---|
370 | 377 | csgItem = menu.add(new MenuItem("CSG")); |
---|
371 | 378 | csgItem.addActionListener(this); |
---|
372 | | - shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
| 379 | + shadowXItem = menu.add(new MenuItem("Shadow Red")); |
---|
373 | 380 | shadowXItem.addActionListener(this); |
---|
374 | | - shadowYItem = menu.add(new MenuItem("Shadow Y")); |
---|
| 381 | + shadowYItem = menu.add(new MenuItem("Shadow Green")); |
---|
375 | 382 | shadowYItem.addActionListener(this); |
---|
376 | | - shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
| 383 | + shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
377 | 384 | shadowZItem.addActionListener(this); |
---|
378 | 385 | if (Globals.ADVANCED) |
---|
379 | 386 | { |
---|
.. | .. |
---|
581 | 588 | //minButton.setToolTipText("Minimize window"); |
---|
582 | 589 | //minButton.addActionListener(this); |
---|
583 | 590 | |
---|
584 | | - oe.toolbarPanel.add(maxButton = new cButton("\u271A", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 591 | + oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
585 | 592 | maxButton.setToolTipText("Maximize window"); |
---|
586 | 593 | maxButton.addActionListener(this); |
---|
587 | 594 | |
---|
588 | | - oe.toolbarPanel.add(fullButton = new cButton("\u2b1c", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 595 | + oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
589 | 596 | fullButton.setToolTipText("Full-screen window"); |
---|
590 | 597 | fullButton.addActionListener(this); |
---|
591 | 598 | |
---|
592 | | - oe.toolbarPanel.add(undoButton = new cButton("\u21a9", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 599 | + oe.toolboxPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
593 | 600 | undoButton.setToolTipText("Undo changes"); |
---|
594 | 601 | undoButton.addActionListener(this); |
---|
595 | 602 | |
---|
596 | | - oe.toolbarPanel.add(redoButton = new cButton("\u21aa", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 603 | + oe.toolboxPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
597 | 604 | redoButton.setToolTipText("Redo changes"); |
---|
598 | 605 | redoButton.addActionListener(this); |
---|
599 | 606 | |
---|
600 | | - oe.toolbarPanel.add(saveButton = new cButton("\u21e3", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 607 | + oe.toolboxPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
601 | 608 | saveButton.setToolTipText("Save changes"); |
---|
602 | 609 | saveButton.addActionListener(this); |
---|
603 | 610 | |
---|
604 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 611 | + oe.toolboxPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
605 | 612 | liveCB.setToolTipText("Enable animation"); |
---|
606 | 613 | liveCB.addItemListener(this); |
---|
607 | 614 | |
---|
608 | | - oe.toolbarPanel.add(oneStepButton = new cButton("\u29f4", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 615 | + oe.toolboxPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
609 | 616 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
610 | 617 | oneStepButton.addActionListener(this); |
---|
611 | 618 | |
---|
612 | | - oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
| 619 | + oe.toolboxPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
613 | 620 | fastCB.setToolTipText("Fast mode"); |
---|
614 | 621 | fastCB.addItemListener(this); |
---|
615 | 622 | |
---|
616 | | - oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 623 | + oe.toolboxPanel.Return(); |
---|
| 624 | + |
---|
| 625 | + oe.toolboxPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
617 | 626 | trackCB.setToolTipText("Enable tracking"); |
---|
618 | 627 | trackCB.addItemListener(this); |
---|
619 | 628 | |
---|
620 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 629 | + oe.toolboxPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
621 | 630 | screenfitButton.setToolTipText("Screen fit"); |
---|
622 | 631 | screenfitButton.addActionListener(this); |
---|
623 | 632 | |
---|
.. | .. |
---|
631 | 640 | snapobjectButton.setToolTipText("Snap Object"); |
---|
632 | 641 | } |
---|
633 | 642 | |
---|
634 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
635 | | - flashSelectionButton.setToolTipText("Show selection"); |
---|
| 643 | + oe.toolboxPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 644 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
636 | 645 | flashSelectionButton.addActionListener(this); |
---|
637 | 646 | |
---|
638 | | - oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
| 647 | + //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
639 | 648 | |
---|
640 | | - oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 649 | + oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
641 | 650 | twoButton.setToolTipText("Show center view only"); |
---|
642 | 651 | twoButton.addActionListener(this); |
---|
643 | | - oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 652 | + this.fullscreenLayout = twoButton; |
---|
| 653 | + |
---|
| 654 | + oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
644 | 655 | fourButton.addActionListener(this); |
---|
645 | 656 | fourButton.setToolTipText("Show left panel only"); |
---|
646 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 657 | + oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
647 | 658 | sixButton.setToolTipText("2-column layout left"); |
---|
648 | 659 | sixButton.addActionListener(this); |
---|
649 | | - oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 660 | + oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
650 | 661 | threeButton.setToolTipText("2-column layout right"); |
---|
651 | 662 | threeButton.addActionListener(this); |
---|
652 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 663 | + oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
653 | 664 | sevenButton.setToolTipText("3-column layout"); |
---|
654 | 665 | sevenButton.addActionListener(this); |
---|
655 | 666 | // |
---|
656 | 667 | |
---|
657 | | - oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 668 | + oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
658 | 669 | rootButton.setToolTipText("Edit selection in new tab"); |
---|
659 | 670 | rootButton.addActionListener(this); |
---|
660 | 671 | |
---|
661 | | - oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 672 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
662 | 673 | closeButton.setToolTipText("Close tab"); |
---|
663 | 674 | closeButton.addActionListener(this); |
---|
664 | 675 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
665 | 676 | //clearButton.addActionListener(this); |
---|
666 | | - |
---|
667 | | - cGridBag commandsPanel = new cGridBag(); |
---|
| 677 | + |
---|
| 678 | + // INSERT |
---|
| 679 | + oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 680 | + gridButton.setToolTipText("Create grid"); |
---|
| 681 | + gridButton.addActionListener(this); |
---|
| 682 | + |
---|
| 683 | + oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 684 | + boxButton.setToolTipText("Create box"); |
---|
| 685 | + boxButton.addActionListener(this); |
---|
| 686 | + |
---|
| 687 | + oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 688 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 689 | + sphereButton.addActionListener(this); |
---|
| 690 | + |
---|
| 691 | + oe.toolboxPanel.Return(); |
---|
668 | 692 | |
---|
669 | | - commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 693 | + oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 694 | + coneButton.setToolTipText("Create cone"); |
---|
| 695 | + coneButton.addActionListener(this); |
---|
| 696 | + |
---|
| 697 | + oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 698 | + torusButton.setToolTipText("Create torus"); |
---|
| 699 | + torusButton.addActionListener(this); |
---|
| 700 | + |
---|
| 701 | + oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 702 | + superButton.setToolTipText("Create superellipsoid"); |
---|
| 703 | + superButton.addActionListener(this); |
---|
| 704 | + |
---|
| 705 | + if (Globals.ADVANCED) |
---|
| 706 | + { |
---|
| 707 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 708 | + kleinButton.setToolTipText("Create Klein bottle"); |
---|
| 709 | + kleinButton.addActionListener(this); |
---|
| 710 | + } |
---|
| 711 | + |
---|
| 712 | + oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 713 | + particlesButton.setToolTipText("Create particle system"); |
---|
| 714 | + particlesButton.addActionListener(this); |
---|
| 715 | + |
---|
| 716 | + oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 717 | + overlayButton.setToolTipText("Create overlay"); |
---|
| 718 | + overlayButton.addActionListener(this); |
---|
| 719 | + |
---|
| 720 | + oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 721 | + lightButton.setToolTipText("Create light"); |
---|
| 722 | + lightButton.addActionListener(this); |
---|
| 723 | + |
---|
| 724 | + // EDIT panel |
---|
| 725 | + editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
670 | 726 | editButton.setToolTipText("Edit selection"); |
---|
671 | 727 | editButton.addActionListener(this); |
---|
672 | 728 | |
---|
673 | | - commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 729 | + editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
674 | 730 | uneditButton.setToolTipText("Unedit selection"); |
---|
675 | 731 | uneditButton.addActionListener(this); |
---|
676 | 732 | |
---|
677 | | - commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 733 | + editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
678 | 734 | allParamsButton.setToolTipText("Edit all params"); |
---|
679 | 735 | allParamsButton.addActionListener(this); |
---|
680 | 736 | |
---|
681 | | - commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 737 | + editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
682 | 738 | clearPanelButton.setToolTipText("Clear edit panel"); |
---|
683 | 739 | clearPanelButton.addActionListener(this); |
---|
684 | 740 | |
---|
685 | | - commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 741 | + editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
686 | 742 | unselectButton.setToolTipText("Unselect"); |
---|
687 | 743 | unselectButton.addActionListener(this); |
---|
688 | 744 | |
---|
689 | | - commandsPanel.preferredHeight = 1; |
---|
| 745 | + editCommandsPanel.preferredHeight = 1; |
---|
690 | 746 | |
---|
691 | | - oe.treePanel.add(commandsPanel); |
---|
692 | | - oe.treePanel.Return(); |
---|
| 747 | +// oe.treePanel.add(commandsPanel); |
---|
| 748 | +// oe.treePanel.Return(); |
---|
693 | 749 | |
---|
694 | 750 | // oe.aConstraints.gridx += 1; |
---|
695 | 751 | // oe.aConstraints.weighty = 0; |
---|
.. | .. |
---|
706 | 762 | |
---|
707 | 763 | JScrollPane jSP; |
---|
708 | 764 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
709 | | - jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints); |
---|
| 765 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
710 | 766 | ResetModel(); |
---|
711 | 767 | |
---|
712 | 768 | oe.treePanel.add(jSPPanel); |
---|
.. | .. |
---|
811 | 867 | // debugCB.addItemListener(this); |
---|
812 | 868 | |
---|
813 | 869 | panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 870 | + oeilCB.setToolTipText("Move camera when tracking target"); |
---|
814 | 871 | oeilCB.addItemListener(this); |
---|
815 | 872 | |
---|
| 873 | + panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
| 874 | + shadowCB.setToolTipText("Compute shadows when live"); |
---|
| 875 | + shadowCB.addItemListener(this); |
---|
| 876 | + |
---|
| 877 | + panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints); |
---|
| 878 | + autosaveCB.setToolTipText("Auto-save on structure change"); |
---|
| 879 | + autosaveCB.addItemListener(this); |
---|
| 880 | + |
---|
| 881 | + if (Globals.ADVANCED) |
---|
| 882 | + { |
---|
816 | 883 | panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
817 | 884 | lookAtCB.setToolTipText("Look-at target"); |
---|
818 | 885 | lookAtCB.addItemListener(this); |
---|
| 886 | + } |
---|
819 | 887 | |
---|
820 | 888 | } |
---|
821 | 889 | |
---|
.. | .. |
---|
830 | 898 | void EditObject(Object3D obj) |
---|
831 | 899 | { |
---|
832 | 900 | cRadio radioButton = new cRadio(obj.name); |
---|
| 901 | + |
---|
| 902 | + // Patch to avoid bug with transparency. |
---|
| 903 | + radioButton.hadMaterial = obj.material != null; |
---|
| 904 | + if (!radioButton.hadMaterial) |
---|
| 905 | + { |
---|
| 906 | + obj.material = new cMaterial(); |
---|
| 907 | + } |
---|
| 908 | + |
---|
833 | 909 | radioButton.SetObject(obj); |
---|
834 | 910 | radioButton.layout = sevenButton; |
---|
835 | 911 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
.. | .. |
---|
851 | 927 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
852 | 928 | } |
---|
853 | 929 | |
---|
854 | | - JCheckBox liveCB; |
---|
855 | | - JCheckBox supportCB; |
---|
856 | | - JCheckBox localCB; |
---|
857 | | - JCheckBox crowdCB; |
---|
858 | | - JCheckBox smoothCB; |
---|
859 | | - JCheckBox fastCB; |
---|
860 | | - JCheckBox slowCB; |
---|
861 | | - JCheckBox boxCB; |
---|
862 | | - JCheckBox zoomBoxCB; |
---|
863 | | - JCheckBox trackCB; |
---|
864 | | - JCheckBox smoothfocusCB; |
---|
| 930 | + cToggleButton liveCB; |
---|
| 931 | + cCheckBox supportCB; |
---|
| 932 | + cCheckBox localCB; |
---|
| 933 | + cCheckBox crowdCB; |
---|
| 934 | + cCheckBox smoothCB; |
---|
| 935 | + cToggleButton fastCB; |
---|
| 936 | + cCheckBox slowCB; |
---|
| 937 | + cCheckBox boxCB; |
---|
| 938 | + cCheckBox zoomBoxCB; |
---|
| 939 | + cToggleButton trackCB; |
---|
| 940 | + cCheckBox smoothfocusCB; |
---|
865 | 941 | // JCheckBox speakerMocapCB; |
---|
866 | | - JCheckBox speakerCameraCB; |
---|
867 | | - JCheckBox speakerFocusCB; |
---|
868 | | - JCheckBox debugCB; |
---|
869 | | - JCheckBox oeilCB; |
---|
870 | | - JCheckBox lookAtCB; |
---|
| 942 | + cCheckBox speakerCameraCB; |
---|
| 943 | + cCheckBox speakerFocusCB; |
---|
| 944 | + cCheckBox debugCB; |
---|
| 945 | + |
---|
| 946 | + cCheckBox oeilCB; |
---|
| 947 | + cCheckBox shadowCB; |
---|
| 948 | + cCheckBox autosaveCB; |
---|
| 949 | + cCheckBox lookAtCB; |
---|
871 | 950 | |
---|
872 | 951 | // static int COLOR = 1; |
---|
873 | 952 | // static int MATERIAL = 2; |
---|
.. | .. |
---|
875 | 954 | |
---|
876 | 955 | int dropAttributes = Object3D.COLOR | Object3D.MATERIAL; |
---|
877 | 956 | |
---|
878 | | - JCheckBox colorCB; |
---|
879 | | - JCheckBox materialCB; |
---|
880 | | - JCheckBox textureCB; |
---|
| 957 | + cCheckBox colorCB; |
---|
| 958 | + cCheckBox materialCB; |
---|
| 959 | + cCheckBox textureCB; |
---|
881 | 960 | |
---|
882 | 961 | public void itemStateChanged(ItemEvent e) |
---|
883 | 962 | { |
---|
.. | .. |
---|
970 | 1049 | { |
---|
971 | 1050 | cameraView.ToggleOeil(); |
---|
972 | 1051 | } |
---|
| 1052 | + else if(e.getSource() == shadowCB) |
---|
| 1053 | + { |
---|
| 1054 | + Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
| 1055 | + } |
---|
| 1056 | + else if(e.getSource() == autosaveCB) |
---|
| 1057 | + { |
---|
| 1058 | + Globals.SAVEONMAKE ^= true; |
---|
| 1059 | + } |
---|
973 | 1060 | else if(e.getSource() == lookAtCB) |
---|
974 | 1061 | { |
---|
975 | 1062 | cameraView.ToggleLookAt(); |
---|
.. | .. |
---|
986 | 1073 | |
---|
987 | 1074 | /**/ |
---|
988 | 1075 | //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this); |
---|
989 | | - TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1076 | + //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1077 | + TreePath path = objEditor.jTree.getSelectionPath(); |
---|
990 | 1078 | if ((path == null) || (path.getPathCount() <= 1)) { |
---|
991 | 1079 | // We can't move the root node or an empty selection |
---|
992 | 1080 | return; |
---|
.. | .. |
---|
1110 | 1198 | return; |
---|
1111 | 1199 | } |
---|
1112 | 1200 | |
---|
1113 | | - if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
1114 | | - { |
---|
| 1201 | +// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1202 | +// { |
---|
1115 | 1203 | loadClipboard(true); |
---|
1116 | 1204 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
1117 | 1205 | pasteInto(false, false); |
---|
1118 | | - } else { |
---|
1119 | | - loadClipboard(false); |
---|
1120 | | - objEditor.jTree.setSelectionPath(destinationPath); |
---|
1121 | | - pasteInto(false, false); // true); // ??? |
---|
1122 | | - } |
---|
| 1206 | +// } else { |
---|
| 1207 | +// loadClipboard(false); |
---|
| 1208 | +// objEditor.jTree.setSelectionPath(destinationPath); |
---|
| 1209 | +// pasteInto(false, false); // true); // ??? |
---|
| 1210 | +// } |
---|
1123 | 1211 | } |
---|
1124 | 1212 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
1125 | 1213 | // Called if the user has modified the current drop gesture |
---|
.. | .. |
---|
1454 | 1542 | shadow.material = new cMaterial(obj.material); |
---|
1455 | 1543 | shadow.material.diffuse = 0.0001f; |
---|
1456 | 1544 | shadow.material.specular = 0.0001f; |
---|
| 1545 | + //shadow.projectedVertices[1].x = 300; |
---|
1457 | 1546 | |
---|
1458 | 1547 | makeSomething(shadow); |
---|
1459 | 1548 | } |
---|
.. | .. |
---|
1710 | 1799 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1711 | 1800 | objEditor.cameraView.repaint(); |
---|
1712 | 1801 | } else |
---|
1713 | | - if (source == rectoidItem) |
---|
| 1802 | + if (source == rectoidItem || source == boxButton) |
---|
1714 | 1803 | { |
---|
1715 | 1804 | makeSomething(new Box()); |
---|
1716 | 1805 | } else |
---|
1717 | | - if (source == particleItem) |
---|
| 1806 | + if (source == particleItem || source == particlesButton) |
---|
1718 | 1807 | { |
---|
1719 | 1808 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1720 | 1809 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1793 | 1882 | |
---|
1794 | 1883 | makeSomething(obj); |
---|
1795 | 1884 | } else |
---|
1796 | | - if (source == gridItem) |
---|
| 1885 | + if (source == gridItem || source == gridButton) |
---|
1797 | 1886 | { |
---|
1798 | 1887 | makeSomething(new Grid()); |
---|
1799 | 1888 | } else |
---|
1800 | | - if (source == ellipsoidItem) |
---|
| 1889 | + if (source == ellipsoidItem || source == sphereButton) |
---|
1801 | 1890 | { |
---|
1802 | 1891 | makeSomething(new Sphere()); |
---|
1803 | 1892 | } else |
---|
1804 | | - if (source == coneItem) |
---|
| 1893 | + if (source == coneItem || source == coneButton) |
---|
1805 | 1894 | { |
---|
1806 | 1895 | makeSomething(new Cone()); |
---|
1807 | 1896 | } else |
---|
1808 | | - if (source == torusItem) |
---|
| 1897 | + if (source == torusItem || source == torusButton) |
---|
1809 | 1898 | { |
---|
1810 | 1899 | makeSomething(new Torus()); |
---|
1811 | 1900 | } else |
---|
1812 | | - if (source == superItem) |
---|
| 1901 | + if (source == superItem || source == superButton) |
---|
1813 | 1902 | { |
---|
1814 | 1903 | makeSomething(new Superellipsoid()); |
---|
1815 | 1904 | } else |
---|
1816 | | - if (source == kleinItem) |
---|
| 1905 | + if (source == kleinItem || source == kleinButton) |
---|
1817 | 1906 | { |
---|
1818 | 1907 | makeSomething(new Klein()); |
---|
1819 | 1908 | } else |
---|
.. | .. |
---|
1833 | 1922 | { |
---|
1834 | 1923 | makeSomething(new BezierSurface()); |
---|
1835 | 1924 | } else |
---|
1836 | | - if (source == overlayItem) |
---|
| 1925 | + if (source == overlayItem || source == overlayButton) |
---|
1837 | 1926 | { |
---|
1838 | 1927 | /* |
---|
1839 | 1928 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1881 | 1970 | s.setup(); |
---|
1882 | 1971 | makeSomething(s); |
---|
1883 | 1972 | } else |
---|
1884 | | - if (source == lightItem) |
---|
| 1973 | + if (source == lightItem || source == lightButton) |
---|
1885 | 1974 | { |
---|
1886 | 1975 | makeSomething(new Light()); |
---|
1887 | 1976 | } else |
---|
.. | .. |
---|
2567 | 2656 | { |
---|
2568 | 2657 | CastShadow(2); |
---|
2569 | 2658 | } else |
---|
2570 | | - if (source == ungroupItem) |
---|
| 2659 | + if (source == ungroupItem || source == ungroupButton) |
---|
2571 | 2660 | { |
---|
2572 | 2661 | //ungroup(); |
---|
2573 | 2662 | for (int i=0; i<group.selection.size(); i++) |
---|
.. | .. |
---|
2905 | 2994 | if (source == twoButton) |
---|
2906 | 2995 | { |
---|
2907 | 2996 | radio.layout = twoButton; |
---|
| 2997 | + |
---|
| 2998 | + if (CameraPane.FULLSCREEN) |
---|
| 2999 | + fullscreenLayout = radio.layout; |
---|
| 3000 | + |
---|
2908 | 3001 | // bug |
---|
2909 | 3002 | //gridPanel.setDividerLocation(1.0); |
---|
2910 | 3003 | //bigPanel.setDividerLocation(0.0); |
---|
.. | .. |
---|
2960 | 3053 | { |
---|
2961 | 3054 | radio.layout = threeButton; |
---|
2962 | 3055 | |
---|
| 3056 | + if (CameraPane.FULLSCREEN) |
---|
| 3057 | + fullscreenLayout = radio.layout; |
---|
| 3058 | + |
---|
2963 | 3059 | // bigThree.remove(scenePanel); |
---|
2964 | 3060 | // bigThree.remove(centralPanel); |
---|
2965 | 3061 | // bigThree.remove(XYZPanel); |
---|
.. | .. |
---|
2998 | 3094 | { |
---|
2999 | 3095 | radio.layout = fourButton; |
---|
3000 | 3096 | |
---|
| 3097 | + if (CameraPane.FULLSCREEN) |
---|
| 3098 | + fullscreenLayout = radio.layout; |
---|
| 3099 | + |
---|
3001 | 3100 | // bigThree.remove(scenePanel); |
---|
3002 | 3101 | // bigThree.remove(centralPanel); |
---|
3003 | 3102 | // bigThree.remove(XYZPanel); |
---|
.. | .. |
---|
3034 | 3133 | if (source == sixButton) |
---|
3035 | 3134 | { |
---|
3036 | 3135 | radio.layout = sixButton; |
---|
| 3136 | + |
---|
| 3137 | + if (CameraPane.FULLSCREEN) |
---|
| 3138 | + fullscreenLayout = radio.layout; |
---|
3037 | 3139 | |
---|
3038 | 3140 | // bigThree.remove(scenePanel); |
---|
3039 | 3141 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
3072 | 3174 | if (source == sevenButton) |
---|
3073 | 3175 | { |
---|
3074 | 3176 | radio.layout = sevenButton; |
---|
| 3177 | + |
---|
| 3178 | + if (CameraPane.FULLSCREEN) |
---|
| 3179 | + fullscreenLayout = radio.layout; |
---|
3075 | 3180 | |
---|
3076 | 3181 | // bigThree.remove(scenePanel); |
---|
3077 | 3182 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
3128 | 3233 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
3129 | 3234 | { |
---|
3130 | 3235 | ab = (cRadio)e.nextElement(); |
---|
3131 | | - if(ab.getModel().isSelected() && ab.GetObject() != client) |
---|
| 3236 | + if (ab.getModel().isSelected() && ab.GetObject() != client) |
---|
3132 | 3237 | { |
---|
| 3238 | + // Patch to avoid bug with transparency. |
---|
| 3239 | + if (!ab.hadMaterial) |
---|
| 3240 | + { |
---|
| 3241 | + ab.object.material = null; |
---|
| 3242 | + } |
---|
| 3243 | + |
---|
3133 | 3244 | buttonGroup.remove(ab); |
---|
3134 | 3245 | radioPanel.remove(ab); |
---|
3135 | 3246 | |
---|
3136 | | - ab.GetObject().editWindow = null; |
---|
| 3247 | + //ab.GetObject().editWindow = null; |
---|
| 3248 | + ab.GetObject().manipWindow = null; |
---|
3137 | 3249 | // ab.GetObject().objectUI = null; // ????????? |
---|
3138 | 3250 | |
---|
3139 | 3251 | ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick(); |
---|
.. | .. |
---|
3247 | 3359 | |
---|
3248 | 3360 | // fix "+" issue |
---|
3249 | 3361 | //group.editWindow = this; |
---|
| 3362 | + group.manipWindow = this; |
---|
3250 | 3363 | |
---|
3251 | 3364 | /* |
---|
3252 | 3365 | currentLayout = radio.layout; |
---|
.. | .. |
---|
4332 | 4445 | { |
---|
4333 | 4446 | //System.out.println("edit : " + objectPanel.indexOfTab("Material")); |
---|
4334 | 4447 | //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false); |
---|
4335 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 4448 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
4336 | 4449 | |
---|
4337 | 4450 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4338 | 4451 | if(elem != group || !newWindow) |
---|
.. | .. |
---|
4569 | 4682 | |
---|
4570 | 4683 | if (cut) |
---|
4571 | 4684 | { |
---|
| 4685 | + if (Globals.SAVEONMAKE) |
---|
4572 | 4686 | Save(); |
---|
4573 | 4687 | //int indices[] = jList.getSelectedIndices(); |
---|
4574 | 4688 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
5295 | 5409 | cButton saveButton; |
---|
5296 | 5410 | cButton oneStepButton; |
---|
5297 | 5411 | |
---|
| 5412 | + cButton groupButton; |
---|
| 5413 | + cButton ungroupButton; |
---|
| 5414 | + cButton compositeButton; |
---|
| 5415 | + |
---|
| 5416 | + cButton gridButton; |
---|
| 5417 | + cButton boxButton; |
---|
| 5418 | + cButton sphereButton; |
---|
| 5419 | + cButton coneButton; |
---|
| 5420 | + cButton torusButton; |
---|
| 5421 | + cButton superButton; |
---|
| 5422 | + cButton kleinButton; |
---|
| 5423 | + cButton particlesButton; |
---|
| 5424 | + cButton overlayButton; |
---|
| 5425 | + cButton lightButton; |
---|
| 5426 | + |
---|
5298 | 5427 | cButton screenfitButton; |
---|
5299 | 5428 | cButton screenfitpointButton; |
---|
5300 | 5429 | cButton snapobjectButton; |
---|
.. | .. |
---|
5319 | 5448 | private MenuItem cutItem; |
---|
5320 | 5449 | private MenuItem undoItem; |
---|
5321 | 5450 | private MenuItem redoItem; |
---|
5322 | | - private MenuItem duplicateItem; |
---|
| 5451 | + private JMenuItem duplicateItem; |
---|
5323 | 5452 | private MenuItem cloneItem; |
---|
5324 | 5453 | private MenuItem cloneSupportItem; |
---|
5325 | 5454 | private MenuItem overwriteGeoItem; |
---|