Normand Briere
2019-08-22 6a145f6c81dfcbe0653eda27d042efb48daa7512
GroupEditor.java
....@@ -16,6 +16,7 @@
1616 //import buoy.widget.BFileChooser;
1717
1818 class GroupEditor extends ObjEditor implements //iParse, //iCallBack,
19
+ Grafreed.iResourceCallBack,
1920 ObjectUI,
2021 Runnable,
2122 ActionListener,
....@@ -28,9 +29,9 @@
2829 {
2930 cButton skyboxButton;
3031 final String path = "cubemaps/" + f + "-skyboxes/" + s;
31
- row.add(skyboxButton = GetButton(path + "/preview.jpg", !Grafreed.NIMBUSLAF));
32
+ row.add(skyboxButton = GetButton(path + "/preview.jpg", !Globals.NIMBUSLAF));
3233 //row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF));
33
- skyboxButton.setToolTipText(s);
34
+ skyboxButton.setToolTipText(s.equals("") ? "No background" : s);
3435 skyboxButton.addActionListener(new ActionListener()
3536 {
3637 @Override
....@@ -41,6 +42,22 @@
4142 });
4243 }
4344
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, !Globals.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
+
4461 public void AddSkyboxTab0(JTabbedPane skyboxpanel)
4562 {
4663 cGridBag tab0 = new cGridBag().setVertical(true);
....@@ -56,7 +73,7 @@
5673 cGridBag row5 = new cGridBag();
5774 cGridBag row6 = new cGridBag();
5875
59
- AddSkyboxButton("default", "rgb", row0);
76
+ AddSkyboxButton("default", "", row0);
6077 //AddSkyboxButton("default", "cornell", row0);
6178 AddSkyboxButton("penguins", "dust", row0);
6279 AddSkyboxButton("penguins", "tropic", row0);
....@@ -311,14 +328,56 @@
311328 }
312329 }
313330
314
- public void ChangeSkybox(String name)
331
+ public void ChangeSkybox(String skybox)
315332 {
316
- //cameraView.envyoff = false;
317
- group.skyboxname = name;
318
- group.skyboxext = "jpg";
319
- 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
+ }
347
+
348
+ public void CreateSkyboxPanel(cGridBag skyboxPanel)
349
+ {
350
+ JTabbedPane skyboxpane = new JTabbedPane(JTabbedPane.LEFT);
351
+
352
+ AddSkyboxTab0(skyboxpane);
353
+ AddSkyboxTab1(skyboxpane);
354
+ AddSkyboxTab2(skyboxpane);
355
+ AddSkyboxTab3(skyboxpane);
356
+
357
+ skyboxPanel.add(skyboxpane);
320358 }
321359
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
+
322381 //ObjEditor objEditor;
323382 public void closeUI2()
324383 {
....@@ -356,10 +415,14 @@
356415 this.copy = this.group = group;
357416 //selectees = this.group.selectees;
358417
418
+ assert(false);
419
+
359420 if (copy.versionlist == null)
360421 {
361422 copy.versionlist = new Object3D[100];
362423 copy.versionindex = -1;
424
+
425
+ //Save(true);
363426 }
364427
365428 if(ui)
....@@ -388,7 +451,7 @@
388451 copy.versionlist = new Object3D[100];
389452 copy.versionindex = -1;
390453
391
- Save(true);
454
+ //Save(true);
392455 }
393456 }
394457
....@@ -479,33 +542,35 @@
479542 // menu.add("-");
480543 duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
481544 duplicateItem.addActionListener(this);
482
- cloneItem = menu.add(new MenuItem("Clone"));
545
+
546
+ cloneItem = oe.jTree.popup.add(new JMenuItem("Clone"));
483547 cloneItem.addActionListener(this);
484
- if (Globals.ADVANCED)
548
+ //if (Globals.ADVANCED)
485549 {
486550 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
487551 cloneSupportItem.addActionListener(this);
488552 }
553
+ oe.jTree.popup.addSeparator();
489554 menu.add("-");
490
- cutItem = menu.add(new MenuItem("Cut"));
555
+ cutItem = oe.jTree.popup.add(new JMenuItem("Cut"));
491556 cutItem.addActionListener(this);
492
- copyItem = menu.add(new MenuItem("Copy"));
557
+ copyItem = oe.jTree.popup.add(new JMenuItem("Copy"));
493558 copyItem.addActionListener(this);
494559 pasteItem = menu.add(new MenuItem("Paste"));
495560 pasteItem.addActionListener(this);
496561
497
- menu.add("-");
498
- 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"));
499565 pasteIntoItem.addActionListener(this);
500
- pasteLinkItem = menu.add(new MenuItem("Paste link"));
566
+ pasteLinkItem = oe.jTree.popup.add(new JMenuItem("Paste link"));
501567 pasteLinkItem.addActionListener(this);
502
- pasteCloneItem = menu.add(new MenuItem("Paste clone"));
568
+ pasteCloneItem = oe.jTree.popup.add(new JMenuItem("Paste clone"));
503569 pasteCloneItem.addActionListener(this);
504
-// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
570
+// CRASH pasteExpandItem = oe.jTree.popup.add(new JMenuItem("Paste expand"));
505571 // pasteExpandItem.addActionListener(this);
506
- menu.add("-");
507
- deleteItem = menu.add(new MenuItem("Delete"));
508
- deleteItem.addActionListener(this);
572
+ //menu.add("-");
573
+ oe.jTree.popup.addSeparator();
509574
510575 if (Globals.ADVANCED)
511576 {
....@@ -591,11 +656,9 @@
591656 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
592657 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
593658 //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
594
- editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
595659 oe.cameraMenu.add("-");
596660 openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
597661 openWindowItem.addActionListener(this);
598
- editLeafItem.addActionListener(this);
599662 lookAtItem.addActionListener(this);
600663 //lookFromItem.addActinoListener(this);
601664 //switchViewItem.addActionListener(this);
....@@ -642,9 +705,8 @@
642705 setMasterItem.addActionListener(this);
643706 }
644707
645
- oe.menuBar.add(menu = new Menu("Group"));
646
-// grabItem = menu.add(new MenuItem("Grab"));
647
-// grabItem.addActionListener(this);
708
+ oe.menuBar.add(menu = new Menu("Order"));
709
+
648710 backItem = menu.add(new MenuItem("Back"));
649711 backItem.addActionListener(this);
650712 frontItem = menu.add(new MenuItem("Front"));
....@@ -652,13 +714,21 @@
652714 // compositeItem = menu.add(new MenuItem("Composite"));
653715 // compositeItem.addActionListener(this);
654716
717
+ grabItem = oe.jTree.popup.add(new JMenuItem("Group"));
718
+ grabItem.addActionListener(this);
719
+
655720 if (Globals.ADVANCED)
656721 {
657722 hideItem = menu.add(new MenuItem("Hidden Group"));
658723 hideItem.addActionListener(this);
659724 }
660
- ungroupItem = menu.add(new MenuItem("Ungroup"));
725
+ ungroupItem = oe.jTree.popup.add(new JMenuItem("Ungroup"));
661726 ungroupItem.addActionListener(this);
727
+
728
+ oe.jTree.popup.addSeparator();
729
+
730
+ deleteItem = oe.jTree.popup.add(new JMenuItem("Delete"));
731
+ deleteItem.addActionListener(this);
662732
663733 // menu.add("-");
664734 //
....@@ -787,9 +857,9 @@
787857 hideleavesItem.addActionListener(this);
788858 showleavesItem = menu.add(new MenuItem("Show Leaves"));
789859 showleavesItem.addActionListener(this);
790
- markleavesItem = menu.add(new MenuItem("Mark Leaves"));
860
+ markleavesItem = menu.add(new MenuItem("Anim Leaves"));
791861 markleavesItem.addActionListener(this);
792
- unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
862
+ unmarkleavesItem = menu.add(new MenuItem("Unanim Leaves"));
793863 unmarkleavesItem.addActionListener(this);
794864 rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
795865 rewindleavesItem.addActionListener(this);
....@@ -843,6 +913,9 @@
843913 shareGeometriesItem.addActionListener(this);
844914 mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
845915 mergeGeometriesItem.addActionListener(this);
916
+ menu.add("-");
917
+ editLeafItem = menu.add(new MenuItem("Edit leaf..."));
918
+ editLeafItem.addActionListener(this);
846919 if (Globals.ADVANCED)
847920 {
848921 // Pretty much the same as duplicate and clone.
....@@ -859,6 +932,79 @@
859932 buildToolsMenu(menu);
860933 }
861934
935
+ JTabbedPane resourcecontainer;
936
+ cGridBag currenttab;
937
+ //boolean added; // patch for jar
938
+
939
+ int totalcount = 0;
940
+
941
+ int tabcount = 0;
942
+ int colcount = 0;
943
+ int rowcount = 0;
944
+ int texturecount = 0;
945
+
946
+ int columns = 5;
947
+ int rows = 7;
948
+
949
+ public void ResourceCallBack(String[] path)
950
+ {
951
+// for (int i = 0; i < path.length; i++)
952
+// System.out.print(path[i] + "/");
953
+// System.out.println();
954
+
955
+ if (//rowcount == 0 ||
956
+ path.length == 1 && !path[0].equals("") && !path[0].equals(".DS_Store"))
957
+ {
958
+ currenttab = new cGridBag();
959
+ String tabname = path[0]; // String.valueOf((char)('A'+tabcount));
960
+ currenttab.setName(tabname);
961
+ //added = false;
962
+ resourcecontainer.add(currenttab);
963
+ resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname);
964
+ rowcount = 1;
965
+ colcount = 0;
966
+ texturecount = 0;
967
+ }
968
+
969
+ if (path.length > 2 && (path[2].toLowerCase().endsWith(".jpg") || path[2].toLowerCase().endsWith(".png")))
970
+ {
971
+ //if (!added)
972
+ {
973
+ //added = true;
974
+ String tabname = path[0]; // String.valueOf((char)('A'+tabcount));
975
+ currenttab = (cGridBag)resourcecontainer.getComponentAt(resourcecontainer.indexOfTab(tabname));
976
+ }
977
+
978
+ AddTextureButton(path[0], path[1], path[2], ++texturecount, currenttab);
979
+ totalcount++;
980
+
981
+ if (++colcount >= columns)
982
+ {
983
+ colcount = 0;
984
+ currenttab.Return();
985
+
986
+ if (rowcount++ >= rows)
987
+ {
988
+ rowcount = 0;
989
+ }
990
+ }
991
+ }
992
+ else
993
+ {
994
+// if (!path[path.length-1].equals("icons"))
995
+// resourcecontainer.Return();
996
+ }
997
+ }
998
+
999
+ void CreateTexturePanel(cGridBag container)
1000
+ {
1001
+ resourcecontainer = new JTabbedPane(JTabbedPane.LEFT);
1002
+ container.add(resourcecontainer);
1003
+
1004
+ Grafreed.ParseResources("textures", this);
1005
+
1006
+ // 935. System.out.println("Total = " + totalcount);
1007
+ }
8621008
8631009 void SetupUI2(ObjEditor oe)
8641010 {
....@@ -877,11 +1023,6 @@
8771023 //new Exception().printStackTrace();
8781024
8791025 oe.radioPanel = new JPanel(new GridBagLayout());
880
- oe.aConstraints.weightx = 1;
881
- oe.aConstraints.weighty = 0;
882
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
883
- oe.aConstraints.gridwidth = 100;
884
- oe.aConstraints.gridheight = 1;
8851026 // oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
8861027
8871028 oe.buttonGroup = new ButtonGroup();
....@@ -902,9 +1043,9 @@
9021043 oe.radioPanel.add(dummyButton);
9031044 oe.buttonGroup.add(dummyButton);
9041045 */
905
- cGridBag copyOptionsPanel = new cGridBag();
1046
+ cGridBag versionManagerPanel = new cGridBag();
9061047
907
- copyOptionsPanel.preferredHeight = 2;
1048
+ versionManagerPanel.preferredHeight = 4;
9081049
9091050 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
9101051
....@@ -914,58 +1055,102 @@
9141055
9151056 if (Globals.ADVANCED)
9161057 {
917
- oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
918
- maxButton.setToolTipText("Maximize window");
919
- maxButton.addActionListener(this);
1058
+// oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1059
+// maxButton.setToolTipText("Maximize window");
1060
+// maxButton.addActionListener(this);
9201061 }
9211062
922
- oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1063
+ cButton gcButton;
1064
+
1065
+// oe.toolbarPanel.add(gcButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1066
+// gcButton.setToolTipText("Garbage collect");
1067
+// gcButton.addActionListener(new ActionListener()
1068
+// {
1069
+// public void actionPerformed(ActionEvent e)
1070
+// {
1071
+// System.gc();
1072
+// }
1073
+// });
1074
+
1075
+ oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1076
+ collapseButton.setToolTipText("Collapse toolbar");
1077
+ collapseButton.addActionListener(this);
1078
+
1079
+ oe.toolbarPanel.add(maximize3DButton = GetButton("icons/square.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1080
+ maximize3DButton.setToolTipText("Maximize 3D view");
1081
+ maximize3DButton.addActionListener(this);
1082
+
1083
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1084
+ twoButton.setToolTipText("Show 3D view only");
1085
+ twoButton.addActionListener(this);
1086
+ this.fullscreenLayout = twoButton;
1087
+
1088
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1089
+ threeButton.setToolTipText("Show controls and 3D view");
1090
+ threeButton.addActionListener(this);
1091
+ if (Globals.ADVANCED)
1092
+ {
1093
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1094
+ sixButton.setToolTipText("Show 3D view and controls");
1095
+ sixButton.addActionListener(this);
1096
+ }
1097
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1098
+// sevenButton.setToolTipText("3-column layout");
1099
+// sevenButton.addActionListener(this);
1100
+ //
1101
+
1102
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
9231103 fullButton.setToolTipText("Full-screen window");
9241104 fullButton.addActionListener(this);
9251105
926
- oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1106
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
9271107 screenfitButton.setToolTipText("Screen fit");
9281108 screenfitButton.addActionListener(this);
9291109
930
- oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1110
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
9311111 restoreCameraButton.setToolTipText("Restore viewpoint");
9321112 restoreCameraButton.addActionListener(this);
9331113
934
- copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
935
- saveButton.setToolTipText("Duplicate current version");
936
- saveButton.addActionListener(this);
1114
+ versionManagerPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1115
+ saveVersionButton.setToolTipText("Duplicate current version");
1116
+ saveVersionButton.addActionListener(this);
9371117
938
- copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
939
- undoButton.setToolTipText("Previous version");
940
- undoButton.addActionListener(this);
941
- undoButton.setEnabled(false);
1118
+ versionManagerPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1119
+ deleteVersionButton.setToolTipText("Delete current version");
1120
+ deleteVersionButton.addActionListener(this);
1121
+ deleteVersionButton.setEnabled(false);
1122
+
1123
+ versionManagerPanel.add(previousVersionButton = GetButton("icons/undo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1124
+ previousVersionButton.setToolTipText("Previous version");
1125
+ previousVersionButton.addActionListener(this);
1126
+ previousVersionButton.setEnabled(false);
9421127
9431128 cGridBag updown = new cGridBag().setVertical(true);
944
- updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1129
+ updown.add(restoreButton = GetButton("icons/restore.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
9451130 restoreButton.setToolTipText("Undo (restore current version)");
9461131 restoreButton.addActionListener(this);
9471132 restoreButton.setEnabled(false);
9481133
949
- updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1134
+ updown.add(replaceButton = GetButton("icons/replace.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
9501135 replaceButton.setToolTipText("Save (replace current version)");
9511136 replaceButton.addActionListener(this);
9521137 replaceButton.setEnabled(false);
9531138
954
- copyOptionsPanel.add(updown);
1139
+ versionManagerPanel.add(updown);
9551140
956
- copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
957
- redoButton.setToolTipText("Next version");
958
- redoButton.addActionListener(this);
959
- redoButton.setEnabled(false);
1141
+ versionManagerPanel.add(nextVersionButton = GetButton("icons/redo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1142
+ nextVersionButton.setToolTipText("Next version");
1143
+ nextVersionButton.addActionListener(this);
1144
+ nextVersionButton.setEnabled(false);
1145
+
1146
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1147
+ oneStepButton.setToolTipText("Animate one step forward");
1148
+ oneStepButton.addActionListener(this);
9601149
9611150 oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
9621151 liveCB.setToolTipText("Enable animation");
9631152 liveCB.addItemListener(this);
9641153
965
- oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
966
- oneStepButton.setToolTipText("Animate one step forward");
967
- oneStepButton.addActionListener(this);
968
-
9691154 oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
9701155 fastCB.setToolTipText("Fast mode");
9711156 fastCB.addItemListener(this);
....@@ -981,38 +1166,23 @@
9811166
9821167 if (Globals.ADVANCED)
9831168 {
984
- oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1169
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Globals.NIMBUSLAF)); //, oe.aConstraints);
9851170 snapobjectButton.addActionListener(this);
9861171 snapobjectButton.setToolTipText("Snap Object");
9871172
988
- oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1173
+ oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
9891174 fourButton.addActionListener(this);
9901175 fourButton.setToolTipText("Show control panel only");
9911176 }
9921177
9931178 //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
9941179
995
- oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
996
- twoButton.setToolTipText("Show 3D view only");
997
- twoButton.addActionListener(this);
998
- this.fullscreenLayout = twoButton;
999
-
1000
- oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1001
- threeButton.setToolTipText("Show controls and 3D view");
1002
- threeButton.addActionListener(this);
1003
- oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1004
- sixButton.setToolTipText("Show 3D view and controls");
1005
- sixButton.addActionListener(this);
1006
-// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1007
-// sevenButton.setToolTipText("3-column layout");
1008
-// sevenButton.addActionListener(this);
1009
- //
10101180
1011
- oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1181
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10121182 rootButton.setToolTipText("Open selection in new tab");
10131183 rootButton.addActionListener(this);
10141184
1015
- oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1185
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10161186 closeButton.setToolTipText("Close tab");
10171187 closeButton.addActionListener(this);
10181188 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
....@@ -1021,38 +1191,38 @@
10211191 cGridBag row1 = new cGridBag();
10221192
10231193 // INSERT
1024
- row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1025
- gridButton.setToolTipText("Create grid");
1194
+ row1.add(gridButton = GetButton("icons/grid.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1195
+ gridButton.setToolTipText("Create ground");
10261196 gridButton.addActionListener(this);
10271197
1028
- row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1198
+ row1.add(boxButton = GetButton("icons/box.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10291199 boxButton.setToolTipText("Create box");
10301200 boxButton.addActionListener(this);
10311201
1032
- row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1033
- sphereButton.setToolTipText("Create sphere");
1034
- sphereButton.addActionListener(this);
1035
-
1036
- row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1037
- coneButton.setToolTipText("Create cone");
1038
- coneButton.addActionListener(this);
1039
-
1040
- row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1041
- torusButton.setToolTipText("Create torus");
1042
- torusButton.addActionListener(this);
1043
-
1044
- row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1202
+ row1.add(superButton = GetButton("icons/super.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10451203 superButton.setToolTipText("Create superellipsoid");
10461204 superButton.addActionListener(this);
10471205
1206
+ row1.add(sphereButton = GetButton("icons/sphere.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1207
+ sphereButton.setToolTipText("Create sphere");
1208
+ sphereButton.addActionListener(this);
1209
+
1210
+ row1.add(coneButton = GetButton("icons/cone.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1211
+ coneButton.setToolTipText("Create cone");
1212
+ coneButton.addActionListener(this);
1213
+
1214
+ row1.add(torusButton = GetButton("icons/torus.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1215
+ torusButton.setToolTipText("Create torus");
1216
+ torusButton.addActionListener(this);
1217
+
10481218 if (Globals.ADVANCED)
10491219 {
1050
- oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1220
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10511221 kleinButton.setToolTipText("Create Klein bottle");
10521222 kleinButton.addActionListener(this);
10531223 }
10541224
1055
- row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1225
+ row1.add(particlesButton = GetButton("icons/particles.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10561226 particlesButton.setToolTipText("Create particle system");
10571227 particlesButton.addActionListener(this);
10581228
....@@ -1060,72 +1230,73 @@
10601230
10611231 cGridBag row2 = new cGridBag();
10621232
1063
- row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1233
+ row2.add(groupButton = GetButton("icons/group.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10641234 groupButton.setToolTipText("Create group");
10651235 groupButton.addActionListener(this);
10661236
1067
- row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1237
+ row2.add(compositeButton = GetButton("icons/composite.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10681238 compositeButton.setToolTipText("Create composite");
10691239 compositeButton.addActionListener(this);
10701240
1071
- row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1241
+ row2.add(switchButton = GetButton("icons/switch.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10721242 switchButton.setToolTipText("Create item switcher");
10731243 switchButton.addActionListener(this);
10741244
1075
- row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1245
+ row2.add(loopButton = GetButton("icons/loop.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10761246 loopButton.setToolTipText("Create loop");
10771247 loopButton.addActionListener(this);
10781248
1079
- row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1249
+ row2.add(textureButton = GetButton("icons/texture.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10801250 textureButton.setToolTipText("Create texture");
10811251 textureButton.addActionListener(this);
10821252
1083
- row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1253
+ row2.add(overlayButton = GetButton("icons/overlay.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10841254 overlayButton.setToolTipText("Create overlay");
10851255 overlayButton.addActionListener(this);
10861256
1087
- row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1257
+ row2.add(lightButton = GetButton("icons/light-bulb.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10881258 lightButton.setToolTipText("Create light");
10891259 lightButton.addActionListener(this);
10901260
10911261 oe.toolboxPanel.add(row2);
10921262
1093
- // ENVYMAPS
1094
- cGridBag skyboxpane = new cGridBag();
1095
- skyboxpane.preferredHeight = 100;
1263
+ cGridBag textures = new cGridBag();
10961264
1097
- oe.toolboxPanel.add(skyboxpane);
1265
+ CreateTexturePanel(textures);
10981266
1099
- JTabbedPane skyboxpanel = new JTabbedPane();
1100
- skyboxpane.add(skyboxpanel);
1267
+ int tabCount = resourcecontainer.getTabCount();
11011268
1102
- AddSkyboxTab0(skyboxpanel);
1103
- AddSkyboxTab1(skyboxpanel);
1104
- AddSkyboxTab2(skyboxpanel);
1105
- AddSkyboxTab3(skyboxpanel);
1269
+ if (tabCount > 0)
1270
+ resourcecontainer.setSelectedIndex((int)(Math.random() * tabCount));
1271
+
1272
+ oe.toolboxPanel.add(textures);
1273
+
1274
+ textures.preferredHeight = 100;
1275
+
1276
+ CreateSkyboxPanel(oe.skyboxPanel);
11061277
11071278 // EDIT panel
1108
- editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1279
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11091280 editButton.setToolTipText("Pin selection controls");
11101281 editButton.addActionListener(this);
11111282
1112
- editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1283
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11131284 uneditButton.setToolTipText("Unpin and remove selection controls");
11141285 uneditButton.addActionListener(this);
11151286
11161287 editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
1117
- allParamsButton.setToolTipText("Show all controle");
1288
+ allParamsButton.setToolTipText("Show all controls");
11181289 allParamsButton.addActionListener(this);
11191290
1120
- editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1121
- clearPanelButton.setToolTipText("Clear edit panel");
1291
+ editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1292
+ clearPanelButton.setToolTipText("Clear all controls");
11221293 clearPanelButton.addActionListener(this);
11231294
1124
- editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1125
- unselectButton.setToolTipText("Unselect");
1126
- unselectButton.addActionListener(this);
1295
+ //editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1296
+ //unselectButton.setToolTipText("Unselect");
1297
+ //unselectButton.addActionListener(this);
11271298
1128
- editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1299
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11291300 flashSelectionButton.setToolTipText("Highlight selection");
11301301 flashSelectionButton.addActionListener(this);
11311302
....@@ -1148,6 +1319,8 @@
11481319
11491320 cGridBag jSPPanel = new cGridBag();
11501321
1322
+ jSPPanel.preferredHeight = 20;
1323
+
11511324 JScrollPane jSP;
11521325 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
11531326 jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
....@@ -1156,11 +1329,11 @@
11561329 oe.treePanel.add(jSPPanel);
11571330 oe.treePanel.Return();
11581331
1159
- oe.treePanel.add(copyOptionsPanel);
1332
+ oe.treePanel.add(versionManagerPanel);
11601333 oe.treePanel.Return();
1161
- cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1162
- versionSlider = (cNumberSlider)sliderPane.getComponent(1);
1163
- sliderPane.preferredHeight = 1;
1334
+ versionSliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1335
+ versionSlider = (cNumberSlider)versionSliderPane.getComponent(1);
1336
+ versionSliderPane.preferredHeight = 3;
11641337
11651338 // mainPanel.setDividerLocation(0.1); //1.0);
11661339 mainPanel.setResizeWeight(0.4);
....@@ -1318,6 +1491,14 @@
13181491
13191492 void EditObject(Object3D obj)
13201493 {
1494
+ assert(obj instanceof Composite);
1495
+
1496
+// if (obj.versionlist == null)
1497
+// {
1498
+// obj.versionlist = new Object3D[100];
1499
+// obj.versionindex = -1;
1500
+// }
1501
+
13211502 cRadio radioButton = new cRadio(obj.name);
13221503
13231504 // June 2019. Patch to avoid bug with transparency.
....@@ -1342,6 +1523,7 @@
13421523
13431524 oe.SetupViews();
13441525
1526
+ if (Globals.DEBUG)
13451527 System.out.println("SetupViews");
13461528 DragSource.getDefaultDragSource().createDefaultDragGestureRecognizer(
13471529 oe.cameraView, DnDConstants.ACTION_COPY_OR_MOVE, this); // ACTION_LINK ??
....@@ -1708,7 +1890,12 @@
17081890 TreePath path;
17091891
17101892 public TransferableTreePath(TreePath tp) {
1711
- path = tp;
1893
+ Object[] objs = new Object[tp.getPathCount()];
1894
+ for (int i=0; i<objs.length; i++)
1895
+ {
1896
+ objs[i] = ((Object3D)tp.getPathComponent(i)).GetUUID();
1897
+ }
1898
+ path = new TreePath(objs);
17121899 }
17131900
17141901 public synchronized DataFlavor[] getTransferDataFlavors() {
....@@ -1998,7 +2185,11 @@
19982185 shadow.material = new cMaterial(obj.material);
19992186 shadow.material.diffuse = 0.0001f;
20002187 shadow.material.specular = 0.0001f;
2001
- //shadow.projectedVertices[1].x = 300;
2188
+ shadow.material.opacity = 0.75f;
2189
+
2190
+ AllocProjectedVertices(shadow);
2191
+
2192
+ shadow.projectedVertices[1].x = 300;
20022193
20032194 makeSomething(shadow);
20042195 }
....@@ -2519,27 +2710,35 @@
25192710 } else
25202711 if (source == loopItem || source == loopButton)
25212712 {
2713
+ if (!group.selection.isEmpty())
2714
+ {
25222715 Composite csg = new GroupLeaf();
25232716 csg.count = 5;
2524
- group(csg);
25252717 Composite child = new cGroup("Branch");
25262718 csg.addChild(child);
25272719 child.addChild(csg);
2720
+ group(csg);
2721
+ }
25282722 } else
25292723 if (source == doubleItem)
25302724 {
2725
+ if (!group.selection.isEmpty())
2726
+ {
25312727 Composite csg = new GroupLeaf("Fork");
25322728 csg.count = 5;
2533
- group(csg);
25342729 Composite child = new cGroup("Branch A");
25352730 csg.addChild(child);
25362731 child.addChild(csg);
25372732 child = new cGroup("Branch B");
25382733 csg.addChild(child);
25392734 child.addChild(csg);
2735
+ group(csg);
2736
+ }
25402737 } else
25412738 if (source == tripleItem)
25422739 {
2740
+ if (!group.selection.isEmpty())
2741
+ {
25432742 Composite csg = new GroupLeaf("Trident");
25442743 csg.count = 4;
25452744 group(csg);
....@@ -2552,6 +2751,7 @@
25522751 child = new cGroup();
25532752 csg.addChild(child);
25542753 child.addChild(csg);
2754
+ }
25552755 } else
25562756 if (source == computeAOItem)
25572757 {
....@@ -2571,7 +2771,7 @@
25712771 if (source == invariantsItem)
25722772 {
25732773 System.out.println("Invariants:");
2574
- Grafreed.grafreeD.universe.invariants();
2774
+ Grafreed.grafreed.universe.invariants();
25752775 } else
25762776 if (source == memoryItem)
25772777 {
....@@ -2602,35 +2802,52 @@
26022802 {
26032803 ToggleFullScreen();
26042804 } else
2605
- if (source == undoButton)
2805
+ if (source == collapseButton)
2806
+ {
2807
+ this.expandedLayout = radio.layout;
2808
+ CollapseToolbar();
2809
+ } else
2810
+ if (source == maximize3DButton)
2811
+ {
2812
+ this.expandedLayout = radio.layout;
2813
+ radio.layout = twoButton;
2814
+ Show3DView();
2815
+ CollapseToolbar();
2816
+ } else
2817
+ if (source == previousVersionButton)
26062818 {
26072819 // Go to previous version
26082820 //if (!Undo())
26092821 //java.awt.Toolkit.getDefaultToolkit().beep();
2610
- Undo();
2822
+ PreviousVersion();
26112823 } else
26122824 if (source == restoreButton)
26132825 {
26142826 // Restore current version
26152827 Restore();
2616
- restoreButton.setEnabled(false);
2828
+ //restoreButton.setEnabled(false);
26172829 } else
26182830 if (source == replaceButton)
26192831 {
26202832 // Overwrite current version
26212833 Replace();
2622
- replaceButton.setEnabled(false);
2834
+ //replaceButton.setEnabled(false);
26232835 } else
2624
- if (source == redoButton)
2836
+ if (source == nextVersionButton)
26252837 {
26262838 // Go to next version
2627
- Redo();
2839
+ NextVersion();
26282840 } else
2629
- if (source == saveButton)
2841
+ if (source == saveVersionButton)
26302842 {
26312843 // Save a new version
26322844 if (!Save(true))
26332845 java.awt.Toolkit.getDefaultToolkit().beep();
2846
+ } else
2847
+ if (source == deleteVersionButton)
2848
+ {
2849
+ // Delete a new version
2850
+ DeleteVersion();
26342851 } else
26352852 if (source == oneStepButton)
26362853 {
....@@ -2685,11 +2902,11 @@
26852902 } else
26862903 if (source == undoItem)
26872904 {
2688
- Undo();
2905
+ PreviousVersion();
26892906 } else
26902907 if (source == redoItem)
26912908 {
2692
- Redo();
2909
+ NextVersion();
26932910 } else
26942911 if (source == duplicateItem)
26952912 {
....@@ -3170,22 +3387,34 @@
31703387 } else
31713388 if (source == ungroupItem || source == ungroupButton)
31723389 {
3173
- boolean hasRoot = false;
3390
+ boolean canUngroup = true;
31743391
31753392 for (int i=0; i<group.selection.size(); i++)
31763393 {
3177
- if (group.selection.get(i) == group)
3394
+ Object3D selectedItem = group.selection.get(i);
3395
+
3396
+ if (selectedItem.Size() == 0)
31783397 {
3179
- hasRoot = true;
3398
+ // Cannot ungroup leaves
3399
+ canUngroup = false;
3400
+ break;
3401
+ }
3402
+
3403
+ if (selectedItem == group)
3404
+ {
3405
+ // Cannot ungroup root
3406
+ canUngroup = false;
31803407 break;
31813408 }
31823409 }
31833410
3184
- if (!hasRoot)
3411
+ if (canUngroup)
31853412 {
31863413 for (int i=0; i<group.selection.size(); i++)
31873414 {
3188
- Ungroup(group.selection.get(i));
3415
+ Object3D selectedItem = group.selection.get(i);
3416
+
3417
+ Ungroup(selectedItem);
31893418 }
31903419
31913420 ClearSelection(false);
....@@ -3548,38 +3777,7 @@
35483777 if (CameraPane.FULLSCREEN)
35493778 fullscreenLayout = radio.layout;
35503779
3551
- // bug
3552
- //gridPanel.setDividerLocation(1.0);
3553
- //bigPanel.setDividerLocation(0.0);
3554
-// bigThree.remove(scenePanel);
3555
-// bigThree.remove(centralPanel);
3556
-// bigThree.remove(XYZPanel);
3557
-// aWindowConstraints.gridx = 0;
3558
-// aWindowConstraints.gridy = 0;
3559
-// aWindowConstraints.gridwidth = 1;
3560
-// // aConstraints.gridheight = 3;
3561
-// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3562
-// aWindowConstraints.weightx = 0;
3563
-// aWindowConstraints.weighty = 1;
3564
-// //bigThree.add(jtp, aWindowConstraints);
3565
-// aWindowConstraints.weightx = 1;
3566
-// aWindowConstraints.gridwidth = 3;
3567
-// // aConstraints.gridheight = 3;
3568
-// aWindowConstraints.gridx = 1;
3569
-// aWindowConstraints.fill = GridBagConstraints.BOTH;
3570
-// bigThree.add(centralPanel, aWindowConstraints);
3571
-// aWindowConstraints.weightx = 0;
3572
-// aWindowConstraints.gridx = 4;
3573
-// aWindowConstraints.gridwidth = 1;
3574
-// // aConstraints.gridheight = 3;
3575
-// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3576
-// //bigThree.add(XYZPanel, aWindowConstraints);
3577
-// scenePanel.setVisible(false);
3578
-// centralPanel.setVisible(true);
3579
-// XYZPanel.setVisible(false);
3580
- bigThree.ClearUI();
3581
- bigThree.add(centralPanel);
3582
- bigThree.FlushUI();
3780
+ Show3DView();
35833781
35843782 cameraView.requestFocusInWindow();
35853783
....@@ -3765,6 +3963,7 @@
37653963 } else
37663964 if (source == rootButton)
37673965 {
3966
+ Replace();
37683967 Object3D obj;
37693968 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
37703969 {
....@@ -3779,6 +3978,8 @@
37793978 if (source == closeButton)
37803979 {
37813980 //System.out.println("CLOSE: " + buttonGroup.getSelection());
3981
+ Replace();
3982
+
37823983 cRadio ab;
37833984 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
37843985 {
....@@ -3877,6 +4078,8 @@
38774078 } else
38784079 if(source instanceof cRadio)
38794080 {
4081
+ Replace();
4082
+
38804083 group.parent = keepparent;
38814084 group.attributes = 0;
38824085 //group.editWindow = null;
....@@ -3901,8 +4104,6 @@
39014104
39024105 copy = group;
39034106
3904
- SetUndoStates();
3905
-
39064107 //Globals.theRenderer.object = group;
39074108 if(!useclient)
39084109 {
....@@ -3930,6 +4131,29 @@
39304131 */
39314132 radio.layout.doClick();
39324133
4134
+ assert(copy instanceof Composite);
4135
+
4136
+ if (copy.versionlist == null)
4137
+ {
4138
+ copy.versionindex = -1;
4139
+
4140
+ // Cannot work with loops
4141
+ // To fix this issue, we first mark all nodes above the root,
4142
+ // and check if any of these nodes are reachable below the root.
4143
+ Grafreed.grafreed.universe.TagObjects(copy, true);
4144
+
4145
+ if (!copy.HasTags())
4146
+ {
4147
+ copy.versionlist = new Object3D[100];
4148
+
4149
+ Save(true);
4150
+ }
4151
+
4152
+ Grafreed.grafreed.universe.TagObjects(copy, false);
4153
+ }
4154
+
4155
+ SetVersionStates();
4156
+
39334157 ClearUnpinned();
39344158
39354159 //Grafreed.Assert(group != null);
....@@ -4073,7 +4297,7 @@
40734297 TouchTransform(obj);
40744298 continue;
40754299 }
4076
- if ((mask&2) != 0) // Scale
4300
+ if ((mask&2) != 0) // Scale/rotation
40774301 {
40784302 obj.toParent[0][0] = obj.toParent[1][1] = obj.toParent[2][2] = 1;
40794303 obj.toParent[0][1] = obj.toParent[1][0] = obj.toParent[2][0] = 0;
....@@ -4081,10 +4305,6 @@
40814305 obj.fromParent[0][0] = obj.fromParent[1][1] = obj.fromParent[2][2] = 1;
40824306 obj.fromParent[0][1] = obj.fromParent[1][0] = obj.fromParent[2][0] = 0;
40834307 obj.fromParent[0][2] = obj.fromParent[1][2] = obj.fromParent[2][1] = 0;
4084
- }
4085
- if ((mask&4) != 0) // Rotation
4086
- {
4087
- // ?
40884308 }
40894309 if ((mask&1) != 0) // Translation
40904310 {
....@@ -5160,15 +5380,31 @@
51605380 {
51615381 editButton.setEnabled(enabled);
51625382 uneditButton.setEnabled(enabled);
5163
- unselectButton.setEnabled(enabled);
5383
+ //unselectButton.setEnabled(enabled);
51645384 flashSelectionButton.setEnabled(enabled);
51655385
51665386 clearPanelButton.setEnabled(!listUI.isEmpty());
5387
+
5388
+ boolean allComposites = true;
5389
+
5390
+ if (group.selection != null)
5391
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
5392
+ {
5393
+ Object next = e.nextElement();
5394
+ if (!(next instanceof Composite)) // || (next instanceof GroupLeaf))
5395
+ {
5396
+ allComposites = false;
5397
+ break;
5398
+ }
5399
+ }
5400
+
5401
+ rootButton.setEnabled(allComposites);
51675402 }
51685403
51695404 void refreshContents(boolean cp)
51705405 {
5171
- if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
5406
+ if (Globals.ADVANCED)
5407
+ //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
51725408 if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
51735409 {
51745410 objEditor.ClearInfo(); // .GetMaterial());
....@@ -5178,7 +5414,7 @@
51785414 Object3D child = (Object3D) group.selection.get(i);
51795415
51805416 objEditor.AddInfo(child, this, true);
5181
- System.err.println("info : " + child.GetPath());
5417
+// System.err.println("info : " + child.GetPath());
51825418 }
51835419
51845420 objEditor.SetText(); // jan 2014
....@@ -6004,7 +6240,6 @@
60046240
60056241 cButton restoreCameraButton;
60066242
6007
- cButton saveButton;
60086243 cButton oneStepButton;
60096244
60106245 cButton groupButton;
....@@ -6062,11 +6297,11 @@
60626297 private MenuItem lookAtItem;
60636298 private MenuItem lookFromItem;
60646299 private MenuItem switchViewItem;
6065
- private MenuItem cutItem;
6300
+ private JMenuItem cutItem;
60666301 private MenuItem undoItem;
60676302 private MenuItem redoItem;
60686303 private JMenuItem duplicateItem;
6069
- private MenuItem cloneItem;
6304
+ private JMenuItem cloneItem;
60706305 private MenuItem cloneSupportItem;
60716306 private MenuItem overwriteGeoItem;
60726307 private MenuItem overwriteMatItem;
....@@ -6087,13 +6322,13 @@
60876322 private MenuItem cloneGeometriesItem;
60886323 private MenuItem shareGeometriesItem;
60896324 private MenuItem mergeGeometriesItem;
6090
- private MenuItem copyItem;
6325
+ private JMenuItem copyItem;
60916326 private MenuItem pasteItem;
6092
- private MenuItem pasteIntoItem;
6093
- private MenuItem pasteLinkItem;
6094
- private MenuItem pasteCloneItem;
6095
- private MenuItem pasteExpandItem;
6096
- private MenuItem deleteItem;
6327
+ private JMenuItem pasteIntoItem;
6328
+ private JMenuItem pasteLinkItem;
6329
+ private JMenuItem pasteCloneItem;
6330
+ private JMenuItem pasteExpandItem;
6331
+ private JMenuItem deleteItem;
60976332 private MenuItem clearAllItem;
60986333 private MenuItem genUVItem;
60996334 private MenuItem genNormalsMESHItem;
....@@ -6148,7 +6383,7 @@
61486383 private MenuItem transformGeometryItem;
61496384 private MenuItem transformChildrenItem;
61506385 private MenuItem hideItem;
6151
- private MenuItem grabItem;
6386
+ private JMenuItem grabItem;
61526387 private MenuItem backItem;
61536388 private MenuItem frontItem;
61546389 private MenuItem cameraItem;
....@@ -6161,7 +6396,7 @@
61616396 private MenuItem switchTransfoItem;
61626397 private MenuItem morphItem;
61636398 private MenuItem linkerItem;
6164
- private MenuItem ungroupItem;
6399
+ private JMenuItem ungroupItem;
61656400 private MenuItem editItem;
61666401 private MenuItem openWindowItem;
61676402 private MenuItem editLeafItem;