.. | .. |
---|
176 | 176 | copyItem.addActionListener(this); |
---|
177 | 177 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
178 | 178 | pasteItem.addActionListener(this); |
---|
179 | | - menu.add("-"); |
---|
180 | 179 | |
---|
181 | 180 | menu.add("-"); |
---|
182 | 181 | pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
.. | .. |
---|
246 | 245 | |
---|
247 | 246 | cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
248 | 247 | toggleDebugItem.addItemListener(this); |
---|
249 | | - toggleDebugItem.setState(CameraPane.DEBUG); |
---|
| 248 | + toggleDebugItem.setState(Globals.DEBUG); |
---|
250 | 249 | |
---|
251 | 250 | cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
252 | 251 | toggleFrustumItem.addItemListener(this); |
---|
.. | .. |
---|
369 | 368 | billboardItem.addActionListener(this); |
---|
370 | 369 | csgItem = menu.add(new MenuItem("CSG")); |
---|
371 | 370 | csgItem.addActionListener(this); |
---|
372 | | - shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
| 371 | + shadowXItem = menu.add(new MenuItem("Shadow Red")); |
---|
373 | 372 | shadowXItem.addActionListener(this); |
---|
374 | | - shadowYItem = menu.add(new MenuItem("Shadow Y")); |
---|
| 373 | + shadowYItem = menu.add(new MenuItem("Shadow Green")); |
---|
375 | 374 | shadowYItem.addActionListener(this); |
---|
376 | | - shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
| 375 | + shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
377 | 376 | shadowZItem.addActionListener(this); |
---|
378 | 377 | if (Globals.ADVANCED) |
---|
379 | 378 | { |
---|
.. | .. |
---|
470 | 469 | markleavesItem.addActionListener(this); |
---|
471 | 470 | unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
472 | 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); |
---|
473 | 480 | menu.add("-"); |
---|
474 | 481 | flipVItem = menu.add(new MenuItem("Flip V")); |
---|
475 | 482 | flipVItem.addActionListener(this); |
---|
.. | .. |
---|
527 | 534 | |
---|
528 | 535 | void SetupUI2(ObjEditor oe) |
---|
529 | 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 | + |
---|
530 | 549 | //new Exception().printStackTrace(); |
---|
531 | 550 | |
---|
532 | 551 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
.. | .. |
---|
557 | 576 | */ |
---|
558 | 577 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
559 | 578 | |
---|
560 | | - oe.toolbarPanel.add(undoButton = new cButton("Undo", !Grafreed.NIMBUSLAF)); //, 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); |
---|
561 | 592 | undoButton.setToolTipText("Undo changes"); |
---|
562 | 593 | undoButton.addActionListener(this); |
---|
563 | 594 | |
---|
564 | | - oe.toolbarPanel.add(redoButton = new cButton("Redo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 595 | + oe.toolbarPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
565 | 596 | redoButton.setToolTipText("Redo changes"); |
---|
566 | 597 | redoButton.addActionListener(this); |
---|
567 | 598 | |
---|
568 | | - oe.toolbarPanel.add(saveButton = new cButton("Save", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 599 | + oe.toolbarPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
569 | 600 | saveButton.setToolTipText("Save changes"); |
---|
570 | 601 | saveButton.addActionListener(this); |
---|
571 | 602 | |
---|
572 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 603 | + oe.toolbarPanel.add(liveCB = GetCheckBox("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
573 | 604 | liveCB.setToolTipText("Enable animation"); |
---|
574 | 605 | liveCB.addItemListener(this); |
---|
575 | 606 | |
---|
576 | | - oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
577 | | - oneStepButton.setToolTipText("Animate one step forward"); |
---|
578 | | - oneStepButton.addActionListener(this); |
---|
579 | | - |
---|
580 | | - oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
| 607 | + oe.toolbarPanel.add(fastCB = GetCheckBox("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
581 | 608 | fastCB.setToolTipText("Fast mode"); |
---|
582 | 609 | fastCB.addItemListener(this); |
---|
583 | 610 | |
---|
584 | | - 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); |
---|
585 | 616 | trackCB.setToolTipText("Enable tracking"); |
---|
586 | 617 | trackCB.addItemListener(this); |
---|
587 | 618 | |
---|
588 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 619 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
589 | 620 | screenfitButton.setToolTipText("Screen fit"); |
---|
590 | 621 | screenfitButton.addActionListener(this); |
---|
591 | 622 | |
---|
.. | .. |
---|
599 | 630 | snapobjectButton.setToolTipText("Snap Object"); |
---|
600 | 631 | } |
---|
601 | 632 | |
---|
602 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
603 | | - flashSelectionButton.setToolTipText("Show selection"); |
---|
| 633 | + oe.toolbarPanel.add(flashSelectionButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 634 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
604 | 635 | flashSelectionButton.addActionListener(this); |
---|
605 | 636 | |
---|
606 | 637 | oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
607 | 638 | |
---|
608 | | - oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 639 | + oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
609 | 640 | twoButton.setToolTipText("Show center view only"); |
---|
610 | 641 | twoButton.addActionListener(this); |
---|
611 | | - oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 642 | + oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
612 | 643 | fourButton.addActionListener(this); |
---|
613 | 644 | fourButton.setToolTipText("Show left panel only"); |
---|
614 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 645 | + oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
615 | 646 | sixButton.setToolTipText("2-column layout left"); |
---|
616 | 647 | sixButton.addActionListener(this); |
---|
617 | | - oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 648 | + oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
618 | 649 | threeButton.setToolTipText("2-column layout right"); |
---|
619 | 650 | threeButton.addActionListener(this); |
---|
620 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 651 | + oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
621 | 652 | sevenButton.setToolTipText("3-column layout"); |
---|
622 | 653 | sevenButton.addActionListener(this); |
---|
623 | 654 | // |
---|
.. | .. |
---|
632 | 663 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
633 | 664 | //clearButton.addActionListener(this); |
---|
634 | 665 | |
---|
635 | | - cGridBag commandsPanel = new cGridBag(); |
---|
636 | | - |
---|
637 | | - commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 666 | + editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
638 | 667 | editButton.setToolTipText("Edit selection"); |
---|
639 | 668 | editButton.addActionListener(this); |
---|
640 | 669 | |
---|
641 | | - commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 670 | + editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
642 | 671 | uneditButton.setToolTipText("Unedit selection"); |
---|
643 | 672 | uneditButton.addActionListener(this); |
---|
644 | 673 | |
---|
645 | | - commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 674 | + editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
646 | 675 | allParamsButton.setToolTipText("Edit all params"); |
---|
647 | 676 | allParamsButton.addActionListener(this); |
---|
648 | 677 | |
---|
649 | | - commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 678 | + editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
650 | 679 | clearPanelButton.setToolTipText("Clear edit panel"); |
---|
651 | 680 | clearPanelButton.addActionListener(this); |
---|
652 | 681 | |
---|
653 | | - commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 682 | + editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
654 | 683 | unselectButton.setToolTipText("Unselect"); |
---|
655 | 684 | unselectButton.addActionListener(this); |
---|
656 | 685 | |
---|
657 | | - commandsPanel.preferredHeight = 1; |
---|
| 686 | + editCommandsPanel.preferredHeight = 1; |
---|
658 | 687 | |
---|
659 | | - oe.treePanel.add(commandsPanel); |
---|
660 | | - oe.treePanel.Return(); |
---|
| 688 | +// oe.treePanel.add(commandsPanel); |
---|
| 689 | +// oe.treePanel.Return(); |
---|
661 | 690 | |
---|
662 | 691 | // oe.aConstraints.gridx += 1; |
---|
663 | 692 | // oe.aConstraints.weighty = 0; |
---|
.. | .. |
---|
779 | 808 | // debugCB.addItemListener(this); |
---|
780 | 809 | |
---|
781 | 810 | panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 811 | + oeilCB.setToolTipText("Move camera when tracking target"); |
---|
782 | 812 | oeilCB.addItemListener(this); |
---|
783 | 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 | + { |
---|
784 | 824 | panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
785 | 825 | lookAtCB.setToolTipText("Look-at target"); |
---|
786 | 826 | lookAtCB.addItemListener(this); |
---|
| 827 | + } |
---|
787 | 828 | |
---|
788 | 829 | } |
---|
789 | 830 | |
---|
.. | .. |
---|
798 | 839 | void EditObject(Object3D obj) |
---|
799 | 840 | { |
---|
800 | 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 | + |
---|
801 | 850 | radioButton.SetObject(obj); |
---|
802 | 851 | radioButton.layout = sevenButton; |
---|
803 | 852 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
.. | .. |
---|
809 | 858 | |
---|
810 | 859 | void SetupViews(ObjEditor oe) |
---|
811 | 860 | { |
---|
| 861 | + theFrame = this; |
---|
| 862 | + |
---|
812 | 863 | oe.SetupViews(); |
---|
813 | 864 | |
---|
814 | 865 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
817 | 868 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
818 | 869 | } |
---|
819 | 870 | |
---|
820 | | - JCheckBox liveCB; |
---|
821 | | - JCheckBox supportCB; |
---|
822 | | - JCheckBox localCB; |
---|
823 | | - JCheckBox crowdCB; |
---|
824 | | - JCheckBox smoothCB; |
---|
825 | | - JCheckBox fastCB; |
---|
826 | | - JCheckBox slowCB; |
---|
827 | | - JCheckBox boxCB; |
---|
828 | | - JCheckBox zoomBoxCB; |
---|
829 | | - JCheckBox trackCB; |
---|
830 | | - 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; |
---|
831 | 882 | // JCheckBox speakerMocapCB; |
---|
832 | | - JCheckBox speakerCameraCB; |
---|
833 | | - JCheckBox speakerFocusCB; |
---|
834 | | - JCheckBox debugCB; |
---|
835 | | - JCheckBox oeilCB; |
---|
836 | | - JCheckBox lookAtCB; |
---|
| 883 | + cCheckBox speakerCameraCB; |
---|
| 884 | + cCheckBox speakerFocusCB; |
---|
| 885 | + cCheckBox debugCB; |
---|
| 886 | + |
---|
| 887 | + cCheckBox oeilCB; |
---|
| 888 | + cCheckBox shadowCB; |
---|
| 889 | + cCheckBox autosaveCB; |
---|
| 890 | + cCheckBox lookAtCB; |
---|
837 | 891 | |
---|
838 | 892 | // static int COLOR = 1; |
---|
839 | 893 | // static int MATERIAL = 2; |
---|
.. | .. |
---|
841 | 895 | |
---|
842 | 896 | int dropAttributes = Object3D.COLOR | Object3D.MATERIAL; |
---|
843 | 897 | |
---|
844 | | - JCheckBox colorCB; |
---|
845 | | - JCheckBox materialCB; |
---|
846 | | - JCheckBox textureCB; |
---|
| 898 | + cCheckBox colorCB; |
---|
| 899 | + cCheckBox materialCB; |
---|
| 900 | + cCheckBox textureCB; |
---|
847 | 901 | |
---|
848 | 902 | public void itemStateChanged(ItemEvent e) |
---|
849 | 903 | { |
---|
.. | .. |
---|
935 | 989 | else if(e.getSource() == oeilCB) |
---|
936 | 990 | { |
---|
937 | 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; |
---|
938 | 1000 | } |
---|
939 | 1001 | else if(e.getSource() == lookAtCB) |
---|
940 | 1002 | { |
---|
.. | .. |
---|
1420 | 1482 | shadow.material = new cMaterial(obj.material); |
---|
1421 | 1483 | shadow.material.diffuse = 0.0001f; |
---|
1422 | 1484 | shadow.material.specular = 0.0001f; |
---|
| 1485 | + //shadow.projectedVertices[1].x = 300; |
---|
1423 | 1486 | |
---|
1424 | 1487 | makeSomething(shadow); |
---|
1425 | 1488 | } |
---|
.. | .. |
---|
1969 | 2032 | if (source == dumpItem) |
---|
1970 | 2033 | { |
---|
1971 | 2034 | DumpObject(); |
---|
| 2035 | + } else |
---|
| 2036 | + if (source == minButton) |
---|
| 2037 | + { |
---|
| 2038 | + Minimize(); |
---|
| 2039 | + } else |
---|
| 2040 | + if (source == maxButton) |
---|
| 2041 | + { |
---|
| 2042 | + Maximize(); |
---|
| 2043 | + } else |
---|
| 2044 | + if (source == fullButton) |
---|
| 2045 | + { |
---|
| 2046 | + ToggleFullScreen(); |
---|
1972 | 2047 | } else |
---|
1973 | 2048 | if (source == undoButton) |
---|
1974 | 2049 | { |
---|
.. | .. |
---|
2609 | 2684 | { |
---|
2610 | 2685 | MarkLeaves(false); |
---|
2611 | 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); |
---|
| 2702 | + } else |
---|
2612 | 2703 | if (source == flipVItem) |
---|
2613 | 2704 | { |
---|
2614 | 2705 | FlipV(true); |
---|
.. | .. |
---|
2875 | 2966 | bigThree.ClearUI(); |
---|
2876 | 2967 | bigThree.add(centralPanel); |
---|
2877 | 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 | + |
---|
2878 | 2987 | } else |
---|
2879 | 2988 | if (source == threeButton) |
---|
2880 | 2989 | { |
---|
.. | .. |
---|
2911 | 3020 | bigThree.add(centralPanel); |
---|
2912 | 3021 | bigThree.add(XYZPanel); |
---|
2913 | 3022 | bigThree.FlushUI(); |
---|
| 3023 | + |
---|
| 3024 | + cameraView.requestFocusInWindow(); |
---|
2914 | 3025 | } else |
---|
2915 | 3026 | if (source == fourButton) |
---|
2916 | 3027 | { |
---|
.. | .. |
---|
2946 | 3057 | bigThree.ClearUI(); |
---|
2947 | 3058 | bigThree.add(scenePanel); |
---|
2948 | 3059 | bigThree.FlushUI(); |
---|
| 3060 | + |
---|
| 3061 | + cameraView.requestFocusInWindow(); |
---|
2949 | 3062 | } else |
---|
2950 | 3063 | if (source == sixButton) |
---|
2951 | 3064 | { |
---|
.. | .. |
---|
2982 | 3095 | bigThree.add(scenePanel); |
---|
2983 | 3096 | bigThree.add(centralPanel); |
---|
2984 | 3097 | bigThree.FlushUI(); |
---|
| 3098 | + |
---|
| 3099 | + cameraView.requestFocusInWindow(); |
---|
2985 | 3100 | } else |
---|
2986 | 3101 | if (source == sevenButton) |
---|
2987 | 3102 | { |
---|
.. | .. |
---|
3019 | 3134 | bigThree.add(centralPanel); |
---|
3020 | 3135 | bigThree.add(XYZPanel); |
---|
3021 | 3136 | bigThree.FlushUI(); |
---|
| 3137 | + |
---|
| 3138 | + cameraView.requestFocusInWindow(); |
---|
3022 | 3139 | } else |
---|
3023 | 3140 | if (source == rootButton) |
---|
3024 | 3141 | { |
---|
.. | .. |
---|
3030 | 3147 | EditObject(obj); |
---|
3031 | 3148 | } |
---|
3032 | 3149 | |
---|
| 3150 | + cameraView.requestFocusInWindow(); |
---|
3033 | 3151 | refreshContents(true); |
---|
3034 | 3152 | } else |
---|
3035 | 3153 | if (source == closeButton) |
---|
.. | .. |
---|
3039 | 3157 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
3040 | 3158 | { |
---|
3041 | 3159 | ab = (cRadio)e.nextElement(); |
---|
3042 | | - if(ab.getModel().isSelected() && ab.GetObject() != client) |
---|
| 3160 | + if (ab.getModel().isSelected() && ab.GetObject() != client) |
---|
3043 | 3161 | { |
---|
| 3162 | + // Patch to avoid bug with transparency. |
---|
| 3163 | + if (!ab.hadMaterial) |
---|
| 3164 | + { |
---|
| 3165 | + ab.object.material = null; |
---|
| 3166 | + } |
---|
| 3167 | + |
---|
3044 | 3168 | buttonGroup.remove(ab); |
---|
3045 | 3169 | radioPanel.remove(ab); |
---|
3046 | 3170 | |
---|
3047 | | - ab.GetObject().editWindow = null; |
---|
| 3171 | + //ab.GetObject().editWindow = null; |
---|
| 3172 | + ab.GetObject().manipWindow = null; |
---|
3048 | 3173 | // ab.GetObject().objectUI = null; // ????????? |
---|
3049 | 3174 | |
---|
3050 | 3175 | ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick(); |
---|
3051 | 3176 | break; |
---|
3052 | 3177 | } |
---|
3053 | 3178 | } |
---|
| 3179 | + |
---|
| 3180 | + cameraView.requestFocusInWindow(); |
---|
3054 | 3181 | refreshContents(true); |
---|
3055 | 3182 | } else |
---|
3056 | 3183 | if (source == editItem || source == editButton) |
---|
.. | .. |
---|
3155 | 3282 | } |
---|
3156 | 3283 | |
---|
3157 | 3284 | // fix "+" issue |
---|
3158 | | - group.editWindow = this; |
---|
| 3285 | + //group.editWindow = this; |
---|
| 3286 | + group.manipWindow = this; |
---|
3159 | 3287 | |
---|
3160 | 3288 | /* |
---|
3161 | 3289 | currentLayout = radio.layout; |
---|
.. | .. |
---|
3168 | 3296 | //group.parent = null; // ROOT |
---|
3169 | 3297 | //group.attributes = -1; |
---|
3170 | 3298 | ResetModel(); |
---|
| 3299 | + |
---|
| 3300 | + cameraView.requestFocusInWindow(); |
---|
3171 | 3301 | refreshContents(true); |
---|
3172 | 3302 | } else if (event.getSource() == editCameraItem) |
---|
3173 | 3303 | { |
---|
.. | .. |
---|
3191 | 3321 | } |
---|
3192 | 3322 | |
---|
3193 | 3323 | boolean useclient = false; |
---|
3194 | | - cRadio radio; |
---|
3195 | 3324 | |
---|
3196 | 3325 | void ToggleRoot() |
---|
3197 | 3326 | { |
---|
.. | .. |
---|
4146 | 4275 | refreshContents(); |
---|
4147 | 4276 | } |
---|
4148 | 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 | + |
---|
4149 | 4290 | void SetTexRes(int tr) |
---|
4150 | 4291 | { |
---|
4151 | 4292 | group.selection.SetTexRes(tr); |
---|
.. | .. |
---|
4465 | 4606 | |
---|
4466 | 4607 | if (cut) |
---|
4467 | 4608 | { |
---|
| 4609 | + if (Globals.SAVEONMAKE) |
---|
4468 | 4610 | Save(); |
---|
4469 | 4611 | //int indices[] = jList.getSelectedIndices(); |
---|
4470 | 4612 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
5183 | 5325 | cButton clearpanelButton; |
---|
5184 | 5326 | cButton unselectButton; |
---|
5185 | 5327 | |
---|
5186 | | - cButton saveButton; |
---|
| 5328 | + cButton minButton; |
---|
| 5329 | + cButton maxButton; |
---|
| 5330 | + cButton fullButton; |
---|
5187 | 5331 | cButton undoButton; |
---|
5188 | 5332 | cButton redoButton; |
---|
| 5333 | + cButton saveButton; |
---|
5189 | 5334 | cButton oneStepButton; |
---|
5190 | 5335 | |
---|
5191 | 5336 | cButton screenfitButton; |
---|
.. | .. |
---|
5198 | 5343 | cButton closeButton; |
---|
5199 | 5344 | |
---|
5200 | 5345 | cButton setsupportButton; |
---|
5201 | | - |
---|
5202 | | - cButton twoButton; |
---|
5203 | | - cButton sixButton; |
---|
5204 | | - cButton threeButton; |
---|
5205 | | - cButton sevenButton; |
---|
5206 | | - cButton fourButton; // full panel |
---|
5207 | | - cButton oneButton; // full XYZ |
---|
5208 | | - //cButton currentLayout; |
---|
5209 | 5346 | |
---|
5210 | 5347 | // |
---|
5211 | 5348 | //Composite |
---|
.. | .. |
---|
5283 | 5420 | private MenuItem showleavesItem; |
---|
5284 | 5421 | private MenuItem markleavesItem; |
---|
5285 | 5422 | private MenuItem unmarkleavesItem; |
---|
| 5423 | + private MenuItem rewindleavesItem; |
---|
| 5424 | + private MenuItem unrewindleavesItem; |
---|
| 5425 | + private MenuItem randomleavesItem; |
---|
| 5426 | + private MenuItem unrandomleavesItem; |
---|
5286 | 5427 | |
---|
5287 | 5428 | private MenuItem flipVItem; |
---|
5288 | 5429 | private MenuItem unflipVItem; |
---|