Normand Briere
2019-06-26 89b25e7cc97f6fe221dfd41c4d463500f8a31bc1
ObjEditor.java
....@@ -207,7 +207,7 @@
207207
208208 objEditor.ctrlPanel.remove(namePanel);
209209
210
- if (!GroupEditor.allparams)
210
+ if (!allparams)
211211 return;
212212
213213 // objEditor.ctrlPanel.remove(liveCB);
....@@ -337,6 +337,11 @@
337337 return frame.action(event, obj);
338338 }
339339
340
+ // Cannot work without static
341
+ static boolean allparams = true;
342
+
343
+ static java.util.Vector<Object3D> listUI = new java.util.Vector<Object3D>();
344
+
340345 void SetupMenu()
341346 {
342347 frame.setMenuBar(menuBar = new MenuBar());
....@@ -397,6 +402,11 @@
397402 // }
398403 //
399404 // materialFlushed = true;
405
+// }
406
+// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Edit"))
407
+// {
408
+// if (listUI.size() == 0)
409
+// EditSelection(false);
400410 // }
401411
402412 refreshContents(false); // To refresh Info tab
....@@ -723,7 +733,9 @@
723733
724734 void ToggleFullScreen()
725735 {
726
- if (CameraPane.FULLSCREEN)
736
+ cameraView.ToggleFullScreen();
737
+
738
+ if (!CameraPane.FULLSCREEN)
727739 {
728740 device.setFullScreenWindow(null);
729741 //frame.setVisible(false);
....@@ -763,8 +775,6 @@
763775 radio.layout.doClick();
764776 //frame.setVisible(true);
765777 }
766
-
767
- cameraView.ToggleFullScreen();
768778 }
769779
770780 private JTextPane createTextPane()
....@@ -1102,7 +1112,7 @@
11021112
11031113 oe.ctrlPanel.Return();
11041114
1105
- if (!GroupEditor.allparams)
1115
+ if (!allparams)
11061116 return;
11071117
11081118 setupPanel = new cGridBag().setVertical(false);
....@@ -1439,13 +1449,13 @@
14391449 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
14401450 //tmp.setName("Edit");
14411451 objectPanel.add(materialPanel);
1442
- objectPanel.add(toolboxPanel);
14431452 // JPanel north = new JPanel(new BorderLayout());
14441453 // north.setName("Edit");
14451454 // north.add(ctrlPanel, BorderLayout.NORTH);
14461455 // objectPanel.add(north);
14471456 objectPanel.add(editPanel);
14481457 objectPanel.add(infoPanel);
1458
+ objectPanel.add(toolboxPanel);
14491459
14501460 /*
14511461 aConstraints.gridx = 0;
....@@ -1454,7 +1464,7 @@
14541464 aConstraints.gridy += 1;
14551465 aConstraints.gridwidth = 1;
14561466 mainPanel.add(objectPanel, aConstraints);
1457
- */
1467
+ */
14581468
14591469 scrollpane = new JScrollPane(mainPanel, ScrollPaneConstants.// VERTICAL_SCROLLBAR_ALWAYS,
14601470 VERTICAL_SCROLLBAR_AS_NEEDED,
....@@ -3527,6 +3537,8 @@
35273537 tab.graphs[i] = null;
35283538 }
35293539
3540
+ SetUndoStates();
3541
+
35303542 // test save
35313543 if (false)
35323544 {
....@@ -3549,6 +3561,8 @@
35493561
35503562 void CopyChanged(Object3D obj)
35513563 {
3564
+ SetUndoStates();
3565
+
35523566 boolean temp = CameraPane.SWITCH;
35533567 CameraPane.SWITCH = false;
35543568
....@@ -3586,6 +3600,17 @@
35863600 }
35873601
35883602 refreshContents();
3603
+ }
3604
+
3605
+ cButton undoButton;
3606
+ cButton redoButton;
3607
+
3608
+ void SetUndoStates()
3609
+ {
3610
+ cRadio tab = GetCurrentTab();
3611
+
3612
+ undoButton.setEnabled(tab.undoindex > 0);
3613
+ redoButton.setEnabled(tab.graphs[tab.undoindex + 1] != null);
35893614 }
35903615
35913616 public void Undo()
....@@ -4765,6 +4790,8 @@
47654790 String filename = browser.getFile();
47664791 if (filename != null && filename.length() > 0)
47674792 {
4793
+ if (!filename.endsWith(".gfd"))
4794
+ filename += ".gfd";
47684795 lastname = browser.getDirectory() + filename;
47694796 save();
47704797 }