.. | .. |
---|
31 | 31 | final String path = "cubemaps/" + f + "-skyboxes/" + s; |
---|
32 | 32 | row.add(skyboxButton = GetButton(path + "/preview.jpg", !Grafreed.NIMBUSLAF)); |
---|
33 | 33 | //row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF)); |
---|
34 | | - skyboxButton.setToolTipText(s); |
---|
| 34 | + skyboxButton.setToolTipText(s.equals("") ? "No background" : s); |
---|
35 | 35 | skyboxButton.addActionListener(new ActionListener() |
---|
36 | 36 | { |
---|
37 | 37 | @Override |
---|
.. | .. |
---|
73 | 73 | cGridBag row5 = new cGridBag(); |
---|
74 | 74 | cGridBag row6 = new cGridBag(); |
---|
75 | 75 | |
---|
76 | | - AddSkyboxButton("default", "rgb", row0); |
---|
| 76 | + AddSkyboxButton("default", "", row0); |
---|
77 | 77 | //AddSkyboxButton("default", "cornell", row0); |
---|
78 | 78 | AddSkyboxButton("penguins", "dust", row0); |
---|
79 | 79 | AddSkyboxButton("penguins", "tropic", row0); |
---|
.. | .. |
---|
330 | 330 | |
---|
331 | 331 | public void ChangeSkybox(String skybox) |
---|
332 | 332 | { |
---|
333 | | - //cameraView.envyoff = false; |
---|
334 | | - group.skyboxname = skybox; |
---|
335 | | - group.skyboxext = "jpg"; |
---|
336 | | - cameraView.repaint(); |
---|
| 333 | + if (skybox.endsWith("/")) |
---|
| 334 | + { |
---|
| 335 | + group.skyboxname = null; |
---|
| 336 | + group.skyboxext = null; |
---|
| 337 | + cameraView.repaint(); |
---|
| 338 | + } |
---|
| 339 | + else |
---|
| 340 | + { |
---|
| 341 | + //cameraView.envyoff = false; |
---|
| 342 | + group.skyboxname = skybox; |
---|
| 343 | + group.skyboxext = "jpg"; |
---|
| 344 | + cameraView.repaint(); |
---|
| 345 | + } |
---|
337 | 346 | } |
---|
338 | 347 | |
---|
339 | 348 | public void CreateSkyboxPanel(cGridBag skyboxPanel) |
---|
.. | .. |
---|
357 | 366 | } |
---|
358 | 367 | |
---|
359 | 368 | refreshContents(); |
---|
| 369 | + } |
---|
| 370 | + |
---|
| 371 | + public void Show3DView() |
---|
| 372 | + { |
---|
| 373 | + // bug |
---|
| 374 | + //gridPanel.setDividerLocation(1.0); |
---|
| 375 | + //bigPanel.setDividerLocation(0.0); |
---|
| 376 | + bigThree.ClearUI(); |
---|
| 377 | + bigThree.add(centralPanel); |
---|
| 378 | + bigThree.FlushUI(); |
---|
360 | 379 | } |
---|
361 | 380 | |
---|
362 | 381 | //ObjEditor objEditor; |
---|
.. | .. |
---|
400 | 419 | { |
---|
401 | 420 | copy.versionlist = new Object3D[100]; |
---|
402 | 421 | copy.versionindex = -1; |
---|
| 422 | + |
---|
| 423 | + Save(true); |
---|
403 | 424 | } |
---|
404 | 425 | |
---|
405 | 426 | if(ui) |
---|
.. | .. |
---|
519 | 540 | // menu.add("-"); |
---|
520 | 541 | duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); |
---|
521 | 542 | duplicateItem.addActionListener(this); |
---|
522 | | - cloneItem = menu.add(new MenuItem("Clone")); |
---|
| 543 | + |
---|
| 544 | + cloneItem = oe.jTree.popup.add(new JMenuItem("Clone")); |
---|
523 | 545 | cloneItem.addActionListener(this); |
---|
524 | | - if (Globals.ADVANCED) |
---|
| 546 | + //if (Globals.ADVANCED) |
---|
525 | 547 | { |
---|
526 | 548 | cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); |
---|
527 | 549 | cloneSupportItem.addActionListener(this); |
---|
528 | 550 | } |
---|
| 551 | + oe.jTree.popup.addSeparator(); |
---|
529 | 552 | menu.add("-"); |
---|
530 | | - cutItem = menu.add(new MenuItem("Cut")); |
---|
| 553 | + cutItem = oe.jTree.popup.add(new JMenuItem("Cut")); |
---|
531 | 554 | cutItem.addActionListener(this); |
---|
532 | | - copyItem = menu.add(new MenuItem("Copy")); |
---|
| 555 | + copyItem = oe.jTree.popup.add(new JMenuItem("Copy")); |
---|
533 | 556 | copyItem.addActionListener(this); |
---|
534 | 557 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
535 | 558 | pasteItem.addActionListener(this); |
---|
536 | 559 | |
---|
537 | | - menu.add("-"); |
---|
538 | | - pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
| 560 | + oe.jTree.popup.addSeparator(); |
---|
| 561 | + //menu.add("-"); |
---|
| 562 | + pasteIntoItem = oe.jTree.popup.add(new JMenuItem("Paste into")); |
---|
539 | 563 | pasteIntoItem.addActionListener(this); |
---|
540 | | - pasteLinkItem = menu.add(new MenuItem("Paste link")); |
---|
| 564 | + pasteLinkItem = oe.jTree.popup.add(new JMenuItem("Paste link")); |
---|
541 | 565 | pasteLinkItem.addActionListener(this); |
---|
542 | | - pasteCloneItem = menu.add(new MenuItem("Paste clone")); |
---|
| 566 | + pasteCloneItem = oe.jTree.popup.add(new JMenuItem("Paste clone")); |
---|
543 | 567 | pasteCloneItem.addActionListener(this); |
---|
544 | | -// pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
| 568 | +// CRASH pasteExpandItem = oe.jTree.popup.add(new JMenuItem("Paste expand")); |
---|
545 | 569 | // pasteExpandItem.addActionListener(this); |
---|
546 | | - menu.add("-"); |
---|
547 | | - deleteItem = menu.add(new MenuItem("Delete")); |
---|
| 570 | + //menu.add("-"); |
---|
| 571 | + oe.jTree.popup.addSeparator(); |
---|
| 572 | + |
---|
| 573 | + deleteItem = oe.jTree.popup.add(new JMenuItem("Delete")); |
---|
548 | 574 | deleteItem.addActionListener(this); |
---|
549 | 575 | |
---|
550 | 576 | if (Globals.ADVANCED) |
---|
.. | .. |
---|
631 | 657 | oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
632 | 658 | //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
633 | 659 | //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); |
---|
634 | | - editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
635 | 660 | oe.cameraMenu.add("-"); |
---|
636 | 661 | openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
637 | 662 | openWindowItem.addActionListener(this); |
---|
638 | | - editLeafItem.addActionListener(this); |
---|
639 | 663 | lookAtItem.addActionListener(this); |
---|
640 | 664 | //lookFromItem.addActinoListener(this); |
---|
641 | 665 | //switchViewItem.addActionListener(this); |
---|
.. | .. |
---|
697 | 721 | hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
698 | 722 | hideItem.addActionListener(this); |
---|
699 | 723 | } |
---|
700 | | - ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
| 724 | + ungroupItem = oe.jTree.popup.add(new JMenuItem("Ungroup")); |
---|
701 | 725 | ungroupItem.addActionListener(this); |
---|
702 | 726 | |
---|
703 | 727 | // menu.add("-"); |
---|
.. | .. |
---|
883 | 907 | shareGeometriesItem.addActionListener(this); |
---|
884 | 908 | mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
885 | 909 | mergeGeometriesItem.addActionListener(this); |
---|
| 910 | + menu.add("-"); |
---|
| 911 | + editLeafItem = menu.add(new MenuItem("Edit leaf...")); |
---|
| 912 | + editLeafItem.addActionListener(this); |
---|
886 | 913 | if (Globals.ADVANCED) |
---|
887 | 914 | { |
---|
888 | 915 | // Pretty much the same as duplicate and clone. |
---|
.. | .. |
---|
901 | 928 | |
---|
902 | 929 | JTabbedPane resourcecontainer; |
---|
903 | 930 | cGridBag currenttab; |
---|
904 | | - boolean added; // patch for jar |
---|
| 931 | + //boolean added; // patch for jar |
---|
905 | 932 | |
---|
906 | 933 | int tabcount = 0; |
---|
907 | 934 | int colcount = 0; |
---|
.. | .. |
---|
918 | 945 | // System.out.println(); |
---|
919 | 946 | |
---|
920 | 947 | if (//rowcount == 0 || |
---|
921 | | - path.length == 1) |
---|
| 948 | + path.length == 1 && !path[0].equals("") && !path[0].equals(".DS_Store")) |
---|
922 | 949 | { |
---|
923 | 950 | currenttab = new cGridBag(); |
---|
924 | | - added = false; |
---|
925 | 951 | String tabname = path[0]; // String.valueOf((char)('A'+tabcount)); |
---|
926 | 952 | currenttab.setName(tabname); |
---|
| 953 | + //added = false; |
---|
| 954 | + resourcecontainer.add(currenttab); |
---|
| 955 | + resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname); |
---|
927 | 956 | rowcount = 1; |
---|
928 | 957 | colcount = 0; |
---|
929 | 958 | texturecount = 0; |
---|
.. | .. |
---|
931 | 960 | |
---|
932 | 961 | if (path.length > 2 && path[2].toLowerCase().endsWith(".jpg")) |
---|
933 | 962 | { |
---|
934 | | - if (!added) |
---|
| 963 | + //if (!added) |
---|
935 | 964 | { |
---|
936 | | - added = true; |
---|
937 | | - resourcecontainer.add(currenttab); |
---|
| 965 | + //added = true; |
---|
938 | 966 | String tabname = path[0]; // String.valueOf((char)('A'+tabcount)); |
---|
939 | | - resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname); |
---|
| 967 | + currenttab = (cGridBag)resourcecontainer.getComponentAt(resourcecontainer.indexOfTab(tabname)); |
---|
940 | 968 | } |
---|
941 | 969 | |
---|
942 | 970 | AddTextureButton(path[0], path[1], path[2], texturecount++, currenttab); |
---|
.. | .. |
---|
984 | 1012 | //new Exception().printStackTrace(); |
---|
985 | 1013 | |
---|
986 | 1014 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
987 | | - oe.aConstraints.weightx = 1; |
---|
988 | | - oe.aConstraints.weighty = 0; |
---|
989 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
990 | | - oe.aConstraints.gridwidth = 100; |
---|
991 | | - oe.aConstraints.gridheight = 1; |
---|
992 | 1015 | // oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
993 | 1016 | |
---|
994 | 1017 | oe.buttonGroup = new ButtonGroup(); |
---|
.. | .. |
---|
1021 | 1044 | |
---|
1022 | 1045 | if (Globals.ADVANCED) |
---|
1023 | 1046 | { |
---|
1024 | | - oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1025 | | - maxButton.setToolTipText("Maximize window"); |
---|
1026 | | - maxButton.addActionListener(this); |
---|
| 1047 | +// oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1048 | +// maxButton.setToolTipText("Maximize window"); |
---|
| 1049 | +// maxButton.addActionListener(this); |
---|
1027 | 1050 | } |
---|
| 1051 | + |
---|
| 1052 | + cButton gcButton; |
---|
| 1053 | + |
---|
| 1054 | +// oe.toolbarPanel.add(gcButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1055 | +// gcButton.setToolTipText("Garbage collect"); |
---|
| 1056 | +// gcButton.addActionListener(new ActionListener() |
---|
| 1057 | +// { |
---|
| 1058 | +// public void actionPerformed(ActionEvent e) |
---|
| 1059 | +// { |
---|
| 1060 | +// System.gc(); |
---|
| 1061 | +// } |
---|
| 1062 | +// }); |
---|
| 1063 | + |
---|
| 1064 | + oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1065 | + collapseButton.setToolTipText("Collapse toolbar"); |
---|
| 1066 | + collapseButton.addActionListener(this); |
---|
| 1067 | + |
---|
| 1068 | + oe.toolbarPanel.add(maximize3DButton = GetButton("", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1069 | + maximize3DButton.setToolTipText("Maximize 3D view"); |
---|
| 1070 | + maximize3DButton.addActionListener(this); |
---|
| 1071 | + |
---|
| 1072 | + oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1073 | + twoButton.setToolTipText("Show 3D view only"); |
---|
| 1074 | + twoButton.addActionListener(this); |
---|
| 1075 | + this.fullscreenLayout = twoButton; |
---|
| 1076 | + |
---|
| 1077 | + oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1078 | + threeButton.setToolTipText("Show controls and 3D view"); |
---|
| 1079 | + threeButton.addActionListener(this); |
---|
| 1080 | + if (Globals.ADVANCED) |
---|
| 1081 | + { |
---|
| 1082 | + oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1083 | + sixButton.setToolTipText("Show 3D view and controls"); |
---|
| 1084 | + sixButton.addActionListener(this); |
---|
| 1085 | + } |
---|
| 1086 | +// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1087 | +// sevenButton.setToolTipText("3-column layout"); |
---|
| 1088 | +// sevenButton.addActionListener(this); |
---|
| 1089 | + // |
---|
1028 | 1090 | |
---|
1029 | 1091 | oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1030 | 1092 | fullButton.setToolTipText("Full-screen window"); |
---|
.. | .. |
---|
1069 | 1131 | nextVersionButton.addActionListener(this); |
---|
1070 | 1132 | nextVersionButton.setEnabled(false); |
---|
1071 | 1133 | |
---|
1072 | | - oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
1073 | | - liveCB.setToolTipText("Enable animation"); |
---|
1074 | | - liveCB.addItemListener(this); |
---|
1075 | | - |
---|
1076 | 1134 | oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1077 | 1135 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
1078 | 1136 | oneStepButton.addActionListener(this); |
---|
1079 | 1137 | |
---|
| 1138 | + oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 1139 | + liveCB.setToolTipText("Enable animation"); |
---|
| 1140 | + liveCB.addItemListener(this); |
---|
| 1141 | + |
---|
1080 | 1142 | oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
1081 | 1143 | fastCB.setToolTipText("Fast mode"); |
---|
1082 | 1144 | fastCB.addItemListener(this); |
---|
.. | .. |
---|
1103 | 1165 | |
---|
1104 | 1166 | //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
1105 | 1167 | |
---|
1106 | | - oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1107 | | - twoButton.setToolTipText("Show 3D view only"); |
---|
1108 | | - twoButton.addActionListener(this); |
---|
1109 | | - this.fullscreenLayout = twoButton; |
---|
1110 | | - |
---|
1111 | | - oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1112 | | - threeButton.setToolTipText("Show controls and 3D view"); |
---|
1113 | | - threeButton.addActionListener(this); |
---|
1114 | | - oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1115 | | - sixButton.setToolTipText("Show 3D view and controls"); |
---|
1116 | | - sixButton.addActionListener(this); |
---|
1117 | | -// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1118 | | -// sevenButton.setToolTipText("3-column layout"); |
---|
1119 | | -// sevenButton.addActionListener(this); |
---|
1120 | | - // |
---|
1121 | 1168 | |
---|
1122 | 1169 | oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1123 | 1170 | rootButton.setToolTipText("Open selection in new tab"); |
---|
.. | .. |
---|
1133 | 1180 | |
---|
1134 | 1181 | // INSERT |
---|
1135 | 1182 | row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1136 | | - gridButton.setToolTipText("Create grid"); |
---|
| 1183 | + gridButton.setToolTipText("Create ground"); |
---|
1137 | 1184 | gridButton.addActionListener(this); |
---|
1138 | 1185 | |
---|
1139 | 1186 | row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
.. | .. |
---|
1425 | 1472 | |
---|
1426 | 1473 | void EditObject(Object3D obj) |
---|
1427 | 1474 | { |
---|
| 1475 | + assert(obj instanceof Composite); |
---|
| 1476 | + |
---|
| 1477 | +// if (obj.versionlist == null) |
---|
| 1478 | +// { |
---|
| 1479 | +// obj.versionlist = new Object3D[100]; |
---|
| 1480 | +// obj.versionindex = -1; |
---|
| 1481 | +// } |
---|
| 1482 | + |
---|
1428 | 1483 | cRadio radioButton = new cRadio(obj.name); |
---|
1429 | 1484 | |
---|
1430 | 1485 | // June 2019. Patch to avoid bug with transparency. |
---|
.. | .. |
---|
1815 | 1870 | TreePath path; |
---|
1816 | 1871 | |
---|
1817 | 1872 | public TransferableTreePath(TreePath tp) { |
---|
1818 | | - path = tp; |
---|
| 1873 | + Object[] objs = new Object[tp.getPathCount()]; |
---|
| 1874 | + for (int i=0; i<objs.length; i++) |
---|
| 1875 | + { |
---|
| 1876 | + objs[i] = ((Object3D)tp.getPathComponent(i)).GetUUID(); |
---|
| 1877 | + } |
---|
| 1878 | + path = new TreePath(objs); |
---|
1819 | 1879 | } |
---|
1820 | 1880 | |
---|
1821 | 1881 | public synchronized DataFlavor[] getTransferDataFlavors() { |
---|
.. | .. |
---|
2626 | 2686 | } else |
---|
2627 | 2687 | if (source == loopItem || source == loopButton) |
---|
2628 | 2688 | { |
---|
| 2689 | + if (!group.selection.isEmpty()) |
---|
| 2690 | + { |
---|
2629 | 2691 | Composite csg = new GroupLeaf(); |
---|
2630 | 2692 | csg.count = 5; |
---|
2631 | | - group(csg); |
---|
2632 | 2693 | Composite child = new cGroup("Branch"); |
---|
2633 | 2694 | csg.addChild(child); |
---|
2634 | 2695 | child.addChild(csg); |
---|
| 2696 | + group(csg); |
---|
| 2697 | + } |
---|
2635 | 2698 | } else |
---|
2636 | 2699 | if (source == doubleItem) |
---|
2637 | 2700 | { |
---|
| 2701 | + if (!group.selection.isEmpty()) |
---|
| 2702 | + { |
---|
2638 | 2703 | Composite csg = new GroupLeaf("Fork"); |
---|
2639 | 2704 | csg.count = 5; |
---|
2640 | | - group(csg); |
---|
2641 | 2705 | Composite child = new cGroup("Branch A"); |
---|
2642 | 2706 | csg.addChild(child); |
---|
2643 | 2707 | child.addChild(csg); |
---|
2644 | 2708 | child = new cGroup("Branch B"); |
---|
2645 | 2709 | csg.addChild(child); |
---|
2646 | 2710 | child.addChild(csg); |
---|
| 2711 | + group(csg); |
---|
| 2712 | + } |
---|
2647 | 2713 | } else |
---|
2648 | 2714 | if (source == tripleItem) |
---|
2649 | 2715 | { |
---|
| 2716 | + if (!group.selection.isEmpty()) |
---|
| 2717 | + { |
---|
2650 | 2718 | Composite csg = new GroupLeaf("Trident"); |
---|
2651 | 2719 | csg.count = 4; |
---|
2652 | 2720 | group(csg); |
---|
.. | .. |
---|
2659 | 2727 | child = new cGroup(); |
---|
2660 | 2728 | csg.addChild(child); |
---|
2661 | 2729 | child.addChild(csg); |
---|
| 2730 | + } |
---|
2662 | 2731 | } else |
---|
2663 | 2732 | if (source == computeAOItem) |
---|
2664 | 2733 | { |
---|
.. | .. |
---|
2708 | 2777 | if (source == fullButton) |
---|
2709 | 2778 | { |
---|
2710 | 2779 | ToggleFullScreen(); |
---|
| 2780 | + } else |
---|
| 2781 | + if (source == collapseButton) |
---|
| 2782 | + { |
---|
| 2783 | + this.expandedLayout = radio.layout; |
---|
| 2784 | + CollapseToolbar(); |
---|
| 2785 | + } else |
---|
| 2786 | + if (source == maximize3DButton) |
---|
| 2787 | + { |
---|
| 2788 | + this.expandedLayout = radio.layout; |
---|
| 2789 | + radio.layout = twoButton; |
---|
| 2790 | + Show3DView(); |
---|
| 2791 | + CollapseToolbar(); |
---|
2711 | 2792 | } else |
---|
2712 | 2793 | if (source == previousVersionButton) |
---|
2713 | 2794 | { |
---|
.. | .. |
---|
3282 | 3363 | } else |
---|
3283 | 3364 | if (source == ungroupItem || source == ungroupButton) |
---|
3284 | 3365 | { |
---|
3285 | | - boolean hasRoot = false; |
---|
| 3366 | + boolean canUngroup = true; |
---|
3286 | 3367 | |
---|
3287 | 3368 | for (int i=0; i<group.selection.size(); i++) |
---|
3288 | 3369 | { |
---|
3289 | | - if (group.selection.get(i) == group) |
---|
| 3370 | + Object3D selectedItem = group.selection.get(i); |
---|
| 3371 | + |
---|
| 3372 | + if (selectedItem.Size() == 0) |
---|
3290 | 3373 | { |
---|
3291 | | - hasRoot = true; |
---|
| 3374 | + // Cannot ungroup leaves |
---|
| 3375 | + canUngroup = false; |
---|
| 3376 | + break; |
---|
| 3377 | + } |
---|
| 3378 | + |
---|
| 3379 | + if (selectedItem == group) |
---|
| 3380 | + { |
---|
| 3381 | + // Cannot ungroup root |
---|
| 3382 | + canUngroup = false; |
---|
3292 | 3383 | break; |
---|
3293 | 3384 | } |
---|
3294 | 3385 | } |
---|
3295 | 3386 | |
---|
3296 | | - if (!hasRoot) |
---|
| 3387 | + if (canUngroup) |
---|
3297 | 3388 | { |
---|
3298 | 3389 | for (int i=0; i<group.selection.size(); i++) |
---|
3299 | 3390 | { |
---|
3300 | | - Ungroup(group.selection.get(i)); |
---|
| 3391 | + Object3D selectedItem = group.selection.get(i); |
---|
| 3392 | + |
---|
| 3393 | + Ungroup(selectedItem); |
---|
3301 | 3394 | } |
---|
3302 | 3395 | |
---|
3303 | 3396 | ClearSelection(false); |
---|
.. | .. |
---|
3660 | 3753 | if (CameraPane.FULLSCREEN) |
---|
3661 | 3754 | fullscreenLayout = radio.layout; |
---|
3662 | 3755 | |
---|
3663 | | - // bug |
---|
3664 | | - //gridPanel.setDividerLocation(1.0); |
---|
3665 | | - //bigPanel.setDividerLocation(0.0); |
---|
3666 | | -// bigThree.remove(scenePanel); |
---|
3667 | | -// bigThree.remove(centralPanel); |
---|
3668 | | -// bigThree.remove(XYZPanel); |
---|
3669 | | -// aWindowConstraints.gridx = 0; |
---|
3670 | | -// aWindowConstraints.gridy = 0; |
---|
3671 | | -// aWindowConstraints.gridwidth = 1; |
---|
3672 | | -// // aConstraints.gridheight = 3; |
---|
3673 | | -// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
3674 | | -// aWindowConstraints.weightx = 0; |
---|
3675 | | -// aWindowConstraints.weighty = 1; |
---|
3676 | | -// //bigThree.add(jtp, aWindowConstraints); |
---|
3677 | | -// aWindowConstraints.weightx = 1; |
---|
3678 | | -// aWindowConstraints.gridwidth = 3; |
---|
3679 | | -// // aConstraints.gridheight = 3; |
---|
3680 | | -// aWindowConstraints.gridx = 1; |
---|
3681 | | -// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
3682 | | -// bigThree.add(centralPanel, aWindowConstraints); |
---|
3683 | | -// aWindowConstraints.weightx = 0; |
---|
3684 | | -// aWindowConstraints.gridx = 4; |
---|
3685 | | -// aWindowConstraints.gridwidth = 1; |
---|
3686 | | -// // aConstraints.gridheight = 3; |
---|
3687 | | -// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
3688 | | -// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
3689 | | -// scenePanel.setVisible(false); |
---|
3690 | | -// centralPanel.setVisible(true); |
---|
3691 | | -// XYZPanel.setVisible(false); |
---|
3692 | | - bigThree.ClearUI(); |
---|
3693 | | - bigThree.add(centralPanel); |
---|
3694 | | - bigThree.FlushUI(); |
---|
| 3756 | + Show3DView(); |
---|
3695 | 3757 | |
---|
3696 | 3758 | cameraView.requestFocusInWindow(); |
---|
3697 | 3759 | |
---|
.. | .. |
---|
3877 | 3939 | } else |
---|
3878 | 3940 | if (source == rootButton) |
---|
3879 | 3941 | { |
---|
| 3942 | + Replace(); |
---|
3880 | 3943 | Object3D obj; |
---|
3881 | 3944 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
3882 | 3945 | { |
---|
.. | .. |
---|
4013 | 4076 | |
---|
4014 | 4077 | copy = group; |
---|
4015 | 4078 | |
---|
4016 | | - SetUndoStates(); |
---|
4017 | | - |
---|
4018 | 4079 | //Globals.theRenderer.object = group; |
---|
4019 | 4080 | if(!useclient) |
---|
4020 | 4081 | { |
---|
.. | .. |
---|
4042 | 4103 | */ |
---|
4043 | 4104 | radio.layout.doClick(); |
---|
4044 | 4105 | |
---|
| 4106 | + assert(copy instanceof Composite); |
---|
| 4107 | + |
---|
| 4108 | + if (copy.versionlist == null) |
---|
| 4109 | + { |
---|
| 4110 | + copy.versionlist = new Object3D[100]; |
---|
| 4111 | + copy.versionindex = -1; |
---|
| 4112 | + |
---|
| 4113 | + Save(true); |
---|
| 4114 | + } |
---|
| 4115 | + |
---|
| 4116 | + SetVersionStates(); |
---|
| 4117 | + |
---|
4045 | 4118 | ClearUnpinned(); |
---|
4046 | 4119 | |
---|
4047 | 4120 | //Grafreed.Assert(group != null); |
---|
.. | .. |
---|
5276 | 5349 | flashSelectionButton.setEnabled(enabled); |
---|
5277 | 5350 | |
---|
5278 | 5351 | clearPanelButton.setEnabled(!listUI.isEmpty()); |
---|
| 5352 | + |
---|
| 5353 | + boolean allComposites = true; |
---|
| 5354 | + |
---|
| 5355 | + if (group.selection != null) |
---|
| 5356 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 5357 | + { |
---|
| 5358 | + if (!(e.nextElement() instanceof Composite)) |
---|
| 5359 | + { |
---|
| 5360 | + allComposites = false; |
---|
| 5361 | + break; |
---|
| 5362 | + } |
---|
| 5363 | + } |
---|
| 5364 | + |
---|
| 5365 | + rootButton.setEnabled(allComposites); |
---|
5279 | 5366 | } |
---|
5280 | 5367 | |
---|
5281 | 5368 | void refreshContents(boolean cp) |
---|
.. | .. |
---|
5290 | 5377 | Object3D child = (Object3D) group.selection.get(i); |
---|
5291 | 5378 | |
---|
5292 | 5379 | objEditor.AddInfo(child, this, true); |
---|
5293 | | - System.err.println("info : " + child.GetPath()); |
---|
| 5380 | +// System.err.println("info : " + child.GetPath()); |
---|
5294 | 5381 | } |
---|
5295 | 5382 | |
---|
5296 | 5383 | objEditor.SetText(); // jan 2014 |
---|
.. | .. |
---|
6173 | 6260 | private MenuItem lookAtItem; |
---|
6174 | 6261 | private MenuItem lookFromItem; |
---|
6175 | 6262 | private MenuItem switchViewItem; |
---|
6176 | | - private MenuItem cutItem; |
---|
| 6263 | + private JMenuItem cutItem; |
---|
6177 | 6264 | private MenuItem undoItem; |
---|
6178 | 6265 | private MenuItem redoItem; |
---|
6179 | 6266 | private JMenuItem duplicateItem; |
---|
6180 | | - private MenuItem cloneItem; |
---|
| 6267 | + private JMenuItem cloneItem; |
---|
6181 | 6268 | private MenuItem cloneSupportItem; |
---|
6182 | 6269 | private MenuItem overwriteGeoItem; |
---|
6183 | 6270 | private MenuItem overwriteMatItem; |
---|
.. | .. |
---|
6198 | 6285 | private MenuItem cloneGeometriesItem; |
---|
6199 | 6286 | private MenuItem shareGeometriesItem; |
---|
6200 | 6287 | private MenuItem mergeGeometriesItem; |
---|
6201 | | - private MenuItem copyItem; |
---|
| 6288 | + private JMenuItem copyItem; |
---|
6202 | 6289 | private MenuItem pasteItem; |
---|
6203 | | - private MenuItem pasteIntoItem; |
---|
6204 | | - private MenuItem pasteLinkItem; |
---|
6205 | | - private MenuItem pasteCloneItem; |
---|
6206 | | - private MenuItem pasteExpandItem; |
---|
6207 | | - private MenuItem deleteItem; |
---|
| 6290 | + private JMenuItem pasteIntoItem; |
---|
| 6291 | + private JMenuItem pasteLinkItem; |
---|
| 6292 | + private JMenuItem pasteCloneItem; |
---|
| 6293 | + private JMenuItem pasteExpandItem; |
---|
| 6294 | + private JMenuItem deleteItem; |
---|
6208 | 6295 | private MenuItem clearAllItem; |
---|
6209 | 6296 | private MenuItem genUVItem; |
---|
6210 | 6297 | private MenuItem genNormalsMESHItem; |
---|
.. | .. |
---|
6272 | 6359 | private MenuItem switchTransfoItem; |
---|
6273 | 6360 | private MenuItem morphItem; |
---|
6274 | 6361 | private MenuItem linkerItem; |
---|
6275 | | - private MenuItem ungroupItem; |
---|
| 6362 | + private JMenuItem ungroupItem; |
---|
6276 | 6363 | private MenuItem editItem; |
---|
6277 | 6364 | private MenuItem openWindowItem; |
---|
6278 | 6365 | private MenuItem editLeafItem; |
---|