.. | .. |
---|
154 | 154 | oe.menuBar.add(menu = new Menu("Edit")); |
---|
155 | 155 | //editItem = menu.add(new MenuItem("Edit")); |
---|
156 | 156 | //editItem.addActionListener(this); |
---|
157 | | - undoItem = menu.add(new MenuItem("Undo")); |
---|
158 | | - undoItem.addActionListener(this); |
---|
159 | | - redoItem = menu.add(new MenuItem("Redo")); |
---|
160 | | - redoItem.addActionListener(this); |
---|
161 | | - menu.add("-"); |
---|
| 157 | + |
---|
| 158 | +// undoItem = menu.add(new MenuItem("Undo")); |
---|
| 159 | +// undoItem.addActionListener(this); |
---|
| 160 | +// redoItem = menu.add(new MenuItem("Redo")); |
---|
| 161 | +// redoItem.addActionListener(this); |
---|
| 162 | +// menu.add("-"); |
---|
162 | 163 | duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
163 | 164 | duplicateItem.addActionListener(this); |
---|
164 | 165 | cloneItem = menu.add(new MenuItem("Clone")); |
---|
.. | .. |
---|
175 | 176 | copyItem.addActionListener(this); |
---|
176 | 177 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
177 | 178 | pasteItem.addActionListener(this); |
---|
178 | | - menu.add("-"); |
---|
179 | 179 | |
---|
180 | 180 | menu.add("-"); |
---|
181 | 181 | pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
.. | .. |
---|
202 | 202 | //zBufferItem.addActionListener(this); |
---|
203 | 203 | //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
204 | 204 | //normalLensItem.addActionListener(this); |
---|
205 | | - cameraMenu.add(revertCameraItem = new MenuItem("Restore Camera")); |
---|
| 205 | + cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint")); |
---|
206 | 206 | revertCameraItem.addActionListener(this); |
---|
207 | 207 | |
---|
208 | 208 | cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
.. | .. |
---|
245 | 245 | |
---|
246 | 246 | cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
247 | 247 | toggleDebugItem.addItemListener(this); |
---|
248 | | - toggleDebugItem.setState(CameraPane.DEBUG); |
---|
| 248 | + toggleDebugItem.setState(Globals.DEBUG); |
---|
249 | 249 | |
---|
250 | 250 | cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
251 | 251 | toggleFrustumItem.addItemListener(this); |
---|
.. | .. |
---|
266 | 266 | // animationItem.addItemListener(this); |
---|
267 | 267 | // animationItem.setState(CameraPane.ANIMATION); |
---|
268 | 268 | cameraMenu.add("-"); |
---|
269 | | - cameraMenu.add(editCameraItem = new MenuItem("Save Camera")); |
---|
| 269 | + cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint")); |
---|
270 | 270 | editCameraItem.addActionListener(this); |
---|
271 | 271 | |
---|
272 | 272 | if (Globals.ADVANCED) |
---|
.. | .. |
---|
368 | 368 | billboardItem.addActionListener(this); |
---|
369 | 369 | csgItem = menu.add(new MenuItem("CSG")); |
---|
370 | 370 | csgItem.addActionListener(this); |
---|
371 | | - shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
| 371 | + shadowXItem = menu.add(new MenuItem("Shadow Red")); |
---|
372 | 372 | shadowXItem.addActionListener(this); |
---|
373 | | - shadowYItem = menu.add(new MenuItem("Shadow Y")); |
---|
| 373 | + shadowYItem = menu.add(new MenuItem("Shadow Green")); |
---|
374 | 374 | shadowYItem.addActionListener(this); |
---|
375 | | - shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
| 375 | + shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
376 | 376 | shadowZItem.addActionListener(this); |
---|
377 | 377 | if (Globals.ADVANCED) |
---|
378 | 378 | { |
---|
.. | .. |
---|
469 | 469 | markleavesItem.addActionListener(this); |
---|
470 | 470 | unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
471 | 471 | unmarkleavesItem.addActionListener(this); |
---|
| 472 | + rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
| 473 | + rewindleavesItem.addActionListener(this); |
---|
| 474 | + unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves")); |
---|
| 475 | + unrewindleavesItem.addActionListener(this); |
---|
| 476 | + randomleavesItem = menu.add(new MenuItem("Random Leaves")); |
---|
| 477 | + randomleavesItem.addActionListener(this); |
---|
| 478 | + unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves")); |
---|
| 479 | + unrandomleavesItem.addActionListener(this); |
---|
472 | 480 | menu.add("-"); |
---|
473 | 481 | flipVItem = menu.add(new MenuItem("Flip V")); |
---|
474 | 482 | flipVItem.addActionListener(this); |
---|
.. | .. |
---|
526 | 534 | |
---|
527 | 535 | void SetupUI2(ObjEditor oe) |
---|
528 | 536 | { |
---|
| 537 | + // June 2019 |
---|
| 538 | + if (oe == null) |
---|
| 539 | + { |
---|
| 540 | + //super.SetupUI2(this); |
---|
| 541 | + //return; |
---|
| 542 | + } |
---|
| 543 | + |
---|
| 544 | + if (copy != group) |
---|
| 545 | + { |
---|
| 546 | + //super.SetupUI2(this); |
---|
| 547 | + } |
---|
| 548 | + |
---|
529 | 549 | //new Exception().printStackTrace(); |
---|
530 | 550 | |
---|
531 | 551 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
.. | .. |
---|
556 | 576 | */ |
---|
557 | 577 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
558 | 578 | |
---|
559 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 579 | + //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 580 | + //minButton.setToolTipText("Minimize window"); |
---|
| 581 | + //minButton.addActionListener(this); |
---|
| 582 | + |
---|
| 583 | + oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 584 | + maxButton.setToolTipText("Maximize window"); |
---|
| 585 | + maxButton.addActionListener(this); |
---|
| 586 | + |
---|
| 587 | + oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 588 | + fullButton.setToolTipText("Full-screen window"); |
---|
| 589 | + fullButton.addActionListener(this); |
---|
| 590 | + |
---|
| 591 | + oe.toolbarPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 592 | + undoButton.setToolTipText("Undo changes"); |
---|
| 593 | + undoButton.addActionListener(this); |
---|
| 594 | + |
---|
| 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"); |
---|
| 601 | + saveButton.addActionListener(this); |
---|
| 602 | + |
---|
| 603 | + oe.toolbarPanel.add(liveCB = GetCheckBox("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
560 | 604 | liveCB.setToolTipText("Enable animation"); |
---|
561 | 605 | liveCB.addItemListener(this); |
---|
562 | 606 | |
---|
563 | | - oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
564 | | - oneStepButton.setToolTipText("Animate one step forward"); |
---|
565 | | - oneStepButton.addActionListener(this); |
---|
566 | | - |
---|
567 | | - oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
| 607 | + oe.toolbarPanel.add(fastCB = GetCheckBox("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
568 | 608 | fastCB.setToolTipText("Fast mode"); |
---|
569 | 609 | fastCB.addItemListener(this); |
---|
570 | 610 | |
---|
571 | | - oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 611 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 612 | + oneStepButton.setToolTipText("Animate one step forward"); |
---|
| 613 | + oneStepButton.addActionListener(this); |
---|
| 614 | + |
---|
| 615 | + oe.toolbarPanel.add(trackCB = GetCheckBox("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
572 | 616 | trackCB.setToolTipText("Enable tracking"); |
---|
573 | 617 | trackCB.addItemListener(this); |
---|
574 | 618 | |
---|
575 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 619 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
576 | 620 | screenfitButton.setToolTipText("Screen fit"); |
---|
577 | 621 | screenfitButton.addActionListener(this); |
---|
578 | 622 | |
---|
.. | .. |
---|
586 | 630 | snapobjectButton.setToolTipText("Snap Object"); |
---|
587 | 631 | } |
---|
588 | 632 | |
---|
589 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
590 | | - flashSelectionButton.setToolTipText("Show selection"); |
---|
| 633 | + oe.toolbarPanel.add(flashSelectionButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 634 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
591 | 635 | flashSelectionButton.addActionListener(this); |
---|
592 | 636 | |
---|
593 | 637 | oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
594 | 638 | |
---|
595 | | - oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 639 | + oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
596 | 640 | twoButton.setToolTipText("Show center view only"); |
---|
597 | 641 | twoButton.addActionListener(this); |
---|
598 | | - oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 642 | + oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
599 | 643 | fourButton.addActionListener(this); |
---|
600 | 644 | fourButton.setToolTipText("Show left panel only"); |
---|
601 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 645 | + oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
602 | 646 | sixButton.setToolTipText("2-column layout left"); |
---|
603 | 647 | sixButton.addActionListener(this); |
---|
604 | | - oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 648 | + oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
605 | 649 | threeButton.setToolTipText("2-column layout right"); |
---|
606 | 650 | threeButton.addActionListener(this); |
---|
607 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 651 | + oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
608 | 652 | sevenButton.setToolTipText("3-column layout"); |
---|
609 | 653 | sevenButton.addActionListener(this); |
---|
610 | 654 | // |
---|
.. | .. |
---|
619 | 663 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
620 | 664 | //clearButton.addActionListener(this); |
---|
621 | 665 | |
---|
622 | | - cGridBag commandsPanel = new cGridBag(); |
---|
623 | | - |
---|
624 | | - commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 666 | + editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
625 | 667 | editButton.setToolTipText("Edit selection"); |
---|
626 | 668 | editButton.addActionListener(this); |
---|
627 | 669 | |
---|
628 | | - commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 670 | + editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
629 | 671 | uneditButton.setToolTipText("Unedit selection"); |
---|
630 | 672 | uneditButton.addActionListener(this); |
---|
631 | 673 | |
---|
632 | | - commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 674 | + editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
633 | 675 | allParamsButton.setToolTipText("Edit all params"); |
---|
634 | 676 | allParamsButton.addActionListener(this); |
---|
635 | 677 | |
---|
636 | | - commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 678 | + editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
637 | 679 | clearPanelButton.setToolTipText("Clear edit panel"); |
---|
638 | 680 | clearPanelButton.addActionListener(this); |
---|
639 | 681 | |
---|
640 | | - commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 682 | + editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
641 | 683 | unselectButton.setToolTipText("Unselect"); |
---|
642 | 684 | unselectButton.addActionListener(this); |
---|
643 | 685 | |
---|
644 | | - commandsPanel.preferredHeight = 1; |
---|
| 686 | + editCommandsPanel.preferredHeight = 1; |
---|
645 | 687 | |
---|
646 | | - oe.treePanel.add(commandsPanel); |
---|
647 | | - oe.treePanel.Return(); |
---|
| 688 | +// oe.treePanel.add(commandsPanel); |
---|
| 689 | +// oe.treePanel.Return(); |
---|
648 | 690 | |
---|
649 | 691 | // oe.aConstraints.gridx += 1; |
---|
650 | 692 | // oe.aConstraints.weighty = 0; |
---|
.. | .. |
---|
766 | 808 | // debugCB.addItemListener(this); |
---|
767 | 809 | |
---|
768 | 810 | panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 811 | + oeilCB.setToolTipText("Move camera when tracking target"); |
---|
769 | 812 | oeilCB.addItemListener(this); |
---|
770 | 813 | |
---|
| 814 | + panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
| 815 | + shadowCB.setToolTipText("Compute shadows when live"); |
---|
| 816 | + shadowCB.addItemListener(this); |
---|
| 817 | + |
---|
| 818 | + panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints); |
---|
| 819 | + autosaveCB.setToolTipText("Auto-save on structure change"); |
---|
| 820 | + autosaveCB.addItemListener(this); |
---|
| 821 | + |
---|
| 822 | + if (Globals.ADVANCED) |
---|
| 823 | + { |
---|
771 | 824 | panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
772 | 825 | lookAtCB.setToolTipText("Look-at target"); |
---|
773 | 826 | lookAtCB.addItemListener(this); |
---|
| 827 | + } |
---|
774 | 828 | |
---|
775 | 829 | } |
---|
776 | 830 | |
---|
.. | .. |
---|
785 | 839 | void EditObject(Object3D obj) |
---|
786 | 840 | { |
---|
787 | 841 | cRadio radioButton = new cRadio(obj.name); |
---|
| 842 | + |
---|
| 843 | + // Patch to avoid bug with transparency. |
---|
| 844 | + radioButton.hadMaterial = obj.material != null; |
---|
| 845 | + if (!radioButton.hadMaterial) |
---|
| 846 | + { |
---|
| 847 | + obj.material = new cMaterial(); |
---|
| 848 | + } |
---|
| 849 | + |
---|
788 | 850 | radioButton.SetObject(obj); |
---|
789 | 851 | radioButton.layout = sevenButton; |
---|
790 | 852 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
.. | .. |
---|
796 | 858 | |
---|
797 | 859 | void SetupViews(ObjEditor oe) |
---|
798 | 860 | { |
---|
| 861 | + theFrame = this; |
---|
| 862 | + |
---|
799 | 863 | oe.SetupViews(); |
---|
800 | 864 | |
---|
801 | 865 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
804 | 868 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
805 | 869 | } |
---|
806 | 870 | |
---|
807 | | - JCheckBox liveCB; |
---|
808 | | - JCheckBox supportCB; |
---|
809 | | - JCheckBox localCB; |
---|
810 | | - JCheckBox crowdCB; |
---|
811 | | - JCheckBox smoothCB; |
---|
812 | | - JCheckBox fastCB; |
---|
813 | | - JCheckBox slowCB; |
---|
814 | | - JCheckBox boxCB; |
---|
815 | | - JCheckBox zoomBoxCB; |
---|
816 | | - JCheckBox trackCB; |
---|
817 | | - JCheckBox smoothfocusCB; |
---|
| 871 | + cCheckBox liveCB; |
---|
| 872 | + cCheckBox supportCB; |
---|
| 873 | + cCheckBox localCB; |
---|
| 874 | + cCheckBox crowdCB; |
---|
| 875 | + cCheckBox smoothCB; |
---|
| 876 | + cCheckBox fastCB; |
---|
| 877 | + cCheckBox slowCB; |
---|
| 878 | + cCheckBox boxCB; |
---|
| 879 | + cCheckBox zoomBoxCB; |
---|
| 880 | + cCheckBox trackCB; |
---|
| 881 | + cCheckBox smoothfocusCB; |
---|
818 | 882 | // JCheckBox speakerMocapCB; |
---|
819 | | - JCheckBox speakerCameraCB; |
---|
820 | | - JCheckBox speakerFocusCB; |
---|
821 | | - JCheckBox debugCB; |
---|
822 | | - JCheckBox oeilCB; |
---|
823 | | - JCheckBox lookAtCB; |
---|
| 883 | + cCheckBox speakerCameraCB; |
---|
| 884 | + cCheckBox speakerFocusCB; |
---|
| 885 | + cCheckBox debugCB; |
---|
| 886 | + |
---|
| 887 | + cCheckBox oeilCB; |
---|
| 888 | + cCheckBox shadowCB; |
---|
| 889 | + cCheckBox autosaveCB; |
---|
| 890 | + cCheckBox lookAtCB; |
---|
824 | 891 | |
---|
825 | 892 | // static int COLOR = 1; |
---|
826 | 893 | // static int MATERIAL = 2; |
---|
.. | .. |
---|
828 | 895 | |
---|
829 | 896 | int dropAttributes = Object3D.COLOR | Object3D.MATERIAL; |
---|
830 | 897 | |
---|
831 | | - JCheckBox colorCB; |
---|
832 | | - JCheckBox materialCB; |
---|
833 | | - JCheckBox textureCB; |
---|
| 898 | + cCheckBox colorCB; |
---|
| 899 | + cCheckBox materialCB; |
---|
| 900 | + cCheckBox textureCB; |
---|
834 | 901 | |
---|
835 | 902 | public void itemStateChanged(ItemEvent e) |
---|
836 | 903 | { |
---|
.. | .. |
---|
858 | 925 | } else if(e.getSource() == liveCB) |
---|
859 | 926 | { |
---|
860 | 927 | cameraView.ToggleLive(); |
---|
| 928 | + refreshContents(false); |
---|
861 | 929 | } |
---|
862 | 930 | else if(e.getSource() == supportCB) |
---|
863 | 931 | { |
---|
.. | .. |
---|
921 | 989 | else if(e.getSource() == oeilCB) |
---|
922 | 990 | { |
---|
923 | 991 | cameraView.ToggleOeil(); |
---|
| 992 | + } |
---|
| 993 | + else if(e.getSource() == shadowCB) |
---|
| 994 | + { |
---|
| 995 | + Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
| 996 | + } |
---|
| 997 | + else if(e.getSource() == autosaveCB) |
---|
| 998 | + { |
---|
| 999 | + Globals.SAVEONMAKE ^= true; |
---|
924 | 1000 | } |
---|
925 | 1001 | else if(e.getSource() == lookAtCB) |
---|
926 | 1002 | { |
---|
.. | .. |
---|
1265 | 1341 | memoryItem.addActionListener(this); |
---|
1266 | 1342 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1267 | 1343 | analyzeItem.addActionListener(this); |
---|
1268 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1344 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1269 | 1345 | dumpItem.addActionListener(this); |
---|
1270 | 1346 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1271 | 1347 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1406 | 1482 | shadow.material = new cMaterial(obj.material); |
---|
1407 | 1483 | shadow.material.diffuse = 0.0001f; |
---|
1408 | 1484 | shadow.material.specular = 0.0001f; |
---|
| 1485 | + //shadow.projectedVertices[1].x = 300; |
---|
1409 | 1486 | |
---|
1410 | 1487 | makeSomething(shadow); |
---|
1411 | 1488 | } |
---|
.. | .. |
---|
1955 | 2032 | if (source == dumpItem) |
---|
1956 | 2033 | { |
---|
1957 | 2034 | DumpObject(); |
---|
| 2035 | + } else |
---|
| 2036 | + if (source == minButton) |
---|
| 2037 | + { |
---|
| 2038 | + Minimize(); |
---|
| 2039 | + } else |
---|
| 2040 | + if (source == maxButton) |
---|
| 2041 | + { |
---|
| 2042 | + Maximize(); |
---|
| 2043 | + } else |
---|
| 2044 | + if (source == fullButton) |
---|
| 2045 | + { |
---|
| 2046 | + ToggleFullScreen(); |
---|
| 2047 | + } else |
---|
| 2048 | + if (source == undoButton) |
---|
| 2049 | + { |
---|
| 2050 | + Undo(); |
---|
| 2051 | + } else |
---|
| 2052 | + if (source == redoButton) |
---|
| 2053 | + { |
---|
| 2054 | + Redo(); |
---|
| 2055 | + } else |
---|
| 2056 | + if (source == saveButton) |
---|
| 2057 | + { |
---|
| 2058 | + Save(); |
---|
1958 | 2059 | } else |
---|
1959 | 2060 | if (source == oneStepButton) |
---|
1960 | 2061 | { |
---|
.. | .. |
---|
2517 | 2618 | } else |
---|
2518 | 2619 | if (source == genNormalsMESHItem) |
---|
2519 | 2620 | { |
---|
2520 | | - GenNormals(true); // TODO |
---|
| 2621 | + GenNormalsMESH(); |
---|
2521 | 2622 | } else |
---|
2522 | 2623 | if (source == genNormalsORGANItem) |
---|
2523 | 2624 | { |
---|
.. | .. |
---|
2582 | 2683 | if (source == unmarkleavesItem) |
---|
2583 | 2684 | { |
---|
2584 | 2685 | MarkLeaves(false); |
---|
| 2686 | + } else |
---|
| 2687 | + if (source == rewindleavesItem) |
---|
| 2688 | + { |
---|
| 2689 | + RewindLeaves(true); |
---|
| 2690 | + } else |
---|
| 2691 | + if (source == unrewindleavesItem) |
---|
| 2692 | + { |
---|
| 2693 | + RewindLeaves(false); |
---|
| 2694 | + } else |
---|
| 2695 | + if (source == randomleavesItem) |
---|
| 2696 | + { |
---|
| 2697 | + RandomLeaves(true); |
---|
| 2698 | + } else |
---|
| 2699 | + if (source == unrandomleavesItem) |
---|
| 2700 | + { |
---|
| 2701 | + RandomLeaves(false); |
---|
2585 | 2702 | } else |
---|
2586 | 2703 | if (source == flipVItem) |
---|
2587 | 2704 | { |
---|
.. | .. |
---|
2849 | 2966 | bigThree.ClearUI(); |
---|
2850 | 2967 | bigThree.add(centralPanel); |
---|
2851 | 2968 | bigThree.FlushUI(); |
---|
| 2969 | + |
---|
| 2970 | + cameraView.requestFocusInWindow(); |
---|
| 2971 | + |
---|
| 2972 | +// refreshContents(true); |
---|
| 2973 | +// |
---|
| 2974 | +// try |
---|
| 2975 | +// { |
---|
| 2976 | +// java.awt.Robot bot = new java.awt.Robot(); |
---|
| 2977 | +// int mask = InputEvent.BUTTON1_MASK; |
---|
| 2978 | +// bot.mouseMove(100, 100); |
---|
| 2979 | +// bot.mousePress(mask); |
---|
| 2980 | +// bot.mouseRelease(mask); |
---|
| 2981 | +// } |
---|
| 2982 | +// catch (Exception e) |
---|
| 2983 | +// { |
---|
| 2984 | +// |
---|
| 2985 | +// } |
---|
| 2986 | + |
---|
2852 | 2987 | } else |
---|
2853 | 2988 | if (source == threeButton) |
---|
2854 | 2989 | { |
---|
.. | .. |
---|
2885 | 3020 | bigThree.add(centralPanel); |
---|
2886 | 3021 | bigThree.add(XYZPanel); |
---|
2887 | 3022 | bigThree.FlushUI(); |
---|
| 3023 | + |
---|
| 3024 | + cameraView.requestFocusInWindow(); |
---|
2888 | 3025 | } else |
---|
2889 | 3026 | if (source == fourButton) |
---|
2890 | 3027 | { |
---|
.. | .. |
---|
2920 | 3057 | bigThree.ClearUI(); |
---|
2921 | 3058 | bigThree.add(scenePanel); |
---|
2922 | 3059 | bigThree.FlushUI(); |
---|
| 3060 | + |
---|
| 3061 | + cameraView.requestFocusInWindow(); |
---|
2923 | 3062 | } else |
---|
2924 | 3063 | if (source == sixButton) |
---|
2925 | 3064 | { |
---|
.. | .. |
---|
2956 | 3095 | bigThree.add(scenePanel); |
---|
2957 | 3096 | bigThree.add(centralPanel); |
---|
2958 | 3097 | bigThree.FlushUI(); |
---|
| 3098 | + |
---|
| 3099 | + cameraView.requestFocusInWindow(); |
---|
2959 | 3100 | } else |
---|
2960 | 3101 | if (source == sevenButton) |
---|
2961 | 3102 | { |
---|
.. | .. |
---|
2993 | 3134 | bigThree.add(centralPanel); |
---|
2994 | 3135 | bigThree.add(XYZPanel); |
---|
2995 | 3136 | bigThree.FlushUI(); |
---|
| 3137 | + |
---|
| 3138 | + cameraView.requestFocusInWindow(); |
---|
2996 | 3139 | } else |
---|
2997 | 3140 | if (source == rootButton) |
---|
2998 | 3141 | { |
---|
.. | .. |
---|
3004 | 3147 | EditObject(obj); |
---|
3005 | 3148 | } |
---|
3006 | 3149 | |
---|
| 3150 | + cameraView.requestFocusInWindow(); |
---|
3007 | 3151 | refreshContents(true); |
---|
3008 | 3152 | } else |
---|
3009 | 3153 | if (source == closeButton) |
---|
.. | .. |
---|
3013 | 3157 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
3014 | 3158 | { |
---|
3015 | 3159 | ab = (cRadio)e.nextElement(); |
---|
3016 | | - if(ab.getModel().isSelected() && ab.GetObject() != client) |
---|
| 3160 | + if (ab.getModel().isSelected() && ab.GetObject() != client) |
---|
3017 | 3161 | { |
---|
| 3162 | + // Patch to avoid bug with transparency. |
---|
| 3163 | + if (!ab.hadMaterial) |
---|
| 3164 | + { |
---|
| 3165 | + ab.object.material = null; |
---|
| 3166 | + } |
---|
| 3167 | + |
---|
3018 | 3168 | buttonGroup.remove(ab); |
---|
3019 | 3169 | radioPanel.remove(ab); |
---|
3020 | 3170 | |
---|
3021 | | - ab.GetObject().editWindow = null; |
---|
| 3171 | + //ab.GetObject().editWindow = null; |
---|
| 3172 | + ab.GetObject().manipWindow = null; |
---|
3022 | 3173 | // ab.GetObject().objectUI = null; // ????????? |
---|
3023 | 3174 | |
---|
3024 | 3175 | ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick(); |
---|
3025 | 3176 | break; |
---|
3026 | 3177 | } |
---|
3027 | 3178 | } |
---|
| 3179 | + |
---|
| 3180 | + cameraView.requestFocusInWindow(); |
---|
3028 | 3181 | refreshContents(true); |
---|
3029 | 3182 | } else |
---|
3030 | 3183 | if (source == editItem || source == editButton) |
---|
.. | .. |
---|
3128 | 3281 | sideView.object = group; |
---|
3129 | 3282 | } |
---|
3130 | 3283 | |
---|
3131 | | -// fix "+" issue group.editWindow = this; |
---|
| 3284 | +// fix "+" issue |
---|
| 3285 | + //group.editWindow = this; |
---|
| 3286 | + group.manipWindow = this; |
---|
3132 | 3287 | |
---|
3133 | 3288 | /* |
---|
3134 | 3289 | currentLayout = radio.layout; |
---|
.. | .. |
---|
3141 | 3296 | //group.parent = null; // ROOT |
---|
3142 | 3297 | //group.attributes = -1; |
---|
3143 | 3298 | ResetModel(); |
---|
| 3299 | + |
---|
| 3300 | + cameraView.requestFocusInWindow(); |
---|
3144 | 3301 | refreshContents(true); |
---|
3145 | 3302 | } else if (event.getSource() == editCameraItem) |
---|
3146 | 3303 | { |
---|
.. | .. |
---|
3164 | 3321 | } |
---|
3165 | 3322 | |
---|
3166 | 3323 | boolean useclient = false; |
---|
3167 | | - cRadio radio; |
---|
3168 | 3324 | |
---|
3169 | 3325 | void ToggleRoot() |
---|
3170 | 3326 | { |
---|
.. | .. |
---|
3403 | 3559 | |
---|
3404 | 3560 | int size = obj.MemorySize(); |
---|
3405 | 3561 | |
---|
3406 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3562 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3563 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3407 | 3564 | } |
---|
3408 | 3565 | } |
---|
3409 | 3566 | catch (Exception e) |
---|
.. | .. |
---|
3484 | 3641 | void GenNormals(boolean crease) |
---|
3485 | 3642 | { |
---|
3486 | 3643 | group.GenNormalsS(crease); |
---|
| 3644 | + |
---|
| 3645 | + refreshContents(); |
---|
| 3646 | + } |
---|
| 3647 | + |
---|
| 3648 | + void GenNormalsMESH() |
---|
| 3649 | + { |
---|
| 3650 | + group.GenNormalsMeshS(); |
---|
3487 | 3651 | |
---|
3488 | 3652 | refreshContents(); |
---|
3489 | 3653 | } |
---|
.. | .. |
---|
4111 | 4275 | refreshContents(); |
---|
4112 | 4276 | } |
---|
4113 | 4277 | |
---|
| 4278 | + void RewindLeaves(boolean hide) |
---|
| 4279 | + { |
---|
| 4280 | + group.selection.RewindLeaves(hide); |
---|
| 4281 | + refreshContents(); |
---|
| 4282 | + } |
---|
| 4283 | + |
---|
| 4284 | + void RandomLeaves(boolean hide) |
---|
| 4285 | + { |
---|
| 4286 | + group.selection.RandomLeaves(hide); |
---|
| 4287 | + refreshContents(); |
---|
| 4288 | + } |
---|
| 4289 | + |
---|
4114 | 4290 | void SetTexRes(int tr) |
---|
4115 | 4291 | { |
---|
4116 | 4292 | group.selection.SetTexRes(tr); |
---|
.. | .. |
---|
4286 | 4462 | //case 702: // Event.LIST_DESELECT |
---|
4287 | 4463 | group.deselectAll(); |
---|
4288 | 4464 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4289 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4290 | 4465 | if (tps != null) |
---|
4291 | 4466 | { |
---|
4292 | 4467 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4295 | 4470 | |
---|
4296 | 4471 | //if (child.parent != null) |
---|
4297 | 4472 | //child.parent.addSelectee(child); |
---|
| 4473 | + objEditor.SetMaterial(child); |
---|
4298 | 4474 | group.addSelectee(child); |
---|
4299 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4300 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4301 | | - System.err.println("info : " + child.GetPath()); |
---|
4302 | 4475 | } |
---|
4303 | 4476 | } |
---|
4304 | 4477 | // else |
---|
.. | .. |
---|
4308 | 4481 | // System.err.println("info : " + group.GetPath()); |
---|
4309 | 4482 | // } |
---|
4310 | 4483 | |
---|
4311 | | - objEditor.SetText(); // jan 2014 |
---|
4312 | | - |
---|
4313 | 4484 | if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4314 | 4485 | CameraPane.flash = true; |
---|
4315 | 4486 | |
---|
.. | .. |
---|
4333 | 4504 | |
---|
4334 | 4505 | freezemodel = false; |
---|
4335 | 4506 | } |
---|
| 4507 | + |
---|
| 4508 | + void refreshContents(boolean cp) |
---|
| 4509 | + { |
---|
| 4510 | + if (!Globals.MOUSEDRAGGED) |
---|
| 4511 | + { |
---|
| 4512 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 4513 | + |
---|
| 4514 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 4515 | + { |
---|
| 4516 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 4517 | + |
---|
| 4518 | + objEditor.AddInfo(child, this, true); |
---|
| 4519 | + System.err.println("info : " + child.GetPath()); |
---|
| 4520 | + } |
---|
| 4521 | + |
---|
| 4522 | + objEditor.SetText(); // jan 2014 |
---|
| 4523 | + } |
---|
| 4524 | + |
---|
| 4525 | + super.refreshContents(cp); |
---|
| 4526 | + } |
---|
4336 | 4527 | |
---|
4337 | 4528 | void linkSomething(Object3D thing) |
---|
4338 | 4529 | { |
---|
.. | .. |
---|
4404 | 4595 | { |
---|
4405 | 4596 | if (group.selection.isEmpty()) |
---|
4406 | 4597 | return; |
---|
| 4598 | + |
---|
4407 | 4599 | Grafreed.clipboardIsTempGroup = false; |
---|
4408 | 4600 | Composite tGroup = null; |
---|
4409 | 4601 | if (group.selection.size() > 0) // 1) |
---|
.. | .. |
---|
4414 | 4606 | |
---|
4415 | 4607 | if (cut) |
---|
4416 | 4608 | { |
---|
| 4609 | + if (Globals.SAVEONMAKE) |
---|
| 4610 | + Save(); |
---|
4417 | 4611 | //int indices[] = jList.getSelectedIndices(); |
---|
4418 | 4612 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4419 | 4613 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4503 | 4697 | } |
---|
4504 | 4698 | |
---|
4505 | 4699 | } |
---|
| 4700 | + |
---|
4506 | 4701 | if (Grafreed.clipboardIsTempGroup) |
---|
4507 | 4702 | Grafreed.clipboard = tGroup; |
---|
| 4703 | + |
---|
4508 | 4704 | if (cut) |
---|
4509 | 4705 | { |
---|
4510 | 4706 | ResetModel(); |
---|
.. | .. |
---|
5129 | 5325 | cButton clearpanelButton; |
---|
5130 | 5326 | cButton unselectButton; |
---|
5131 | 5327 | |
---|
| 5328 | + cButton minButton; |
---|
| 5329 | + cButton maxButton; |
---|
| 5330 | + cButton fullButton; |
---|
| 5331 | + cButton undoButton; |
---|
| 5332 | + cButton redoButton; |
---|
| 5333 | + cButton saveButton; |
---|
5132 | 5334 | cButton oneStepButton; |
---|
5133 | 5335 | |
---|
5134 | 5336 | cButton screenfitButton; |
---|
.. | .. |
---|
5141 | 5343 | cButton closeButton; |
---|
5142 | 5344 | |
---|
5143 | 5345 | cButton setsupportButton; |
---|
5144 | | - |
---|
5145 | | - cButton twoButton; |
---|
5146 | | - cButton sixButton; |
---|
5147 | | - cButton threeButton; |
---|
5148 | | - cButton sevenButton; |
---|
5149 | | - cButton fourButton; // full panel |
---|
5150 | | - cButton oneButton; // full XYZ |
---|
5151 | | - //cButton currentLayout; |
---|
5152 | 5346 | |
---|
5153 | 5347 | // |
---|
5154 | 5348 | //Composite |
---|
.. | .. |
---|
5226 | 5420 | private MenuItem showleavesItem; |
---|
5227 | 5421 | private MenuItem markleavesItem; |
---|
5228 | 5422 | private MenuItem unmarkleavesItem; |
---|
| 5423 | + private MenuItem rewindleavesItem; |
---|
| 5424 | + private MenuItem unrewindleavesItem; |
---|
| 5425 | + private MenuItem randomleavesItem; |
---|
| 5426 | + private MenuItem unrandomleavesItem; |
---|
5229 | 5427 | |
---|
5230 | 5428 | private MenuItem flipVItem; |
---|
5231 | 5429 | private MenuItem unflipVItem; |
---|