Normand Briere
2019-08-16 64e20f390e4b8e58bd0006dde8fa10fba1dac1d5
GroupEditor.java
....@@ -31,7 +31,7 @@
3131 final String path = "cubemaps/" + f + "-skyboxes/" + s;
3232 row.add(skyboxButton = GetButton(path + "/preview.jpg", !Grafreed.NIMBUSLAF));
3333 //row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF));
34
- skyboxButton.setToolTipText(s);
34
+ skyboxButton.setToolTipText(s.equals("") ? "No background" : s);
3535 skyboxButton.addActionListener(new ActionListener()
3636 {
3737 @Override
....@@ -73,7 +73,7 @@
7373 cGridBag row5 = new cGridBag();
7474 cGridBag row6 = new cGridBag();
7575
76
- AddSkyboxButton("default", "rgb", row0);
76
+ AddSkyboxButton("default", "", row0);
7777 //AddSkyboxButton("default", "cornell", row0);
7878 AddSkyboxButton("penguins", "dust", row0);
7979 AddSkyboxButton("penguins", "tropic", row0);
....@@ -330,10 +330,19 @@
330330
331331 public void ChangeSkybox(String skybox)
332332 {
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
+ }
337346 }
338347
339348 public void CreateSkyboxPanel(cGridBag skyboxPanel)
....@@ -357,6 +366,16 @@
357366 }
358367
359368 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();
360379 }
361380
362381 //ObjEditor objEditor;
....@@ -400,6 +419,8 @@
400419 {
401420 copy.versionlist = new Object3D[100];
402421 copy.versionindex = -1;
422
+
423
+ Save(true);
403424 }
404425
405426 if(ui)
....@@ -519,33 +540,35 @@
519540 // menu.add("-");
520541 duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
521542 duplicateItem.addActionListener(this);
522
- cloneItem = menu.add(new MenuItem("Clone"));
543
+
544
+ cloneItem = oe.jTree.popup.add(new JMenuItem("Clone"));
523545 cloneItem.addActionListener(this);
524
- if (Globals.ADVANCED)
546
+ //if (Globals.ADVANCED)
525547 {
526548 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
527549 cloneSupportItem.addActionListener(this);
528550 }
551
+ oe.jTree.popup.addSeparator();
529552 menu.add("-");
530
- cutItem = menu.add(new MenuItem("Cut"));
553
+ cutItem = oe.jTree.popup.add(new JMenuItem("Cut"));
531554 cutItem.addActionListener(this);
532
- copyItem = menu.add(new MenuItem("Copy"));
555
+ copyItem = oe.jTree.popup.add(new JMenuItem("Copy"));
533556 copyItem.addActionListener(this);
534557 pasteItem = menu.add(new MenuItem("Paste"));
535558 pasteItem.addActionListener(this);
536559
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"));
539563 pasteIntoItem.addActionListener(this);
540
- pasteLinkItem = menu.add(new MenuItem("Paste link"));
564
+ pasteLinkItem = oe.jTree.popup.add(new JMenuItem("Paste link"));
541565 pasteLinkItem.addActionListener(this);
542
- pasteCloneItem = menu.add(new MenuItem("Paste clone"));
566
+ pasteCloneItem = oe.jTree.popup.add(new JMenuItem("Paste clone"));
543567 pasteCloneItem.addActionListener(this);
544
-// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
568
+// CRASH pasteExpandItem = oe.jTree.popup.add(new JMenuItem("Paste expand"));
545569 // pasteExpandItem.addActionListener(this);
546
- menu.add("-");
547
- deleteItem = menu.add(new MenuItem("Delete"));
548
- deleteItem.addActionListener(this);
570
+ //menu.add("-");
571
+ oe.jTree.popup.addSeparator();
549572
550573 if (Globals.ADVANCED)
551574 {
....@@ -631,11 +654,9 @@
631654 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
632655 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
633656 //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
634
- editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
635657 oe.cameraMenu.add("-");
636658 openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
637659 openWindowItem.addActionListener(this);
638
- editLeafItem.addActionListener(this);
639660 lookAtItem.addActionListener(this);
640661 //lookFromItem.addActinoListener(this);
641662 //switchViewItem.addActionListener(this);
....@@ -682,9 +703,8 @@
682703 setMasterItem.addActionListener(this);
683704 }
684705
685
- oe.menuBar.add(menu = new Menu("Group"));
686
-// grabItem = menu.add(new MenuItem("Grab"));
687
-// grabItem.addActionListener(this);
706
+ oe.menuBar.add(menu = new Menu("Order"));
707
+
688708 backItem = menu.add(new MenuItem("Back"));
689709 backItem.addActionListener(this);
690710 frontItem = menu.add(new MenuItem("Front"));
....@@ -692,13 +712,21 @@
692712 // compositeItem = menu.add(new MenuItem("Composite"));
693713 // compositeItem.addActionListener(this);
694714
715
+ grabItem = oe.jTree.popup.add(new JMenuItem("Group"));
716
+ grabItem.addActionListener(this);
717
+
695718 if (Globals.ADVANCED)
696719 {
697720 hideItem = menu.add(new MenuItem("Hidden Group"));
698721 hideItem.addActionListener(this);
699722 }
700
- ungroupItem = menu.add(new MenuItem("Ungroup"));
723
+ ungroupItem = oe.jTree.popup.add(new JMenuItem("Ungroup"));
701724 ungroupItem.addActionListener(this);
725
+
726
+ oe.jTree.popup.addSeparator();
727
+
728
+ deleteItem = oe.jTree.popup.add(new JMenuItem("Delete"));
729
+ deleteItem.addActionListener(this);
702730
703731 // menu.add("-");
704732 //
....@@ -883,6 +911,9 @@
883911 shareGeometriesItem.addActionListener(this);
884912 mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
885913 mergeGeometriesItem.addActionListener(this);
914
+ menu.add("-");
915
+ editLeafItem = menu.add(new MenuItem("Edit leaf..."));
916
+ editLeafItem.addActionListener(this);
886917 if (Globals.ADVANCED)
887918 {
888919 // Pretty much the same as duplicate and clone.
....@@ -901,7 +932,7 @@
901932
902933 JTabbedPane resourcecontainer;
903934 cGridBag currenttab;
904
- boolean added; // patch for jar
935
+ //boolean added; // patch for jar
905936
906937 int tabcount = 0;
907938 int colcount = 0;
....@@ -918,12 +949,14 @@
918949 // System.out.println();
919950
920951 if (//rowcount == 0 ||
921
- path.length == 1)
952
+ path.length == 1 && !path[0].equals("") && !path[0].equals(".DS_Store"))
922953 {
923954 currenttab = new cGridBag();
924
- added = false;
925955 String tabname = path[0]; // String.valueOf((char)('A'+tabcount));
926956 currenttab.setName(tabname);
957
+ //added = false;
958
+ resourcecontainer.add(currenttab);
959
+ resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname);
927960 rowcount = 1;
928961 colcount = 0;
929962 texturecount = 0;
....@@ -931,12 +964,11 @@
931964
932965 if (path.length > 2 && path[2].toLowerCase().endsWith(".jpg"))
933966 {
934
- if (!added)
967
+ //if (!added)
935968 {
936
- added = true;
937
- resourcecontainer.add(currenttab);
969
+ //added = true;
938970 String tabname = path[0]; // String.valueOf((char)('A'+tabcount));
939
- resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname);
971
+ currenttab = (cGridBag)resourcecontainer.getComponentAt(resourcecontainer.indexOfTab(tabname));
940972 }
941973
942974 AddTextureButton(path[0], path[1], path[2], texturecount++, currenttab);
....@@ -984,11 +1016,6 @@
9841016 //new Exception().printStackTrace();
9851017
9861018 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;
9921019 // oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
9931020
9941021 oe.buttonGroup = new ButtonGroup();
....@@ -1021,10 +1048,49 @@
10211048
10221049 if (Globals.ADVANCED)
10231050 {
1024
- oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1025
- maxButton.setToolTipText("Maximize window");
1026
- maxButton.addActionListener(this);
1051
+// oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1052
+// maxButton.setToolTipText("Maximize window");
1053
+// maxButton.addActionListener(this);
10271054 }
1055
+
1056
+ cButton gcButton;
1057
+
1058
+// oe.toolbarPanel.add(gcButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1059
+// gcButton.setToolTipText("Garbage collect");
1060
+// gcButton.addActionListener(new ActionListener()
1061
+// {
1062
+// public void actionPerformed(ActionEvent e)
1063
+// {
1064
+// System.gc();
1065
+// }
1066
+// });
1067
+
1068
+ oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1069
+ collapseButton.setToolTipText("Collapse toolbar");
1070
+ collapseButton.addActionListener(this);
1071
+
1072
+ oe.toolbarPanel.add(maximize3DButton = GetButton("icons/empty.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1073
+ maximize3DButton.setToolTipText("Maximize 3D view");
1074
+ maximize3DButton.addActionListener(this);
1075
+
1076
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1077
+ twoButton.setToolTipText("Show 3D view only");
1078
+ twoButton.addActionListener(this);
1079
+ this.fullscreenLayout = twoButton;
1080
+
1081
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1082
+ threeButton.setToolTipText("Show controls and 3D view");
1083
+ threeButton.addActionListener(this);
1084
+ if (Globals.ADVANCED)
1085
+ {
1086
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1087
+ sixButton.setToolTipText("Show 3D view and controls");
1088
+ sixButton.addActionListener(this);
1089
+ }
1090
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1091
+// sevenButton.setToolTipText("3-column layout");
1092
+// sevenButton.addActionListener(this);
1093
+ //
10281094
10291095 oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
10301096 fullButton.setToolTipText("Full-screen window");
....@@ -1069,14 +1135,14 @@
10691135 nextVersionButton.addActionListener(this);
10701136 nextVersionButton.setEnabled(false);
10711137
1072
- oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
1073
- liveCB.setToolTipText("Enable animation");
1074
- liveCB.addItemListener(this);
1075
-
10761138 oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
10771139 oneStepButton.setToolTipText("Animate one step forward");
10781140 oneStepButton.addActionListener(this);
10791141
1142
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
1143
+ liveCB.setToolTipText("Enable animation");
1144
+ liveCB.addItemListener(this);
1145
+
10801146 oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
10811147 fastCB.setToolTipText("Fast mode");
10821148 fastCB.addItemListener(this);
....@@ -1103,21 +1169,6 @@
11031169
11041170 //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
11051171
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
- //
11211172
11221173 oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
11231174 rootButton.setToolTipText("Open selection in new tab");
....@@ -1133,12 +1184,16 @@
11331184
11341185 // INSERT
11351186 row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1136
- gridButton.setToolTipText("Create grid");
1187
+ gridButton.setToolTipText("Create ground");
11371188 gridButton.addActionListener(this);
11381189
11391190 row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
11401191 boxButton.setToolTipText("Create box");
11411192 boxButton.addActionListener(this);
1193
+
1194
+ row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1195
+ superButton.setToolTipText("Create superellipsoid");
1196
+ superButton.addActionListener(this);
11421197
11431198 row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
11441199 sphereButton.setToolTipText("Create sphere");
....@@ -1151,10 +1206,6 @@
11511206 row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
11521207 torusButton.setToolTipText("Create torus");
11531208 torusButton.addActionListener(this);
1154
-
1155
- row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1156
- superButton.setToolTipText("Create superellipsoid");
1157
- superButton.addActionListener(this);
11581209
11591210 if (Globals.ADVANCED)
11601211 {
....@@ -1425,6 +1476,14 @@
14251476
14261477 void EditObject(Object3D obj)
14271478 {
1479
+ assert(obj instanceof Composite);
1480
+
1481
+// if (obj.versionlist == null)
1482
+// {
1483
+// obj.versionlist = new Object3D[100];
1484
+// obj.versionindex = -1;
1485
+// }
1486
+
14281487 cRadio radioButton = new cRadio(obj.name);
14291488
14301489 // June 2019. Patch to avoid bug with transparency.
....@@ -1449,6 +1508,7 @@
14491508
14501509 oe.SetupViews();
14511510
1511
+ if (Globals.DEBUG)
14521512 System.out.println("SetupViews");
14531513 DragSource.getDefaultDragSource().createDefaultDragGestureRecognizer(
14541514 oe.cameraView, DnDConstants.ACTION_COPY_OR_MOVE, this); // ACTION_LINK ??
....@@ -1815,7 +1875,12 @@
18151875 TreePath path;
18161876
18171877 public TransferableTreePath(TreePath tp) {
1818
- path = tp;
1878
+ Object[] objs = new Object[tp.getPathCount()];
1879
+ for (int i=0; i<objs.length; i++)
1880
+ {
1881
+ objs[i] = ((Object3D)tp.getPathComponent(i)).GetUUID();
1882
+ }
1883
+ path = new TreePath(objs);
18191884 }
18201885
18211886 public synchronized DataFlavor[] getTransferDataFlavors() {
....@@ -2105,7 +2170,11 @@
21052170 shadow.material = new cMaterial(obj.material);
21062171 shadow.material.diffuse = 0.0001f;
21072172 shadow.material.specular = 0.0001f;
2108
- //shadow.projectedVertices[1].x = 300;
2173
+ shadow.material.opacity = 0.75f;
2174
+
2175
+ AllocProjectedVertices(shadow);
2176
+
2177
+ shadow.projectedVertices[1].x = 300;
21092178
21102179 makeSomething(shadow);
21112180 }
....@@ -2626,27 +2695,35 @@
26262695 } else
26272696 if (source == loopItem || source == loopButton)
26282697 {
2698
+ if (!group.selection.isEmpty())
2699
+ {
26292700 Composite csg = new GroupLeaf();
26302701 csg.count = 5;
2631
- group(csg);
26322702 Composite child = new cGroup("Branch");
26332703 csg.addChild(child);
26342704 child.addChild(csg);
2705
+ group(csg);
2706
+ }
26352707 } else
26362708 if (source == doubleItem)
26372709 {
2710
+ if (!group.selection.isEmpty())
2711
+ {
26382712 Composite csg = new GroupLeaf("Fork");
26392713 csg.count = 5;
2640
- group(csg);
26412714 Composite child = new cGroup("Branch A");
26422715 csg.addChild(child);
26432716 child.addChild(csg);
26442717 child = new cGroup("Branch B");
26452718 csg.addChild(child);
26462719 child.addChild(csg);
2720
+ group(csg);
2721
+ }
26472722 } else
26482723 if (source == tripleItem)
26492724 {
2725
+ if (!group.selection.isEmpty())
2726
+ {
26502727 Composite csg = new GroupLeaf("Trident");
26512728 csg.count = 4;
26522729 group(csg);
....@@ -2659,6 +2736,7 @@
26592736 child = new cGroup();
26602737 csg.addChild(child);
26612738 child.addChild(csg);
2739
+ }
26622740 } else
26632741 if (source == computeAOItem)
26642742 {
....@@ -2708,6 +2786,18 @@
27082786 if (source == fullButton)
27092787 {
27102788 ToggleFullScreen();
2789
+ } else
2790
+ if (source == collapseButton)
2791
+ {
2792
+ this.expandedLayout = radio.layout;
2793
+ CollapseToolbar();
2794
+ } else
2795
+ if (source == maximize3DButton)
2796
+ {
2797
+ this.expandedLayout = radio.layout;
2798
+ radio.layout = twoButton;
2799
+ Show3DView();
2800
+ CollapseToolbar();
27112801 } else
27122802 if (source == previousVersionButton)
27132803 {
....@@ -3282,22 +3372,34 @@
32823372 } else
32833373 if (source == ungroupItem || source == ungroupButton)
32843374 {
3285
- boolean hasRoot = false;
3375
+ boolean canUngroup = true;
32863376
32873377 for (int i=0; i<group.selection.size(); i++)
32883378 {
3289
- if (group.selection.get(i) == group)
3379
+ Object3D selectedItem = group.selection.get(i);
3380
+
3381
+ if (selectedItem.Size() == 0)
32903382 {
3291
- hasRoot = true;
3383
+ // Cannot ungroup leaves
3384
+ canUngroup = false;
3385
+ break;
3386
+ }
3387
+
3388
+ if (selectedItem == group)
3389
+ {
3390
+ // Cannot ungroup root
3391
+ canUngroup = false;
32923392 break;
32933393 }
32943394 }
32953395
3296
- if (!hasRoot)
3396
+ if (canUngroup)
32973397 {
32983398 for (int i=0; i<group.selection.size(); i++)
32993399 {
3300
- Ungroup(group.selection.get(i));
3400
+ Object3D selectedItem = group.selection.get(i);
3401
+
3402
+ Ungroup(selectedItem);
33013403 }
33023404
33033405 ClearSelection(false);
....@@ -3660,38 +3762,7 @@
36603762 if (CameraPane.FULLSCREEN)
36613763 fullscreenLayout = radio.layout;
36623764
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();
3765
+ Show3DView();
36953766
36963767 cameraView.requestFocusInWindow();
36973768
....@@ -3877,6 +3948,7 @@
38773948 } else
38783949 if (source == rootButton)
38793950 {
3951
+ Replace();
38803952 Object3D obj;
38813953 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
38823954 {
....@@ -4013,8 +4085,6 @@
40134085
40144086 copy = group;
40154087
4016
- SetUndoStates();
4017
-
40184088 //Globals.theRenderer.object = group;
40194089 if(!useclient)
40204090 {
....@@ -4042,6 +4112,21 @@
40424112 */
40434113 radio.layout.doClick();
40444114
4115
+ assert(copy instanceof Composite);
4116
+
4117
+ if (copy.versionlist == null)
4118
+ {
4119
+ copy.versionlist = new Object3D[100];
4120
+ copy.versionindex = -1;
4121
+
4122
+ // Cannot work with loops
4123
+ // To fix this issue, first mark all nodes above the root,
4124
+ // and check if any of these nodes are reachable below the root.
4125
+ //Save(true);
4126
+ }
4127
+
4128
+ SetVersionStates();
4129
+
40454130 ClearUnpinned();
40464131
40474132 //Grafreed.Assert(group != null);
....@@ -5276,6 +5361,21 @@
52765361 flashSelectionButton.setEnabled(enabled);
52775362
52785363 clearPanelButton.setEnabled(!listUI.isEmpty());
5364
+
5365
+ boolean allComposites = true;
5366
+
5367
+ if (group.selection != null)
5368
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
5369
+ {
5370
+ Object next = e.nextElement();
5371
+ if (!(next instanceof Composite)) // || (next instanceof GroupLeaf))
5372
+ {
5373
+ allComposites = false;
5374
+ break;
5375
+ }
5376
+ }
5377
+
5378
+ rootButton.setEnabled(allComposites);
52795379 }
52805380
52815381 void refreshContents(boolean cp)
....@@ -5290,7 +5390,7 @@
52905390 Object3D child = (Object3D) group.selection.get(i);
52915391
52925392 objEditor.AddInfo(child, this, true);
5293
- System.err.println("info : " + child.GetPath());
5393
+// System.err.println("info : " + child.GetPath());
52945394 }
52955395
52965396 objEditor.SetText(); // jan 2014
....@@ -6173,11 +6273,11 @@
61736273 private MenuItem lookAtItem;
61746274 private MenuItem lookFromItem;
61756275 private MenuItem switchViewItem;
6176
- private MenuItem cutItem;
6276
+ private JMenuItem cutItem;
61776277 private MenuItem undoItem;
61786278 private MenuItem redoItem;
61796279 private JMenuItem duplicateItem;
6180
- private MenuItem cloneItem;
6280
+ private JMenuItem cloneItem;
61816281 private MenuItem cloneSupportItem;
61826282 private MenuItem overwriteGeoItem;
61836283 private MenuItem overwriteMatItem;
....@@ -6198,13 +6298,13 @@
61986298 private MenuItem cloneGeometriesItem;
61996299 private MenuItem shareGeometriesItem;
62006300 private MenuItem mergeGeometriesItem;
6201
- private MenuItem copyItem;
6301
+ private JMenuItem copyItem;
62026302 private MenuItem pasteItem;
6203
- private MenuItem pasteIntoItem;
6204
- private MenuItem pasteLinkItem;
6205
- private MenuItem pasteCloneItem;
6206
- private MenuItem pasteExpandItem;
6207
- private MenuItem deleteItem;
6303
+ private JMenuItem pasteIntoItem;
6304
+ private JMenuItem pasteLinkItem;
6305
+ private JMenuItem pasteCloneItem;
6306
+ private JMenuItem pasteExpandItem;
6307
+ private JMenuItem deleteItem;
62086308 private MenuItem clearAllItem;
62096309 private MenuItem genUVItem;
62106310 private MenuItem genNormalsMESHItem;
....@@ -6259,7 +6359,7 @@
62596359 private MenuItem transformGeometryItem;
62606360 private MenuItem transformChildrenItem;
62616361 private MenuItem hideItem;
6262
- private MenuItem grabItem;
6362
+ private JMenuItem grabItem;
62636363 private MenuItem backItem;
62646364 private MenuItem frontItem;
62656365 private MenuItem cameraItem;
....@@ -6272,7 +6372,7 @@
62726372 private MenuItem switchTransfoItem;
62736373 private MenuItem morphItem;
62746374 private MenuItem linkerItem;
6275
- private MenuItem ungroupItem;
6375
+ private JMenuItem ungroupItem;
62766376 private MenuItem editItem;
62776377 private MenuItem openWindowItem;
62786378 private MenuItem editLeafItem;