.. | .. |
---|
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; |
---|
.. | .. |
---|
791 | 838 | |
---|
792 | 839 | void SetupViews(ObjEditor oe) |
---|
793 | 840 | { |
---|
| 841 | + theFrame = this; |
---|
| 842 | + |
---|
794 | 843 | oe.SetupViews(); |
---|
795 | 844 | |
---|
796 | 845 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
853 | 902 | } else if(e.getSource() == liveCB) |
---|
854 | 903 | { |
---|
855 | 904 | cameraView.ToggleLive(); |
---|
| 905 | + refreshContents(false); |
---|
856 | 906 | } |
---|
857 | 907 | else if(e.getSource() == supportCB) |
---|
858 | 908 | { |
---|
.. | .. |
---|
1260 | 1310 | memoryItem.addActionListener(this); |
---|
1261 | 1311 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1262 | 1312 | analyzeItem.addActionListener(this); |
---|
1263 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1313 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1264 | 1314 | dumpItem.addActionListener(this); |
---|
1265 | 1315 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1266 | 1316 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1401 | 1451 | shadow.material = new cMaterial(obj.material); |
---|
1402 | 1452 | shadow.material.diffuse = 0.0001f; |
---|
1403 | 1453 | shadow.material.specular = 0.0001f; |
---|
| 1454 | + //shadow.projectedVertices[1].x = 300; |
---|
1404 | 1455 | |
---|
1405 | 1456 | makeSomething(shadow); |
---|
1406 | 1457 | } |
---|
.. | .. |
---|
1951 | 2002 | { |
---|
1952 | 2003 | DumpObject(); |
---|
1953 | 2004 | } else |
---|
| 2005 | + if (source == minButton) |
---|
| 2006 | + { |
---|
| 2007 | + Minimize(); |
---|
| 2008 | + } else |
---|
| 2009 | + if (source == maxButton) |
---|
| 2010 | + { |
---|
| 2011 | + Maximize(); |
---|
| 2012 | + } else |
---|
| 2013 | + if (source == fullButton) |
---|
| 2014 | + { |
---|
| 2015 | + ToggleFullScreen(); |
---|
| 2016 | + } else |
---|
| 2017 | + if (source == undoButton) |
---|
| 2018 | + { |
---|
| 2019 | + Undo(); |
---|
| 2020 | + } else |
---|
| 2021 | + if (source == redoButton) |
---|
| 2022 | + { |
---|
| 2023 | + Redo(); |
---|
| 2024 | + } else |
---|
| 2025 | + if (source == saveButton) |
---|
| 2026 | + { |
---|
| 2027 | + Save(); |
---|
| 2028 | + } else |
---|
1954 | 2029 | if (source == oneStepButton) |
---|
1955 | 2030 | { |
---|
1956 | 2031 | Globals.ONESTEP = true; |
---|
.. | .. |
---|
2004 | 2079 | if (source == cutItem || source == clearButton) |
---|
2005 | 2080 | { |
---|
2006 | 2081 | loadClipboard(true); |
---|
| 2082 | + } else |
---|
| 2083 | + if (source == undoItem) |
---|
| 2084 | + { |
---|
| 2085 | + Undo(); |
---|
| 2086 | + } else |
---|
| 2087 | + if (source == redoItem) |
---|
| 2088 | + { |
---|
| 2089 | + Redo(); |
---|
2007 | 2090 | } else |
---|
2008 | 2091 | if (source == duplicateItem) |
---|
2009 | 2092 | { |
---|
.. | .. |
---|
2504 | 2587 | } else |
---|
2505 | 2588 | if (source == genNormalsMESHItem) |
---|
2506 | 2589 | { |
---|
2507 | | - GenNormals(true); // TODO |
---|
| 2590 | + GenNormalsMESH(); |
---|
2508 | 2591 | } else |
---|
2509 | 2592 | if (source == genNormalsORGANItem) |
---|
2510 | 2593 | { |
---|
.. | .. |
---|
2569 | 2652 | if (source == unmarkleavesItem) |
---|
2570 | 2653 | { |
---|
2571 | 2654 | MarkLeaves(false); |
---|
| 2655 | + } else |
---|
| 2656 | + if (source == rewindleavesItem) |
---|
| 2657 | + { |
---|
| 2658 | + RewindLeaves(true); |
---|
| 2659 | + } else |
---|
| 2660 | + if (source == unrewindleavesItem) |
---|
| 2661 | + { |
---|
| 2662 | + RewindLeaves(false); |
---|
| 2663 | + } else |
---|
| 2664 | + if (source == randomleavesItem) |
---|
| 2665 | + { |
---|
| 2666 | + RandomLeaves(true); |
---|
| 2667 | + } else |
---|
| 2668 | + if (source == unrandomleavesItem) |
---|
| 2669 | + { |
---|
| 2670 | + RandomLeaves(false); |
---|
2572 | 2671 | } else |
---|
2573 | 2672 | if (source == flipVItem) |
---|
2574 | 2673 | { |
---|
.. | .. |
---|
2836 | 2935 | bigThree.ClearUI(); |
---|
2837 | 2936 | bigThree.add(centralPanel); |
---|
2838 | 2937 | bigThree.FlushUI(); |
---|
| 2938 | + |
---|
| 2939 | + cameraView.requestFocusInWindow(); |
---|
| 2940 | + |
---|
| 2941 | +// refreshContents(true); |
---|
| 2942 | +// |
---|
| 2943 | +// try |
---|
| 2944 | +// { |
---|
| 2945 | +// java.awt.Robot bot = new java.awt.Robot(); |
---|
| 2946 | +// int mask = InputEvent.BUTTON1_MASK; |
---|
| 2947 | +// bot.mouseMove(100, 100); |
---|
| 2948 | +// bot.mousePress(mask); |
---|
| 2949 | +// bot.mouseRelease(mask); |
---|
| 2950 | +// } |
---|
| 2951 | +// catch (Exception e) |
---|
| 2952 | +// { |
---|
| 2953 | +// |
---|
| 2954 | +// } |
---|
| 2955 | + |
---|
2839 | 2956 | } else |
---|
2840 | 2957 | if (source == threeButton) |
---|
2841 | 2958 | { |
---|
.. | .. |
---|
2872 | 2989 | bigThree.add(centralPanel); |
---|
2873 | 2990 | bigThree.add(XYZPanel); |
---|
2874 | 2991 | bigThree.FlushUI(); |
---|
| 2992 | + |
---|
| 2993 | + cameraView.requestFocusInWindow(); |
---|
2875 | 2994 | } else |
---|
2876 | 2995 | if (source == fourButton) |
---|
2877 | 2996 | { |
---|
.. | .. |
---|
2907 | 3026 | bigThree.ClearUI(); |
---|
2908 | 3027 | bigThree.add(scenePanel); |
---|
2909 | 3028 | bigThree.FlushUI(); |
---|
| 3029 | + |
---|
| 3030 | + cameraView.requestFocusInWindow(); |
---|
2910 | 3031 | } else |
---|
2911 | 3032 | if (source == sixButton) |
---|
2912 | 3033 | { |
---|
.. | .. |
---|
2943 | 3064 | bigThree.add(scenePanel); |
---|
2944 | 3065 | bigThree.add(centralPanel); |
---|
2945 | 3066 | bigThree.FlushUI(); |
---|
| 3067 | + |
---|
| 3068 | + cameraView.requestFocusInWindow(); |
---|
2946 | 3069 | } else |
---|
2947 | 3070 | if (source == sevenButton) |
---|
2948 | 3071 | { |
---|
.. | .. |
---|
2980 | 3103 | bigThree.add(centralPanel); |
---|
2981 | 3104 | bigThree.add(XYZPanel); |
---|
2982 | 3105 | bigThree.FlushUI(); |
---|
| 3106 | + |
---|
| 3107 | + cameraView.requestFocusInWindow(); |
---|
2983 | 3108 | } else |
---|
2984 | 3109 | if (source == rootButton) |
---|
2985 | 3110 | { |
---|
.. | .. |
---|
2991 | 3116 | EditObject(obj); |
---|
2992 | 3117 | } |
---|
2993 | 3118 | |
---|
| 3119 | + cameraView.requestFocusInWindow(); |
---|
2994 | 3120 | refreshContents(true); |
---|
2995 | 3121 | } else |
---|
2996 | 3122 | if (source == closeButton) |
---|
.. | .. |
---|
3012 | 3138 | break; |
---|
3013 | 3139 | } |
---|
3014 | 3140 | } |
---|
| 3141 | + |
---|
| 3142 | + cameraView.requestFocusInWindow(); |
---|
3015 | 3143 | refreshContents(true); |
---|
3016 | 3144 | } else |
---|
3017 | 3145 | if (source == editItem || source == editButton) |
---|
.. | .. |
---|
3028 | 3156 | child.CloseUI(); |
---|
3029 | 3157 | listUI.remove(child); |
---|
3030 | 3158 | |
---|
3031 | | - child.editWindow = null; // ??????????? |
---|
| 3159 | + //child.editWindow = null; // ??????????? |
---|
3032 | 3160 | } |
---|
3033 | 3161 | objEditor.ctrlPanel.FlushUI(); |
---|
3034 | 3162 | //objEditor.jTree.clearSelection(); |
---|
.. | .. |
---|
3115 | 3243 | sideView.object = group; |
---|
3116 | 3244 | } |
---|
3117 | 3245 | |
---|
3118 | | -// fix "+" issue group.editWindow = this; |
---|
| 3246 | +// fix "+" issue |
---|
| 3247 | + //group.editWindow = this; |
---|
3119 | 3248 | |
---|
3120 | 3249 | /* |
---|
3121 | 3250 | currentLayout = radio.layout; |
---|
.. | .. |
---|
3128 | 3257 | //group.parent = null; // ROOT |
---|
3129 | 3258 | //group.attributes = -1; |
---|
3130 | 3259 | ResetModel(); |
---|
| 3260 | + |
---|
| 3261 | + cameraView.requestFocusInWindow(); |
---|
3131 | 3262 | refreshContents(true); |
---|
3132 | 3263 | } else if (event.getSource() == editCameraItem) |
---|
3133 | 3264 | { |
---|
.. | .. |
---|
3151 | 3282 | } |
---|
3152 | 3283 | |
---|
3153 | 3284 | boolean useclient = false; |
---|
3154 | | - cRadio radio; |
---|
3155 | 3285 | |
---|
3156 | 3286 | void ToggleRoot() |
---|
3157 | 3287 | { |
---|
.. | .. |
---|
3390 | 3520 | |
---|
3391 | 3521 | int size = obj.MemorySize(); |
---|
3392 | 3522 | |
---|
3393 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3523 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3524 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3394 | 3525 | } |
---|
3395 | 3526 | } |
---|
3396 | 3527 | catch (Exception e) |
---|
.. | .. |
---|
3471 | 3602 | void GenNormals(boolean crease) |
---|
3472 | 3603 | { |
---|
3473 | 3604 | group.GenNormalsS(crease); |
---|
| 3605 | + |
---|
| 3606 | + refreshContents(); |
---|
| 3607 | + } |
---|
| 3608 | + |
---|
| 3609 | + void GenNormalsMESH() |
---|
| 3610 | + { |
---|
| 3611 | + group.GenNormalsMeshS(); |
---|
3474 | 3612 | |
---|
3475 | 3613 | refreshContents(); |
---|
3476 | 3614 | } |
---|
.. | .. |
---|
4098 | 4236 | refreshContents(); |
---|
4099 | 4237 | } |
---|
4100 | 4238 | |
---|
| 4239 | + void RewindLeaves(boolean hide) |
---|
| 4240 | + { |
---|
| 4241 | + group.selection.RewindLeaves(hide); |
---|
| 4242 | + refreshContents(); |
---|
| 4243 | + } |
---|
| 4244 | + |
---|
| 4245 | + void RandomLeaves(boolean hide) |
---|
| 4246 | + { |
---|
| 4247 | + group.selection.RandomLeaves(hide); |
---|
| 4248 | + refreshContents(); |
---|
| 4249 | + } |
---|
| 4250 | + |
---|
4101 | 4251 | void SetTexRes(int tr) |
---|
4102 | 4252 | { |
---|
4103 | 4253 | group.selection.SetTexRes(tr); |
---|
.. | .. |
---|
4273 | 4423 | //case 702: // Event.LIST_DESELECT |
---|
4274 | 4424 | group.deselectAll(); |
---|
4275 | 4425 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4276 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4277 | 4426 | if (tps != null) |
---|
4278 | 4427 | { |
---|
4279 | 4428 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4282 | 4431 | |
---|
4283 | 4432 | //if (child.parent != null) |
---|
4284 | 4433 | //child.parent.addSelectee(child); |
---|
| 4434 | + objEditor.SetMaterial(child); |
---|
4285 | 4435 | group.addSelectee(child); |
---|
4286 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4287 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4288 | | - System.err.println("info : " + child.GetPath()); |
---|
4289 | 4436 | } |
---|
4290 | 4437 | } |
---|
4291 | 4438 | // else |
---|
.. | .. |
---|
4295 | 4442 | // System.err.println("info : " + group.GetPath()); |
---|
4296 | 4443 | // } |
---|
4297 | 4444 | |
---|
4298 | | - objEditor.SetText(); // jan 2014 |
---|
4299 | | - |
---|
4300 | | - if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4445 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4301 | 4446 | CameraPane.flash = true; |
---|
4302 | 4447 | |
---|
4303 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 4448 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4304 | 4449 | // a camera |
---|
4305 | 4450 | { |
---|
4306 | | - CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4307 | | - Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4451 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 4452 | + { |
---|
| 4453 | + CameraPane.camerachangeframe = 0; // don't refuse it |
---|
| 4454 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4455 | + } |
---|
4308 | 4456 | // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
4309 | 4457 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4310 | 4458 | } |
---|
.. | .. |
---|
4317 | 4465 | |
---|
4318 | 4466 | freezemodel = false; |
---|
4319 | 4467 | } |
---|
| 4468 | + |
---|
| 4469 | + void refreshContents(boolean cp) |
---|
| 4470 | + { |
---|
| 4471 | + if (!Globals.MOUSEDRAGGED) |
---|
| 4472 | + { |
---|
| 4473 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 4474 | + |
---|
| 4475 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 4476 | + { |
---|
| 4477 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 4478 | + |
---|
| 4479 | + objEditor.AddInfo(child, this, true); |
---|
| 4480 | + System.err.println("info : " + child.GetPath()); |
---|
| 4481 | + } |
---|
| 4482 | + |
---|
| 4483 | + objEditor.SetText(); // jan 2014 |
---|
| 4484 | + } |
---|
| 4485 | + |
---|
| 4486 | + super.refreshContents(cp); |
---|
| 4487 | + } |
---|
4320 | 4488 | |
---|
4321 | 4489 | void linkSomething(Object3D thing) |
---|
4322 | 4490 | { |
---|
.. | .. |
---|
4388 | 4556 | { |
---|
4389 | 4557 | if (group.selection.isEmpty()) |
---|
4390 | 4558 | return; |
---|
| 4559 | + |
---|
4391 | 4560 | Grafreed.clipboardIsTempGroup = false; |
---|
4392 | 4561 | Composite tGroup = null; |
---|
4393 | 4562 | if (group.selection.size() > 0) // 1) |
---|
.. | .. |
---|
4398 | 4567 | |
---|
4399 | 4568 | if (cut) |
---|
4400 | 4569 | { |
---|
| 4570 | + Save(); |
---|
4401 | 4571 | //int indices[] = jList.getSelectedIndices(); |
---|
4402 | 4572 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4403 | 4573 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4487 | 4657 | } |
---|
4488 | 4658 | |
---|
4489 | 4659 | } |
---|
| 4660 | + |
---|
4490 | 4661 | if (Grafreed.clipboardIsTempGroup) |
---|
4491 | 4662 | Grafreed.clipboard = tGroup; |
---|
| 4663 | + |
---|
4492 | 4664 | if (cut) |
---|
4493 | 4665 | { |
---|
4494 | 4666 | ResetModel(); |
---|
.. | .. |
---|
5113 | 5285 | cButton clearpanelButton; |
---|
5114 | 5286 | cButton unselectButton; |
---|
5115 | 5287 | |
---|
| 5288 | + cButton minButton; |
---|
| 5289 | + cButton maxButton; |
---|
| 5290 | + cButton fullButton; |
---|
| 5291 | + cButton undoButton; |
---|
| 5292 | + cButton redoButton; |
---|
| 5293 | + cButton saveButton; |
---|
5116 | 5294 | cButton oneStepButton; |
---|
5117 | 5295 | |
---|
5118 | 5296 | cButton screenfitButton; |
---|
.. | .. |
---|
5126 | 5304 | |
---|
5127 | 5305 | cButton setsupportButton; |
---|
5128 | 5306 | |
---|
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 | 5307 | // |
---|
5138 | 5308 | //Composite |
---|
5139 | 5309 | Object3D // to do !! |
---|
.. | .. |
---|
5145 | 5315 | private MenuItem lookFromItem; |
---|
5146 | 5316 | private MenuItem switchItem; |
---|
5147 | 5317 | private MenuItem cutItem; |
---|
| 5318 | + private MenuItem undoItem; |
---|
| 5319 | + private MenuItem redoItem; |
---|
5148 | 5320 | private MenuItem duplicateItem; |
---|
5149 | 5321 | private MenuItem cloneItem; |
---|
5150 | 5322 | private MenuItem cloneSupportItem; |
---|
.. | .. |
---|
5208 | 5380 | private MenuItem showleavesItem; |
---|
5209 | 5381 | private MenuItem markleavesItem; |
---|
5210 | 5382 | private MenuItem unmarkleavesItem; |
---|
| 5383 | + private MenuItem rewindleavesItem; |
---|
| 5384 | + private MenuItem unrewindleavesItem; |
---|
| 5385 | + private MenuItem randomleavesItem; |
---|
| 5386 | + private MenuItem unrandomleavesItem; |
---|
5211 | 5387 | |
---|
5212 | 5388 | private MenuItem flipVItem; |
---|
5213 | 5389 | private MenuItem unflipVItem; |
---|