Normand Briere
2019-08-16 83d0c2fa0bd2e96448f776144e1a89cdb1bb6998
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;
....@@ -396,10 +415,14 @@
396415 this.copy = this.group = group;
397416 //selectees = this.group.selectees;
398417
418
+ assert(false);
419
+
399420 if (copy.versionlist == null)
400421 {
401422 copy.versionlist = new Object3D[100];
402423 copy.versionindex = -1;
424
+
425
+ //Save(true);
403426 }
404427
405428 if(ui)
....@@ -428,7 +451,7 @@
428451 copy.versionlist = new Object3D[100];
429452 copy.versionindex = -1;
430453
431
- Save(true);
454
+ //Save(true);
432455 }
433456 }
434457
....@@ -519,33 +542,35 @@
519542 // menu.add("-");
520543 duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
521544 duplicateItem.addActionListener(this);
522
- cloneItem = menu.add(new MenuItem("Clone"));
545
+
546
+ cloneItem = oe.jTree.popup.add(new JMenuItem("Clone"));
523547 cloneItem.addActionListener(this);
524
- if (Globals.ADVANCED)
548
+ //if (Globals.ADVANCED)
525549 {
526550 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
527551 cloneSupportItem.addActionListener(this);
528552 }
553
+ oe.jTree.popup.addSeparator();
529554 menu.add("-");
530
- cutItem = menu.add(new MenuItem("Cut"));
555
+ cutItem = oe.jTree.popup.add(new JMenuItem("Cut"));
531556 cutItem.addActionListener(this);
532
- copyItem = menu.add(new MenuItem("Copy"));
557
+ copyItem = oe.jTree.popup.add(new JMenuItem("Copy"));
533558 copyItem.addActionListener(this);
534559 pasteItem = menu.add(new MenuItem("Paste"));
535560 pasteItem.addActionListener(this);
536561
537
- menu.add("-");
538
- pasteIntoItem = menu.add(new MenuItem("Paste into"));
562
+ oe.jTree.popup.addSeparator();
563
+ //menu.add("-");
564
+ pasteIntoItem = oe.jTree.popup.add(new JMenuItem("Paste into"));
539565 pasteIntoItem.addActionListener(this);
540
- pasteLinkItem = menu.add(new MenuItem("Paste link"));
566
+ pasteLinkItem = oe.jTree.popup.add(new JMenuItem("Paste link"));
541567 pasteLinkItem.addActionListener(this);
542
- pasteCloneItem = menu.add(new MenuItem("Paste clone"));
568
+ pasteCloneItem = oe.jTree.popup.add(new JMenuItem("Paste clone"));
543569 pasteCloneItem.addActionListener(this);
544
-// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
570
+// CRASH pasteExpandItem = oe.jTree.popup.add(new JMenuItem("Paste expand"));
545571 // pasteExpandItem.addActionListener(this);
546
- menu.add("-");
547
- deleteItem = menu.add(new MenuItem("Delete"));
548
- deleteItem.addActionListener(this);
572
+ //menu.add("-");
573
+ oe.jTree.popup.addSeparator();
549574
550575 if (Globals.ADVANCED)
551576 {
....@@ -631,11 +656,9 @@
631656 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
632657 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
633658 //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
634
- editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
635659 oe.cameraMenu.add("-");
636660 openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
637661 openWindowItem.addActionListener(this);
638
- editLeafItem.addActionListener(this);
639662 lookAtItem.addActionListener(this);
640663 //lookFromItem.addActinoListener(this);
641664 //switchViewItem.addActionListener(this);
....@@ -682,9 +705,8 @@
682705 setMasterItem.addActionListener(this);
683706 }
684707
685
- oe.menuBar.add(menu = new Menu("Group"));
686
-// grabItem = menu.add(new MenuItem("Grab"));
687
-// grabItem.addActionListener(this);
708
+ oe.menuBar.add(menu = new Menu("Order"));
709
+
688710 backItem = menu.add(new MenuItem("Back"));
689711 backItem.addActionListener(this);
690712 frontItem = menu.add(new MenuItem("Front"));
....@@ -692,13 +714,21 @@
692714 // compositeItem = menu.add(new MenuItem("Composite"));
693715 // compositeItem.addActionListener(this);
694716
717
+ grabItem = oe.jTree.popup.add(new JMenuItem("Group"));
718
+ grabItem.addActionListener(this);
719
+
695720 if (Globals.ADVANCED)
696721 {
697722 hideItem = menu.add(new MenuItem("Hidden Group"));
698723 hideItem.addActionListener(this);
699724 }
700
- ungroupItem = menu.add(new MenuItem("Ungroup"));
725
+ ungroupItem = oe.jTree.popup.add(new JMenuItem("Ungroup"));
701726 ungroupItem.addActionListener(this);
727
+
728
+ oe.jTree.popup.addSeparator();
729
+
730
+ deleteItem = oe.jTree.popup.add(new JMenuItem("Delete"));
731
+ deleteItem.addActionListener(this);
702732
703733 // menu.add("-");
704734 //
....@@ -883,6 +913,9 @@
883913 shareGeometriesItem.addActionListener(this);
884914 mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
885915 mergeGeometriesItem.addActionListener(this);
916
+ menu.add("-");
917
+ editLeafItem = menu.add(new MenuItem("Edit leaf..."));
918
+ editLeafItem.addActionListener(this);
886919 if (Globals.ADVANCED)
887920 {
888921 // Pretty much the same as duplicate and clone.
....@@ -901,7 +934,7 @@
901934
902935 JTabbedPane resourcecontainer;
903936 cGridBag currenttab;
904
- boolean added; // patch for jar
937
+ //boolean added; // patch for jar
905938
906939 int tabcount = 0;
907940 int colcount = 0;
....@@ -918,12 +951,14 @@
918951 // System.out.println();
919952
920953 if (//rowcount == 0 ||
921
- path.length == 1)
954
+ path.length == 1 && !path[0].equals("") && !path[0].equals(".DS_Store"))
922955 {
923956 currenttab = new cGridBag();
924
- added = false;
925957 String tabname = path[0]; // String.valueOf((char)('A'+tabcount));
926958 currenttab.setName(tabname);
959
+ //added = false;
960
+ resourcecontainer.add(currenttab);
961
+ resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname);
927962 rowcount = 1;
928963 colcount = 0;
929964 texturecount = 0;
....@@ -931,12 +966,11 @@
931966
932967 if (path.length > 2 && path[2].toLowerCase().endsWith(".jpg"))
933968 {
934
- if (!added)
969
+ //if (!added)
935970 {
936
- added = true;
937
- resourcecontainer.add(currenttab);
971
+ //added = true;
938972 String tabname = path[0]; // String.valueOf((char)('A'+tabcount));
939
- resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname);
973
+ currenttab = (cGridBag)resourcecontainer.getComponentAt(resourcecontainer.indexOfTab(tabname));
940974 }
941975
942976 AddTextureButton(path[0], path[1], path[2], texturecount++, currenttab);
....@@ -984,11 +1018,6 @@
9841018 //new Exception().printStackTrace();
9851019
9861020 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;
9921021 // oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
9931022
9941023 oe.buttonGroup = new ButtonGroup();
....@@ -1021,10 +1050,49 @@
10211050
10221051 if (Globals.ADVANCED)
10231052 {
1024
- oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1025
- maxButton.setToolTipText("Maximize window");
1026
- maxButton.addActionListener(this);
1053
+// oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1054
+// maxButton.setToolTipText("Maximize window");
1055
+// maxButton.addActionListener(this);
10271056 }
1057
+
1058
+ cButton gcButton;
1059
+
1060
+// oe.toolbarPanel.add(gcButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1061
+// gcButton.setToolTipText("Garbage collect");
1062
+// gcButton.addActionListener(new ActionListener()
1063
+// {
1064
+// public void actionPerformed(ActionEvent e)
1065
+// {
1066
+// System.gc();
1067
+// }
1068
+// });
1069
+
1070
+ oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1071
+ collapseButton.setToolTipText("Collapse toolbar");
1072
+ collapseButton.addActionListener(this);
1073
+
1074
+ oe.toolbarPanel.add(maximize3DButton = GetButton("icons/empty.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1075
+ maximize3DButton.setToolTipText("Maximize 3D view");
1076
+ maximize3DButton.addActionListener(this);
1077
+
1078
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1079
+ twoButton.setToolTipText("Show 3D view only");
1080
+ twoButton.addActionListener(this);
1081
+ this.fullscreenLayout = twoButton;
1082
+
1083
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1084
+ threeButton.setToolTipText("Show controls and 3D view");
1085
+ threeButton.addActionListener(this);
1086
+ if (Globals.ADVANCED)
1087
+ {
1088
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1089
+ sixButton.setToolTipText("Show 3D view and controls");
1090
+ sixButton.addActionListener(this);
1091
+ }
1092
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1093
+// sevenButton.setToolTipText("3-column layout");
1094
+// sevenButton.addActionListener(this);
1095
+ //
10281096
10291097 oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
10301098 fullButton.setToolTipText("Full-screen window");
....@@ -1045,6 +1113,7 @@
10451113 copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
10461114 deleteVersionButton.setToolTipText("Delete current version");
10471115 deleteVersionButton.addActionListener(this);
1116
+ deleteVersionButton.setEnabled(false);
10481117
10491118 copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
10501119 previousVersionButton.setToolTipText("Previous version");
....@@ -1055,12 +1124,12 @@
10551124 updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
10561125 restoreButton.setToolTipText("Undo (restore current version)");
10571126 restoreButton.addActionListener(this);
1058
- //restoreButton.setEnabled(false);
1127
+ restoreButton.setEnabled(false);
10591128
10601129 updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
10611130 replaceButton.setToolTipText("Save (replace current version)");
10621131 replaceButton.addActionListener(this);
1063
- //replaceButton.setEnabled(false);
1132
+ replaceButton.setEnabled(false);
10641133
10651134 copyOptionsPanel.add(updown);
10661135
....@@ -1069,14 +1138,14 @@
10691138 nextVersionButton.addActionListener(this);
10701139 nextVersionButton.setEnabled(false);
10711140
1072
- oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
1073
- liveCB.setToolTipText("Enable animation");
1074
- liveCB.addItemListener(this);
1075
-
10761141 oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
10771142 oneStepButton.setToolTipText("Animate one step forward");
10781143 oneStepButton.addActionListener(this);
10791144
1145
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
1146
+ liveCB.setToolTipText("Enable animation");
1147
+ liveCB.addItemListener(this);
1148
+
10801149 oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
10811150 fastCB.setToolTipText("Fast mode");
10821151 fastCB.addItemListener(this);
....@@ -1103,21 +1172,6 @@
11031172
11041173 //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
11051174
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
- //
11211175
11221176 oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
11231177 rootButton.setToolTipText("Open selection in new tab");
....@@ -1133,12 +1187,16 @@
11331187
11341188 // INSERT
11351189 row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1136
- gridButton.setToolTipText("Create grid");
1190
+ gridButton.setToolTipText("Create ground");
11371191 gridButton.addActionListener(this);
11381192
11391193 row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
11401194 boxButton.setToolTipText("Create box");
11411195 boxButton.addActionListener(this);
1196
+
1197
+ row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1198
+ superButton.setToolTipText("Create superellipsoid");
1199
+ superButton.addActionListener(this);
11421200
11431201 row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
11441202 sphereButton.setToolTipText("Create sphere");
....@@ -1151,10 +1209,6 @@
11511209 row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
11521210 torusButton.setToolTipText("Create torus");
11531211 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);
11581212
11591213 if (Globals.ADVANCED)
11601214 {
....@@ -1425,6 +1479,14 @@
14251479
14261480 void EditObject(Object3D obj)
14271481 {
1482
+ assert(obj instanceof Composite);
1483
+
1484
+// if (obj.versionlist == null)
1485
+// {
1486
+// obj.versionlist = new Object3D[100];
1487
+// obj.versionindex = -1;
1488
+// }
1489
+
14281490 cRadio radioButton = new cRadio(obj.name);
14291491
14301492 // June 2019. Patch to avoid bug with transparency.
....@@ -1449,6 +1511,7 @@
14491511
14501512 oe.SetupViews();
14511513
1514
+ if (Globals.DEBUG)
14521515 System.out.println("SetupViews");
14531516 DragSource.getDefaultDragSource().createDefaultDragGestureRecognizer(
14541517 oe.cameraView, DnDConstants.ACTION_COPY_OR_MOVE, this); // ACTION_LINK ??
....@@ -1815,7 +1878,12 @@
18151878 TreePath path;
18161879
18171880 public TransferableTreePath(TreePath tp) {
1818
- path = tp;
1881
+ Object[] objs = new Object[tp.getPathCount()];
1882
+ for (int i=0; i<objs.length; i++)
1883
+ {
1884
+ objs[i] = ((Object3D)tp.getPathComponent(i)).GetUUID();
1885
+ }
1886
+ path = new TreePath(objs);
18191887 }
18201888
18211889 public synchronized DataFlavor[] getTransferDataFlavors() {
....@@ -2105,7 +2173,11 @@
21052173 shadow.material = new cMaterial(obj.material);
21062174 shadow.material.diffuse = 0.0001f;
21072175 shadow.material.specular = 0.0001f;
2108
- //shadow.projectedVertices[1].x = 300;
2176
+ shadow.material.opacity = 0.75f;
2177
+
2178
+ AllocProjectedVertices(shadow);
2179
+
2180
+ shadow.projectedVertices[1].x = 300;
21092181
21102182 makeSomething(shadow);
21112183 }
....@@ -2626,27 +2698,35 @@
26262698 } else
26272699 if (source == loopItem || source == loopButton)
26282700 {
2701
+ if (!group.selection.isEmpty())
2702
+ {
26292703 Composite csg = new GroupLeaf();
26302704 csg.count = 5;
2631
- group(csg);
26322705 Composite child = new cGroup("Branch");
26332706 csg.addChild(child);
26342707 child.addChild(csg);
2708
+ group(csg);
2709
+ }
26352710 } else
26362711 if (source == doubleItem)
26372712 {
2713
+ if (!group.selection.isEmpty())
2714
+ {
26382715 Composite csg = new GroupLeaf("Fork");
26392716 csg.count = 5;
2640
- group(csg);
26412717 Composite child = new cGroup("Branch A");
26422718 csg.addChild(child);
26432719 child.addChild(csg);
26442720 child = new cGroup("Branch B");
26452721 csg.addChild(child);
26462722 child.addChild(csg);
2723
+ group(csg);
2724
+ }
26472725 } else
26482726 if (source == tripleItem)
26492727 {
2728
+ if (!group.selection.isEmpty())
2729
+ {
26502730 Composite csg = new GroupLeaf("Trident");
26512731 csg.count = 4;
26522732 group(csg);
....@@ -2659,6 +2739,7 @@
26592739 child = new cGroup();
26602740 csg.addChild(child);
26612741 child.addChild(csg);
2742
+ }
26622743 } else
26632744 if (source == computeAOItem)
26642745 {
....@@ -2708,6 +2789,18 @@
27082789 if (source == fullButton)
27092790 {
27102791 ToggleFullScreen();
2792
+ } else
2793
+ if (source == collapseButton)
2794
+ {
2795
+ this.expandedLayout = radio.layout;
2796
+ CollapseToolbar();
2797
+ } else
2798
+ if (source == maximize3DButton)
2799
+ {
2800
+ this.expandedLayout = radio.layout;
2801
+ radio.layout = twoButton;
2802
+ Show3DView();
2803
+ CollapseToolbar();
27112804 } else
27122805 if (source == previousVersionButton)
27132806 {
....@@ -3282,22 +3375,34 @@
32823375 } else
32833376 if (source == ungroupItem || source == ungroupButton)
32843377 {
3285
- boolean hasRoot = false;
3378
+ boolean canUngroup = true;
32863379
32873380 for (int i=0; i<group.selection.size(); i++)
32883381 {
3289
- if (group.selection.get(i) == group)
3382
+ Object3D selectedItem = group.selection.get(i);
3383
+
3384
+ if (selectedItem.Size() == 0)
32903385 {
3291
- hasRoot = true;
3386
+ // Cannot ungroup leaves
3387
+ canUngroup = false;
3388
+ break;
3389
+ }
3390
+
3391
+ if (selectedItem == group)
3392
+ {
3393
+ // Cannot ungroup root
3394
+ canUngroup = false;
32923395 break;
32933396 }
32943397 }
32953398
3296
- if (!hasRoot)
3399
+ if (canUngroup)
32973400 {
32983401 for (int i=0; i<group.selection.size(); i++)
32993402 {
3300
- Ungroup(group.selection.get(i));
3403
+ Object3D selectedItem = group.selection.get(i);
3404
+
3405
+ Ungroup(selectedItem);
33013406 }
33023407
33033408 ClearSelection(false);
....@@ -3660,38 +3765,7 @@
36603765 if (CameraPane.FULLSCREEN)
36613766 fullscreenLayout = radio.layout;
36623767
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();
3768
+ Show3DView();
36953769
36963770 cameraView.requestFocusInWindow();
36973771
....@@ -3877,6 +3951,7 @@
38773951 } else
38783952 if (source == rootButton)
38793953 {
3954
+ Replace();
38803955 Object3D obj;
38813956 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
38823957 {
....@@ -4013,8 +4088,6 @@
40134088
40144089 copy = group;
40154090
4016
- SetUndoStates();
4017
-
40184091 //Globals.theRenderer.object = group;
40194092 if(!useclient)
40204093 {
....@@ -4042,6 +4115,21 @@
40424115 */
40434116 radio.layout.doClick();
40444117
4118
+ assert(copy instanceof Composite);
4119
+
4120
+ if (copy.versionlist == null)
4121
+ {
4122
+ copy.versionlist = new Object3D[100];
4123
+ copy.versionindex = -1;
4124
+
4125
+ // Cannot work with loops
4126
+ // To fix this issue, first mark all nodes above the root,
4127
+ // and check if any of these nodes are reachable below the root.
4128
+ //Save(true);
4129
+ }
4130
+
4131
+ SetVersionStates();
4132
+
40454133 ClearUnpinned();
40464134
40474135 //Grafreed.Assert(group != null);
....@@ -5276,6 +5364,21 @@
52765364 flashSelectionButton.setEnabled(enabled);
52775365
52785366 clearPanelButton.setEnabled(!listUI.isEmpty());
5367
+
5368
+ boolean allComposites = true;
5369
+
5370
+ if (group.selection != null)
5371
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
5372
+ {
5373
+ Object next = e.nextElement();
5374
+ if (!(next instanceof Composite)) // || (next instanceof GroupLeaf))
5375
+ {
5376
+ allComposites = false;
5377
+ break;
5378
+ }
5379
+ }
5380
+
5381
+ rootButton.setEnabled(allComposites);
52795382 }
52805383
52815384 void refreshContents(boolean cp)
....@@ -5290,7 +5393,7 @@
52905393 Object3D child = (Object3D) group.selection.get(i);
52915394
52925395 objEditor.AddInfo(child, this, true);
5293
- System.err.println("info : " + child.GetPath());
5396
+// System.err.println("info : " + child.GetPath());
52945397 }
52955398
52965399 objEditor.SetText(); // jan 2014
....@@ -6173,11 +6276,11 @@
61736276 private MenuItem lookAtItem;
61746277 private MenuItem lookFromItem;
61756278 private MenuItem switchViewItem;
6176
- private MenuItem cutItem;
6279
+ private JMenuItem cutItem;
61776280 private MenuItem undoItem;
61786281 private MenuItem redoItem;
61796282 private JMenuItem duplicateItem;
6180
- private MenuItem cloneItem;
6283
+ private JMenuItem cloneItem;
61816284 private MenuItem cloneSupportItem;
61826285 private MenuItem overwriteGeoItem;
61836286 private MenuItem overwriteMatItem;
....@@ -6198,13 +6301,13 @@
61986301 private MenuItem cloneGeometriesItem;
61996302 private MenuItem shareGeometriesItem;
62006303 private MenuItem mergeGeometriesItem;
6201
- private MenuItem copyItem;
6304
+ private JMenuItem copyItem;
62026305 private MenuItem pasteItem;
6203
- private MenuItem pasteIntoItem;
6204
- private MenuItem pasteLinkItem;
6205
- private MenuItem pasteCloneItem;
6206
- private MenuItem pasteExpandItem;
6207
- private MenuItem deleteItem;
6306
+ private JMenuItem pasteIntoItem;
6307
+ private JMenuItem pasteLinkItem;
6308
+ private JMenuItem pasteCloneItem;
6309
+ private JMenuItem pasteExpandItem;
6310
+ private JMenuItem deleteItem;
62086311 private MenuItem clearAllItem;
62096312 private MenuItem genUVItem;
62106313 private MenuItem genNormalsMESHItem;
....@@ -6259,7 +6362,7 @@
62596362 private MenuItem transformGeometryItem;
62606363 private MenuItem transformChildrenItem;
62616364 private MenuItem hideItem;
6262
- private MenuItem grabItem;
6365
+ private JMenuItem grabItem;
62636366 private MenuItem backItem;
62646367 private MenuItem frontItem;
62656368 private MenuItem cameraItem;
....@@ -6272,7 +6375,7 @@
62726375 private MenuItem switchTransfoItem;
62736376 private MenuItem morphItem;
62746377 private MenuItem linkerItem;
6275
- private MenuItem ungroupItem;
6378
+ private JMenuItem ungroupItem;
62766379 private MenuItem editItem;
62776380 private MenuItem openWindowItem;
62786381 private MenuItem editLeafItem;