Normand Briere
2019-06-21 15123b19e7bc8da2869429b07f0fbaa0598e945e
ObjEditor.java
....@@ -168,6 +168,7 @@
168168 // objEditor.ctrlPanel.remove(remarkButton);
169169
170170 objEditor.ctrlPanel.remove(setupPanel);
171
+ objEditor.ctrlPanel.remove(setupPanel2);
171172 objEditor.ctrlPanel.remove(commandsPanel);
172173 objEditor.ctrlPanel.remove(pushPanel);
173174 //objEditor.ctrlPanel.remove(fillPanel);
....@@ -278,7 +279,7 @@
278279 frame.setMenuBar(menuBar = new MenuBar());
279280 menuBar.add(fileMenu = new Menu("File"));
280281 fileMenu.add(newItem = new MenuItem("New"));
281
- fileMenu.add(loadItem = new MenuItem("Load..."));
282
+ fileMenu.add(loadItem = new MenuItem("Open..."));
282283
283284 //oe.menuBar.add(menu = new Menu("Include"));
284285 Menu menu = new Menu("Import");
....@@ -419,10 +420,10 @@
419420 e.printStackTrace();
420421 }
421422
422
- String selection = infoarea.getText();
423
- java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection);
424
- java.awt.datatransfer.Clipboard clipboard =
425
- Toolkit.getDefaultToolkit().getSystemClipboard();
423
+// String selection = infoarea.getText();
424
+// java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection);
425
+// java.awt.datatransfer.Clipboard clipboard =
426
+// Toolkit.getDefaultToolkit().getSystemClipboard();
426427 //clipboard.setContents(data, data);
427428 }
428429
....@@ -747,6 +748,7 @@
747748
748749 cGridBag namePanel;
749750 cGridBag setupPanel;
751
+ cGridBag setupPanel2;
750752 cGridBag commandsPanel;
751753 cGridBag pushPanel;
752754 cGridBag fillPanel;
....@@ -939,21 +941,25 @@
939941 markCB = AddCheckBox(setupPanel, "Mark", copy.marked);
940942 markCB.setToolTipText("Set the animation target transform");
941943
942
- rewindCB = AddCheckBox(setupPanel, "Rewind", copy.rewind);
944
+ setupPanel2 = new cGridBag().setVertical(false);
945
+
946
+ rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind);
943947 rewindCB.setToolTipText("Rewind animation");
944948
945
- randomCB = AddCheckBox(setupPanel, "Random", copy.random);
946
- randomCB.setToolTipText("Option for switch node");
949
+ randomCB = AddCheckBox(setupPanel2, "Rand", copy.random);
950
+ randomCB.setToolTipText("Rewind or Go back and forth randomly");
947951
948952 if (Globals.ADVANCED)
949953 {
950
- link2masterCB = AddCheckBox(setupPanel, "Support", copy.link2master);
954
+ link2masterCB = AddCheckBox(setupPanel2, "Supp", copy.link2master);
951955 link2masterCB.setToolTipText("Attach to support");
952
- speedupCB = AddCheckBox(setupPanel, "Speed", copy.speedup);
956
+ speedupCB = AddCheckBox(setupPanel2, "Speed", copy.speedup);
953957 speedupCB.setToolTipText("Option motion capture");
954958 }
955959
956960 oe.ctrlPanel.add(setupPanel);
961
+ oe.ctrlPanel.Return();
962
+ oe.ctrlPanel.add(setupPanel2);
957963 oe.ctrlPanel.Return();
958964
959965 commandsPanel = new cGridBag().setVertical(false);
....@@ -2072,19 +2078,19 @@
20722078
20732079 void LoadObjFile(String fullname)
20742080 {
2075
- /*
2081
+ System.out.println("Loading " + fullname);
2082
+ /**/
20762083 //lastFilename = fullname;
20772084 if(loadObjThread == null)
20782085 {
2079
- loadObjThread = new LoadOBJThread();
2080
- loadObjThread.start();
2086
+ loadObjThread = new LoadOBJThread();
2087
+ loadObjThread.start();
20812088 }
20822089
20832090 loadObjThread.add(fullname);
2084
- */
2091
+ /**/
20852092
2086
- System.out.println("Loading " + fullname);
2087
- makeSomething(new FileObject(fullname, true), true);
2093
+ //makeSomething(new FileObject(fullname, true), true);
20882094 }
20892095
20902096 void LoadGFDFile(String fullname)
....@@ -3214,7 +3220,7 @@
32143220 objEditor.refreshContents();
32153221 }
32163222
3217
- static public byte[] Compress(Object o)
3223
+ static public byte[] Compress(Object3D o)
32183224 {
32193225 try
32203226 {
....@@ -3222,8 +3228,13 @@
32223228 java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos);
32233229 ObjectOutputStream out = new ObjectOutputStream(zstream);
32243230
3231
+ Object3D parent = o.parent;
3232
+ o.parent = null;
3233
+
32253234 out.writeObject(o);
32263235
3236
+ o.parent = parent;
3237
+
32273238 out.flush();
32283239
32293240 zstream.close();
....@@ -4290,6 +4301,7 @@
42904301
42914302 try
42924303 {
4304
+ // Try compressed version first.
42934305 java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
42944306 java.util.zip.GZIPInputStream zstream = new java.util.zip.GZIPInputStream(istream);
42954307 java.io.ObjectInputStream p = new java.io.ObjectInputStream(zstream);
....@@ -4359,6 +4371,12 @@
43594371
43604372 void LoadIt(Object obj)
43614373 {
4374
+ if (obj == null)
4375
+ {
4376
+ // Invalid file
4377
+ return;
4378
+ }
4379
+
43624380 System.out.println("Loaded " + obj);
43634381 //new Exception().printStackTrace();
43644382 Object3D readobj = (Object3D) obj;