.. | .. |
---|
154 | 154 | oe.menuBar.add(menu = new Menu("Edit")); |
---|
155 | 155 | //editItem = menu.add(new MenuItem("Edit")); |
---|
156 | 156 | //editItem.addActionListener(this); |
---|
| 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("-"); |
---|
157 | 163 | duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
158 | 164 | duplicateItem.addActionListener(this); |
---|
159 | 165 | cloneItem = menu.add(new MenuItem("Clone")); |
---|
.. | .. |
---|
170 | 176 | copyItem.addActionListener(this); |
---|
171 | 177 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
172 | 178 | pasteItem.addActionListener(this); |
---|
173 | | - menu.add("-"); |
---|
174 | 179 | |
---|
175 | 180 | menu.add("-"); |
---|
176 | 181 | pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
.. | .. |
---|
197 | 202 | //zBufferItem.addActionListener(this); |
---|
198 | 203 | //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
199 | 204 | //normalLensItem.addActionListener(this); |
---|
200 | | - cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera")); |
---|
| 205 | + cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint")); |
---|
201 | 206 | revertCameraItem.addActionListener(this); |
---|
202 | 207 | |
---|
203 | 208 | cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
.. | .. |
---|
240 | 245 | |
---|
241 | 246 | cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
242 | 247 | toggleDebugItem.addItemListener(this); |
---|
243 | | - toggleDebugItem.setState(CameraPane.DEBUG); |
---|
| 248 | + toggleDebugItem.setState(Globals.DEBUG); |
---|
244 | 249 | |
---|
245 | 250 | cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
246 | 251 | toggleFrustumItem.addItemListener(this); |
---|
.. | .. |
---|
261 | 266 | // animationItem.addItemListener(this); |
---|
262 | 267 | // animationItem.setState(CameraPane.ANIMATION); |
---|
263 | 268 | cameraMenu.add("-"); |
---|
264 | | - cameraMenu.add(editCameraItem = new MenuItem("Freeze Camera")); |
---|
| 269 | + cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint")); |
---|
265 | 270 | editCameraItem.addActionListener(this); |
---|
266 | 271 | |
---|
267 | 272 | if (Globals.ADVANCED) |
---|
.. | .. |
---|
363 | 368 | billboardItem.addActionListener(this); |
---|
364 | 369 | csgItem = menu.add(new MenuItem("CSG")); |
---|
365 | 370 | csgItem.addActionListener(this); |
---|
366 | | - shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
| 371 | + shadowXItem = menu.add(new MenuItem("Shadow Red")); |
---|
367 | 372 | shadowXItem.addActionListener(this); |
---|
368 | | - shadowYItem = menu.add(new MenuItem("Shadow Y")); |
---|
| 373 | + shadowYItem = menu.add(new MenuItem("Shadow Green")); |
---|
369 | 374 | shadowYItem.addActionListener(this); |
---|
370 | | - shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
| 375 | + shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
371 | 376 | shadowZItem.addActionListener(this); |
---|
372 | 377 | if (Globals.ADVANCED) |
---|
373 | 378 | { |
---|
.. | .. |
---|
464 | 469 | markleavesItem.addActionListener(this); |
---|
465 | 470 | unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
466 | 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); |
---|
467 | 480 | menu.add("-"); |
---|
468 | 481 | flipVItem = menu.add(new MenuItem("Flip V")); |
---|
469 | 482 | flipVItem.addActionListener(this); |
---|
.. | .. |
---|
521 | 534 | |
---|
522 | 535 | void SetupUI2(ObjEditor oe) |
---|
523 | 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 | + |
---|
524 | 549 | //new Exception().printStackTrace(); |
---|
525 | 550 | |
---|
526 | 551 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
.. | .. |
---|
551 | 576 | */ |
---|
552 | 577 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
553 | 578 | |
---|
554 | | - 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); |
---|
555 | 604 | liveCB.setToolTipText("Enable animation"); |
---|
556 | 605 | liveCB.addItemListener(this); |
---|
557 | 606 | |
---|
558 | | - oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
559 | | - oneStepButton.setToolTipText("Animate one step forward"); |
---|
560 | | - oneStepButton.addActionListener(this); |
---|
561 | | - |
---|
562 | | - oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
| 607 | + oe.toolbarPanel.add(fastCB = GetCheckBox("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
563 | 608 | fastCB.setToolTipText("Fast mode"); |
---|
564 | 609 | fastCB.addItemListener(this); |
---|
565 | 610 | |
---|
566 | | - 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); |
---|
567 | 616 | trackCB.setToolTipText("Enable tracking"); |
---|
568 | 617 | trackCB.addItemListener(this); |
---|
569 | 618 | |
---|
570 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 619 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
571 | 620 | screenfitButton.setToolTipText("Screen fit"); |
---|
572 | 621 | screenfitButton.addActionListener(this); |
---|
573 | 622 | |
---|
.. | .. |
---|
581 | 630 | snapobjectButton.setToolTipText("Snap Object"); |
---|
582 | 631 | } |
---|
583 | 632 | |
---|
584 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
585 | | - flashSelectionButton.setToolTipText("Show selection"); |
---|
| 633 | + oe.toolbarPanel.add(flashSelectionButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 634 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
586 | 635 | flashSelectionButton.addActionListener(this); |
---|
587 | 636 | |
---|
588 | 637 | oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
589 | 638 | |
---|
590 | | - oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 639 | + oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
591 | 640 | twoButton.setToolTipText("Show center view only"); |
---|
592 | 641 | twoButton.addActionListener(this); |
---|
593 | | - oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 642 | + oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
594 | 643 | fourButton.addActionListener(this); |
---|
595 | 644 | fourButton.setToolTipText("Show left panel only"); |
---|
596 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 645 | + oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
597 | 646 | sixButton.setToolTipText("2-column layout left"); |
---|
598 | 647 | sixButton.addActionListener(this); |
---|
599 | | - oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 648 | + oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
600 | 649 | threeButton.setToolTipText("2-column layout right"); |
---|
601 | 650 | threeButton.addActionListener(this); |
---|
602 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 651 | + oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
603 | 652 | sevenButton.setToolTipText("3-column layout"); |
---|
604 | 653 | sevenButton.addActionListener(this); |
---|
605 | 654 | // |
---|
.. | .. |
---|
614 | 663 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
615 | 664 | //clearButton.addActionListener(this); |
---|
616 | 665 | |
---|
617 | | - cGridBag commandsPanel = new cGridBag(); |
---|
618 | | - |
---|
619 | | - commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 666 | + editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
620 | 667 | editButton.setToolTipText("Edit selection"); |
---|
621 | 668 | editButton.addActionListener(this); |
---|
622 | 669 | |
---|
623 | | - commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 670 | + editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
624 | 671 | uneditButton.setToolTipText("Unedit selection"); |
---|
625 | 672 | uneditButton.addActionListener(this); |
---|
626 | 673 | |
---|
627 | | - commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 674 | + editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
628 | 675 | allParamsButton.setToolTipText("Edit all params"); |
---|
629 | 676 | allParamsButton.addActionListener(this); |
---|
630 | 677 | |
---|
631 | | - commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 678 | + editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
632 | 679 | clearPanelButton.setToolTipText("Clear edit panel"); |
---|
633 | 680 | clearPanelButton.addActionListener(this); |
---|
634 | 681 | |
---|
635 | | - commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 682 | + editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
636 | 683 | unselectButton.setToolTipText("Unselect"); |
---|
637 | 684 | unselectButton.addActionListener(this); |
---|
638 | 685 | |
---|
639 | | - commandsPanel.preferredHeight = 1; |
---|
| 686 | + editCommandsPanel.preferredHeight = 1; |
---|
640 | 687 | |
---|
641 | | - oe.treePanel.add(commandsPanel); |
---|
642 | | - oe.treePanel.Return(); |
---|
| 688 | +// oe.treePanel.add(commandsPanel); |
---|
| 689 | +// oe.treePanel.Return(); |
---|
643 | 690 | |
---|
644 | 691 | // oe.aConstraints.gridx += 1; |
---|
645 | 692 | // oe.aConstraints.weighty = 0; |
---|
.. | .. |
---|
761 | 808 | // debugCB.addItemListener(this); |
---|
762 | 809 | |
---|
763 | 810 | panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 811 | + oeilCB.setToolTipText("Move camera when tracking target"); |
---|
764 | 812 | oeilCB.addItemListener(this); |
---|
765 | 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 | + { |
---|
766 | 824 | panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
767 | 825 | lookAtCB.setToolTipText("Look-at target"); |
---|
768 | 826 | lookAtCB.addItemListener(this); |
---|
| 827 | + } |
---|
769 | 828 | |
---|
770 | 829 | } |
---|
771 | 830 | |
---|
.. | .. |
---|
780 | 839 | void EditObject(Object3D obj) |
---|
781 | 840 | { |
---|
782 | 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 | + |
---|
783 | 850 | radioButton.SetObject(obj); |
---|
784 | 851 | radioButton.layout = sevenButton; |
---|
785 | 852 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
.. | .. |
---|
791 | 858 | |
---|
792 | 859 | void SetupViews(ObjEditor oe) |
---|
793 | 860 | { |
---|
| 861 | + theFrame = this; |
---|
| 862 | + |
---|
794 | 863 | oe.SetupViews(); |
---|
795 | 864 | |
---|
796 | 865 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
799 | 868 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
800 | 869 | } |
---|
801 | 870 | |
---|
802 | | - JCheckBox liveCB; |
---|
803 | | - JCheckBox supportCB; |
---|
804 | | - JCheckBox localCB; |
---|
805 | | - JCheckBox crowdCB; |
---|
806 | | - JCheckBox smoothCB; |
---|
807 | | - JCheckBox fastCB; |
---|
808 | | - JCheckBox slowCB; |
---|
809 | | - JCheckBox boxCB; |
---|
810 | | - JCheckBox zoomBoxCB; |
---|
811 | | - JCheckBox trackCB; |
---|
812 | | - 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; |
---|
813 | 882 | // JCheckBox speakerMocapCB; |
---|
814 | | - JCheckBox speakerCameraCB; |
---|
815 | | - JCheckBox speakerFocusCB; |
---|
816 | | - JCheckBox debugCB; |
---|
817 | | - JCheckBox oeilCB; |
---|
818 | | - JCheckBox lookAtCB; |
---|
| 883 | + cCheckBox speakerCameraCB; |
---|
| 884 | + cCheckBox speakerFocusCB; |
---|
| 885 | + cCheckBox debugCB; |
---|
| 886 | + |
---|
| 887 | + cCheckBox oeilCB; |
---|
| 888 | + cCheckBox shadowCB; |
---|
| 889 | + cCheckBox autosaveCB; |
---|
| 890 | + cCheckBox lookAtCB; |
---|
819 | 891 | |
---|
820 | 892 | // static int COLOR = 1; |
---|
821 | 893 | // static int MATERIAL = 2; |
---|
.. | .. |
---|
823 | 895 | |
---|
824 | 896 | int dropAttributes = Object3D.COLOR | Object3D.MATERIAL; |
---|
825 | 897 | |
---|
826 | | - JCheckBox colorCB; |
---|
827 | | - JCheckBox materialCB; |
---|
828 | | - JCheckBox textureCB; |
---|
| 898 | + cCheckBox colorCB; |
---|
| 899 | + cCheckBox materialCB; |
---|
| 900 | + cCheckBox textureCB; |
---|
829 | 901 | |
---|
830 | 902 | public void itemStateChanged(ItemEvent e) |
---|
831 | 903 | { |
---|
.. | .. |
---|
853 | 925 | } else if(e.getSource() == liveCB) |
---|
854 | 926 | { |
---|
855 | 927 | cameraView.ToggleLive(); |
---|
| 928 | + refreshContents(false); |
---|
856 | 929 | } |
---|
857 | 930 | else if(e.getSource() == supportCB) |
---|
858 | 931 | { |
---|
.. | .. |
---|
916 | 989 | else if(e.getSource() == oeilCB) |
---|
917 | 990 | { |
---|
918 | 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; |
---|
919 | 1000 | } |
---|
920 | 1001 | else if(e.getSource() == lookAtCB) |
---|
921 | 1002 | { |
---|
.. | .. |
---|
1260 | 1341 | memoryItem.addActionListener(this); |
---|
1261 | 1342 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1262 | 1343 | analyzeItem.addActionListener(this); |
---|
1263 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1344 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1264 | 1345 | dumpItem.addActionListener(this); |
---|
1265 | 1346 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1266 | 1347 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1401 | 1482 | shadow.material = new cMaterial(obj.material); |
---|
1402 | 1483 | shadow.material.diffuse = 0.0001f; |
---|
1403 | 1484 | shadow.material.specular = 0.0001f; |
---|
| 1485 | + //shadow.projectedVertices[1].x = 300; |
---|
1404 | 1486 | |
---|
1405 | 1487 | makeSomething(shadow); |
---|
1406 | 1488 | } |
---|
.. | .. |
---|
1951 | 2033 | { |
---|
1952 | 2034 | DumpObject(); |
---|
1953 | 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(); |
---|
| 2059 | + } else |
---|
1954 | 2060 | if (source == oneStepButton) |
---|
1955 | 2061 | { |
---|
1956 | 2062 | Globals.ONESTEP = true; |
---|
.. | .. |
---|
2004 | 2110 | if (source == cutItem || source == clearButton) |
---|
2005 | 2111 | { |
---|
2006 | 2112 | loadClipboard(true); |
---|
| 2113 | + } else |
---|
| 2114 | + if (source == undoItem) |
---|
| 2115 | + { |
---|
| 2116 | + Undo(); |
---|
| 2117 | + } else |
---|
| 2118 | + if (source == redoItem) |
---|
| 2119 | + { |
---|
| 2120 | + Redo(); |
---|
2007 | 2121 | } else |
---|
2008 | 2122 | if (source == duplicateItem) |
---|
2009 | 2123 | { |
---|
.. | .. |
---|
2504 | 2618 | } else |
---|
2505 | 2619 | if (source == genNormalsMESHItem) |
---|
2506 | 2620 | { |
---|
2507 | | - GenNormals(true); // TODO |
---|
| 2621 | + GenNormalsMESH(); |
---|
2508 | 2622 | } else |
---|
2509 | 2623 | if (source == genNormalsORGANItem) |
---|
2510 | 2624 | { |
---|
.. | .. |
---|
2569 | 2683 | if (source == unmarkleavesItem) |
---|
2570 | 2684 | { |
---|
2571 | 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); |
---|
2572 | 2702 | } else |
---|
2573 | 2703 | if (source == flipVItem) |
---|
2574 | 2704 | { |
---|
.. | .. |
---|
2836 | 2966 | bigThree.ClearUI(); |
---|
2837 | 2967 | bigThree.add(centralPanel); |
---|
2838 | 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 | + |
---|
2839 | 2987 | } else |
---|
2840 | 2988 | if (source == threeButton) |
---|
2841 | 2989 | { |
---|
.. | .. |
---|
2872 | 3020 | bigThree.add(centralPanel); |
---|
2873 | 3021 | bigThree.add(XYZPanel); |
---|
2874 | 3022 | bigThree.FlushUI(); |
---|
| 3023 | + |
---|
| 3024 | + cameraView.requestFocusInWindow(); |
---|
2875 | 3025 | } else |
---|
2876 | 3026 | if (source == fourButton) |
---|
2877 | 3027 | { |
---|
.. | .. |
---|
2907 | 3057 | bigThree.ClearUI(); |
---|
2908 | 3058 | bigThree.add(scenePanel); |
---|
2909 | 3059 | bigThree.FlushUI(); |
---|
| 3060 | + |
---|
| 3061 | + cameraView.requestFocusInWindow(); |
---|
2910 | 3062 | } else |
---|
2911 | 3063 | if (source == sixButton) |
---|
2912 | 3064 | { |
---|
.. | .. |
---|
2943 | 3095 | bigThree.add(scenePanel); |
---|
2944 | 3096 | bigThree.add(centralPanel); |
---|
2945 | 3097 | bigThree.FlushUI(); |
---|
| 3098 | + |
---|
| 3099 | + cameraView.requestFocusInWindow(); |
---|
2946 | 3100 | } else |
---|
2947 | 3101 | if (source == sevenButton) |
---|
2948 | 3102 | { |
---|
.. | .. |
---|
2980 | 3134 | bigThree.add(centralPanel); |
---|
2981 | 3135 | bigThree.add(XYZPanel); |
---|
2982 | 3136 | bigThree.FlushUI(); |
---|
| 3137 | + |
---|
| 3138 | + cameraView.requestFocusInWindow(); |
---|
2983 | 3139 | } else |
---|
2984 | 3140 | if (source == rootButton) |
---|
2985 | 3141 | { |
---|
.. | .. |
---|
2991 | 3147 | EditObject(obj); |
---|
2992 | 3148 | } |
---|
2993 | 3149 | |
---|
| 3150 | + cameraView.requestFocusInWindow(); |
---|
2994 | 3151 | refreshContents(true); |
---|
2995 | 3152 | } else |
---|
2996 | 3153 | if (source == closeButton) |
---|
.. | .. |
---|
3000 | 3157 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
3001 | 3158 | { |
---|
3002 | 3159 | ab = (cRadio)e.nextElement(); |
---|
3003 | | - if(ab.getModel().isSelected() && ab.GetObject() != client) |
---|
| 3160 | + if (ab.getModel().isSelected() && ab.GetObject() != client) |
---|
3004 | 3161 | { |
---|
| 3162 | + // Patch to avoid bug with transparency. |
---|
| 3163 | + if (!ab.hadMaterial) |
---|
| 3164 | + { |
---|
| 3165 | + ab.object.material = null; |
---|
| 3166 | + } |
---|
| 3167 | + |
---|
3005 | 3168 | buttonGroup.remove(ab); |
---|
3006 | 3169 | radioPanel.remove(ab); |
---|
3007 | 3170 | |
---|
3008 | | - ab.GetObject().editWindow = null; |
---|
| 3171 | + //ab.GetObject().editWindow = null; |
---|
| 3172 | + ab.GetObject().manipWindow = null; |
---|
3009 | 3173 | // ab.GetObject().objectUI = null; // ????????? |
---|
3010 | 3174 | |
---|
3011 | 3175 | ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick(); |
---|
3012 | 3176 | break; |
---|
3013 | 3177 | } |
---|
3014 | 3178 | } |
---|
| 3179 | + |
---|
| 3180 | + cameraView.requestFocusInWindow(); |
---|
3015 | 3181 | refreshContents(true); |
---|
3016 | 3182 | } else |
---|
3017 | 3183 | if (source == editItem || source == editButton) |
---|
.. | .. |
---|
3028 | 3194 | child.CloseUI(); |
---|
3029 | 3195 | listUI.remove(child); |
---|
3030 | 3196 | |
---|
3031 | | - child.editWindow = null; // ??????????? |
---|
| 3197 | + //child.editWindow = null; // ??????????? |
---|
3032 | 3198 | } |
---|
3033 | 3199 | objEditor.ctrlPanel.FlushUI(); |
---|
3034 | 3200 | //objEditor.jTree.clearSelection(); |
---|
.. | .. |
---|
3115 | 3281 | sideView.object = group; |
---|
3116 | 3282 | } |
---|
3117 | 3283 | |
---|
3118 | | -// fix "+" issue group.editWindow = this; |
---|
| 3284 | +// fix "+" issue |
---|
| 3285 | + //group.editWindow = this; |
---|
| 3286 | + group.manipWindow = this; |
---|
3119 | 3287 | |
---|
3120 | 3288 | /* |
---|
3121 | 3289 | currentLayout = radio.layout; |
---|
.. | .. |
---|
3128 | 3296 | //group.parent = null; // ROOT |
---|
3129 | 3297 | //group.attributes = -1; |
---|
3130 | 3298 | ResetModel(); |
---|
| 3299 | + |
---|
| 3300 | + cameraView.requestFocusInWindow(); |
---|
3131 | 3301 | refreshContents(true); |
---|
3132 | 3302 | } else if (event.getSource() == editCameraItem) |
---|
3133 | 3303 | { |
---|
.. | .. |
---|
3151 | 3321 | } |
---|
3152 | 3322 | |
---|
3153 | 3323 | boolean useclient = false; |
---|
3154 | | - cRadio radio; |
---|
3155 | 3324 | |
---|
3156 | 3325 | void ToggleRoot() |
---|
3157 | 3326 | { |
---|
.. | .. |
---|
3390 | 3559 | |
---|
3391 | 3560 | int size = obj.MemorySize(); |
---|
3392 | 3561 | |
---|
3393 | | - 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)"); |
---|
3394 | 3564 | } |
---|
3395 | 3565 | } |
---|
3396 | 3566 | catch (Exception e) |
---|
.. | .. |
---|
3471 | 3641 | void GenNormals(boolean crease) |
---|
3472 | 3642 | { |
---|
3473 | 3643 | group.GenNormalsS(crease); |
---|
| 3644 | + |
---|
| 3645 | + refreshContents(); |
---|
| 3646 | + } |
---|
| 3647 | + |
---|
| 3648 | + void GenNormalsMESH() |
---|
| 3649 | + { |
---|
| 3650 | + group.GenNormalsMeshS(); |
---|
3474 | 3651 | |
---|
3475 | 3652 | refreshContents(); |
---|
3476 | 3653 | } |
---|
.. | .. |
---|
4098 | 4275 | refreshContents(); |
---|
4099 | 4276 | } |
---|
4100 | 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 | + |
---|
4101 | 4290 | void SetTexRes(int tr) |
---|
4102 | 4291 | { |
---|
4103 | 4292 | group.selection.SetTexRes(tr); |
---|
.. | .. |
---|
4273 | 4462 | //case 702: // Event.LIST_DESELECT |
---|
4274 | 4463 | group.deselectAll(); |
---|
4275 | 4464 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4276 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4277 | 4465 | if (tps != null) |
---|
4278 | 4466 | { |
---|
4279 | 4467 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4282 | 4470 | |
---|
4283 | 4471 | //if (child.parent != null) |
---|
4284 | 4472 | //child.parent.addSelectee(child); |
---|
| 4473 | + objEditor.SetMaterial(child); |
---|
4285 | 4474 | group.addSelectee(child); |
---|
4286 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4287 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4288 | | - System.err.println("info : " + child.GetPath()); |
---|
4289 | 4475 | } |
---|
4290 | 4476 | } |
---|
4291 | 4477 | // else |
---|
.. | .. |
---|
4295 | 4481 | // System.err.println("info : " + group.GetPath()); |
---|
4296 | 4482 | // } |
---|
4297 | 4483 | |
---|
4298 | | - objEditor.SetText(); // jan 2014 |
---|
4299 | | - |
---|
4300 | | - if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4484 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4301 | 4485 | CameraPane.flash = true; |
---|
4302 | 4486 | |
---|
4303 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 4487 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4304 | 4488 | // a camera |
---|
4305 | 4489 | { |
---|
4306 | | - CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4307 | | - Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4490 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 4491 | + { |
---|
| 4492 | + CameraPane.camerachangeframe = 0; // don't refuse it |
---|
| 4493 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4494 | + } |
---|
4308 | 4495 | // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
4309 | 4496 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4310 | 4497 | } |
---|
.. | .. |
---|
4317 | 4504 | |
---|
4318 | 4505 | freezemodel = false; |
---|
4319 | 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 | + } |
---|
4320 | 4527 | |
---|
4321 | 4528 | void linkSomething(Object3D thing) |
---|
4322 | 4529 | { |
---|
.. | .. |
---|
4388 | 4595 | { |
---|
4389 | 4596 | if (group.selection.isEmpty()) |
---|
4390 | 4597 | return; |
---|
| 4598 | + |
---|
4391 | 4599 | Grafreed.clipboardIsTempGroup = false; |
---|
4392 | 4600 | Composite tGroup = null; |
---|
4393 | 4601 | if (group.selection.size() > 0) // 1) |
---|
.. | .. |
---|
4398 | 4606 | |
---|
4399 | 4607 | if (cut) |
---|
4400 | 4608 | { |
---|
| 4609 | + if (Globals.SAVEONMAKE) |
---|
| 4610 | + Save(); |
---|
4401 | 4611 | //int indices[] = jList.getSelectedIndices(); |
---|
4402 | 4612 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4403 | 4613 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4487 | 4697 | } |
---|
4488 | 4698 | |
---|
4489 | 4699 | } |
---|
| 4700 | + |
---|
4490 | 4701 | if (Grafreed.clipboardIsTempGroup) |
---|
4491 | 4702 | Grafreed.clipboard = tGroup; |
---|
| 4703 | + |
---|
4492 | 4704 | if (cut) |
---|
4493 | 4705 | { |
---|
4494 | 4706 | ResetModel(); |
---|
.. | .. |
---|
5113 | 5325 | cButton clearpanelButton; |
---|
5114 | 5326 | cButton unselectButton; |
---|
5115 | 5327 | |
---|
| 5328 | + cButton minButton; |
---|
| 5329 | + cButton maxButton; |
---|
| 5330 | + cButton fullButton; |
---|
| 5331 | + cButton undoButton; |
---|
| 5332 | + cButton redoButton; |
---|
| 5333 | + cButton saveButton; |
---|
5116 | 5334 | cButton oneStepButton; |
---|
5117 | 5335 | |
---|
5118 | 5336 | cButton screenfitButton; |
---|
.. | .. |
---|
5126 | 5344 | |
---|
5127 | 5345 | cButton setsupportButton; |
---|
5128 | 5346 | |
---|
5129 | | - cButton twoButton; |
---|
5130 | | - cButton sixButton; |
---|
5131 | | - cButton threeButton; |
---|
5132 | | - cButton sevenButton; |
---|
5133 | | - cButton fourButton; // full panel |
---|
5134 | | - cButton oneButton; // full XYZ |
---|
5135 | | - //cButton currentLayout; |
---|
5136 | | - |
---|
5137 | 5347 | // |
---|
5138 | 5348 | //Composite |
---|
5139 | 5349 | Object3D // to do !! |
---|
.. | .. |
---|
5145 | 5355 | private MenuItem lookFromItem; |
---|
5146 | 5356 | private MenuItem switchItem; |
---|
5147 | 5357 | private MenuItem cutItem; |
---|
| 5358 | + private MenuItem undoItem; |
---|
| 5359 | + private MenuItem redoItem; |
---|
5148 | 5360 | private MenuItem duplicateItem; |
---|
5149 | 5361 | private MenuItem cloneItem; |
---|
5150 | 5362 | private MenuItem cloneSupportItem; |
---|
.. | .. |
---|
5208 | 5420 | private MenuItem showleavesItem; |
---|
5209 | 5421 | private MenuItem markleavesItem; |
---|
5210 | 5422 | private MenuItem unmarkleavesItem; |
---|
| 5423 | + private MenuItem rewindleavesItem; |
---|
| 5424 | + private MenuItem unrewindleavesItem; |
---|
| 5425 | + private MenuItem randomleavesItem; |
---|
| 5426 | + private MenuItem unrandomleavesItem; |
---|
5211 | 5427 | |
---|
5212 | 5428 | private MenuItem flipVItem; |
---|
5213 | 5429 | private MenuItem unflipVItem; |
---|