Normand Briere
2019-08-15 33504fc9a180903aace77613264550754fba5706
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
....@@ -42,12 +42,12 @@
4242 });
4343 }
4444
45
- public void AddTextureButton(String f, final String t, cGridBag row)
45
+ public void AddTextureButton(String f, String c, final String t, int count, cGridBag row)
4646 {
4747 cButton textureButton;
48
- final String path = "textures/" + f + "/"; // + t;
48
+ final String path = "textures/" + f + "/" + c + "/"; // + t;
4949 row.add(textureButton = GetButton(path + "icons/" + t, !Grafreed.NIMBUSLAF));
50
- textureButton.setToolTipText(f + "s");
50
+ textureButton.setToolTipText(c + count);
5151 textureButton.addActionListener(new ActionListener()
5252 {
5353 @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)
....@@ -350,7 +359,23 @@
350359
351360 public void ChangeTexture(String texture)
352361 {
353
- cameraView.repaint();
362
+ for (int i=0; i<group.selection.size(); i++)
363
+ {
364
+ Object3D obj = group.selection.get(i);
365
+ obj.SetPigmentTexture("@" + texture);
366
+ }
367
+
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();
354379 }
355380
356381 //ObjEditor objEditor;
....@@ -394,6 +419,8 @@
394419 {
395420 copy.versionlist = new Object3D[100];
396421 copy.versionindex = -1;
422
+
423
+ Save(true);
397424 }
398425
399426 if(ui)
....@@ -513,32 +540,37 @@
513540 // menu.add("-");
514541 duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
515542 duplicateItem.addActionListener(this);
516
- cloneItem = menu.add(new MenuItem("Clone"));
543
+
544
+ cloneItem = oe.jTree.popup.add(new JMenuItem("Clone"));
517545 cloneItem.addActionListener(this);
518
- if (Globals.ADVANCED)
546
+ //if (Globals.ADVANCED)
519547 {
520548 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
521549 cloneSupportItem.addActionListener(this);
522550 }
551
+ oe.jTree.popup.addSeparator();
523552 menu.add("-");
524
- cutItem = menu.add(new MenuItem("Cut"));
553
+ cutItem = oe.jTree.popup.add(new JMenuItem("Cut"));
525554 cutItem.addActionListener(this);
526
- copyItem = menu.add(new MenuItem("Copy"));
555
+ copyItem = oe.jTree.popup.add(new JMenuItem("Copy"));
527556 copyItem.addActionListener(this);
528557 pasteItem = menu.add(new MenuItem("Paste"));
529558 pasteItem.addActionListener(this);
530559
531
- menu.add("-");
532
- 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"));
533563 pasteIntoItem.addActionListener(this);
534
- pasteLinkItem = menu.add(new MenuItem("Paste link"));
564
+ pasteLinkItem = oe.jTree.popup.add(new JMenuItem("Paste link"));
535565 pasteLinkItem.addActionListener(this);
536
- pasteCloneItem = menu.add(new MenuItem("Paste clone"));
566
+ pasteCloneItem = oe.jTree.popup.add(new JMenuItem("Paste clone"));
537567 pasteCloneItem.addActionListener(this);
538
-// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
568
+// CRASH pasteExpandItem = oe.jTree.popup.add(new JMenuItem("Paste expand"));
539569 // pasteExpandItem.addActionListener(this);
540
- menu.add("-");
541
- deleteItem = menu.add(new MenuItem("Delete"));
570
+ //menu.add("-");
571
+ oe.jTree.popup.addSeparator();
572
+
573
+ deleteItem = oe.jTree.popup.add(new JMenuItem("Delete"));
542574 deleteItem.addActionListener(this);
543575
544576 if (Globals.ADVANCED)
....@@ -625,11 +657,9 @@
625657 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
626658 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
627659 //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
628
- editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
629660 oe.cameraMenu.add("-");
630661 openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
631662 openWindowItem.addActionListener(this);
632
- editLeafItem.addActionListener(this);
633663 lookAtItem.addActionListener(this);
634664 //lookFromItem.addActinoListener(this);
635665 //switchViewItem.addActionListener(this);
....@@ -691,7 +721,7 @@
691721 hideItem = menu.add(new MenuItem("Hidden Group"));
692722 hideItem.addActionListener(this);
693723 }
694
- ungroupItem = menu.add(new MenuItem("Ungroup"));
724
+ ungroupItem = oe.jTree.popup.add(new JMenuItem("Ungroup"));
695725 ungroupItem.addActionListener(this);
696726
697727 // menu.add("-");
....@@ -877,6 +907,9 @@
877907 shareGeometriesItem.addActionListener(this);
878908 mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
879909 mergeGeometriesItem.addActionListener(this);
910
+ menu.add("-");
911
+ editLeafItem = menu.add(new MenuItem("Edit leaf..."));
912
+ editLeafItem.addActionListener(this);
880913 if (Globals.ADVANCED)
881914 {
882915 // Pretty much the same as duplicate and clone.
....@@ -895,40 +928,47 @@
895928
896929 JTabbedPane resourcecontainer;
897930 cGridBag currenttab;
898
- boolean added; // patch for jar
931
+ //boolean added; // patch for jar
899932
900933 int tabcount = 0;
901934 int colcount = 0;
902935 int rowcount = 0;
936
+ int texturecount = 0;
903937
904938 int columns = 5;
905939 int rows = 7;
906940
907941 public void ResourceCallBack(String[] path)
908942 {
909
- for (int i = 0; i < path.length; i++)
910
- System.out.print(path[i] + "/");
911
- System.out.println();
912
- if (rowcount == 0)
943
+// for (int i = 0; i < path.length; i++)
944
+// System.out.print(path[i] + "/");
945
+// System.out.println();
946
+
947
+ if (//rowcount == 0 ||
948
+ path.length == 1 && !path[0].equals("") && !path[0].equals(".DS_Store"))
913949 {
914950 currenttab = new cGridBag();
915
- added = false;
916
- String tabname = String.valueOf((char)('A'+tabcount));
951
+ String tabname = path[0]; // String.valueOf((char)('A'+tabcount));
917952 currenttab.setName(tabname);
953
+ //added = false;
954
+ resourcecontainer.add(currenttab);
955
+ resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname);
918956 rowcount = 1;
957
+ colcount = 0;
958
+ texturecount = 0;
919959 }
920960
921
- if (path.length > 1 && path[1].toLowerCase().endsWith(".jpg"))
961
+ if (path.length > 2 && path[2].toLowerCase().endsWith(".jpg"))
922962 {
923
- if (!added)
963
+ //if (!added)
924964 {
925
- added = true;
926
- resourcecontainer.add(currenttab);
927
- String tabname = String.valueOf((char)('A'+tabcount));
928
- resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname);
965
+ //added = true;
966
+ String tabname = path[0]; // String.valueOf((char)('A'+tabcount));
967
+ currenttab = (cGridBag)resourcecontainer.getComponentAt(resourcecontainer.indexOfTab(tabname));
929968 }
930969
931
- AddTextureButton(path[0], path[1], currenttab);
970
+ AddTextureButton(path[0], path[1], path[2], texturecount++, currenttab);
971
+
932972 if (++colcount >= columns)
933973 {
934974 colcount = 0;
....@@ -949,7 +989,7 @@
949989
950990 void CreateTexturePanel(cGridBag container)
951991 {
952
- resourcecontainer = new JTabbedPane();
992
+ resourcecontainer = new JTabbedPane(JTabbedPane.LEFT);
953993 container.add(resourcecontainer);
954994
955995 Grafreed.ParseResources("textures", this);
....@@ -972,11 +1012,6 @@
9721012 //new Exception().printStackTrace();
9731013
9741014 oe.radioPanel = new JPanel(new GridBagLayout());
975
- oe.aConstraints.weightx = 1;
976
- oe.aConstraints.weighty = 0;
977
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
978
- oe.aConstraints.gridwidth = 100;
979
- oe.aConstraints.gridheight = 1;
9801015 // oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
9811016
9821017 oe.buttonGroup = new ButtonGroup();
....@@ -1009,10 +1044,49 @@
10091044
10101045 if (Globals.ADVANCED)
10111046 {
1012
- oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1013
- maxButton.setToolTipText("Maximize window");
1014
- 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);
10151050 }
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
+ //
10161090
10171091 oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
10181092 fullButton.setToolTipText("Full-screen window");
....@@ -1057,14 +1131,14 @@
10571131 nextVersionButton.addActionListener(this);
10581132 nextVersionButton.setEnabled(false);
10591133
1060
- oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
1061
- liveCB.setToolTipText("Enable animation");
1062
- liveCB.addItemListener(this);
1063
-
10641134 oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
10651135 oneStepButton.setToolTipText("Animate one step forward");
10661136 oneStepButton.addActionListener(this);
10671137
1138
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
1139
+ liveCB.setToolTipText("Enable animation");
1140
+ liveCB.addItemListener(this);
1141
+
10681142 oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
10691143 fastCB.setToolTipText("Fast mode");
10701144 fastCB.addItemListener(this);
....@@ -1091,21 +1165,6 @@
10911165
10921166 //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
10931167
1094
- oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1095
- twoButton.setToolTipText("Show 3D view only");
1096
- twoButton.addActionListener(this);
1097
- this.fullscreenLayout = twoButton;
1098
-
1099
- oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1100
- threeButton.setToolTipText("Show controls and 3D view");
1101
- threeButton.addActionListener(this);
1102
- oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1103
- sixButton.setToolTipText("Show 3D view and controls");
1104
- sixButton.addActionListener(this);
1105
-// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1106
-// sevenButton.setToolTipText("3-column layout");
1107
-// sevenButton.addActionListener(this);
1108
- //
11091168
11101169 oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
11111170 rootButton.setToolTipText("Open selection in new tab");
....@@ -1121,12 +1180,16 @@
11211180
11221181 // INSERT
11231182 row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1124
- gridButton.setToolTipText("Create grid");
1183
+ gridButton.setToolTipText("Create ground");
11251184 gridButton.addActionListener(this);
11261185
11271186 row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
11281187 boxButton.setToolTipText("Create box");
11291188 boxButton.addActionListener(this);
1189
+
1190
+ row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1191
+ superButton.setToolTipText("Create superellipsoid");
1192
+ superButton.addActionListener(this);
11301193
11311194 row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
11321195 sphereButton.setToolTipText("Create sphere");
....@@ -1139,10 +1202,6 @@
11391202 row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
11401203 torusButton.setToolTipText("Create torus");
11411204 torusButton.addActionListener(this);
1142
-
1143
- row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1144
- superButton.setToolTipText("Create superellipsoid");
1145
- superButton.addActionListener(this);
11461205
11471206 if (Globals.ADVANCED)
11481207 {
....@@ -1413,6 +1472,14 @@
14131472
14141473 void EditObject(Object3D obj)
14151474 {
1475
+ assert(obj instanceof Composite);
1476
+
1477
+// if (obj.versionlist == null)
1478
+// {
1479
+// obj.versionlist = new Object3D[100];
1480
+// obj.versionindex = -1;
1481
+// }
1482
+
14161483 cRadio radioButton = new cRadio(obj.name);
14171484
14181485 // June 2019. Patch to avoid bug with transparency.
....@@ -1803,7 +1870,12 @@
18031870 TreePath path;
18041871
18051872 public TransferableTreePath(TreePath tp) {
1806
- 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);
18071879 }
18081880
18091881 public synchronized DataFlavor[] getTransferDataFlavors() {
....@@ -2093,7 +2165,11 @@
20932165 shadow.material = new cMaterial(obj.material);
20942166 shadow.material.diffuse = 0.0001f;
20952167 shadow.material.specular = 0.0001f;
2096
- //shadow.projectedVertices[1].x = 300;
2168
+ shadow.material.opacity = 0.75f;
2169
+
2170
+ AllocProjectedVertices(shadow);
2171
+
2172
+ shadow.projectedVertices[1].x = 300;
20972173
20982174 makeSomething(shadow);
20992175 }
....@@ -2614,27 +2690,35 @@
26142690 } else
26152691 if (source == loopItem || source == loopButton)
26162692 {
2693
+ if (!group.selection.isEmpty())
2694
+ {
26172695 Composite csg = new GroupLeaf();
26182696 csg.count = 5;
2619
- group(csg);
26202697 Composite child = new cGroup("Branch");
26212698 csg.addChild(child);
26222699 child.addChild(csg);
2700
+ group(csg);
2701
+ }
26232702 } else
26242703 if (source == doubleItem)
26252704 {
2705
+ if (!group.selection.isEmpty())
2706
+ {
26262707 Composite csg = new GroupLeaf("Fork");
26272708 csg.count = 5;
2628
- group(csg);
26292709 Composite child = new cGroup("Branch A");
26302710 csg.addChild(child);
26312711 child.addChild(csg);
26322712 child = new cGroup("Branch B");
26332713 csg.addChild(child);
26342714 child.addChild(csg);
2715
+ group(csg);
2716
+ }
26352717 } else
26362718 if (source == tripleItem)
26372719 {
2720
+ if (!group.selection.isEmpty())
2721
+ {
26382722 Composite csg = new GroupLeaf("Trident");
26392723 csg.count = 4;
26402724 group(csg);
....@@ -2647,6 +2731,7 @@
26472731 child = new cGroup();
26482732 csg.addChild(child);
26492733 child.addChild(csg);
2734
+ }
26502735 } else
26512736 if (source == computeAOItem)
26522737 {
....@@ -2696,6 +2781,18 @@
26962781 if (source == fullButton)
26972782 {
26982783 ToggleFullScreen();
2784
+ } else
2785
+ if (source == collapseButton)
2786
+ {
2787
+ this.expandedLayout = radio.layout;
2788
+ CollapseToolbar();
2789
+ } else
2790
+ if (source == maximize3DButton)
2791
+ {
2792
+ this.expandedLayout = radio.layout;
2793
+ radio.layout = twoButton;
2794
+ Show3DView();
2795
+ CollapseToolbar();
26992796 } else
27002797 if (source == previousVersionButton)
27012798 {
....@@ -3270,22 +3367,34 @@
32703367 } else
32713368 if (source == ungroupItem || source == ungroupButton)
32723369 {
3273
- boolean hasRoot = false;
3370
+ boolean canUngroup = true;
32743371
32753372 for (int i=0; i<group.selection.size(); i++)
32763373 {
3277
- if (group.selection.get(i) == group)
3374
+ Object3D selectedItem = group.selection.get(i);
3375
+
3376
+ if (selectedItem.Size() == 0)
32783377 {
3279
- hasRoot = true;
3378
+ // Cannot ungroup leaves
3379
+ canUngroup = false;
3380
+ break;
3381
+ }
3382
+
3383
+ if (selectedItem == group)
3384
+ {
3385
+ // Cannot ungroup root
3386
+ canUngroup = false;
32803387 break;
32813388 }
32823389 }
32833390
3284
- if (!hasRoot)
3391
+ if (canUngroup)
32853392 {
32863393 for (int i=0; i<group.selection.size(); i++)
32873394 {
3288
- Ungroup(group.selection.get(i));
3395
+ Object3D selectedItem = group.selection.get(i);
3396
+
3397
+ Ungroup(selectedItem);
32893398 }
32903399
32913400 ClearSelection(false);
....@@ -3648,38 +3757,7 @@
36483757 if (CameraPane.FULLSCREEN)
36493758 fullscreenLayout = radio.layout;
36503759
3651
- // bug
3652
- //gridPanel.setDividerLocation(1.0);
3653
- //bigPanel.setDividerLocation(0.0);
3654
-// bigThree.remove(scenePanel);
3655
-// bigThree.remove(centralPanel);
3656
-// bigThree.remove(XYZPanel);
3657
-// aWindowConstraints.gridx = 0;
3658
-// aWindowConstraints.gridy = 0;
3659
-// aWindowConstraints.gridwidth = 1;
3660
-// // aConstraints.gridheight = 3;
3661
-// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3662
-// aWindowConstraints.weightx = 0;
3663
-// aWindowConstraints.weighty = 1;
3664
-// //bigThree.add(jtp, aWindowConstraints);
3665
-// aWindowConstraints.weightx = 1;
3666
-// aWindowConstraints.gridwidth = 3;
3667
-// // aConstraints.gridheight = 3;
3668
-// aWindowConstraints.gridx = 1;
3669
-// aWindowConstraints.fill = GridBagConstraints.BOTH;
3670
-// bigThree.add(centralPanel, aWindowConstraints);
3671
-// aWindowConstraints.weightx = 0;
3672
-// aWindowConstraints.gridx = 4;
3673
-// aWindowConstraints.gridwidth = 1;
3674
-// // aConstraints.gridheight = 3;
3675
-// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3676
-// //bigThree.add(XYZPanel, aWindowConstraints);
3677
-// scenePanel.setVisible(false);
3678
-// centralPanel.setVisible(true);
3679
-// XYZPanel.setVisible(false);
3680
- bigThree.ClearUI();
3681
- bigThree.add(centralPanel);
3682
- bigThree.FlushUI();
3760
+ Show3DView();
36833761
36843762 cameraView.requestFocusInWindow();
36853763
....@@ -3865,6 +3943,7 @@
38653943 } else
38663944 if (source == rootButton)
38673945 {
3946
+ Replace();
38683947 Object3D obj;
38693948 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
38703949 {
....@@ -4001,8 +4080,6 @@
40014080
40024081 copy = group;
40034082
4004
- SetUndoStates();
4005
-
40064083 //Globals.theRenderer.object = group;
40074084 if(!useclient)
40084085 {
....@@ -4030,6 +4107,18 @@
40304107 */
40314108 radio.layout.doClick();
40324109
4110
+ assert(copy instanceof Composite);
4111
+
4112
+ if (copy.versionlist == null)
4113
+ {
4114
+ copy.versionlist = new Object3D[100];
4115
+ copy.versionindex = -1;
4116
+
4117
+ Save(true);
4118
+ }
4119
+
4120
+ SetVersionStates();
4121
+
40334122 ClearUnpinned();
40344123
40354124 //Grafreed.Assert(group != null);
....@@ -5264,6 +5353,20 @@
52645353 flashSelectionButton.setEnabled(enabled);
52655354
52665355 clearPanelButton.setEnabled(!listUI.isEmpty());
5356
+
5357
+ boolean allComposites = true;
5358
+
5359
+ if (group.selection != null)
5360
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
5361
+ {
5362
+ if (!(e.nextElement() instanceof Composite))
5363
+ {
5364
+ allComposites = false;
5365
+ break;
5366
+ }
5367
+ }
5368
+
5369
+ rootButton.setEnabled(allComposites);
52675370 }
52685371
52695372 void refreshContents(boolean cp)
....@@ -5278,7 +5381,7 @@
52785381 Object3D child = (Object3D) group.selection.get(i);
52795382
52805383 objEditor.AddInfo(child, this, true);
5281
- System.err.println("info : " + child.GetPath());
5384
+// System.err.println("info : " + child.GetPath());
52825385 }
52835386
52845387 objEditor.SetText(); // jan 2014
....@@ -6161,11 +6264,11 @@
61616264 private MenuItem lookAtItem;
61626265 private MenuItem lookFromItem;
61636266 private MenuItem switchViewItem;
6164
- private MenuItem cutItem;
6267
+ private JMenuItem cutItem;
61656268 private MenuItem undoItem;
61666269 private MenuItem redoItem;
61676270 private JMenuItem duplicateItem;
6168
- private MenuItem cloneItem;
6271
+ private JMenuItem cloneItem;
61696272 private MenuItem cloneSupportItem;
61706273 private MenuItem overwriteGeoItem;
61716274 private MenuItem overwriteMatItem;
....@@ -6186,13 +6289,13 @@
61866289 private MenuItem cloneGeometriesItem;
61876290 private MenuItem shareGeometriesItem;
61886291 private MenuItem mergeGeometriesItem;
6189
- private MenuItem copyItem;
6292
+ private JMenuItem copyItem;
61906293 private MenuItem pasteItem;
6191
- private MenuItem pasteIntoItem;
6192
- private MenuItem pasteLinkItem;
6193
- private MenuItem pasteCloneItem;
6194
- private MenuItem pasteExpandItem;
6195
- private MenuItem deleteItem;
6294
+ private JMenuItem pasteIntoItem;
6295
+ private JMenuItem pasteLinkItem;
6296
+ private JMenuItem pasteCloneItem;
6297
+ private JMenuItem pasteExpandItem;
6298
+ private JMenuItem deleteItem;
61966299 private MenuItem clearAllItem;
61976300 private MenuItem genUVItem;
61986301 private MenuItem genNormalsMESHItem;
....@@ -6260,7 +6363,7 @@
62606363 private MenuItem switchTransfoItem;
62616364 private MenuItem morphItem;
62626365 private MenuItem linkerItem;
6263
- private MenuItem ungroupItem;
6366
+ private JMenuItem ungroupItem;
62646367 private MenuItem editItem;
62656368 private MenuItem openWindowItem;
62666369 private MenuItem editLeafItem;