.. | .. |
---|
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 | |
---|
| 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 | + |
---|
559 | 603 | oe.toolbarPanel.add(liveCB = new cCheckBox("Live", 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); |
---|
| 607 | + oe.toolbarPanel.add(oneStepButton = new cButton("\u29f4", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
564 | 608 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
565 | 609 | oneStepButton.addActionListener(this); |
---|
566 | 610 | |
---|
.. | .. |
---|
568 | 612 | fastCB.setToolTipText("Fast mode"); |
---|
569 | 613 | fastCB.addItemListener(this); |
---|
570 | 614 | |
---|
571 | | - oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 615 | + oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK)); //, oe.aConstraints); |
---|
572 | 616 | trackCB.setToolTipText("Enable tracking"); |
---|
573 | 617 | trackCB.addItemListener(this); |
---|
574 | 618 | |
---|
.. | .. |
---|
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 | + if (Globals.ADVANCED) |
---|
| 819 | + { |
---|
771 | 820 | panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
772 | 821 | lookAtCB.setToolTipText("Look-at target"); |
---|
773 | 822 | lookAtCB.addItemListener(this); |
---|
| 823 | + } |
---|
774 | 824 | |
---|
775 | 825 | } |
---|
776 | 826 | |
---|
.. | .. |
---|
785 | 835 | void EditObject(Object3D obj) |
---|
786 | 836 | { |
---|
787 | 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 | + |
---|
788 | 846 | radioButton.SetObject(obj); |
---|
789 | 847 | radioButton.layout = sevenButton; |
---|
790 | 848 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
.. | .. |
---|
796 | 854 | |
---|
797 | 855 | void SetupViews(ObjEditor oe) |
---|
798 | 856 | { |
---|
| 857 | + theFrame = this; |
---|
| 858 | + |
---|
799 | 859 | oe.SetupViews(); |
---|
800 | 860 | |
---|
801 | 861 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
819 | 879 | JCheckBox speakerCameraCB; |
---|
820 | 880 | JCheckBox speakerFocusCB; |
---|
821 | 881 | JCheckBox debugCB; |
---|
| 882 | + |
---|
822 | 883 | JCheckBox oeilCB; |
---|
| 884 | + JCheckBox shadowCB; |
---|
823 | 885 | JCheckBox lookAtCB; |
---|
824 | 886 | |
---|
825 | 887 | // static int COLOR = 1; |
---|
.. | .. |
---|
858 | 920 | } else if(e.getSource() == liveCB) |
---|
859 | 921 | { |
---|
860 | 922 | cameraView.ToggleLive(); |
---|
| 923 | + refreshContents(false); |
---|
861 | 924 | } |
---|
862 | 925 | else if(e.getSource() == supportCB) |
---|
863 | 926 | { |
---|
.. | .. |
---|
921 | 984 | else if(e.getSource() == oeilCB) |
---|
922 | 985 | { |
---|
923 | 986 | cameraView.ToggleOeil(); |
---|
| 987 | + } |
---|
| 988 | + else if(e.getSource() == shadowCB) |
---|
| 989 | + { |
---|
| 990 | + Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
924 | 991 | } |
---|
925 | 992 | else if(e.getSource() == lookAtCB) |
---|
926 | 993 | { |
---|
.. | .. |
---|
1265 | 1332 | memoryItem.addActionListener(this); |
---|
1266 | 1333 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1267 | 1334 | analyzeItem.addActionListener(this); |
---|
1268 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1335 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1269 | 1336 | dumpItem.addActionListener(this); |
---|
1270 | 1337 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1271 | 1338 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1406 | 1473 | shadow.material = new cMaterial(obj.material); |
---|
1407 | 1474 | shadow.material.diffuse = 0.0001f; |
---|
1408 | 1475 | shadow.material.specular = 0.0001f; |
---|
| 1476 | + //shadow.projectedVertices[1].x = 300; |
---|
1409 | 1477 | |
---|
1410 | 1478 | makeSomething(shadow); |
---|
1411 | 1479 | } |
---|
.. | .. |
---|
1955 | 2023 | if (source == dumpItem) |
---|
1956 | 2024 | { |
---|
1957 | 2025 | DumpObject(); |
---|
| 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(); |
---|
1958 | 2050 | } else |
---|
1959 | 2051 | if (source == oneStepButton) |
---|
1960 | 2052 | { |
---|
.. | .. |
---|
2517 | 2609 | } else |
---|
2518 | 2610 | if (source == genNormalsMESHItem) |
---|
2519 | 2611 | { |
---|
2520 | | - GenNormals(true); // TODO |
---|
| 2612 | + GenNormalsMESH(); |
---|
2521 | 2613 | } else |
---|
2522 | 2614 | if (source == genNormalsORGANItem) |
---|
2523 | 2615 | { |
---|
.. | .. |
---|
2582 | 2674 | if (source == unmarkleavesItem) |
---|
2583 | 2675 | { |
---|
2584 | 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); |
---|
2585 | 2693 | } else |
---|
2586 | 2694 | if (source == flipVItem) |
---|
2587 | 2695 | { |
---|
.. | .. |
---|
2849 | 2957 | bigThree.ClearUI(); |
---|
2850 | 2958 | bigThree.add(centralPanel); |
---|
2851 | 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 | + |
---|
2852 | 2978 | } else |
---|
2853 | 2979 | if (source == threeButton) |
---|
2854 | 2980 | { |
---|
.. | .. |
---|
2885 | 3011 | bigThree.add(centralPanel); |
---|
2886 | 3012 | bigThree.add(XYZPanel); |
---|
2887 | 3013 | bigThree.FlushUI(); |
---|
| 3014 | + |
---|
| 3015 | + cameraView.requestFocusInWindow(); |
---|
2888 | 3016 | } else |
---|
2889 | 3017 | if (source == fourButton) |
---|
2890 | 3018 | { |
---|
.. | .. |
---|
2920 | 3048 | bigThree.ClearUI(); |
---|
2921 | 3049 | bigThree.add(scenePanel); |
---|
2922 | 3050 | bigThree.FlushUI(); |
---|
| 3051 | + |
---|
| 3052 | + cameraView.requestFocusInWindow(); |
---|
2923 | 3053 | } else |
---|
2924 | 3054 | if (source == sixButton) |
---|
2925 | 3055 | { |
---|
.. | .. |
---|
2956 | 3086 | bigThree.add(scenePanel); |
---|
2957 | 3087 | bigThree.add(centralPanel); |
---|
2958 | 3088 | bigThree.FlushUI(); |
---|
| 3089 | + |
---|
| 3090 | + cameraView.requestFocusInWindow(); |
---|
2959 | 3091 | } else |
---|
2960 | 3092 | if (source == sevenButton) |
---|
2961 | 3093 | { |
---|
.. | .. |
---|
2993 | 3125 | bigThree.add(centralPanel); |
---|
2994 | 3126 | bigThree.add(XYZPanel); |
---|
2995 | 3127 | bigThree.FlushUI(); |
---|
| 3128 | + |
---|
| 3129 | + cameraView.requestFocusInWindow(); |
---|
2996 | 3130 | } else |
---|
2997 | 3131 | if (source == rootButton) |
---|
2998 | 3132 | { |
---|
.. | .. |
---|
3004 | 3138 | EditObject(obj); |
---|
3005 | 3139 | } |
---|
3006 | 3140 | |
---|
| 3141 | + cameraView.requestFocusInWindow(); |
---|
3007 | 3142 | refreshContents(true); |
---|
3008 | 3143 | } else |
---|
3009 | 3144 | if (source == closeButton) |
---|
.. | .. |
---|
3013 | 3148 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
3014 | 3149 | { |
---|
3015 | 3150 | ab = (cRadio)e.nextElement(); |
---|
3016 | | - if(ab.getModel().isSelected() && ab.GetObject() != client) |
---|
| 3151 | + if (ab.getModel().isSelected() && ab.GetObject() != client) |
---|
3017 | 3152 | { |
---|
| 3153 | + // Patch to avoid bug with transparency. |
---|
| 3154 | + if (!ab.hadMaterial) |
---|
| 3155 | + { |
---|
| 3156 | + ab.object.material = null; |
---|
| 3157 | + } |
---|
| 3158 | + |
---|
3018 | 3159 | buttonGroup.remove(ab); |
---|
3019 | 3160 | radioPanel.remove(ab); |
---|
3020 | 3161 | |
---|
.. | .. |
---|
3025 | 3166 | break; |
---|
3026 | 3167 | } |
---|
3027 | 3168 | } |
---|
| 3169 | + |
---|
| 3170 | + cameraView.requestFocusInWindow(); |
---|
3028 | 3171 | refreshContents(true); |
---|
3029 | 3172 | } else |
---|
3030 | 3173 | if (source == editItem || source == editButton) |
---|
.. | .. |
---|
3128 | 3271 | sideView.object = group; |
---|
3129 | 3272 | } |
---|
3130 | 3273 | |
---|
3131 | | -// fix "+" issue group.editWindow = this; |
---|
| 3274 | +// fix "+" issue |
---|
| 3275 | + //group.editWindow = this; |
---|
3132 | 3276 | |
---|
3133 | 3277 | /* |
---|
3134 | 3278 | currentLayout = radio.layout; |
---|
.. | .. |
---|
3141 | 3285 | //group.parent = null; // ROOT |
---|
3142 | 3286 | //group.attributes = -1; |
---|
3143 | 3287 | ResetModel(); |
---|
| 3288 | + |
---|
| 3289 | + cameraView.requestFocusInWindow(); |
---|
3144 | 3290 | refreshContents(true); |
---|
3145 | 3291 | } else if (event.getSource() == editCameraItem) |
---|
3146 | 3292 | { |
---|
.. | .. |
---|
3164 | 3310 | } |
---|
3165 | 3311 | |
---|
3166 | 3312 | boolean useclient = false; |
---|
3167 | | - cRadio radio; |
---|
3168 | 3313 | |
---|
3169 | 3314 | void ToggleRoot() |
---|
3170 | 3315 | { |
---|
.. | .. |
---|
3403 | 3548 | |
---|
3404 | 3549 | int size = obj.MemorySize(); |
---|
3405 | 3550 | |
---|
3406 | | - 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)"); |
---|
3407 | 3553 | } |
---|
3408 | 3554 | } |
---|
3409 | 3555 | catch (Exception e) |
---|
.. | .. |
---|
3484 | 3630 | void GenNormals(boolean crease) |
---|
3485 | 3631 | { |
---|
3486 | 3632 | group.GenNormalsS(crease); |
---|
| 3633 | + |
---|
| 3634 | + refreshContents(); |
---|
| 3635 | + } |
---|
| 3636 | + |
---|
| 3637 | + void GenNormalsMESH() |
---|
| 3638 | + { |
---|
| 3639 | + group.GenNormalsMeshS(); |
---|
3487 | 3640 | |
---|
3488 | 3641 | refreshContents(); |
---|
3489 | 3642 | } |
---|
.. | .. |
---|
4111 | 4264 | refreshContents(); |
---|
4112 | 4265 | } |
---|
4113 | 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 | + |
---|
4114 | 4279 | void SetTexRes(int tr) |
---|
4115 | 4280 | { |
---|
4116 | 4281 | group.selection.SetTexRes(tr); |
---|
.. | .. |
---|
4286 | 4451 | //case 702: // Event.LIST_DESELECT |
---|
4287 | 4452 | group.deselectAll(); |
---|
4288 | 4453 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4289 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4290 | 4454 | if (tps != null) |
---|
4291 | 4455 | { |
---|
4292 | 4456 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4295 | 4459 | |
---|
4296 | 4460 | //if (child.parent != null) |
---|
4297 | 4461 | //child.parent.addSelectee(child); |
---|
| 4462 | + objEditor.SetMaterial(child); |
---|
4298 | 4463 | group.addSelectee(child); |
---|
4299 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4300 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4301 | | - System.err.println("info : " + child.GetPath()); |
---|
4302 | 4464 | } |
---|
4303 | 4465 | } |
---|
4304 | 4466 | // else |
---|
.. | .. |
---|
4308 | 4470 | // System.err.println("info : " + group.GetPath()); |
---|
4309 | 4471 | // } |
---|
4310 | 4472 | |
---|
4311 | | - objEditor.SetText(); // jan 2014 |
---|
4312 | | - |
---|
4313 | 4473 | if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4314 | 4474 | CameraPane.flash = true; |
---|
4315 | 4475 | |
---|
.. | .. |
---|
4333 | 4493 | |
---|
4334 | 4494 | freezemodel = false; |
---|
4335 | 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 | + } |
---|
4336 | 4516 | |
---|
4337 | 4517 | void linkSomething(Object3D thing) |
---|
4338 | 4518 | { |
---|
.. | .. |
---|
4404 | 4584 | { |
---|
4405 | 4585 | if (group.selection.isEmpty()) |
---|
4406 | 4586 | return; |
---|
| 4587 | + |
---|
4407 | 4588 | Grafreed.clipboardIsTempGroup = false; |
---|
4408 | 4589 | Composite tGroup = null; |
---|
4409 | 4590 | if (group.selection.size() > 0) // 1) |
---|
.. | .. |
---|
4414 | 4595 | |
---|
4415 | 4596 | if (cut) |
---|
4416 | 4597 | { |
---|
| 4598 | + Save(); |
---|
4417 | 4599 | //int indices[] = jList.getSelectedIndices(); |
---|
4418 | 4600 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4419 | 4601 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4503 | 4685 | } |
---|
4504 | 4686 | |
---|
4505 | 4687 | } |
---|
| 4688 | + |
---|
4506 | 4689 | if (Grafreed.clipboardIsTempGroup) |
---|
4507 | 4690 | Grafreed.clipboard = tGroup; |
---|
| 4691 | + |
---|
4508 | 4692 | if (cut) |
---|
4509 | 4693 | { |
---|
4510 | 4694 | ResetModel(); |
---|
.. | .. |
---|
5129 | 5313 | cButton clearpanelButton; |
---|
5130 | 5314 | cButton unselectButton; |
---|
5131 | 5315 | |
---|
| 5316 | + cButton minButton; |
---|
| 5317 | + cButton maxButton; |
---|
| 5318 | + cButton fullButton; |
---|
| 5319 | + cButton undoButton; |
---|
| 5320 | + cButton redoButton; |
---|
| 5321 | + cButton saveButton; |
---|
5132 | 5322 | cButton oneStepButton; |
---|
5133 | 5323 | |
---|
5134 | 5324 | cButton screenfitButton; |
---|
.. | .. |
---|
5141 | 5331 | cButton closeButton; |
---|
5142 | 5332 | |
---|
5143 | 5333 | 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 | 5334 | |
---|
5153 | 5335 | // |
---|
5154 | 5336 | //Composite |
---|
.. | .. |
---|
5226 | 5408 | private MenuItem showleavesItem; |
---|
5227 | 5409 | private MenuItem markleavesItem; |
---|
5228 | 5410 | private MenuItem unmarkleavesItem; |
---|
| 5411 | + private MenuItem rewindleavesItem; |
---|
| 5412 | + private MenuItem unrewindleavesItem; |
---|
| 5413 | + private MenuItem randomleavesItem; |
---|
| 5414 | + private MenuItem unrandomleavesItem; |
---|
5229 | 5415 | |
---|
5230 | 5416 | private MenuItem flipVItem; |
---|
5231 | 5417 | private MenuItem unflipVItem; |
---|