.. | .. |
---|
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 | |
---|
| 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 = new cButton("\u271A", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 584 | + maxButton.setToolTipText("Maximize window"); |
---|
| 585 | + maxButton.addActionListener(this); |
---|
| 586 | + |
---|
| 587 | + oe.toolbarPanel.add(fullButton = new cButton("\u2b1c", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 588 | + fullButton.setToolTipText("Full-screen window"); |
---|
| 589 | + fullButton.addActionListener(this); |
---|
| 590 | + |
---|
| 591 | + oe.toolbarPanel.add(undoButton = new cButton("\u21a9", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 592 | + undoButton.setToolTipText("Undo changes"); |
---|
| 593 | + undoButton.addActionListener(this); |
---|
| 594 | + |
---|
| 595 | + oe.toolbarPanel.add(redoButton = new cButton("\u21aa", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 596 | + redoButton.setToolTipText("Redo changes"); |
---|
| 597 | + redoButton.addActionListener(this); |
---|
| 598 | + |
---|
| 599 | + oe.toolbarPanel.add(saveButton = new cButton("\u21e3", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 600 | + saveButton.setToolTipText("Save changes"); |
---|
| 601 | + saveButton.addActionListener(this); |
---|
| 602 | + |
---|
554 | 603 | oe.toolbarPanel.add(liveCB = new cCheckBox("Live", 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); |
---|
| 607 | + oe.toolbarPanel.add(oneStepButton = new cButton("\u29f4", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
559 | 608 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
560 | 609 | oneStepButton.addActionListener(this); |
---|
561 | 610 | |
---|
.. | .. |
---|
563 | 612 | fastCB.setToolTipText("Fast mode"); |
---|
564 | 613 | fastCB.addItemListener(this); |
---|
565 | 614 | |
---|
566 | | - oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 615 | + oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK)); //, oe.aConstraints); |
---|
567 | 616 | trackCB.setToolTipText("Enable tracking"); |
---|
568 | 617 | trackCB.addItemListener(this); |
---|
569 | 618 | |
---|
.. | .. |
---|
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 | + if (Globals.ADVANCED) |
---|
| 819 | + { |
---|
766 | 820 | panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
767 | 821 | lookAtCB.setToolTipText("Look-at target"); |
---|
768 | 822 | lookAtCB.addItemListener(this); |
---|
| 823 | + } |
---|
769 | 824 | |
---|
770 | 825 | } |
---|
771 | 826 | |
---|
.. | .. |
---|
780 | 835 | void EditObject(Object3D obj) |
---|
781 | 836 | { |
---|
782 | 837 | cRadio radioButton = new cRadio(obj.name); |
---|
| 838 | + |
---|
| 839 | + // Patch to avoid bug with transparency. |
---|
| 840 | + radioButton.hadMaterial = obj.material != null; |
---|
| 841 | + if (!radioButton.hadMaterial) |
---|
| 842 | + { |
---|
| 843 | + obj.material = new cMaterial(); |
---|
| 844 | + } |
---|
| 845 | + |
---|
783 | 846 | radioButton.SetObject(obj); |
---|
784 | 847 | radioButton.layout = sevenButton; |
---|
785 | 848 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
.. | .. |
---|
791 | 854 | |
---|
792 | 855 | void SetupViews(ObjEditor oe) |
---|
793 | 856 | { |
---|
| 857 | + theFrame = this; |
---|
| 858 | + |
---|
794 | 859 | oe.SetupViews(); |
---|
795 | 860 | |
---|
796 | 861 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
814 | 879 | JCheckBox speakerCameraCB; |
---|
815 | 880 | JCheckBox speakerFocusCB; |
---|
816 | 881 | JCheckBox debugCB; |
---|
| 882 | + |
---|
817 | 883 | JCheckBox oeilCB; |
---|
| 884 | + JCheckBox shadowCB; |
---|
818 | 885 | JCheckBox lookAtCB; |
---|
819 | 886 | |
---|
820 | 887 | // static int COLOR = 1; |
---|
.. | .. |
---|
853 | 920 | } else if(e.getSource() == liveCB) |
---|
854 | 921 | { |
---|
855 | 922 | cameraView.ToggleLive(); |
---|
| 923 | + refreshContents(false); |
---|
856 | 924 | } |
---|
857 | 925 | else if(e.getSource() == supportCB) |
---|
858 | 926 | { |
---|
.. | .. |
---|
916 | 984 | else if(e.getSource() == oeilCB) |
---|
917 | 985 | { |
---|
918 | 986 | cameraView.ToggleOeil(); |
---|
| 987 | + } |
---|
| 988 | + else if(e.getSource() == shadowCB) |
---|
| 989 | + { |
---|
| 990 | + Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
919 | 991 | } |
---|
920 | 992 | else if(e.getSource() == lookAtCB) |
---|
921 | 993 | { |
---|
.. | .. |
---|
1260 | 1332 | memoryItem.addActionListener(this); |
---|
1261 | 1333 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1262 | 1334 | analyzeItem.addActionListener(this); |
---|
1263 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1335 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1264 | 1336 | dumpItem.addActionListener(this); |
---|
1265 | 1337 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1266 | 1338 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1401 | 1473 | shadow.material = new cMaterial(obj.material); |
---|
1402 | 1474 | shadow.material.diffuse = 0.0001f; |
---|
1403 | 1475 | shadow.material.specular = 0.0001f; |
---|
| 1476 | + //shadow.projectedVertices[1].x = 300; |
---|
1404 | 1477 | |
---|
1405 | 1478 | makeSomething(shadow); |
---|
1406 | 1479 | } |
---|
.. | .. |
---|
1951 | 2024 | { |
---|
1952 | 2025 | DumpObject(); |
---|
1953 | 2026 | } else |
---|
| 2027 | + if (source == minButton) |
---|
| 2028 | + { |
---|
| 2029 | + Minimize(); |
---|
| 2030 | + } else |
---|
| 2031 | + if (source == maxButton) |
---|
| 2032 | + { |
---|
| 2033 | + Maximize(); |
---|
| 2034 | + } else |
---|
| 2035 | + if (source == fullButton) |
---|
| 2036 | + { |
---|
| 2037 | + ToggleFullScreen(); |
---|
| 2038 | + } else |
---|
| 2039 | + if (source == undoButton) |
---|
| 2040 | + { |
---|
| 2041 | + Undo(); |
---|
| 2042 | + } else |
---|
| 2043 | + if (source == redoButton) |
---|
| 2044 | + { |
---|
| 2045 | + Redo(); |
---|
| 2046 | + } else |
---|
| 2047 | + if (source == saveButton) |
---|
| 2048 | + { |
---|
| 2049 | + Save(); |
---|
| 2050 | + } else |
---|
1954 | 2051 | if (source == oneStepButton) |
---|
1955 | 2052 | { |
---|
1956 | 2053 | Globals.ONESTEP = true; |
---|
.. | .. |
---|
2004 | 2101 | if (source == cutItem || source == clearButton) |
---|
2005 | 2102 | { |
---|
2006 | 2103 | loadClipboard(true); |
---|
| 2104 | + } else |
---|
| 2105 | + if (source == undoItem) |
---|
| 2106 | + { |
---|
| 2107 | + Undo(); |
---|
| 2108 | + } else |
---|
| 2109 | + if (source == redoItem) |
---|
| 2110 | + { |
---|
| 2111 | + Redo(); |
---|
2007 | 2112 | } else |
---|
2008 | 2113 | if (source == duplicateItem) |
---|
2009 | 2114 | { |
---|
.. | .. |
---|
2504 | 2609 | } else |
---|
2505 | 2610 | if (source == genNormalsMESHItem) |
---|
2506 | 2611 | { |
---|
2507 | | - GenNormals(true); // TODO |
---|
| 2612 | + GenNormalsMESH(); |
---|
2508 | 2613 | } else |
---|
2509 | 2614 | if (source == genNormalsORGANItem) |
---|
2510 | 2615 | { |
---|
.. | .. |
---|
2569 | 2674 | if (source == unmarkleavesItem) |
---|
2570 | 2675 | { |
---|
2571 | 2676 | MarkLeaves(false); |
---|
| 2677 | + } else |
---|
| 2678 | + if (source == rewindleavesItem) |
---|
| 2679 | + { |
---|
| 2680 | + RewindLeaves(true); |
---|
| 2681 | + } else |
---|
| 2682 | + if (source == unrewindleavesItem) |
---|
| 2683 | + { |
---|
| 2684 | + RewindLeaves(false); |
---|
| 2685 | + } else |
---|
| 2686 | + if (source == randomleavesItem) |
---|
| 2687 | + { |
---|
| 2688 | + RandomLeaves(true); |
---|
| 2689 | + } else |
---|
| 2690 | + if (source == unrandomleavesItem) |
---|
| 2691 | + { |
---|
| 2692 | + RandomLeaves(false); |
---|
2572 | 2693 | } else |
---|
2573 | 2694 | if (source == flipVItem) |
---|
2574 | 2695 | { |
---|
.. | .. |
---|
2836 | 2957 | bigThree.ClearUI(); |
---|
2837 | 2958 | bigThree.add(centralPanel); |
---|
2838 | 2959 | bigThree.FlushUI(); |
---|
| 2960 | + |
---|
| 2961 | + cameraView.requestFocusInWindow(); |
---|
| 2962 | + |
---|
| 2963 | +// refreshContents(true); |
---|
| 2964 | +// |
---|
| 2965 | +// try |
---|
| 2966 | +// { |
---|
| 2967 | +// java.awt.Robot bot = new java.awt.Robot(); |
---|
| 2968 | +// int mask = InputEvent.BUTTON1_MASK; |
---|
| 2969 | +// bot.mouseMove(100, 100); |
---|
| 2970 | +// bot.mousePress(mask); |
---|
| 2971 | +// bot.mouseRelease(mask); |
---|
| 2972 | +// } |
---|
| 2973 | +// catch (Exception e) |
---|
| 2974 | +// { |
---|
| 2975 | +// |
---|
| 2976 | +// } |
---|
| 2977 | + |
---|
2839 | 2978 | } else |
---|
2840 | 2979 | if (source == threeButton) |
---|
2841 | 2980 | { |
---|
.. | .. |
---|
2872 | 3011 | bigThree.add(centralPanel); |
---|
2873 | 3012 | bigThree.add(XYZPanel); |
---|
2874 | 3013 | bigThree.FlushUI(); |
---|
| 3014 | + |
---|
| 3015 | + cameraView.requestFocusInWindow(); |
---|
2875 | 3016 | } else |
---|
2876 | 3017 | if (source == fourButton) |
---|
2877 | 3018 | { |
---|
.. | .. |
---|
2907 | 3048 | bigThree.ClearUI(); |
---|
2908 | 3049 | bigThree.add(scenePanel); |
---|
2909 | 3050 | bigThree.FlushUI(); |
---|
| 3051 | + |
---|
| 3052 | + cameraView.requestFocusInWindow(); |
---|
2910 | 3053 | } else |
---|
2911 | 3054 | if (source == sixButton) |
---|
2912 | 3055 | { |
---|
.. | .. |
---|
2943 | 3086 | bigThree.add(scenePanel); |
---|
2944 | 3087 | bigThree.add(centralPanel); |
---|
2945 | 3088 | bigThree.FlushUI(); |
---|
| 3089 | + |
---|
| 3090 | + cameraView.requestFocusInWindow(); |
---|
2946 | 3091 | } else |
---|
2947 | 3092 | if (source == sevenButton) |
---|
2948 | 3093 | { |
---|
.. | .. |
---|
2980 | 3125 | bigThree.add(centralPanel); |
---|
2981 | 3126 | bigThree.add(XYZPanel); |
---|
2982 | 3127 | bigThree.FlushUI(); |
---|
| 3128 | + |
---|
| 3129 | + cameraView.requestFocusInWindow(); |
---|
2983 | 3130 | } else |
---|
2984 | 3131 | if (source == rootButton) |
---|
2985 | 3132 | { |
---|
.. | .. |
---|
2991 | 3138 | EditObject(obj); |
---|
2992 | 3139 | } |
---|
2993 | 3140 | |
---|
| 3141 | + cameraView.requestFocusInWindow(); |
---|
2994 | 3142 | refreshContents(true); |
---|
2995 | 3143 | } else |
---|
2996 | 3144 | if (source == closeButton) |
---|
.. | .. |
---|
3000 | 3148 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
3001 | 3149 | { |
---|
3002 | 3150 | ab = (cRadio)e.nextElement(); |
---|
3003 | | - if(ab.getModel().isSelected() && ab.GetObject() != client) |
---|
| 3151 | + if (ab.getModel().isSelected() && ab.GetObject() != client) |
---|
3004 | 3152 | { |
---|
| 3153 | + // Patch to avoid bug with transparency. |
---|
| 3154 | + if (!ab.hadMaterial) |
---|
| 3155 | + { |
---|
| 3156 | + ab.object.material = null; |
---|
| 3157 | + } |
---|
| 3158 | + |
---|
3005 | 3159 | buttonGroup.remove(ab); |
---|
3006 | 3160 | radioPanel.remove(ab); |
---|
3007 | 3161 | |
---|
.. | .. |
---|
3012 | 3166 | break; |
---|
3013 | 3167 | } |
---|
3014 | 3168 | } |
---|
| 3169 | + |
---|
| 3170 | + cameraView.requestFocusInWindow(); |
---|
3015 | 3171 | refreshContents(true); |
---|
3016 | 3172 | } else |
---|
3017 | 3173 | if (source == editItem || source == editButton) |
---|
.. | .. |
---|
3028 | 3184 | child.CloseUI(); |
---|
3029 | 3185 | listUI.remove(child); |
---|
3030 | 3186 | |
---|
3031 | | - child.editWindow = null; // ??????????? |
---|
| 3187 | + //child.editWindow = null; // ??????????? |
---|
3032 | 3188 | } |
---|
3033 | 3189 | objEditor.ctrlPanel.FlushUI(); |
---|
3034 | 3190 | //objEditor.jTree.clearSelection(); |
---|
.. | .. |
---|
3115 | 3271 | sideView.object = group; |
---|
3116 | 3272 | } |
---|
3117 | 3273 | |
---|
3118 | | -// fix "+" issue group.editWindow = this; |
---|
| 3274 | +// fix "+" issue |
---|
| 3275 | + //group.editWindow = this; |
---|
3119 | 3276 | |
---|
3120 | 3277 | /* |
---|
3121 | 3278 | currentLayout = radio.layout; |
---|
.. | .. |
---|
3128 | 3285 | //group.parent = null; // ROOT |
---|
3129 | 3286 | //group.attributes = -1; |
---|
3130 | 3287 | ResetModel(); |
---|
| 3288 | + |
---|
| 3289 | + cameraView.requestFocusInWindow(); |
---|
3131 | 3290 | refreshContents(true); |
---|
3132 | 3291 | } else if (event.getSource() == editCameraItem) |
---|
3133 | 3292 | { |
---|
.. | .. |
---|
3151 | 3310 | } |
---|
3152 | 3311 | |
---|
3153 | 3312 | boolean useclient = false; |
---|
3154 | | - cRadio radio; |
---|
3155 | 3313 | |
---|
3156 | 3314 | void ToggleRoot() |
---|
3157 | 3315 | { |
---|
.. | .. |
---|
3390 | 3548 | |
---|
3391 | 3549 | int size = obj.MemorySize(); |
---|
3392 | 3550 | |
---|
3393 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3551 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3552 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3394 | 3553 | } |
---|
3395 | 3554 | } |
---|
3396 | 3555 | catch (Exception e) |
---|
.. | .. |
---|
3471 | 3630 | void GenNormals(boolean crease) |
---|
3472 | 3631 | { |
---|
3473 | 3632 | group.GenNormalsS(crease); |
---|
| 3633 | + |
---|
| 3634 | + refreshContents(); |
---|
| 3635 | + } |
---|
| 3636 | + |
---|
| 3637 | + void GenNormalsMESH() |
---|
| 3638 | + { |
---|
| 3639 | + group.GenNormalsMeshS(); |
---|
3474 | 3640 | |
---|
3475 | 3641 | refreshContents(); |
---|
3476 | 3642 | } |
---|
.. | .. |
---|
4098 | 4264 | refreshContents(); |
---|
4099 | 4265 | } |
---|
4100 | 4266 | |
---|
| 4267 | + void RewindLeaves(boolean hide) |
---|
| 4268 | + { |
---|
| 4269 | + group.selection.RewindLeaves(hide); |
---|
| 4270 | + refreshContents(); |
---|
| 4271 | + } |
---|
| 4272 | + |
---|
| 4273 | + void RandomLeaves(boolean hide) |
---|
| 4274 | + { |
---|
| 4275 | + group.selection.RandomLeaves(hide); |
---|
| 4276 | + refreshContents(); |
---|
| 4277 | + } |
---|
| 4278 | + |
---|
4101 | 4279 | void SetTexRes(int tr) |
---|
4102 | 4280 | { |
---|
4103 | 4281 | group.selection.SetTexRes(tr); |
---|
.. | .. |
---|
4273 | 4451 | //case 702: // Event.LIST_DESELECT |
---|
4274 | 4452 | group.deselectAll(); |
---|
4275 | 4453 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4276 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4277 | 4454 | if (tps != null) |
---|
4278 | 4455 | { |
---|
4279 | 4456 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4282 | 4459 | |
---|
4283 | 4460 | //if (child.parent != null) |
---|
4284 | 4461 | //child.parent.addSelectee(child); |
---|
| 4462 | + objEditor.SetMaterial(child); |
---|
4285 | 4463 | group.addSelectee(child); |
---|
4286 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4287 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4288 | | - System.err.println("info : " + child.GetPath()); |
---|
4289 | 4464 | } |
---|
4290 | 4465 | } |
---|
4291 | 4466 | // else |
---|
.. | .. |
---|
4295 | 4470 | // System.err.println("info : " + group.GetPath()); |
---|
4296 | 4471 | // } |
---|
4297 | 4472 | |
---|
4298 | | - objEditor.SetText(); // jan 2014 |
---|
4299 | | - |
---|
4300 | | - if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4473 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4301 | 4474 | CameraPane.flash = true; |
---|
4302 | 4475 | |
---|
4303 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 4476 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4304 | 4477 | // a camera |
---|
4305 | 4478 | { |
---|
4306 | | - CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4307 | | - Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4479 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 4480 | + { |
---|
| 4481 | + CameraPane.camerachangeframe = 0; // don't refuse it |
---|
| 4482 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4483 | + } |
---|
4308 | 4484 | // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
4309 | 4485 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4310 | 4486 | } |
---|
.. | .. |
---|
4317 | 4493 | |
---|
4318 | 4494 | freezemodel = false; |
---|
4319 | 4495 | } |
---|
| 4496 | + |
---|
| 4497 | + void refreshContents(boolean cp) |
---|
| 4498 | + { |
---|
| 4499 | + if (!Globals.MOUSEDRAGGED) |
---|
| 4500 | + { |
---|
| 4501 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 4502 | + |
---|
| 4503 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 4504 | + { |
---|
| 4505 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 4506 | + |
---|
| 4507 | + objEditor.AddInfo(child, this, true); |
---|
| 4508 | + System.err.println("info : " + child.GetPath()); |
---|
| 4509 | + } |
---|
| 4510 | + |
---|
| 4511 | + objEditor.SetText(); // jan 2014 |
---|
| 4512 | + } |
---|
| 4513 | + |
---|
| 4514 | + super.refreshContents(cp); |
---|
| 4515 | + } |
---|
4320 | 4516 | |
---|
4321 | 4517 | void linkSomething(Object3D thing) |
---|
4322 | 4518 | { |
---|
.. | .. |
---|
4388 | 4584 | { |
---|
4389 | 4585 | if (group.selection.isEmpty()) |
---|
4390 | 4586 | return; |
---|
| 4587 | + |
---|
4391 | 4588 | Grafreed.clipboardIsTempGroup = false; |
---|
4392 | 4589 | Composite tGroup = null; |
---|
4393 | 4590 | if (group.selection.size() > 0) // 1) |
---|
.. | .. |
---|
4398 | 4595 | |
---|
4399 | 4596 | if (cut) |
---|
4400 | 4597 | { |
---|
| 4598 | + Save(); |
---|
4401 | 4599 | //int indices[] = jList.getSelectedIndices(); |
---|
4402 | 4600 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4403 | 4601 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4487 | 4685 | } |
---|
4488 | 4686 | |
---|
4489 | 4687 | } |
---|
| 4688 | + |
---|
4490 | 4689 | if (Grafreed.clipboardIsTempGroup) |
---|
4491 | 4690 | Grafreed.clipboard = tGroup; |
---|
| 4691 | + |
---|
4492 | 4692 | if (cut) |
---|
4493 | 4693 | { |
---|
4494 | 4694 | ResetModel(); |
---|
.. | .. |
---|
5113 | 5313 | cButton clearpanelButton; |
---|
5114 | 5314 | cButton unselectButton; |
---|
5115 | 5315 | |
---|
| 5316 | + cButton minButton; |
---|
| 5317 | + cButton maxButton; |
---|
| 5318 | + cButton fullButton; |
---|
| 5319 | + cButton undoButton; |
---|
| 5320 | + cButton redoButton; |
---|
| 5321 | + cButton saveButton; |
---|
5116 | 5322 | cButton oneStepButton; |
---|
5117 | 5323 | |
---|
5118 | 5324 | cButton screenfitButton; |
---|
.. | .. |
---|
5126 | 5332 | |
---|
5127 | 5333 | cButton setsupportButton; |
---|
5128 | 5334 | |
---|
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 | 5335 | // |
---|
5138 | 5336 | //Composite |
---|
5139 | 5337 | Object3D // to do !! |
---|
.. | .. |
---|
5145 | 5343 | private MenuItem lookFromItem; |
---|
5146 | 5344 | private MenuItem switchItem; |
---|
5147 | 5345 | private MenuItem cutItem; |
---|
| 5346 | + private MenuItem undoItem; |
---|
| 5347 | + private MenuItem redoItem; |
---|
5148 | 5348 | private MenuItem duplicateItem; |
---|
5149 | 5349 | private MenuItem cloneItem; |
---|
5150 | 5350 | private MenuItem cloneSupportItem; |
---|
.. | .. |
---|
5208 | 5408 | private MenuItem showleavesItem; |
---|
5209 | 5409 | private MenuItem markleavesItem; |
---|
5210 | 5410 | private MenuItem unmarkleavesItem; |
---|
| 5411 | + private MenuItem rewindleavesItem; |
---|
| 5412 | + private MenuItem unrewindleavesItem; |
---|
| 5413 | + private MenuItem randomleavesItem; |
---|
| 5414 | + private MenuItem unrandomleavesItem; |
---|
5211 | 5415 | |
---|
5212 | 5416 | private MenuItem flipVItem; |
---|
5213 | 5417 | private MenuItem unflipVItem; |
---|