Normand Briere
2019-08-22 0c7b833be7d86598a6813cd1c6db0ca9e1b17966
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,
....@@ -29,9 +29,9 @@
2929 {
3030 cButton skyboxButton;
3131 final String path = "cubemaps/" + f + "-skyboxes/" + s;
32
- row.add(skyboxButton = GetButton(path + "/preview.jpg", !Grafreed.NIMBUSLAF));
32
+ row.add(skyboxButton = GetButton(path + "/preview.jpg", !Globals.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, !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
+
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(JTabbedPane.LEFT);
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 {
....@@ -369,11 +415,15 @@
369415 this.copy = this.group = group;
370416 //selectees = this.group.selectees;
371417
372
- if (copy.versionlist == null)
373
- {
374
- copy.versionlist = new Object3D[100];
375
- copy.versionindex = -1;
376
- }
418
+ assert(false);
419
+
420
+// if (copy.versionlist == null)
421
+// {
422
+// copy.versionlist = new Object3D[100];
423
+// copy.versionindex = -1;
424
+//
425
+// //Save(true);
426
+// }
377427
378428 if(ui)
379429 SetupUI(objEditor);
....@@ -396,13 +446,13 @@
396446
397447 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
398448
399
- if (copy.versionlist == null)
400
- {
401
- copy.versionlist = new Object3D[100];
402
- copy.versionindex = -1;
403
-
404
- Save(true);
405
- }
449
+// if (copy.versionlist == null)
450
+// {
451
+// copy.versionlist = new Object3D[100];
452
+// copy.versionindex = -1;
453
+//
454
+// //Save(true);
455
+// }
406456 }
407457
408458 void CloneSelection(boolean supports)
....@@ -492,33 +542,35 @@
492542 // menu.add("-");
493543 duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
494544 duplicateItem.addActionListener(this);
495
- cloneItem = menu.add(new MenuItem("Clone"));
545
+
546
+ cloneItem = oe.jTree.popup.add(new JMenuItem("Clone"));
496547 cloneItem.addActionListener(this);
497
- if (Globals.ADVANCED)
548
+ //if (Globals.ADVANCED)
498549 {
499550 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
500551 cloneSupportItem.addActionListener(this);
501552 }
553
+ oe.jTree.popup.addSeparator();
502554 menu.add("-");
503
- cutItem = menu.add(new MenuItem("Cut"));
555
+ cutItem = oe.jTree.popup.add(new JMenuItem("Cut"));
504556 cutItem.addActionListener(this);
505
- copyItem = menu.add(new MenuItem("Copy"));
557
+ copyItem = oe.jTree.popup.add(new JMenuItem("Copy"));
506558 copyItem.addActionListener(this);
507559 pasteItem = menu.add(new MenuItem("Paste"));
508560 pasteItem.addActionListener(this);
509561
510
- menu.add("-");
511
- 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"));
512565 pasteIntoItem.addActionListener(this);
513
- pasteLinkItem = menu.add(new MenuItem("Paste link"));
566
+ pasteLinkItem = oe.jTree.popup.add(new JMenuItem("Paste link"));
514567 pasteLinkItem.addActionListener(this);
515
- pasteCloneItem = menu.add(new MenuItem("Paste clone"));
568
+ pasteCloneItem = oe.jTree.popup.add(new JMenuItem("Paste clone"));
516569 pasteCloneItem.addActionListener(this);
517
-// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
570
+// CRASH pasteExpandItem = oe.jTree.popup.add(new JMenuItem("Paste expand"));
518571 // pasteExpandItem.addActionListener(this);
519
- menu.add("-");
520
- deleteItem = menu.add(new MenuItem("Delete"));
521
- deleteItem.addActionListener(this);
572
+ //menu.add("-");
573
+ oe.jTree.popup.addSeparator();
522574
523575 if (Globals.ADVANCED)
524576 {
....@@ -604,11 +656,9 @@
604656 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
605657 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
606658 //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
607
- editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
608659 oe.cameraMenu.add("-");
609660 openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
610661 openWindowItem.addActionListener(this);
611
- editLeafItem.addActionListener(this);
612662 lookAtItem.addActionListener(this);
613663 //lookFromItem.addActinoListener(this);
614664 //switchViewItem.addActionListener(this);
....@@ -655,9 +705,8 @@
655705 setMasterItem.addActionListener(this);
656706 }
657707
658
- oe.menuBar.add(menu = new Menu("Group"));
659
-// grabItem = menu.add(new MenuItem("Grab"));
660
-// grabItem.addActionListener(this);
708
+ oe.menuBar.add(menu = new Menu("Order"));
709
+
661710 backItem = menu.add(new MenuItem("Back"));
662711 backItem.addActionListener(this);
663712 frontItem = menu.add(new MenuItem("Front"));
....@@ -665,13 +714,21 @@
665714 // compositeItem = menu.add(new MenuItem("Composite"));
666715 // compositeItem.addActionListener(this);
667716
717
+ grabItem = oe.jTree.popup.add(new JMenuItem("Group"));
718
+ grabItem.addActionListener(this);
719
+
668720 if (Globals.ADVANCED)
669721 {
670722 hideItem = menu.add(new MenuItem("Hidden Group"));
671723 hideItem.addActionListener(this);
672724 }
673
- ungroupItem = menu.add(new MenuItem("Ungroup"));
725
+ ungroupItem = oe.jTree.popup.add(new JMenuItem("Ungroup"));
674726 ungroupItem.addActionListener(this);
727
+
728
+ oe.jTree.popup.addSeparator();
729
+
730
+ deleteItem = oe.jTree.popup.add(new JMenuItem("Delete"));
731
+ deleteItem.addActionListener(this);
675732
676733 // menu.add("-");
677734 //
....@@ -778,6 +835,8 @@
778835 }
779836
780837 oe.menuBar.add(menu = new Menu("Attributes"));
838
+ clearVersionsItem = menu.add(new MenuItem("Clear Versions"));
839
+ clearVersionsItem.addActionListener(this);
781840 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
782841 clearMaterialsItem.addActionListener(this);
783842 resetAllItem = menu.add(new MenuItem("Reset All"));
....@@ -800,9 +859,9 @@
800859 hideleavesItem.addActionListener(this);
801860 showleavesItem = menu.add(new MenuItem("Show Leaves"));
802861 showleavesItem.addActionListener(this);
803
- markleavesItem = menu.add(new MenuItem("Mark Leaves"));
862
+ markleavesItem = menu.add(new MenuItem("Anim Leaves"));
804863 markleavesItem.addActionListener(this);
805
- unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
864
+ unmarkleavesItem = menu.add(new MenuItem("Unanim Leaves"));
806865 unmarkleavesItem.addActionListener(this);
807866 rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
808867 rewindleavesItem.addActionListener(this);
....@@ -856,6 +915,9 @@
856915 shareGeometriesItem.addActionListener(this);
857916 mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
858917 mergeGeometriesItem.addActionListener(this);
918
+ menu.add("-");
919
+ editLeafItem = menu.add(new MenuItem("Edit leaf..."));
920
+ editLeafItem.addActionListener(this);
859921 if (Globals.ADVANCED)
860922 {
861923 // Pretty much the same as duplicate and clone.
....@@ -872,6 +934,79 @@
872934 buildToolsMenu(menu);
873935 }
874936
937
+ JTabbedPane resourcecontainer;
938
+ cGridBag currenttab;
939
+ //boolean added; // patch for jar
940
+
941
+ int totalcount = 0;
942
+
943
+ int tabcount = 0;
944
+ int colcount = 0;
945
+ int rowcount = 0;
946
+ int texturecount = 0;
947
+
948
+ int columns = 5;
949
+ int rows = 7;
950
+
951
+ public void ResourceCallBack(String[] path)
952
+ {
953
+// for (int i = 0; i < path.length; i++)
954
+// System.out.print(path[i] + "/");
955
+// System.out.println();
956
+
957
+ if (//rowcount == 0 ||
958
+ path.length == 1 && !path[0].equals("") && !path[0].equals(".DS_Store"))
959
+ {
960
+ currenttab = new cGridBag();
961
+ String tabname = path[0]; // String.valueOf((char)('A'+tabcount));
962
+ currenttab.setName(tabname);
963
+ //added = false;
964
+ resourcecontainer.add(currenttab);
965
+ resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname);
966
+ rowcount = 1;
967
+ colcount = 0;
968
+ texturecount = 0;
969
+ }
970
+
971
+ if (path.length > 2 && (path[2].toLowerCase().endsWith(".jpg") || path[2].toLowerCase().endsWith(".png")))
972
+ {
973
+ //if (!added)
974
+ {
975
+ //added = true;
976
+ String tabname = path[0]; // String.valueOf((char)('A'+tabcount));
977
+ currenttab = (cGridBag)resourcecontainer.getComponentAt(resourcecontainer.indexOfTab(tabname));
978
+ }
979
+
980
+ AddTextureButton(path[0], path[1], path[2], ++texturecount, currenttab);
981
+ totalcount++;
982
+
983
+ if (++colcount >= columns)
984
+ {
985
+ colcount = 0;
986
+ currenttab.Return();
987
+
988
+ if (rowcount++ >= rows)
989
+ {
990
+ rowcount = 0;
991
+ }
992
+ }
993
+ }
994
+ else
995
+ {
996
+// if (!path[path.length-1].equals("icons"))
997
+// resourcecontainer.Return();
998
+ }
999
+ }
1000
+
1001
+ void CreateTexturePanel(cGridBag container)
1002
+ {
1003
+ resourcecontainer = new JTabbedPane(JTabbedPane.LEFT);
1004
+ container.add(resourcecontainer);
1005
+
1006
+ Grafreed.ParseResources("textures", this);
1007
+
1008
+ // 935. System.out.println("Total = " + totalcount);
1009
+ }
8751010
8761011 void SetupUI2(ObjEditor oe)
8771012 {
....@@ -890,11 +1025,6 @@
8901025 //new Exception().printStackTrace();
8911026
8921027 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;
8981028 // oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
8991029
9001030 oe.buttonGroup = new ButtonGroup();
....@@ -915,9 +1045,9 @@
9151045 oe.radioPanel.add(dummyButton);
9161046 oe.buttonGroup.add(dummyButton);
9171047 */
918
- cGridBag copyOptionsPanel = new cGridBag();
1048
+ cGridBag versionManagerPanel = new cGridBag();
9191049
920
- copyOptionsPanel.preferredHeight = 2;
1050
+ versionManagerPanel.preferredHeight = 4;
9211051
9221052 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
9231053
....@@ -927,62 +1057,102 @@
9271057
9281058 if (Globals.ADVANCED)
9291059 {
930
- oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
931
- maxButton.setToolTipText("Maximize window");
932
- maxButton.addActionListener(this);
1060
+// oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1061
+// maxButton.setToolTipText("Maximize window");
1062
+// maxButton.addActionListener(this);
9331063 }
9341064
935
- oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1065
+ cButton gcButton;
1066
+
1067
+// oe.toolbarPanel.add(gcButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1068
+// gcButton.setToolTipText("Garbage collect");
1069
+// gcButton.addActionListener(new ActionListener()
1070
+// {
1071
+// public void actionPerformed(ActionEvent e)
1072
+// {
1073
+// System.gc();
1074
+// }
1075
+// });
1076
+
1077
+ oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1078
+ collapseButton.setToolTipText("Collapse toolbar");
1079
+ collapseButton.addActionListener(this);
1080
+
1081
+ oe.toolbarPanel.add(maximize3DButton = GetButton("icons/square.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1082
+ maximize3DButton.setToolTipText("Maximize 3D view");
1083
+ maximize3DButton.addActionListener(this);
1084
+
1085
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1086
+ twoButton.setToolTipText("Show 3D view only");
1087
+ twoButton.addActionListener(this);
1088
+ this.fullscreenLayout = twoButton;
1089
+
1090
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1091
+ threeButton.setToolTipText("Show controls and 3D view");
1092
+ threeButton.addActionListener(this);
1093
+ if (Globals.ADVANCED)
1094
+ {
1095
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1096
+ sixButton.setToolTipText("Show 3D view and controls");
1097
+ sixButton.addActionListener(this);
1098
+ }
1099
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1100
+// sevenButton.setToolTipText("3-column layout");
1101
+// sevenButton.addActionListener(this);
1102
+ //
1103
+
1104
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
9361105 fullButton.setToolTipText("Full-screen window");
9371106 fullButton.addActionListener(this);
9381107
939
- oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1108
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
9401109 screenfitButton.setToolTipText("Screen fit");
9411110 screenfitButton.addActionListener(this);
9421111
943
- oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1112
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
9441113 restoreCameraButton.setToolTipText("Restore viewpoint");
9451114 restoreCameraButton.addActionListener(this);
9461115
947
- copyOptionsPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1116
+ versionManagerPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
9481117 saveVersionButton.setToolTipText("Duplicate current version");
9491118 saveVersionButton.addActionListener(this);
9501119
951
- copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1120
+ versionManagerPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
9521121 deleteVersionButton.setToolTipText("Delete current version");
9531122 deleteVersionButton.addActionListener(this);
1123
+ deleteVersionButton.setEnabled(false);
9541124
955
- copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1125
+ versionManagerPanel.add(previousVersionButton = GetButton("icons/undo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
9561126 previousVersionButton.setToolTipText("Previous version");
9571127 previousVersionButton.addActionListener(this);
9581128 previousVersionButton.setEnabled(false);
9591129
9601130 cGridBag updown = new cGridBag().setVertical(true);
961
- updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1131
+ updown.add(restoreButton = GetButton("icons/restore.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
9621132 restoreButton.setToolTipText("Undo (restore current version)");
9631133 restoreButton.addActionListener(this);
964
- //restoreButton.setEnabled(false);
1134
+ restoreButton.setEnabled(false);
9651135
966
- updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1136
+ updown.add(replaceButton = GetButton("icons/replace.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
9671137 replaceButton.setToolTipText("Save (replace current version)");
9681138 replaceButton.addActionListener(this);
969
- //replaceButton.setEnabled(false);
1139
+ replaceButton.setEnabled(false);
9701140
971
- copyOptionsPanel.add(updown);
1141
+ versionManagerPanel.add(updown);
9721142
973
- copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1143
+ versionManagerPanel.add(nextVersionButton = GetButton("icons/redo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
9741144 nextVersionButton.setToolTipText("Next version");
9751145 nextVersionButton.addActionListener(this);
9761146 nextVersionButton.setEnabled(false);
1147
+
1148
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1149
+ oneStepButton.setToolTipText("Animate one step forward");
1150
+ oneStepButton.addActionListener(this);
9771151
9781152 oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
9791153 liveCB.setToolTipText("Enable animation");
9801154 liveCB.addItemListener(this);
9811155
982
- oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
983
- oneStepButton.setToolTipText("Animate one step forward");
984
- oneStepButton.addActionListener(this);
985
-
9861156 oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
9871157 fastCB.setToolTipText("Fast mode");
9881158 fastCB.addItemListener(this);
....@@ -998,38 +1168,23 @@
9981168
9991169 if (Globals.ADVANCED)
10001170 {
1001
- oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1171
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10021172 snapobjectButton.addActionListener(this);
10031173 snapobjectButton.setToolTipText("Snap Object");
10041174
1005
- oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1175
+ oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10061176 fourButton.addActionListener(this);
10071177 fourButton.setToolTipText("Show control panel only");
10081178 }
10091179
10101180 //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
10111181
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
- //
10271182
1028
- oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1183
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10291184 rootButton.setToolTipText("Open selection in new tab");
10301185 rootButton.addActionListener(this);
10311186
1032
- oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1187
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10331188 closeButton.setToolTipText("Close tab");
10341189 closeButton.addActionListener(this);
10351190 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
....@@ -1038,38 +1193,38 @@
10381193 cGridBag row1 = new cGridBag();
10391194
10401195 // INSERT
1041
- row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1042
- gridButton.setToolTipText("Create grid");
1196
+ row1.add(gridButton = GetButton("icons/grid.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1197
+ gridButton.setToolTipText("Create ground");
10431198 gridButton.addActionListener(this);
10441199
1045
- row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1200
+ row1.add(boxButton = GetButton("icons/box.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10461201 boxButton.setToolTipText("Create box");
10471202 boxButton.addActionListener(this);
10481203
1049
- row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1050
- sphereButton.setToolTipText("Create sphere");
1051
- sphereButton.addActionListener(this);
1052
-
1053
- row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1054
- coneButton.setToolTipText("Create cone");
1055
- coneButton.addActionListener(this);
1056
-
1057
- row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1058
- torusButton.setToolTipText("Create torus");
1059
- torusButton.addActionListener(this);
1060
-
1061
- row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1204
+ row1.add(superButton = GetButton("icons/super.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10621205 superButton.setToolTipText("Create superellipsoid");
10631206 superButton.addActionListener(this);
10641207
1208
+ row1.add(sphereButton = GetButton("icons/sphere.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1209
+ sphereButton.setToolTipText("Create sphere");
1210
+ sphereButton.addActionListener(this);
1211
+
1212
+ row1.add(coneButton = GetButton("icons/cone.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1213
+ coneButton.setToolTipText("Create cone");
1214
+ coneButton.addActionListener(this);
1215
+
1216
+ row1.add(torusButton = GetButton("icons/torus.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1217
+ torusButton.setToolTipText("Create torus");
1218
+ torusButton.addActionListener(this);
1219
+
10651220 if (Globals.ADVANCED)
10661221 {
1067
- oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1222
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10681223 kleinButton.setToolTipText("Create Klein bottle");
10691224 kleinButton.addActionListener(this);
10701225 }
10711226
1072
- row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1227
+ row1.add(particlesButton = GetButton("icons/particles.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10731228 particlesButton.setToolTipText("Create particle system");
10741229 particlesButton.addActionListener(this);
10751230
....@@ -1077,72 +1232,73 @@
10771232
10781233 cGridBag row2 = new cGridBag();
10791234
1080
- row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1235
+ row2.add(groupButton = GetButton("icons/group.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10811236 groupButton.setToolTipText("Create group");
10821237 groupButton.addActionListener(this);
10831238
1084
- row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1239
+ row2.add(compositeButton = GetButton("icons/composite.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10851240 compositeButton.setToolTipText("Create composite");
10861241 compositeButton.addActionListener(this);
10871242
1088
- row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1243
+ row2.add(switchButton = GetButton("icons/switch.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10891244 switchButton.setToolTipText("Create item switcher");
10901245 switchButton.addActionListener(this);
10911246
1092
- row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1247
+ row2.add(loopButton = GetButton("icons/loop.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10931248 loopButton.setToolTipText("Create loop");
10941249 loopButton.addActionListener(this);
10951250
1096
- row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1251
+ row2.add(textureButton = GetButton("icons/texture.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10971252 textureButton.setToolTipText("Create texture");
10981253 textureButton.addActionListener(this);
10991254
1100
- row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1255
+ row2.add(overlayButton = GetButton("icons/overlay.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11011256 overlayButton.setToolTipText("Create overlay");
11021257 overlayButton.addActionListener(this);
11031258
1104
- row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1259
+ row2.add(lightButton = GetButton("icons/light-bulb.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11051260 lightButton.setToolTipText("Create light");
11061261 lightButton.addActionListener(this);
11071262
11081263 oe.toolboxPanel.add(row2);
11091264
1110
- // ENVYMAPS
1111
- cGridBag skyboxpane = new cGridBag();
1112
- skyboxpane.preferredHeight = 100;
1265
+ cGridBag textures = new cGridBag();
11131266
1114
- oe.skyboxPanel.add(skyboxpane);
1267
+ CreateTexturePanel(textures);
11151268
1116
- JTabbedPane skyboxpanel = new JTabbedPane();
1117
- skyboxpane.add(skyboxpanel);
1269
+ int tabCount = resourcecontainer.getTabCount();
11181270
1119
- AddSkyboxTab0(skyboxpanel);
1120
- AddSkyboxTab1(skyboxpanel);
1121
- AddSkyboxTab2(skyboxpanel);
1122
- AddSkyboxTab3(skyboxpanel);
1271
+ if (tabCount > 0)
1272
+ resourcecontainer.setSelectedIndex((int)(Math.random() * tabCount));
1273
+
1274
+ oe.toolboxPanel.add(textures);
1275
+
1276
+ textures.preferredHeight = 100;
1277
+
1278
+ CreateSkyboxPanel(oe.skyboxPanel);
11231279
11241280 // EDIT panel
1125
- editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1281
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11261282 editButton.setToolTipText("Pin selection controls");
11271283 editButton.addActionListener(this);
11281284
1129
- editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1285
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11301286 uneditButton.setToolTipText("Unpin and remove selection controls");
11311287 uneditButton.addActionListener(this);
11321288
11331289 editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
1134
- allParamsButton.setToolTipText("Show all controle");
1290
+ allParamsButton.setToolTipText("Show all controls");
11351291 allParamsButton.addActionListener(this);
11361292
1137
- editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1138
- clearPanelButton.setToolTipText("Clear edit panel");
1293
+ editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1294
+ clearPanelButton.setToolTipText("Clear all controls");
11391295 clearPanelButton.addActionListener(this);
11401296
11411297 //editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
11421298 //unselectButton.setToolTipText("Unselect");
11431299 //unselectButton.addActionListener(this);
11441300
1145
- editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1301
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11461302 flashSelectionButton.setToolTipText("Highlight selection");
11471303 flashSelectionButton.addActionListener(this);
11481304
....@@ -1165,6 +1321,8 @@
11651321
11661322 cGridBag jSPPanel = new cGridBag();
11671323
1324
+ jSPPanel.preferredHeight = 20;
1325
+
11681326 JScrollPane jSP;
11691327 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
11701328 jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
....@@ -1173,11 +1331,11 @@
11731331 oe.treePanel.add(jSPPanel);
11741332 oe.treePanel.Return();
11751333
1176
- oe.treePanel.add(copyOptionsPanel);
1334
+ oe.treePanel.add(versionManagerPanel);
11771335 oe.treePanel.Return();
1178
- cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1179
- versionSlider = (cNumberSlider)sliderPane.getComponent(1);
1180
- sliderPane.preferredHeight = 1;
1336
+ versionSliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1337
+ versionSlider = (cNumberSlider)versionSliderPane.getComponent(1);
1338
+ versionSliderPane.preferredHeight = 3;
11811339
11821340 // mainPanel.setDividerLocation(0.1); //1.0);
11831341 mainPanel.setResizeWeight(0.4);
....@@ -1335,6 +1493,14 @@
13351493
13361494 void EditObject(Object3D obj)
13371495 {
1496
+ assert(obj instanceof Composite);
1497
+
1498
+// if (obj.versionlist == null)
1499
+// {
1500
+// obj.versionlist = new Object3D[100];
1501
+// obj.versionindex = -1;
1502
+// }
1503
+
13381504 cRadio radioButton = new cRadio(obj.name);
13391505
13401506 // June 2019. Patch to avoid bug with transparency.
....@@ -1359,6 +1525,7 @@
13591525
13601526 oe.SetupViews();
13611527
1528
+ if (Globals.DEBUG)
13621529 System.out.println("SetupViews");
13631530 DragSource.getDefaultDragSource().createDefaultDragGestureRecognizer(
13641531 oe.cameraView, DnDConstants.ACTION_COPY_OR_MOVE, this); // ACTION_LINK ??
....@@ -1725,7 +1892,12 @@
17251892 TreePath path;
17261893
17271894 public TransferableTreePath(TreePath tp) {
1728
- path = tp;
1895
+ Object[] objs = new Object[tp.getPathCount()];
1896
+ for (int i=0; i<objs.length; i++)
1897
+ {
1898
+ objs[i] = ((Object3D)tp.getPathComponent(i)).GetUUID();
1899
+ }
1900
+ path = new TreePath(objs);
17291901 }
17301902
17311903 public synchronized DataFlavor[] getTransferDataFlavors() {
....@@ -2015,7 +2187,11 @@
20152187 shadow.material = new cMaterial(obj.material);
20162188 shadow.material.diffuse = 0.0001f;
20172189 shadow.material.specular = 0.0001f;
2018
- //shadow.projectedVertices[1].x = 300;
2190
+ shadow.material.opacity = 0.75f;
2191
+
2192
+ AllocProjectedVertices(shadow);
2193
+
2194
+ shadow.projectedVertices[1].x = 300;
20192195
20202196 makeSomething(shadow);
20212197 }
....@@ -2536,27 +2712,35 @@
25362712 } else
25372713 if (source == loopItem || source == loopButton)
25382714 {
2715
+ if (!group.selection.isEmpty())
2716
+ {
25392717 Composite csg = new GroupLeaf();
25402718 csg.count = 5;
2541
- group(csg);
25422719 Composite child = new cGroup("Branch");
25432720 csg.addChild(child);
25442721 child.addChild(csg);
2722
+ group(csg);
2723
+ }
25452724 } else
25462725 if (source == doubleItem)
25472726 {
2727
+ if (!group.selection.isEmpty())
2728
+ {
25482729 Composite csg = new GroupLeaf("Fork");
25492730 csg.count = 5;
2550
- group(csg);
25512731 Composite child = new cGroup("Branch A");
25522732 csg.addChild(child);
25532733 child.addChild(csg);
25542734 child = new cGroup("Branch B");
25552735 csg.addChild(child);
25562736 child.addChild(csg);
2737
+ group(csg);
2738
+ }
25572739 } else
25582740 if (source == tripleItem)
25592741 {
2742
+ if (!group.selection.isEmpty())
2743
+ {
25602744 Composite csg = new GroupLeaf("Trident");
25612745 csg.count = 4;
25622746 group(csg);
....@@ -2569,6 +2753,7 @@
25692753 child = new cGroup();
25702754 csg.addChild(child);
25712755 child.addChild(csg);
2756
+ }
25722757 } else
25732758 if (source == computeAOItem)
25742759 {
....@@ -2618,6 +2803,18 @@
26182803 if (source == fullButton)
26192804 {
26202805 ToggleFullScreen();
2806
+ } else
2807
+ if (source == collapseButton)
2808
+ {
2809
+ this.expandedLayout = radio.layout;
2810
+ CollapseToolbar();
2811
+ } else
2812
+ if (source == maximize3DButton)
2813
+ {
2814
+ this.expandedLayout = radio.layout;
2815
+ radio.layout = twoButton;
2816
+ Show3DView();
2817
+ CollapseToolbar();
26212818 } else
26222819 if (source == previousVersionButton)
26232820 {
....@@ -3192,22 +3389,34 @@
31923389 } else
31933390 if (source == ungroupItem || source == ungroupButton)
31943391 {
3195
- boolean hasRoot = false;
3392
+ boolean canUngroup = true;
31963393
31973394 for (int i=0; i<group.selection.size(); i++)
31983395 {
3199
- if (group.selection.get(i) == group)
3396
+ Object3D selectedItem = group.selection.get(i);
3397
+
3398
+ if (selectedItem.Size() == 0)
32003399 {
3201
- hasRoot = true;
3400
+ // Cannot ungroup leaves
3401
+ canUngroup = false;
3402
+ break;
3403
+ }
3404
+
3405
+ if (selectedItem == group)
3406
+ {
3407
+ // Cannot ungroup root
3408
+ canUngroup = false;
32023409 break;
32033410 }
32043411 }
32053412
3206
- if (!hasRoot)
3413
+ if (canUngroup)
32073414 {
32083415 for (int i=0; i<group.selection.size(); i++)
32093416 {
3210
- Ungroup(group.selection.get(i));
3417
+ Object3D selectedItem = group.selection.get(i);
3418
+
3419
+ Ungroup(selectedItem);
32113420 }
32123421
32133422 ClearSelection(false);
....@@ -3258,6 +3467,10 @@
32583467 if (source == clearMaterialsItem)
32593468 {
32603469 ClearMaterials();
3470
+ } else
3471
+ if (source == clearVersionsItem)
3472
+ {
3473
+ ClearVersions();
32613474 } else
32623475 if (source == liveleavesItem)
32633476 {
....@@ -3570,38 +3783,7 @@
35703783 if (CameraPane.FULLSCREEN)
35713784 fullscreenLayout = radio.layout;
35723785
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();
3786
+ Show3DView();
36053787
36063788 cameraView.requestFocusInWindow();
36073789
....@@ -3787,6 +3969,7 @@
37873969 } else
37883970 if (source == rootButton)
37893971 {
3972
+ Replace();
37903973 Object3D obj;
37913974 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
37923975 {
....@@ -3801,6 +3984,8 @@
38013984 if (source == closeButton)
38023985 {
38033986 //System.out.println("CLOSE: " + buttonGroup.getSelection());
3987
+ Replace();
3988
+
38043989 cRadio ab;
38053990 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
38063991 {
....@@ -3899,6 +4084,8 @@
38994084 } else
39004085 if(source instanceof cRadio)
39014086 {
4087
+ Replace();
4088
+
39024089 group.parent = keepparent;
39034090 group.attributes = 0;
39044091 //group.editWindow = null;
....@@ -3923,8 +4110,6 @@
39234110
39244111 copy = group;
39254112
3926
- SetUndoStates();
3927
-
39284113 //Globals.theRenderer.object = group;
39294114 if(!useclient)
39304115 {
....@@ -3952,6 +4137,31 @@
39524137 */
39534138 radio.layout.doClick();
39544139
4140
+ assert(copy instanceof Composite);
4141
+
4142
+ if (copy.versionlist == null)
4143
+ {
4144
+ copy.versionindex = -1;
4145
+
4146
+ // Cannot work with loops
4147
+ // To fix this issue, we first mark all nodes above the root,
4148
+ // and check if any of these nodes are reachable below the root.
4149
+ Grafreed.grafreed.universe.TagObjects(copy, true);
4150
+
4151
+ if (copy.versionlist == null && !copy.HasTags())
4152
+ {
4153
+ copy.versionlist = new Object3D[100];
4154
+
4155
+ //Save(true);
4156
+ }
4157
+ else
4158
+ copy.versionindex = -2;
4159
+
4160
+ Grafreed.grafreed.universe.TagObjects(copy, false);
4161
+ }
4162
+
4163
+ SetVersionStates();
4164
+
39554165 ClearUnpinned();
39564166
39574167 //Grafreed.Assert(group != null);
....@@ -4095,7 +4305,7 @@
40954305 TouchTransform(obj);
40964306 continue;
40974307 }
4098
- if ((mask&2) != 0) // Scale
4308
+ if ((mask&2) != 0) // Scale/rotation
40994309 {
41004310 obj.toParent[0][0] = obj.toParent[1][1] = obj.toParent[2][2] = 1;
41014311 obj.toParent[0][1] = obj.toParent[1][0] = obj.toParent[2][0] = 0;
....@@ -4103,10 +4313,6 @@
41034313 obj.fromParent[0][0] = obj.fromParent[1][1] = obj.fromParent[2][2] = 1;
41044314 obj.fromParent[0][1] = obj.fromParent[1][0] = obj.fromParent[2][0] = 0;
41054315 obj.fromParent[0][2] = obj.fromParent[1][2] = obj.fromParent[2][1] = 0;
4106
- }
4107
- if ((mask&4) != 0) // Rotation
4108
- {
4109
- // ?
41104316 }
41114317 if ((mask&1) != 0) // Translation
41124318 {
....@@ -4915,6 +5121,12 @@
49155121 refreshContents();
49165122 }
49175123
5124
+ void ClearVersions()
5125
+ {
5126
+ group.selection.ClearVersions();
5127
+ refreshContents();
5128
+ }
5129
+
49185130 void FlipV(boolean flip)
49195131 {
49205132 group.selection.FlipV(flip);
....@@ -5186,10 +5398,26 @@
51865398 flashSelectionButton.setEnabled(enabled);
51875399
51885400 clearPanelButton.setEnabled(!listUI.isEmpty());
5401
+
5402
+ boolean allComposites = true;
5403
+
5404
+ if (group.selection != null)
5405
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
5406
+ {
5407
+ Object next = e.nextElement();
5408
+ if (!(next instanceof Composite)) // || (next instanceof GroupLeaf))
5409
+ {
5410
+ allComposites = false;
5411
+ break;
5412
+ }
5413
+ }
5414
+
5415
+ rootButton.setEnabled(allComposites);
51895416 }
51905417
51915418 void refreshContents(boolean cp)
51925419 {
5420
+ if (Globals.ADVANCED)
51935421 //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
51945422 if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
51955423 {
....@@ -5200,7 +5428,7 @@
52005428 Object3D child = (Object3D) group.selection.get(i);
52015429
52025430 objEditor.AddInfo(child, this, true);
5203
- System.err.println("info : " + child.GetPath());
5431
+// System.err.println("info : " + child.GetPath());
52045432 }
52055433
52065434 objEditor.SetText(); // jan 2014
....@@ -6083,11 +6311,11 @@
60836311 private MenuItem lookAtItem;
60846312 private MenuItem lookFromItem;
60856313 private MenuItem switchViewItem;
6086
- private MenuItem cutItem;
6314
+ private JMenuItem cutItem;
60876315 private MenuItem undoItem;
60886316 private MenuItem redoItem;
60896317 private JMenuItem duplicateItem;
6090
- private MenuItem cloneItem;
6318
+ private JMenuItem cloneItem;
60916319 private MenuItem cloneSupportItem;
60926320 private MenuItem overwriteGeoItem;
60936321 private MenuItem overwriteMatItem;
....@@ -6108,13 +6336,13 @@
61086336 private MenuItem cloneGeometriesItem;
61096337 private MenuItem shareGeometriesItem;
61106338 private MenuItem mergeGeometriesItem;
6111
- private MenuItem copyItem;
6339
+ private JMenuItem copyItem;
61126340 private MenuItem pasteItem;
6113
- private MenuItem pasteIntoItem;
6114
- private MenuItem pasteLinkItem;
6115
- private MenuItem pasteCloneItem;
6116
- private MenuItem pasteExpandItem;
6117
- private MenuItem deleteItem;
6341
+ private JMenuItem pasteIntoItem;
6342
+ private JMenuItem pasteLinkItem;
6343
+ private JMenuItem pasteCloneItem;
6344
+ private JMenuItem pasteExpandItem;
6345
+ private JMenuItem deleteItem;
61186346 private MenuItem clearAllItem;
61196347 private MenuItem genUVItem;
61206348 private MenuItem genNormalsMESHItem;
....@@ -6140,6 +6368,7 @@
61406368 private MenuItem clipMeshItem;
61416369 private MenuItem smoothMeshItem;
61426370 private MenuItem clearMaterialsItem;
6371
+ private MenuItem clearVersionsItem;
61436372
61446373 private MenuItem liveleavesItem;
61456374 private MenuItem unliveleavesItem;
....@@ -6169,7 +6398,7 @@
61696398 private MenuItem transformGeometryItem;
61706399 private MenuItem transformChildrenItem;
61716400 private MenuItem hideItem;
6172
- private MenuItem grabItem;
6401
+ private JMenuItem grabItem;
61736402 private MenuItem backItem;
61746403 private MenuItem frontItem;
61756404 private MenuItem cameraItem;
....@@ -6182,7 +6411,7 @@
61826411 private MenuItem switchTransfoItem;
61836412 private MenuItem morphItem;
61846413 private MenuItem linkerItem;
6185
- private MenuItem ungroupItem;
6414
+ private JMenuItem ungroupItem;
61866415 private MenuItem editItem;
61876416 private MenuItem openWindowItem;
61886417 private MenuItem editLeafItem;