.. | .. |
---|
36 | 36 | GroupEditor callee; |
---|
37 | 37 | JFrame frame; |
---|
38 | 38 | |
---|
| 39 | + static ObjEditor theFrame; |
---|
| 40 | + |
---|
39 | 41 | // SCRIPT |
---|
40 | 42 | |
---|
41 | 43 | transient JFrame textpanel = null; |
---|
.. | .. |
---|
168 | 170 | // objEditor.ctrlPanel.remove(remarkButton); |
---|
169 | 171 | |
---|
170 | 172 | objEditor.ctrlPanel.remove(setupPanel); |
---|
| 173 | + objEditor.ctrlPanel.remove(setupPanel2); |
---|
171 | 174 | objEditor.ctrlPanel.remove(commandsPanel); |
---|
172 | 175 | objEditor.ctrlPanel.remove(pushPanel); |
---|
173 | 176 | //objEditor.ctrlPanel.remove(fillPanel); |
---|
.. | .. |
---|
243 | 246 | //localCopy.parent = null; |
---|
244 | 247 | |
---|
245 | 248 | frame = new JFrame(); |
---|
| 249 | + frame.setUndecorated(true); |
---|
246 | 250 | objEditor = this; |
---|
247 | 251 | this.callee = callee; |
---|
248 | 252 | |
---|
.. | .. |
---|
278 | 282 | frame.setMenuBar(menuBar = new MenuBar()); |
---|
279 | 283 | menuBar.add(fileMenu = new Menu("File")); |
---|
280 | 284 | fileMenu.add(newItem = new MenuItem("New")); |
---|
281 | | - fileMenu.add(loadItem = new MenuItem("Load...")); |
---|
| 285 | + fileMenu.add(loadItem = new MenuItem("Open...")); |
---|
282 | 286 | |
---|
283 | 287 | //oe.menuBar.add(menu = new Menu("Include")); |
---|
284 | 288 | Menu menu = new Menu("Import"); |
---|
.. | .. |
---|
419 | 423 | e.printStackTrace(); |
---|
420 | 424 | } |
---|
421 | 425 | |
---|
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(); |
---|
| 426 | +// String selection = infoarea.getText(); |
---|
| 427 | +// java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection); |
---|
| 428 | +// java.awt.datatransfer.Clipboard clipboard = |
---|
| 429 | +// Toolkit.getDefaultToolkit().getSystemClipboard(); |
---|
426 | 430 | //clipboard.setContents(data, data); |
---|
427 | 431 | } |
---|
428 | 432 | |
---|
.. | .. |
---|
582 | 586 | } |
---|
583 | 587 | } |
---|
584 | 588 | |
---|
| 589 | +static GraphicsDevice device = GraphicsEnvironment |
---|
| 590 | + .getLocalGraphicsEnvironment().getScreenDevices()[0]; |
---|
| 591 | + |
---|
| 592 | + Rectangle keeprect; |
---|
| 593 | + cRadio radio; |
---|
| 594 | + |
---|
| 595 | +cButton keepButton; |
---|
| 596 | + cButton twoButton; // Full 3D |
---|
| 597 | + cButton sixButton; |
---|
| 598 | + cButton threeButton; |
---|
| 599 | + cButton sevenButton; |
---|
| 600 | + cButton fourButton; // full panel |
---|
| 601 | + cButton oneButton; // full XYZ |
---|
| 602 | + //cButton currentLayout; |
---|
| 603 | + |
---|
| 604 | + boolean maximized; |
---|
| 605 | + |
---|
| 606 | + void Minimize() |
---|
| 607 | + { |
---|
| 608 | + frame.setState(Frame.ICONIFIED); |
---|
| 609 | + } |
---|
| 610 | + |
---|
| 611 | + void Maximize() |
---|
| 612 | + { |
---|
| 613 | + if (maximized) |
---|
| 614 | + { |
---|
| 615 | + frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height); |
---|
| 616 | + } |
---|
| 617 | + else |
---|
| 618 | + { |
---|
| 619 | + keeprect = frame.getBounds(); |
---|
| 620 | + Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds(); |
---|
| 621 | + Dimension rect2 = frame.getToolkit().getScreenSize(); |
---|
| 622 | + frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height); |
---|
| 623 | +// frame.setState(Frame.MAXIMIZED_BOTH); |
---|
| 624 | + } |
---|
| 625 | + |
---|
| 626 | + maximized ^= true; |
---|
| 627 | + } |
---|
| 628 | + |
---|
585 | 629 | void ToggleFullScreen() |
---|
586 | 630 | { |
---|
587 | 631 | if (CameraPane.FULLSCREEN) |
---|
588 | 632 | { |
---|
589 | | - frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
590 | | - framePanel.add(bigThree); |
---|
591 | | - frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 633 | + device.setFullScreenWindow(null); |
---|
| 634 | + //frame.setVisible(false); |
---|
| 635 | +// frame.removeNotify(); |
---|
| 636 | +// frame.setUndecorated(false); |
---|
| 637 | +// frame.addNotify(); |
---|
| 638 | + //frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height); |
---|
| 639 | + |
---|
| 640 | +// X frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
| 641 | +// X framePanel.add(bigThree); |
---|
| 642 | +// X frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 643 | + framePanel.setDividerLocation(1); |
---|
| 644 | + |
---|
| 645 | + //frame.setVisible(true); |
---|
| 646 | + radio.layout = keepButton; |
---|
| 647 | + //theFrame = null; |
---|
| 648 | + keepButton = null; |
---|
| 649 | + radio.layout.doClick(); |
---|
| 650 | + |
---|
592 | 651 | } else |
---|
593 | 652 | { |
---|
594 | | - frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
595 | | - framePanel.remove(bigThree); |
---|
596 | | - frame.getContentPane().add(/*"Center",*/bigThree); |
---|
| 653 | + keepButton = radio.layout; |
---|
| 654 | + //keeprect = frame.getBounds(); |
---|
| 655 | +// frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width, |
---|
| 656 | +// frame.getToolkit().getScreenSize().height); |
---|
| 657 | + //frame.setVisible(false); |
---|
| 658 | + device.setFullScreenWindow(frame); |
---|
| 659 | +// frame.removeNotify(); |
---|
| 660 | +// frame.setUndecorated(true); |
---|
| 661 | +// frame.addNotify(); |
---|
| 662 | +// X frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
| 663 | +// X framePanel.remove(bigThree); |
---|
| 664 | +// X frame.getContentPane().add(/*"Center",*/bigThree); |
---|
| 665 | + framePanel.setDividerLocation(0); |
---|
| 666 | + |
---|
| 667 | + radio.layout = twoButton; |
---|
| 668 | + radio.layout.doClick(); |
---|
| 669 | + //frame.setVisible(true); |
---|
597 | 670 | } |
---|
| 671 | + |
---|
598 | 672 | cameraView.ToggleFullScreen(); |
---|
599 | 673 | } |
---|
600 | 674 | |
---|
.. | .. |
---|
747 | 821 | |
---|
748 | 822 | cGridBag namePanel; |
---|
749 | 823 | cGridBag setupPanel; |
---|
| 824 | + cGridBag setupPanel2; |
---|
750 | 825 | cGridBag commandsPanel; |
---|
751 | 826 | cGridBag pushPanel; |
---|
752 | 827 | cGridBag fillPanel; |
---|
.. | .. |
---|
939 | 1014 | markCB = AddCheckBox(setupPanel, "Mark", copy.marked); |
---|
940 | 1015 | markCB.setToolTipText("Set the animation target transform"); |
---|
941 | 1016 | |
---|
942 | | - rewindCB = AddCheckBox(setupPanel, "Rewind", copy.rewind); |
---|
| 1017 | + setupPanel2 = new cGridBag().setVertical(false); |
---|
| 1018 | + |
---|
| 1019 | + rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind); |
---|
943 | 1020 | rewindCB.setToolTipText("Rewind animation"); |
---|
944 | 1021 | |
---|
945 | | - randomCB = AddCheckBox(setupPanel, "Random", copy.random); |
---|
946 | | - randomCB.setToolTipText("Option for switch node"); |
---|
| 1022 | + randomCB = AddCheckBox(setupPanel2, "Rand", copy.random); |
---|
| 1023 | + randomCB.setToolTipText("Randomly Rewind or Go back and forth"); |
---|
947 | 1024 | |
---|
948 | 1025 | if (Globals.ADVANCED) |
---|
949 | 1026 | { |
---|
950 | | - link2masterCB = AddCheckBox(setupPanel, "Support", copy.link2master); |
---|
| 1027 | + link2masterCB = AddCheckBox(setupPanel2, "Supp", copy.link2master); |
---|
951 | 1028 | link2masterCB.setToolTipText("Attach to support"); |
---|
952 | | - speedupCB = AddCheckBox(setupPanel, "Speed", copy.speedup); |
---|
| 1029 | + speedupCB = AddCheckBox(setupPanel2, "Speed", copy.speedup); |
---|
953 | 1030 | speedupCB.setToolTipText("Option motion capture"); |
---|
954 | 1031 | } |
---|
955 | 1032 | |
---|
956 | 1033 | oe.ctrlPanel.add(setupPanel); |
---|
| 1034 | + oe.ctrlPanel.Return(); |
---|
| 1035 | + oe.ctrlPanel.add(setupPanel2); |
---|
957 | 1036 | oe.ctrlPanel.Return(); |
---|
958 | 1037 | |
---|
959 | 1038 | commandsPanel = new cGridBag().setVertical(false); |
---|
.. | .. |
---|
1178 | 1257 | //worldPanel.setName("World"); |
---|
1179 | 1258 | centralPanel = new cGridBag(); |
---|
1180 | 1259 | centralPanel.preferredWidth = 20; |
---|
1181 | | - timelinePanel = new JPanel(new BorderLayout()); |
---|
1182 | | - timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); |
---|
| 1260 | + |
---|
| 1261 | + if (Globals.ADVANCED) |
---|
| 1262 | + { |
---|
| 1263 | + timelinePanel = new JPanel(new BorderLayout()); |
---|
| 1264 | + timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); |
---|
1183 | 1265 | |
---|
1184 | 1266 | cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel); |
---|
1185 | 1267 | cameraPanel.setContinuousLayout(true); |
---|
.. | .. |
---|
1188 | 1270 | // cameraPanel.setDividerSize(9); |
---|
1189 | 1271 | cameraPanel.setResizeWeight(1.0); |
---|
1190 | 1272 | |
---|
| 1273 | + } |
---|
| 1274 | + |
---|
1191 | 1275 | centralPanel.add(cameraView); |
---|
| 1276 | + centralPanel.setFocusable(true); |
---|
1192 | 1277 | //frame.setJMenuBar(timelineMenubar); |
---|
1193 | 1278 | //centralPanel.add(timelinePanel); |
---|
1194 | 1279 | |
---|
.. | .. |
---|
1386 | 1471 | frame.setSize(1280, 860); |
---|
1387 | 1472 | frame.setVisible(true); |
---|
1388 | 1473 | |
---|
| 1474 | + cameraView.requestFocusInWindow(); |
---|
| 1475 | + |
---|
1389 | 1476 | gridPanel.setDividerLocation(1.0); |
---|
1390 | 1477 | |
---|
1391 | 1478 | frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); |
---|
.. | .. |
---|
1935 | 2022 | e2.printStackTrace(); |
---|
1936 | 2023 | } |
---|
1937 | 2024 | } |
---|
| 2025 | + |
---|
1938 | 2026 | LoadJMEThread loadThread; |
---|
1939 | 2027 | |
---|
1940 | 2028 | class LoadJMEThread extends Thread |
---|
.. | .. |
---|
1992 | 2080 | //LoadFile0(filename, converter); |
---|
1993 | 2081 | } |
---|
1994 | 2082 | } |
---|
| 2083 | + |
---|
1995 | 2084 | LoadOBJThread loadObjThread; |
---|
1996 | 2085 | |
---|
1997 | 2086 | class LoadOBJThread extends Thread |
---|
.. | .. |
---|
2070 | 2159 | |
---|
2071 | 2160 | void LoadObjFile(String fullname) |
---|
2072 | 2161 | { |
---|
2073 | | - /* |
---|
| 2162 | + System.out.println("Loading " + fullname); |
---|
| 2163 | + /**/ |
---|
2074 | 2164 | //lastFilename = fullname; |
---|
2075 | 2165 | if(loadObjThread == null) |
---|
2076 | 2166 | { |
---|
2077 | | - loadObjThread = new LoadOBJThread(); |
---|
2078 | | - loadObjThread.start(); |
---|
| 2167 | + loadObjThread = new LoadOBJThread(); |
---|
| 2168 | + loadObjThread.start(); |
---|
2079 | 2169 | } |
---|
2080 | 2170 | |
---|
2081 | 2171 | loadObjThread.add(fullname); |
---|
2082 | | - */ |
---|
| 2172 | + /**/ |
---|
2083 | 2173 | |
---|
2084 | | - System.out.println("Loading " + fullname); |
---|
2085 | | - makeSomething(new FileObject(fullname, true), true); |
---|
| 2174 | + //makeSomething(new FileObject(fullname, true), true); |
---|
2086 | 2175 | } |
---|
2087 | 2176 | |
---|
2088 | 2177 | void LoadGFDFile(String fullname) |
---|
.. | .. |
---|
2925 | 3014 | return; |
---|
2926 | 3015 | } else if (event.getSource() == toggleSwitchItem) |
---|
2927 | 3016 | { |
---|
2928 | | - cameraView.ToggleRandom(); |
---|
| 3017 | + cameraView.ToggleSwitch(); |
---|
2929 | 3018 | cameraView.repaint(); |
---|
2930 | 3019 | return; |
---|
2931 | 3020 | } else if (event.getSource() == toggleHandleItem) |
---|
.. | .. |
---|
3207 | 3296 | { |
---|
3208 | 3297 | copy.remove(1); |
---|
3209 | 3298 | } |
---|
| 3299 | + |
---|
3210 | 3300 | ResetModel(); |
---|
3211 | 3301 | objEditor.refreshContents(); |
---|
3212 | 3302 | } |
---|
3213 | 3303 | |
---|
| 3304 | + static public byte[] Compress(Object3D o) |
---|
| 3305 | + { |
---|
| 3306 | + try |
---|
| 3307 | + { |
---|
| 3308 | + ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
---|
| 3309 | + java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos); |
---|
| 3310 | + ObjectOutputStream out = new ObjectOutputStream(zstream); |
---|
| 3311 | + |
---|
| 3312 | + Object3D parent = o.parent; |
---|
| 3313 | + o.parent = null; |
---|
| 3314 | + |
---|
| 3315 | + out.writeObject(o); |
---|
| 3316 | + |
---|
| 3317 | + o.parent = parent; |
---|
| 3318 | + |
---|
| 3319 | + out.flush(); |
---|
| 3320 | + |
---|
| 3321 | + zstream.close(); |
---|
| 3322 | + out.close(); |
---|
| 3323 | + |
---|
| 3324 | + return baos.toByteArray(); |
---|
| 3325 | + } catch (Exception e) |
---|
| 3326 | + { |
---|
| 3327 | + System.err.println(e); |
---|
| 3328 | + return null; |
---|
| 3329 | + } |
---|
| 3330 | + } |
---|
| 3331 | + |
---|
| 3332 | + static public Object Uncompress(byte[] bytes) |
---|
| 3333 | + { |
---|
| 3334 | + System.out.println("#bytes = " + bytes.length); |
---|
| 3335 | + try |
---|
| 3336 | + { |
---|
| 3337 | + ByteArrayInputStream bais = new ByteArrayInputStream(bytes); |
---|
| 3338 | + java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais); |
---|
| 3339 | + ObjectInputStream in = new ObjectInputStream(istream); |
---|
| 3340 | + Object obj = in.readObject(); |
---|
| 3341 | + in.close(); |
---|
| 3342 | + |
---|
| 3343 | + return obj; |
---|
| 3344 | + } catch (Exception e) |
---|
| 3345 | + { |
---|
| 3346 | + System.err.println(e); |
---|
| 3347 | + return null; |
---|
| 3348 | + } |
---|
| 3349 | + } |
---|
| 3350 | + |
---|
| 3351 | + static public Object clone(Object o) |
---|
| 3352 | + { |
---|
| 3353 | + try |
---|
| 3354 | + { |
---|
| 3355 | + ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
---|
| 3356 | + ObjectOutputStream out = new ObjectOutputStream(baos); |
---|
| 3357 | + |
---|
| 3358 | + out.writeObject(o); |
---|
| 3359 | + |
---|
| 3360 | + out.flush(); |
---|
| 3361 | + out.close(); |
---|
| 3362 | + |
---|
| 3363 | + byte[] bytes = baos.toByteArray(); |
---|
| 3364 | + |
---|
| 3365 | + System.out.println("clone = " + bytes.length); |
---|
| 3366 | + |
---|
| 3367 | + ByteArrayInputStream bais = new ByteArrayInputStream(bytes); |
---|
| 3368 | + ObjectInputStream in = new ObjectInputStream(bais); |
---|
| 3369 | + Object obj = in.readObject(); |
---|
| 3370 | + in.close(); |
---|
| 3371 | + |
---|
| 3372 | + return obj; |
---|
| 3373 | + } catch (Exception e) |
---|
| 3374 | + { |
---|
| 3375 | + System.err.println(e); |
---|
| 3376 | + return null; |
---|
| 3377 | + } |
---|
| 3378 | + } |
---|
| 3379 | + |
---|
| 3380 | + cRadio GetCurrentTab() |
---|
| 3381 | + { |
---|
| 3382 | + cRadio ab; |
---|
| 3383 | + for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
| 3384 | + { |
---|
| 3385 | + ab = (cRadio)e.nextElement(); |
---|
| 3386 | + if(ab.GetObject() == copy) |
---|
| 3387 | + { |
---|
| 3388 | + return ab; |
---|
| 3389 | + } |
---|
| 3390 | + } |
---|
| 3391 | + |
---|
| 3392 | + return null; |
---|
| 3393 | + } |
---|
| 3394 | + |
---|
| 3395 | + java.util.Hashtable<java.util.UUID, Object3D> hashtable = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
| 3396 | + |
---|
| 3397 | + public void Save() |
---|
| 3398 | + { |
---|
| 3399 | + cRadio tab = GetCurrentTab(); |
---|
| 3400 | + |
---|
| 3401 | + boolean temp = CameraPane.SWITCH; |
---|
| 3402 | + CameraPane.SWITCH = false; |
---|
| 3403 | + |
---|
| 3404 | + copy.ExtractBigData(hashtable); |
---|
| 3405 | + |
---|
| 3406 | + //EditorFrame.m_MainFrame.requestFocusInWindow(); |
---|
| 3407 | + tab.graphs[tab.undoindex++] = Compress(copy); |
---|
| 3408 | + |
---|
| 3409 | + copy.RestoreBigData(hashtable); |
---|
| 3410 | + |
---|
| 3411 | + CameraPane.SWITCH = temp; |
---|
| 3412 | + |
---|
| 3413 | + //assert(hashtable.isEmpty()); |
---|
| 3414 | + |
---|
| 3415 | + for (int i = tab.undoindex; i < tab.graphs.length; i++) |
---|
| 3416 | + { |
---|
| 3417 | + tab.graphs[i] = null; |
---|
| 3418 | + } |
---|
| 3419 | + |
---|
| 3420 | + // test save |
---|
| 3421 | + if (false) |
---|
| 3422 | + { |
---|
| 3423 | + try |
---|
| 3424 | + { |
---|
| 3425 | + FileOutputStream ostream = new FileOutputStream("save" + tab.undoindex); |
---|
| 3426 | + ObjectOutputStream p = new ObjectOutputStream(ostream); |
---|
| 3427 | + |
---|
| 3428 | + p.writeObject(copy); |
---|
| 3429 | + |
---|
| 3430 | + p.flush(); |
---|
| 3431 | + |
---|
| 3432 | + ostream.close(); |
---|
| 3433 | + } catch (Exception e) |
---|
| 3434 | + { |
---|
| 3435 | + e.printStackTrace(); |
---|
| 3436 | + } |
---|
| 3437 | + } |
---|
| 3438 | + } |
---|
| 3439 | + |
---|
| 3440 | + void CopyChanged(Object3D obj) |
---|
| 3441 | + { |
---|
| 3442 | + boolean temp = CameraPane.SWITCH; |
---|
| 3443 | + CameraPane.SWITCH = false; |
---|
| 3444 | + |
---|
| 3445 | + copy.ExtractBigData(hashtable); |
---|
| 3446 | + |
---|
| 3447 | + copy.clear(); |
---|
| 3448 | + |
---|
| 3449 | + for (int i=0; i<obj.Size(); i++) |
---|
| 3450 | + { |
---|
| 3451 | + copy.add(obj.get(i)); |
---|
| 3452 | + } |
---|
| 3453 | + |
---|
| 3454 | + copy.RestoreBigData(hashtable); |
---|
| 3455 | + |
---|
| 3456 | + CameraPane.SWITCH = temp; |
---|
| 3457 | + |
---|
| 3458 | + //assert(hashtable.isEmpty()); |
---|
| 3459 | + |
---|
| 3460 | + copy.Touch(); |
---|
| 3461 | + |
---|
| 3462 | + ResetModel(); |
---|
| 3463 | + copy.HardTouch(); // recompile? |
---|
| 3464 | + |
---|
| 3465 | + cRadio ab; |
---|
| 3466 | + for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
| 3467 | + { |
---|
| 3468 | + ab = (cRadio)e.nextElement(); |
---|
| 3469 | + Object3D test = copy.GetObject(ab.object.GetUUID()); |
---|
| 3470 | + //ab.camera = (Camera)copy.GetObject(ab.camera.GetUUID()); |
---|
| 3471 | + if (test != null) |
---|
| 3472 | + { |
---|
| 3473 | + test.editWindow = ab.object.editWindow; |
---|
| 3474 | + ab.object = test; |
---|
| 3475 | + } |
---|
| 3476 | + } |
---|
| 3477 | + |
---|
| 3478 | + refreshContents(); |
---|
| 3479 | + } |
---|
| 3480 | + |
---|
| 3481 | + public void Undo() |
---|
| 3482 | + { |
---|
| 3483 | + cRadio tab = GetCurrentTab(); |
---|
| 3484 | + |
---|
| 3485 | + if (tab.undoindex == 0) |
---|
| 3486 | + { |
---|
| 3487 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 3488 | + return; |
---|
| 3489 | + } |
---|
| 3490 | + |
---|
| 3491 | + if (tab.graphs[tab.undoindex] == null) |
---|
| 3492 | + { |
---|
| 3493 | + Save(); |
---|
| 3494 | + tab.undoindex -= 1; |
---|
| 3495 | + } |
---|
| 3496 | + |
---|
| 3497 | + tab.undoindex -= 1; |
---|
| 3498 | + |
---|
| 3499 | + CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex])); |
---|
| 3500 | + } |
---|
| 3501 | + |
---|
| 3502 | + public void Redo() |
---|
| 3503 | + { |
---|
| 3504 | + cRadio tab = GetCurrentTab(); |
---|
| 3505 | + |
---|
| 3506 | + if (tab.graphs[tab.undoindex + 1] == null) |
---|
| 3507 | + { |
---|
| 3508 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 3509 | + return; |
---|
| 3510 | + } |
---|
| 3511 | + |
---|
| 3512 | + tab.undoindex += 1; |
---|
| 3513 | + |
---|
| 3514 | + CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex])); |
---|
| 3515 | + } |
---|
| 3516 | + |
---|
3214 | 3517 | void ImportGFD() |
---|
3215 | 3518 | { |
---|
3216 | 3519 | FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
.. | .. |
---|
3855 | 4158 | |
---|
3856 | 4159 | void makeSomething(Object3D thing, boolean resetmodel) // deselect) |
---|
3857 | 4160 | { |
---|
| 4161 | + Save(); |
---|
3858 | 4162 | //Tween.set(thing, 0).target(1).start(tweenManager); |
---|
3859 | 4163 | //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager); |
---|
3860 | 4164 | // if (thing instanceof GenericJointDemo) |
---|
.. | .. |
---|
4078 | 4382 | |
---|
4079 | 4383 | try |
---|
4080 | 4384 | { |
---|
| 4385 | + // Try compressed version first. |
---|
4081 | 4386 | java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
4082 | 4387 | java.util.zip.GZIPInputStream zstream = new java.util.zip.GZIPInputStream(istream); |
---|
4083 | 4388 | java.io.ObjectInputStream p = new java.io.ObjectInputStream(zstream); |
---|
.. | .. |
---|
4147 | 4452 | |
---|
4148 | 4453 | void LoadIt(Object obj) |
---|
4149 | 4454 | { |
---|
| 4455 | + if (obj == null) |
---|
| 4456 | + { |
---|
| 4457 | + // Invalid file |
---|
| 4458 | + return; |
---|
| 4459 | + } |
---|
| 4460 | + |
---|
4150 | 4461 | System.out.println("Loaded " + obj); |
---|
4151 | 4462 | //new Exception().printStackTrace(); |
---|
4152 | 4463 | Object3D readobj = (Object3D) obj; |
---|
.. | .. |
---|
4156 | 4467 | |
---|
4157 | 4468 | if (readobj != null) |
---|
4158 | 4469 | { |
---|
| 4470 | + Save(); |
---|
4159 | 4471 | try |
---|
4160 | 4472 | { |
---|
4161 | 4473 | //readobj.deepCopySelf(copy); |
---|