Normand Briere
2019-08-15 7f97054d681518416a4ee1c1548ad42cfb489a8f
GroupEditor.java
....@@ -16,7 +16,7 @@
1616 //import buoy.widget.BFileChooser;
1717
1818 class GroupEditor extends ObjEditor implements //iParse, //iCallBack,
19
- Grafreed.iResourceCallBack,
19
+ Grafreed.iResourceCallBack,
2020 ObjectUI,
2121 Runnable,
2222 ActionListener,
....@@ -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,6 +42,22 @@
4242 });
4343 }
4444
45
+ public void AddTextureButton(String f, String c, final String t, int count, cGridBag row)
46
+ {
47
+ cButton textureButton;
48
+ final String path = "textures/" + f + "/" + c + "/"; // + t;
49
+ row.add(textureButton = GetButton(path + "icons/" + t, !Grafreed.NIMBUSLAF));
50
+ textureButton.setToolTipText(c + count);
51
+ textureButton.addActionListener(new ActionListener()
52
+ {
53
+ @Override
54
+ public void actionPerformed(ActionEvent e)
55
+ {
56
+ ChangeTexture(path + t);
57
+ }
58
+ });
59
+ }
60
+
4561 public void AddSkyboxTab0(JTabbedPane skyboxpanel)
4662 {
4763 cGridBag tab0 = new cGridBag().setVertical(true);
....@@ -57,7 +73,7 @@
5773 cGridBag row5 = new cGridBag();
5874 cGridBag row6 = new cGridBag();
5975
60
- AddSkyboxButton("default", "rgb", row0);
76
+ AddSkyboxButton("default", "", row0);
6177 //AddSkyboxButton("default", "cornell", row0);
6278 AddSkyboxButton("penguins", "dust", row0);
6379 AddSkyboxButton("penguins", "tropic", row0);
....@@ -312,26 +328,56 @@
312328 }
313329 }
314330
315
- public void CallBack(String[] path)
316
- {
317
- for (int i = 0; i < path.length; i++)
318
- {
319
- System.out.print(path[i] + "/");
320
- }
321
-
322
- System.out.println();
323
- }
324
-
325331 public void ChangeSkybox(String skybox)
326332 {
327
- //cameraView.envyoff = false;
328
- group.skyboxname = skybox;
329
- group.skyboxext = "jpg";
330
- 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
+ }
346
+ }
331347
332
- Grafreed.ParseResources("textures", this);
348
+ public void CreateSkyboxPanel(cGridBag skyboxPanel)
349
+ {
350
+ JTabbedPane skyboxpane = new JTabbedPane();
351
+
352
+ AddSkyboxTab0(skyboxpane);
353
+ AddSkyboxTab1(skyboxpane);
354
+ AddSkyboxTab2(skyboxpane);
355
+ AddSkyboxTab3(skyboxpane);
356
+
357
+ skyboxPanel.add(skyboxpane);
333358 }
334359
360
+ public void ChangeTexture(String texture)
361
+ {
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();
379
+ }
380
+
335381 //ObjEditor objEditor;
336382 public void closeUI2()
337383 {
....@@ -373,6 +419,8 @@
373419 {
374420 copy.versionlist = new Object3D[100];
375421 copy.versionindex = -1;
422
+
423
+ Save(true);
376424 }
377425
378426 if(ui)
....@@ -492,32 +540,37 @@
492540 // menu.add("-");
493541 duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
494542 duplicateItem.addActionListener(this);
495
- cloneItem = menu.add(new MenuItem("Clone"));
543
+
544
+ cloneItem = oe.jTree.popup.add(new JMenuItem("Clone"));
496545 cloneItem.addActionListener(this);
497
- if (Globals.ADVANCED)
546
+ //if (Globals.ADVANCED)
498547 {
499548 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
500549 cloneSupportItem.addActionListener(this);
501550 }
551
+ oe.jTree.popup.addSeparator();
502552 menu.add("-");
503
- cutItem = menu.add(new MenuItem("Cut"));
553
+ cutItem = oe.jTree.popup.add(new JMenuItem("Cut"));
504554 cutItem.addActionListener(this);
505
- copyItem = menu.add(new MenuItem("Copy"));
555
+ copyItem = oe.jTree.popup.add(new JMenuItem("Copy"));
506556 copyItem.addActionListener(this);
507557 pasteItem = menu.add(new MenuItem("Paste"));
508558 pasteItem.addActionListener(this);
509559
510
- menu.add("-");
511
- 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"));
512563 pasteIntoItem.addActionListener(this);
513
- pasteLinkItem = menu.add(new MenuItem("Paste link"));
564
+ pasteLinkItem = oe.jTree.popup.add(new JMenuItem("Paste link"));
514565 pasteLinkItem.addActionListener(this);
515
- pasteCloneItem = menu.add(new MenuItem("Paste clone"));
566
+ pasteCloneItem = oe.jTree.popup.add(new JMenuItem("Paste clone"));
516567 pasteCloneItem.addActionListener(this);
517
-// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
568
+// CRASH pasteExpandItem = oe.jTree.popup.add(new JMenuItem("Paste expand"));
518569 // pasteExpandItem.addActionListener(this);
519
- menu.add("-");
520
- deleteItem = menu.add(new MenuItem("Delete"));
570
+ //menu.add("-");
571
+ oe.jTree.popup.addSeparator();
572
+
573
+ deleteItem = oe.jTree.popup.add(new JMenuItem("Delete"));
521574 deleteItem.addActionListener(this);
522575
523576 if (Globals.ADVANCED)
....@@ -604,11 +657,9 @@
604657 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
605658 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
606659 //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
607
- editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
608660 oe.cameraMenu.add("-");
609661 openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
610662 openWindowItem.addActionListener(this);
611
- editLeafItem.addActionListener(this);
612663 lookAtItem.addActionListener(this);
613664 //lookFromItem.addActinoListener(this);
614665 //switchViewItem.addActionListener(this);
....@@ -670,7 +721,7 @@
670721 hideItem = menu.add(new MenuItem("Hidden Group"));
671722 hideItem.addActionListener(this);
672723 }
673
- ungroupItem = menu.add(new MenuItem("Ungroup"));
724
+ ungroupItem = oe.jTree.popup.add(new JMenuItem("Ungroup"));
674725 ungroupItem.addActionListener(this);
675726
676727 // menu.add("-");
....@@ -856,6 +907,9 @@
856907 shareGeometriesItem.addActionListener(this);
857908 mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
858909 mergeGeometriesItem.addActionListener(this);
910
+ menu.add("-");
911
+ editLeafItem = menu.add(new MenuItem("Edit leaf..."));
912
+ editLeafItem.addActionListener(this);
859913 if (Globals.ADVANCED)
860914 {
861915 // Pretty much the same as duplicate and clone.
....@@ -872,6 +926,73 @@
872926 buildToolsMenu(menu);
873927 }
874928
929
+ JTabbedPane resourcecontainer;
930
+ cGridBag currenttab;
931
+ boolean added; // patch for jar
932
+
933
+ int tabcount = 0;
934
+ int colcount = 0;
935
+ int rowcount = 0;
936
+ int texturecount = 0;
937
+
938
+ int columns = 5;
939
+ int rows = 7;
940
+
941
+ public void ResourceCallBack(String[] path)
942
+ {
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)
949
+ {
950
+ currenttab = new cGridBag();
951
+ added = false;
952
+ String tabname = path[0]; // String.valueOf((char)('A'+tabcount));
953
+ currenttab.setName(tabname);
954
+ rowcount = 1;
955
+ colcount = 0;
956
+ texturecount = 0;
957
+ }
958
+
959
+ if (path.length > 2 && path[2].toLowerCase().endsWith(".jpg"))
960
+ {
961
+ if (!added)
962
+ {
963
+ added = true;
964
+ resourcecontainer.add(currenttab);
965
+ String tabname = path[0]; // String.valueOf((char)('A'+tabcount));
966
+ resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname);
967
+ }
968
+
969
+ AddTextureButton(path[0], path[1], path[2], texturecount++, currenttab);
970
+
971
+ if (++colcount >= columns)
972
+ {
973
+ colcount = 0;
974
+ currenttab.Return();
975
+
976
+ if (rowcount++ >= rows)
977
+ {
978
+ rowcount = 0;
979
+ }
980
+ }
981
+ }
982
+ else
983
+ {
984
+// if (!path[path.length-1].equals("icons"))
985
+// resourcecontainer.Return();
986
+ }
987
+ }
988
+
989
+ void CreateTexturePanel(cGridBag container)
990
+ {
991
+ resourcecontainer = new JTabbedPane(JTabbedPane.LEFT);
992
+ container.add(resourcecontainer);
993
+
994
+ Grafreed.ParseResources("textures", this);
995
+ }
875996
876997 void SetupUI2(ObjEditor oe)
877998 {
....@@ -890,11 +1011,6 @@
8901011 //new Exception().printStackTrace();
8911012
8921013 oe.radioPanel = new JPanel(new GridBagLayout());
893
- oe.aConstraints.weightx = 1;
894
- oe.aConstraints.weighty = 0;
895
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
896
- oe.aConstraints.gridwidth = 100;
897
- oe.aConstraints.gridheight = 1;
8981014 // oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
8991015
9001016 oe.buttonGroup = new ButtonGroup();
....@@ -927,10 +1043,49 @@
9271043
9281044 if (Globals.ADVANCED)
9291045 {
930
- oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
931
- maxButton.setToolTipText("Maximize window");
932
- maxButton.addActionListener(this);
1046
+// oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1047
+// maxButton.setToolTipText("Maximize window");
1048
+// maxButton.addActionListener(this);
9331049 }
1050
+
1051
+ cButton gcButton;
1052
+
1053
+// oe.toolbarPanel.add(gcButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1054
+// gcButton.setToolTipText("Garbage collect");
1055
+// gcButton.addActionListener(new ActionListener()
1056
+// {
1057
+// public void actionPerformed(ActionEvent e)
1058
+// {
1059
+// System.gc();
1060
+// }
1061
+// });
1062
+
1063
+ oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1064
+ collapseButton.setToolTipText("Collapse toolbar");
1065
+ collapseButton.addActionListener(this);
1066
+
1067
+ oe.toolbarPanel.add(maximize3DButton = GetButton("", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1068
+ maximize3DButton.setToolTipText("Maximize 3D view");
1069
+ maximize3DButton.addActionListener(this);
1070
+
1071
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1072
+ twoButton.setToolTipText("Show 3D view only");
1073
+ twoButton.addActionListener(this);
1074
+ this.fullscreenLayout = twoButton;
1075
+
1076
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1077
+ threeButton.setToolTipText("Show controls and 3D view");
1078
+ threeButton.addActionListener(this);
1079
+ if (Globals.ADVANCED)
1080
+ {
1081
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1082
+ sixButton.setToolTipText("Show 3D view and controls");
1083
+ sixButton.addActionListener(this);
1084
+ }
1085
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1086
+// sevenButton.setToolTipText("3-column layout");
1087
+// sevenButton.addActionListener(this);
1088
+ //
9341089
9351090 oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
9361091 fullButton.setToolTipText("Full-screen window");
....@@ -975,14 +1130,14 @@
9751130 nextVersionButton.addActionListener(this);
9761131 nextVersionButton.setEnabled(false);
9771132
978
- oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
979
- liveCB.setToolTipText("Enable animation");
980
- liveCB.addItemListener(this);
981
-
9821133 oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
9831134 oneStepButton.setToolTipText("Animate one step forward");
9841135 oneStepButton.addActionListener(this);
9851136
1137
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
1138
+ liveCB.setToolTipText("Enable animation");
1139
+ liveCB.addItemListener(this);
1140
+
9861141 oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
9871142 fastCB.setToolTipText("Fast mode");
9881143 fastCB.addItemListener(this);
....@@ -1009,21 +1164,6 @@
10091164
10101165 //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
10111166
1012
- oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1013
- twoButton.setToolTipText("Show 3D view only");
1014
- twoButton.addActionListener(this);
1015
- this.fullscreenLayout = twoButton;
1016
-
1017
- oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1018
- threeButton.setToolTipText("Show controls and 3D view");
1019
- threeButton.addActionListener(this);
1020
- oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1021
- sixButton.setToolTipText("Show 3D view and controls");
1022
- sixButton.addActionListener(this);
1023
-// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1024
-// sevenButton.setToolTipText("3-column layout");
1025
-// sevenButton.addActionListener(this);
1026
- //
10271167
10281168 oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
10291169 rootButton.setToolTipText("Open selection in new tab");
....@@ -1039,7 +1179,7 @@
10391179
10401180 // INSERT
10411181 row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1042
- gridButton.setToolTipText("Create grid");
1182
+ gridButton.setToolTipText("Create ground");
10431183 gridButton.addActionListener(this);
10441184
10451185 row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -1107,19 +1247,15 @@
11071247
11081248 oe.toolboxPanel.add(row2);
11091249
1110
- // ENVYMAPS
1111
- cGridBag skyboxpane = new cGridBag();
1112
- skyboxpane.preferredHeight = 100;
1250
+ cGridBag textures = new cGridBag();
11131251
1114
- oe.skyboxPanel.add(skyboxpane);
1252
+ CreateTexturePanel(textures);
11151253
1116
- JTabbedPane skyboxpanel = new JTabbedPane();
1117
- skyboxpane.add(skyboxpanel);
1254
+ oe.toolboxPanel.add(textures);
11181255
1119
- AddSkyboxTab0(skyboxpanel);
1120
- AddSkyboxTab1(skyboxpanel);
1121
- AddSkyboxTab2(skyboxpanel);
1122
- AddSkyboxTab3(skyboxpanel);
1256
+ textures.preferredHeight = 100;
1257
+
1258
+ CreateSkyboxPanel(oe.skyboxPanel);
11231259
11241260 // EDIT panel
11251261 editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -1131,11 +1267,11 @@
11311267 uneditButton.addActionListener(this);
11321268
11331269 editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
1134
- allParamsButton.setToolTipText("Show all controle");
1270
+ allParamsButton.setToolTipText("Show all controls");
11351271 allParamsButton.addActionListener(this);
11361272
11371273 editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1138
- clearPanelButton.setToolTipText("Clear edit panel");
1274
+ clearPanelButton.setToolTipText("Clear all controls");
11391275 clearPanelButton.addActionListener(this);
11401276
11411277 //editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -1335,6 +1471,14 @@
13351471
13361472 void EditObject(Object3D obj)
13371473 {
1474
+ assert(obj instanceof Composite);
1475
+
1476
+// if (obj.versionlist == null)
1477
+// {
1478
+// obj.versionlist = new Object3D[100];
1479
+// obj.versionindex = -1;
1480
+// }
1481
+
13381482 cRadio radioButton = new cRadio(obj.name);
13391483
13401484 // June 2019. Patch to avoid bug with transparency.
....@@ -1725,7 +1869,12 @@
17251869 TreePath path;
17261870
17271871 public TransferableTreePath(TreePath tp) {
1728
- path = tp;
1872
+ Object[] objs = new Object[tp.getPathCount()];
1873
+ for (int i=0; i<objs.length; i++)
1874
+ {
1875
+ objs[i] = ((Object3D)tp.getPathComponent(i)).GetUUID();
1876
+ }
1877
+ path = new TreePath(objs);
17291878 }
17301879
17311880 public synchronized DataFlavor[] getTransferDataFlavors() {
....@@ -2536,27 +2685,35 @@
25362685 } else
25372686 if (source == loopItem || source == loopButton)
25382687 {
2688
+ if (!group.selection.isEmpty())
2689
+ {
25392690 Composite csg = new GroupLeaf();
25402691 csg.count = 5;
2541
- group(csg);
25422692 Composite child = new cGroup("Branch");
25432693 csg.addChild(child);
25442694 child.addChild(csg);
2695
+ group(csg);
2696
+ }
25452697 } else
25462698 if (source == doubleItem)
25472699 {
2700
+ if (!group.selection.isEmpty())
2701
+ {
25482702 Composite csg = new GroupLeaf("Fork");
25492703 csg.count = 5;
2550
- group(csg);
25512704 Composite child = new cGroup("Branch A");
25522705 csg.addChild(child);
25532706 child.addChild(csg);
25542707 child = new cGroup("Branch B");
25552708 csg.addChild(child);
25562709 child.addChild(csg);
2710
+ group(csg);
2711
+ }
25572712 } else
25582713 if (source == tripleItem)
25592714 {
2715
+ if (!group.selection.isEmpty())
2716
+ {
25602717 Composite csg = new GroupLeaf("Trident");
25612718 csg.count = 4;
25622719 group(csg);
....@@ -2569,6 +2726,7 @@
25692726 child = new cGroup();
25702727 csg.addChild(child);
25712728 child.addChild(csg);
2729
+ }
25722730 } else
25732731 if (source == computeAOItem)
25742732 {
....@@ -2618,6 +2776,18 @@
26182776 if (source == fullButton)
26192777 {
26202778 ToggleFullScreen();
2779
+ } else
2780
+ if (source == collapseButton)
2781
+ {
2782
+ this.expandedLayout = radio.layout;
2783
+ CollapseToolbar();
2784
+ } else
2785
+ if (source == maximize3DButton)
2786
+ {
2787
+ this.expandedLayout = radio.layout;
2788
+ radio.layout = twoButton;
2789
+ Show3DView();
2790
+ CollapseToolbar();
26212791 } else
26222792 if (source == previousVersionButton)
26232793 {
....@@ -3192,22 +3362,34 @@
31923362 } else
31933363 if (source == ungroupItem || source == ungroupButton)
31943364 {
3195
- boolean hasRoot = false;
3365
+ boolean canUngroup = true;
31963366
31973367 for (int i=0; i<group.selection.size(); i++)
31983368 {
3199
- if (group.selection.get(i) == group)
3369
+ Object3D selectedItem = group.selection.get(i);
3370
+
3371
+ if (selectedItem.Size() == 0)
32003372 {
3201
- hasRoot = true;
3373
+ // Cannot ungroup leaves
3374
+ canUngroup = false;
3375
+ break;
3376
+ }
3377
+
3378
+ if (selectedItem == group)
3379
+ {
3380
+ // Cannot ungroup root
3381
+ canUngroup = false;
32023382 break;
32033383 }
32043384 }
32053385
3206
- if (!hasRoot)
3386
+ if (canUngroup)
32073387 {
32083388 for (int i=0; i<group.selection.size(); i++)
32093389 {
3210
- Ungroup(group.selection.get(i));
3390
+ Object3D selectedItem = group.selection.get(i);
3391
+
3392
+ Ungroup(selectedItem);
32113393 }
32123394
32133395 ClearSelection(false);
....@@ -3570,38 +3752,7 @@
35703752 if (CameraPane.FULLSCREEN)
35713753 fullscreenLayout = radio.layout;
35723754
3573
- // bug
3574
- //gridPanel.setDividerLocation(1.0);
3575
- //bigPanel.setDividerLocation(0.0);
3576
-// bigThree.remove(scenePanel);
3577
-// bigThree.remove(centralPanel);
3578
-// bigThree.remove(XYZPanel);
3579
-// aWindowConstraints.gridx = 0;
3580
-// aWindowConstraints.gridy = 0;
3581
-// aWindowConstraints.gridwidth = 1;
3582
-// // aConstraints.gridheight = 3;
3583
-// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3584
-// aWindowConstraints.weightx = 0;
3585
-// aWindowConstraints.weighty = 1;
3586
-// //bigThree.add(jtp, aWindowConstraints);
3587
-// aWindowConstraints.weightx = 1;
3588
-// aWindowConstraints.gridwidth = 3;
3589
-// // aConstraints.gridheight = 3;
3590
-// aWindowConstraints.gridx = 1;
3591
-// aWindowConstraints.fill = GridBagConstraints.BOTH;
3592
-// bigThree.add(centralPanel, aWindowConstraints);
3593
-// aWindowConstraints.weightx = 0;
3594
-// aWindowConstraints.gridx = 4;
3595
-// aWindowConstraints.gridwidth = 1;
3596
-// // aConstraints.gridheight = 3;
3597
-// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3598
-// //bigThree.add(XYZPanel, aWindowConstraints);
3599
-// scenePanel.setVisible(false);
3600
-// centralPanel.setVisible(true);
3601
-// XYZPanel.setVisible(false);
3602
- bigThree.ClearUI();
3603
- bigThree.add(centralPanel);
3604
- bigThree.FlushUI();
3755
+ Show3DView();
36053756
36063757 cameraView.requestFocusInWindow();
36073758
....@@ -3787,6 +3938,7 @@
37873938 } else
37883939 if (source == rootButton)
37893940 {
3941
+ Replace();
37903942 Object3D obj;
37913943 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
37923944 {
....@@ -3923,8 +4075,6 @@
39234075
39244076 copy = group;
39254077
3926
- SetUndoStates();
3927
-
39284078 //Globals.theRenderer.object = group;
39294079 if(!useclient)
39304080 {
....@@ -3952,6 +4102,18 @@
39524102 */
39534103 radio.layout.doClick();
39544104
4105
+ assert(copy instanceof Composite);
4106
+
4107
+ if (copy.versionlist == null)
4108
+ {
4109
+ copy.versionlist = new Object3D[100];
4110
+ copy.versionindex = -1;
4111
+
4112
+ Save(true);
4113
+ }
4114
+
4115
+ SetVersionStates();
4116
+
39554117 ClearUnpinned();
39564118
39574119 //Grafreed.Assert(group != null);
....@@ -5186,6 +5348,20 @@
51865348 flashSelectionButton.setEnabled(enabled);
51875349
51885350 clearPanelButton.setEnabled(!listUI.isEmpty());
5351
+
5352
+ boolean allComposites = true;
5353
+
5354
+ if (group.selection != null)
5355
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
5356
+ {
5357
+ if (!(e.nextElement() instanceof Composite))
5358
+ {
5359
+ allComposites = false;
5360
+ break;
5361
+ }
5362
+ }
5363
+
5364
+ rootButton.setEnabled(allComposites);
51895365 }
51905366
51915367 void refreshContents(boolean cp)
....@@ -5200,7 +5376,7 @@
52005376 Object3D child = (Object3D) group.selection.get(i);
52015377
52025378 objEditor.AddInfo(child, this, true);
5203
- System.err.println("info : " + child.GetPath());
5379
+// System.err.println("info : " + child.GetPath());
52045380 }
52055381
52065382 objEditor.SetText(); // jan 2014
....@@ -6083,11 +6259,11 @@
60836259 private MenuItem lookAtItem;
60846260 private MenuItem lookFromItem;
60856261 private MenuItem switchViewItem;
6086
- private MenuItem cutItem;
6262
+ private JMenuItem cutItem;
60876263 private MenuItem undoItem;
60886264 private MenuItem redoItem;
60896265 private JMenuItem duplicateItem;
6090
- private MenuItem cloneItem;
6266
+ private JMenuItem cloneItem;
60916267 private MenuItem cloneSupportItem;
60926268 private MenuItem overwriteGeoItem;
60936269 private MenuItem overwriteMatItem;
....@@ -6108,13 +6284,13 @@
61086284 private MenuItem cloneGeometriesItem;
61096285 private MenuItem shareGeometriesItem;
61106286 private MenuItem mergeGeometriesItem;
6111
- private MenuItem copyItem;
6287
+ private JMenuItem copyItem;
61126288 private MenuItem pasteItem;
6113
- private MenuItem pasteIntoItem;
6114
- private MenuItem pasteLinkItem;
6115
- private MenuItem pasteCloneItem;
6116
- private MenuItem pasteExpandItem;
6117
- private MenuItem deleteItem;
6289
+ private JMenuItem pasteIntoItem;
6290
+ private JMenuItem pasteLinkItem;
6291
+ private JMenuItem pasteCloneItem;
6292
+ private JMenuItem pasteExpandItem;
6293
+ private JMenuItem deleteItem;
61186294 private MenuItem clearAllItem;
61196295 private MenuItem genUVItem;
61206296 private MenuItem genNormalsMESHItem;
....@@ -6182,7 +6358,7 @@
61826358 private MenuItem switchTransfoItem;
61836359 private MenuItem morphItem;
61846360 private MenuItem linkerItem;
6185
- private MenuItem ungroupItem;
6361
+ private JMenuItem ungroupItem;
61866362 private MenuItem editItem;
61876363 private MenuItem openWindowItem;
61886364 private MenuItem editLeafItem;