Normand Briere
2019-08-12 b1d79b74514041a059b454a9f6fc3970773c0cb8
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,
....@@ -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, !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
+
4461 public void AddSkyboxTab0(JTabbedPane skyboxpanel)
4562 {
4663 cGridBag tab0 = new cGridBag().setVertical(true);
....@@ -311,14 +328,47 @@
311328 }
312329 }
313330
314
- public void ChangeSkybox(String name)
331
+ public void ChangeSkybox(String skybox)
315332 {
316333 //cameraView.envyoff = false;
317
- group.skyboxname = name;
334
+ group.skyboxname = skybox;
318335 group.skyboxext = "jpg";
319336 cameraView.repaint();
320337 }
338
+
339
+ public void CreateSkyboxPanel(cGridBag skyboxPanel)
340
+ {
341
+ JTabbedPane skyboxpane = new JTabbedPane();
342
+
343
+ AddSkyboxTab0(skyboxpane);
344
+ AddSkyboxTab1(skyboxpane);
345
+ AddSkyboxTab2(skyboxpane);
346
+ AddSkyboxTab3(skyboxpane);
347
+
348
+ skyboxPanel.add(skyboxpane);
349
+ }
321350
351
+ public void ChangeTexture(String texture)
352
+ {
353
+ for (int i=0; i<group.selection.size(); i++)
354
+ {
355
+ Object3D obj = group.selection.get(i);
356
+ obj.SetPigmentTexture("@" + texture);
357
+ }
358
+
359
+ refreshContents();
360
+ }
361
+
362
+ public void Show3DView()
363
+ {
364
+ // bug
365
+ //gridPanel.setDividerLocation(1.0);
366
+ //bigPanel.setDividerLocation(0.0);
367
+ bigThree.ClearUI();
368
+ bigThree.add(centralPanel);
369
+ bigThree.FlushUI();
370
+ }
371
+
322372 //ObjEditor objEditor;
323373 public void closeUI2()
324374 {
....@@ -356,9 +406,9 @@
356406 this.copy = this.group = group;
357407 //selectees = this.group.selectees;
358408
359
- if (copy.versions == null)
409
+ if (copy.versionlist == null)
360410 {
361
- copy.versions = new byte[100][];
411
+ copy.versionlist = new Object3D[100];
362412 copy.versionindex = -1;
363413 }
364414
....@@ -383,9 +433,9 @@
383433
384434 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
385435
386
- if (copy.versions == null)
436
+ if (copy.versionlist == null)
387437 {
388
- copy.versions = new byte[100][];
438
+ copy.versionlist = new Object3D[100];
389439 copy.versionindex = -1;
390440
391441 Save(true);
....@@ -859,6 +909,73 @@
859909 buildToolsMenu(menu);
860910 }
861911
912
+ JTabbedPane resourcecontainer;
913
+ cGridBag currenttab;
914
+ boolean added; // patch for jar
915
+
916
+ int tabcount = 0;
917
+ int colcount = 0;
918
+ int rowcount = 0;
919
+ int texturecount = 0;
920
+
921
+ int columns = 5;
922
+ int rows = 7;
923
+
924
+ public void ResourceCallBack(String[] path)
925
+ {
926
+// for (int i = 0; i < path.length; i++)
927
+// System.out.print(path[i] + "/");
928
+// System.out.println();
929
+
930
+ if (//rowcount == 0 ||
931
+ path.length == 1)
932
+ {
933
+ currenttab = new cGridBag();
934
+ added = false;
935
+ String tabname = path[0]; // String.valueOf((char)('A'+tabcount));
936
+ currenttab.setName(tabname);
937
+ rowcount = 1;
938
+ colcount = 0;
939
+ texturecount = 0;
940
+ }
941
+
942
+ if (path.length > 2 && path[2].toLowerCase().endsWith(".jpg"))
943
+ {
944
+ if (!added)
945
+ {
946
+ added = true;
947
+ resourcecontainer.add(currenttab);
948
+ String tabname = path[0]; // String.valueOf((char)('A'+tabcount));
949
+ resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname);
950
+ }
951
+
952
+ AddTextureButton(path[0], path[1], path[2], texturecount++, currenttab);
953
+
954
+ if (++colcount >= columns)
955
+ {
956
+ colcount = 0;
957
+ currenttab.Return();
958
+
959
+ if (rowcount++ >= rows)
960
+ {
961
+ rowcount = 0;
962
+ }
963
+ }
964
+ }
965
+ else
966
+ {
967
+// if (!path[path.length-1].equals("icons"))
968
+// resourcecontainer.Return();
969
+ }
970
+ }
971
+
972
+ void CreateTexturePanel(cGridBag container)
973
+ {
974
+ resourcecontainer = new JTabbedPane(JTabbedPane.LEFT);
975
+ container.add(resourcecontainer);
976
+
977
+ Grafreed.ParseResources("textures", this);
978
+ }
862979
863980 void SetupUI2(ObjEditor oe)
864981 {
....@@ -877,11 +994,6 @@
877994 //new Exception().printStackTrace();
878995
879996 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;
885997 // oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
886998
887999 oe.buttonGroup = new ButtonGroup();
....@@ -919,6 +1031,45 @@
9191031 maxButton.addActionListener(this);
9201032 }
9211033
1034
+ cButton gcButton;
1035
+
1036
+ oe.toolbarPanel.add(gcButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1037
+ gcButton.setToolTipText("Garbage collect");
1038
+ gcButton.addActionListener(new ActionListener()
1039
+ {
1040
+ public void actionPerformed(ActionEvent e)
1041
+ {
1042
+ System.gc();
1043
+ }
1044
+ });
1045
+
1046
+ oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1047
+ collapseButton.setToolTipText("Collapse toolbar");
1048
+ collapseButton.addActionListener(this);
1049
+
1050
+ oe.toolbarPanel.add(maximize3DButton = GetButton("", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1051
+ maximize3DButton.setToolTipText("Maximize 3D view");
1052
+ maximize3DButton.addActionListener(this);
1053
+
1054
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1055
+ twoButton.setToolTipText("Show 3D view only");
1056
+ twoButton.addActionListener(this);
1057
+ this.fullscreenLayout = twoButton;
1058
+
1059
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1060
+ threeButton.setToolTipText("Show controls and 3D view");
1061
+ threeButton.addActionListener(this);
1062
+ if (Globals.ADVANCED)
1063
+ {
1064
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1065
+ sixButton.setToolTipText("Show 3D view and controls");
1066
+ sixButton.addActionListener(this);
1067
+ }
1068
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1069
+// sevenButton.setToolTipText("3-column layout");
1070
+// sevenButton.addActionListener(this);
1071
+ //
1072
+
9221073 oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
9231074 fullButton.setToolTipText("Full-screen window");
9241075 fullButton.addActionListener(this);
....@@ -931,41 +1082,45 @@
9311082 restoreCameraButton.setToolTipText("Restore viewpoint");
9321083 restoreCameraButton.addActionListener(this);
9331084
934
- copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
935
- saveButton.setToolTipText("New version");
936
- saveButton.addActionListener(this);
1085
+ copyOptionsPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1086
+ saveVersionButton.setToolTipText("Duplicate current version");
1087
+ saveVersionButton.addActionListener(this);
9371088
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);
1089
+ copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1090
+ deleteVersionButton.setToolTipText("Delete current version");
1091
+ deleteVersionButton.addActionListener(this);
1092
+
1093
+ copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1094
+ previousVersionButton.setToolTipText("Previous version");
1095
+ previousVersionButton.addActionListener(this);
1096
+ previousVersionButton.setEnabled(false);
9421097
9431098 cGridBag updown = new cGridBag().setVertical(true);
9441099 updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
945
- restoreButton.setToolTipText("Restore current");
1100
+ restoreButton.setToolTipText("Undo (restore current version)");
9461101 restoreButton.addActionListener(this);
947
- restoreButton.setEnabled(false);
1102
+ //restoreButton.setEnabled(false);
9481103
9491104 updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
950
- replaceButton.setToolTipText("Replace current");
1105
+ replaceButton.setToolTipText("Save (replace current version)");
9511106 replaceButton.addActionListener(this);
952
- replaceButton.setEnabled(false);
1107
+ //replaceButton.setEnabled(false);
9531108
9541109 copyOptionsPanel.add(updown);
9551110
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);
1111
+ copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1112
+ nextVersionButton.setToolTipText("Next version");
1113
+ nextVersionButton.addActionListener(this);
1114
+ nextVersionButton.setEnabled(false);
1115
+
1116
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1117
+ oneStepButton.setToolTipText("Animate one step forward");
1118
+ oneStepButton.addActionListener(this);
9601119
9611120 oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
9621121 liveCB.setToolTipText("Enable animation");
9631122 liveCB.addItemListener(this);
9641123
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
-
9691124 oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
9701125 fastCB.setToolTipText("Fast mode");
9711126 fastCB.addItemListener(this);
....@@ -992,21 +1147,6 @@
9921147
9931148 //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
9941149
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
- //
10101150
10111151 oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
10121152 rootButton.setToolTipText("Open selection in new tab");
....@@ -1090,19 +1230,15 @@
10901230
10911231 oe.toolboxPanel.add(row2);
10921232
1093
- // ENVYMAPS
1094
- cGridBag skyboxpane = new cGridBag();
1095
- skyboxpane.preferredHeight = 100;
1233
+ cGridBag textures = new cGridBag();
10961234
1097
- oe.toolboxPanel.add(skyboxpane);
1235
+ CreateTexturePanel(textures);
10981236
1099
- JTabbedPane skyboxpanel = new JTabbedPane();
1100
- skyboxpane.add(skyboxpanel);
1237
+ oe.toolboxPanel.add(textures);
11011238
1102
- AddSkyboxTab0(skyboxpanel);
1103
- AddSkyboxTab1(skyboxpanel);
1104
- AddSkyboxTab2(skyboxpanel);
1105
- AddSkyboxTab3(skyboxpanel);
1239
+ textures.preferredHeight = 100;
1240
+
1241
+ CreateSkyboxPanel(oe.skyboxPanel);
11061242
11071243 // EDIT panel
11081244 editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -1110,20 +1246,20 @@
11101246 editButton.addActionListener(this);
11111247
11121248 editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1113
- uneditButton.setToolTipText("Remove selection controls");
1249
+ uneditButton.setToolTipText("Unpin and remove selection controls");
11141250 uneditButton.addActionListener(this);
11151251
11161252 editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
1117
- allParamsButton.setToolTipText("Show all controle");
1253
+ allParamsButton.setToolTipText("Show all controls");
11181254 allParamsButton.addActionListener(this);
11191255
1120
- editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1121
- clearPanelButton.setToolTipText("Clear edit panel");
1256
+ editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1257
+ clearPanelButton.setToolTipText("Clear all controls");
11221258 clearPanelButton.addActionListener(this);
11231259
1124
- editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1125
- unselectButton.setToolTipText("Unselect");
1126
- unselectButton.addActionListener(this);
1260
+ //editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1261
+ //unselectButton.setToolTipText("Unselect");
1262
+ //unselectButton.addActionListener(this);
11271263
11281264 editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
11291265 flashSelectionButton.setToolTipText("Highlight selection");
....@@ -1183,7 +1319,7 @@
11831319 dgr.addDragGestureListener(this);
11841320 }catch(Exception e) {}
11851321 */
1186
- radio.layout = sixButton; // sevenButton;
1322
+ radio.layout = threeButton; // sixButton;
11871323 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
11881324 }
11891325
....@@ -1234,9 +1370,12 @@
12341370 smoothCB.setToolTipText("Snapping delay");
12351371 smoothCB.addItemListener(this);
12361372
1237
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
1238
- slowCB.setToolTipText("Smooth interpolation");
1239
- slowCB.addItemListener(this);
1373
+// panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
1374
+// slowCB.setToolTipText("Smooth interpolation");
1375
+// slowCB.addItemListener(this);
1376
+ panel.add(minshaderCB = new cCheckBox("Min shader", Globals.MINSHADER)); //, constraints);
1377
+ minshaderCB.setToolTipText("Minimal fast shader");
1378
+ minshaderCB.addItemListener(this);
12401379
12411380 // constraints.gridy += 1;
12421381 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
....@@ -1325,7 +1464,7 @@
13251464 }
13261465
13271466 radioButton.SetObject(obj);
1328
- radioButton.layout = sixButton; // sevenButton;
1467
+ radioButton.layout = threeButton; // sixButton;
13291468 radioButton.SetCamera(cameraView.renderCamera, false);
13301469 radioButton.addActionListener(this);
13311470 radioPanel.add(radioButton);
....@@ -1350,6 +1489,8 @@
13501489 cCheckBox localCB;
13511490 cCheckBox crowdCB;
13521491 cCheckBox smoothCB;
1492
+ cCheckBox minshaderCB;
1493
+
13531494 cToggleButton fastCB;
13541495 cCheckBox slowCB;
13551496 cCheckBox boxCB;
....@@ -1420,6 +1561,12 @@
14201561 {
14211562 cameraView.ToggleInertia();
14221563 cameraView.repaint();
1564
+ }
1565
+ else if(e.getSource() == minshaderCB)
1566
+ {
1567
+ Globals.MINSHADER ^= true;
1568
+ cameraView.programInitialized = false;
1569
+ cameraView.repaint();
14231570 }
14241571 else if(e.getSource() == localCB)
14251572 {
....@@ -1697,7 +1844,12 @@
16971844 TreePath path;
16981845
16991846 public TransferableTreePath(TreePath tp) {
1700
- path = tp;
1847
+ Object[] objs = new Object[tp.getPathCount()];
1848
+ for (int i=0; i<objs.length; i++)
1849
+ {
1850
+ objs[i] = ((Object3D)tp.getPathComponent(i)).GetUUID();
1851
+ }
1852
+ path = new TreePath(objs);
17011853 }
17021854
17031855 public synchronized DataFlavor[] getTransferDataFlavors() {
....@@ -2560,7 +2712,7 @@
25602712 if (source == invariantsItem)
25612713 {
25622714 System.out.println("Invariants:");
2563
- Grafreed.grafreeD.universe.invariants();
2715
+ Grafreed.grafreed.universe.invariants();
25642716 } else
25652717 if (source == memoryItem)
25662718 {
....@@ -2591,33 +2743,52 @@
25912743 {
25922744 ToggleFullScreen();
25932745 } else
2594
- if (source == undoButton)
2746
+ if (source == collapseButton)
2747
+ {
2748
+ this.expandedLayout = radio.layout;
2749
+ CollapseToolbar();
2750
+ } else
2751
+ if (source == maximize3DButton)
2752
+ {
2753
+ this.expandedLayout = radio.layout;
2754
+ radio.layout = twoButton;
2755
+ Show3DView();
2756
+ CollapseToolbar();
2757
+ } else
2758
+ if (source == previousVersionButton)
25952759 {
25962760 // Go to previous version
25972761 //if (!Undo())
25982762 //java.awt.Toolkit.getDefaultToolkit().beep();
2599
- Undo();
2763
+ PreviousVersion();
26002764 } else
26012765 if (source == restoreButton)
26022766 {
26032767 // Restore current version
26042768 Restore();
2769
+ //restoreButton.setEnabled(false);
26052770 } else
26062771 if (source == replaceButton)
26072772 {
26082773 // Overwrite current version
26092774 Replace();
2775
+ //replaceButton.setEnabled(false);
26102776 } else
2611
- if (source == redoButton)
2777
+ if (source == nextVersionButton)
26122778 {
26132779 // Go to next version
2614
- Redo();
2780
+ NextVersion();
26152781 } else
2616
- if (source == saveButton)
2782
+ if (source == saveVersionButton)
26172783 {
26182784 // Save a new version
26192785 if (!Save(true))
26202786 java.awt.Toolkit.getDefaultToolkit().beep();
2787
+ } else
2788
+ if (source == deleteVersionButton)
2789
+ {
2790
+ // Delete a new version
2791
+ DeleteVersion();
26212792 } else
26222793 if (source == oneStepButton)
26232794 {
....@@ -2672,11 +2843,11 @@
26722843 } else
26732844 if (source == undoItem)
26742845 {
2675
- Undo();
2846
+ PreviousVersion();
26762847 } else
26772848 if (source == redoItem)
26782849 {
2679
- Redo();
2850
+ NextVersion();
26802851 } else
26812852 if (source == duplicateItem)
26822853 {
....@@ -3535,38 +3706,7 @@
35353706 if (CameraPane.FULLSCREEN)
35363707 fullscreenLayout = radio.layout;
35373708
3538
- // bug
3539
- //gridPanel.setDividerLocation(1.0);
3540
- //bigPanel.setDividerLocation(0.0);
3541
-// bigThree.remove(scenePanel);
3542
-// bigThree.remove(centralPanel);
3543
-// bigThree.remove(XYZPanel);
3544
-// aWindowConstraints.gridx = 0;
3545
-// aWindowConstraints.gridy = 0;
3546
-// aWindowConstraints.gridwidth = 1;
3547
-// // aConstraints.gridheight = 3;
3548
-// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3549
-// aWindowConstraints.weightx = 0;
3550
-// aWindowConstraints.weighty = 1;
3551
-// //bigThree.add(jtp, aWindowConstraints);
3552
-// aWindowConstraints.weightx = 1;
3553
-// aWindowConstraints.gridwidth = 3;
3554
-// // aConstraints.gridheight = 3;
3555
-// aWindowConstraints.gridx = 1;
3556
-// aWindowConstraints.fill = GridBagConstraints.BOTH;
3557
-// bigThree.add(centralPanel, aWindowConstraints);
3558
-// aWindowConstraints.weightx = 0;
3559
-// aWindowConstraints.gridx = 4;
3560
-// aWindowConstraints.gridwidth = 1;
3561
-// // aConstraints.gridheight = 3;
3562
-// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3563
-// //bigThree.add(XYZPanel, aWindowConstraints);
3564
-// scenePanel.setVisible(false);
3565
-// centralPanel.setVisible(true);
3566
-// XYZPanel.setVisible(false);
3567
- bigThree.ClearUI();
3568
- bigThree.add(centralPanel);
3569
- bigThree.FlushUI();
3709
+ Show3DView();
35703710
35713711 cameraView.requestFocusInWindow();
35723712
....@@ -3809,10 +3949,10 @@
38093949 {
38103950 Object3D child = (Object3D)e.nextElement();
38113951 if(child.editWindow != null)
3812
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
38133952 child.pinned = false;
38143953 child.CloseUI();
38153954 listUI.remove(child);
3955
+// objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
38163956
38173957 //child.editWindow = null; // ???????????
38183958 }
....@@ -3831,6 +3971,7 @@
38313971 obj.CloseUI();
38323972 }
38333973 listUI.clear();
3974
+ SetPinStates(group.selection.size() > 0);
38343975 refreshContents(true);
38353976 } else
38363977 if (source == allParamsButton)
....@@ -3917,6 +4058,7 @@
39174058 radio.layout.doClick();
39184059
39194060 ClearUnpinned();
4061
+
39204062 //Grafreed.Assert(group != null);
39214063 //Grafreed.Assert(group.selection != null);
39224064 SetPinStates(group.selection == null || group.selection.size() > 0);
....@@ -3933,11 +4075,13 @@
39334075 } else if (event.getSource() == editCameraItem)
39344076 {
39354077 cameraView.ProtectCamera();
4078
+ cameraView.requestFocusInWindow();
39364079 cameraView.repaint();
39374080 return;
39384081 } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
39394082 {
39404083 cameraView.RevertCamera();
4084
+ cameraView.requestFocusInWindow();
39414085 cameraView.repaint();
39424086 return;
39434087 // } else if (event.getSource() == textureButton)
....@@ -5070,9 +5214,7 @@
50705214
50715215 freezemodel = false;
50725216 }
5073
-
5074
- boolean flashIt = true;
5075
-
5217
+
50765218 public void valueChanged(TreeSelectionEvent e)
50775219 //public boolean handleEvent(Event event)
50785220 {
....@@ -5145,13 +5287,15 @@
51455287 {
51465288 editButton.setEnabled(enabled);
51475289 uneditButton.setEnabled(enabled);
5148
- unselectButton.setEnabled(enabled);
5290
+ //unselectButton.setEnabled(enabled);
51495291 flashSelectionButton.setEnabled(enabled);
5292
+
5293
+ clearPanelButton.setEnabled(!listUI.isEmpty());
51505294 }
51515295
51525296 void refreshContents(boolean cp)
51535297 {
5154
- if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
5298
+ //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
51555299 if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
51565300 {
51575301 objEditor.ClearInfo(); // .GetMaterial());
....@@ -5161,7 +5305,7 @@
51615305 Object3D child = (Object3D) group.selection.get(i);
51625306
51635307 objEditor.AddInfo(child, this, true);
5164
- System.err.println("info : " + child.GetPath());
5308
+// System.err.println("info : " + child.GetPath());
51655309 }
51665310
51675311 objEditor.SetText(); // jan 2014
....@@ -5987,7 +6131,6 @@
59876131
59886132 cButton restoreCameraButton;
59896133
5990
- cButton saveButton;
59916134 cButton oneStepButton;
59926135
59936136 cButton groupButton;