.. | .. |
---|
4 | 4 | |
---|
5 | 5 | import java.awt.*; |
---|
6 | 6 | import java.awt.event.*; |
---|
| 7 | +import java.awt.image.BufferedImage; |
---|
7 | 8 | import javax.swing.*; |
---|
8 | 9 | import javax.swing.event.*; |
---|
9 | 10 | import javax.swing.text.*; |
---|
.. | .. |
---|
35 | 36 | |
---|
36 | 37 | GroupEditor callee; |
---|
37 | 38 | JFrame frame; |
---|
| 39 | + |
---|
| 40 | + static ObjEditor theFrame; |
---|
| 41 | + |
---|
| 42 | + cButton GetButton(String name, boolean border) |
---|
| 43 | + { |
---|
| 44 | + try |
---|
| 45 | + { |
---|
| 46 | + ImageIcon icon = GetIcon(name); |
---|
| 47 | + return new cButton(icon, border); |
---|
| 48 | + } |
---|
| 49 | + catch (Exception e) |
---|
| 50 | + { |
---|
| 51 | + return new cButton(name, border); |
---|
| 52 | + } |
---|
| 53 | + } |
---|
| 54 | + |
---|
| 55 | + cToggleButton GetToggleButton(String name, boolean border) |
---|
| 56 | + { |
---|
| 57 | + try |
---|
| 58 | + { |
---|
| 59 | + ImageIcon icon = GetIcon(name); |
---|
| 60 | + return new cToggleButton(icon, border); |
---|
| 61 | + } |
---|
| 62 | + catch (Exception e) |
---|
| 63 | + { |
---|
| 64 | + return new cToggleButton(name, border); |
---|
| 65 | + } |
---|
| 66 | + } |
---|
| 67 | + |
---|
| 68 | + cCheckBox GetCheckBox(String name, boolean border) |
---|
| 69 | + { |
---|
| 70 | + try |
---|
| 71 | + { |
---|
| 72 | + ImageIcon icon = GetIcon(name); |
---|
| 73 | + return new cCheckBox(icon, border); |
---|
| 74 | + } |
---|
| 75 | + catch (Exception e) |
---|
| 76 | + { |
---|
| 77 | + return new cCheckBox(name, border); |
---|
| 78 | + } |
---|
| 79 | + } |
---|
| 80 | + |
---|
| 81 | + private ImageIcon GetIcon(String name) throws IOException |
---|
| 82 | + { |
---|
| 83 | + BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name)); |
---|
| 84 | + |
---|
| 85 | + if (image.getWidth() != 24 && image.getHeight() != 24) |
---|
| 86 | + { |
---|
| 87 | + BufferedImage resized = new BufferedImage(24, 24, image.getType()); |
---|
| 88 | + Graphics2D g = resized.createGraphics(); |
---|
| 89 | + g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); |
---|
| 90 | + //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
---|
| 91 | + g.drawImage(image, 0, 0, 24, 24, 0, 0, image.getWidth(), image.getHeight(), null); |
---|
| 92 | + g.dispose(); |
---|
| 93 | + |
---|
| 94 | + image = resized; |
---|
| 95 | + } |
---|
| 96 | + |
---|
| 97 | + javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image); |
---|
| 98 | + return icon; |
---|
| 99 | + } |
---|
38 | 100 | |
---|
39 | 101 | // SCRIPT |
---|
40 | 102 | |
---|
.. | .. |
---|
168 | 230 | // objEditor.ctrlPanel.remove(remarkButton); |
---|
169 | 231 | |
---|
170 | 232 | objEditor.ctrlPanel.remove(setupPanel); |
---|
171 | | - objEditor.ctrlPanel.remove(commandsPanel); |
---|
| 233 | + objEditor.ctrlPanel.remove(setupPanel2); |
---|
| 234 | + objEditor.ctrlPanel.remove(objectCommandsPanel); |
---|
172 | 235 | objEditor.ctrlPanel.remove(pushPanel); |
---|
173 | 236 | //objEditor.ctrlPanel.remove(fillPanel); |
---|
174 | 237 | |
---|
.. | .. |
---|
243 | 306 | //localCopy.parent = null; |
---|
244 | 307 | |
---|
245 | 308 | frame = new JFrame(); |
---|
| 309 | + frame.setUndecorated(true); |
---|
246 | 310 | objEditor = this; |
---|
247 | 311 | this.callee = callee; |
---|
248 | 312 | |
---|
.. | .. |
---|
278 | 342 | frame.setMenuBar(menuBar = new MenuBar()); |
---|
279 | 343 | menuBar.add(fileMenu = new Menu("File")); |
---|
280 | 344 | fileMenu.add(newItem = new MenuItem("New")); |
---|
281 | | - fileMenu.add(loadItem = new MenuItem("Load...")); |
---|
| 345 | + fileMenu.add(loadItem = new MenuItem("Open...")); |
---|
282 | 346 | |
---|
283 | 347 | //oe.menuBar.add(menu = new Menu("Include")); |
---|
284 | 348 | Menu menu = new Menu("Import"); |
---|
.. | .. |
---|
323 | 387 | toolbarPanel.setName("Toolbar"); |
---|
324 | 388 | treePanel = new cGridBag(); |
---|
325 | 389 | treePanel.setName("Tree"); |
---|
| 390 | + |
---|
| 391 | + editPanel = new cGridBag().setVertical(true); |
---|
| 392 | + editPanel.setName("Edit"); |
---|
| 393 | + |
---|
326 | 394 | ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout()); |
---|
327 | | - ctrlPanel.setName("Edit"); |
---|
| 395 | + |
---|
| 396 | + editCommandsPanel = new cGridBag(); |
---|
| 397 | + editPanel.add(editCommandsPanel); |
---|
| 398 | + editPanel.add(ctrlPanel); |
---|
| 399 | + |
---|
| 400 | + toolboxPanel = new cGridBag().setVertical(false); |
---|
| 401 | + toolboxPanel.setName("Toolbox"); |
---|
| 402 | + |
---|
328 | 403 | materialPanel = new cGridBag().setVertical(true); |
---|
329 | 404 | materialPanel.setName("Material"); |
---|
| 405 | + |
---|
330 | 406 | /*JTextPane*/ |
---|
331 | 407 | infoarea = createTextPane(); |
---|
332 | 408 | doc = infoarea.getStyledDocument(); |
---|
.. | .. |
---|
419 | 495 | e.printStackTrace(); |
---|
420 | 496 | } |
---|
421 | 497 | |
---|
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(); |
---|
| 498 | +// String selection = infoarea.getText(); |
---|
| 499 | +// java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection); |
---|
| 500 | +// java.awt.datatransfer.Clipboard clipboard = |
---|
| 501 | +// Toolkit.getDefaultToolkit().getSystemClipboard(); |
---|
426 | 502 | //clipboard.setContents(data, data); |
---|
427 | 503 | } |
---|
428 | 504 | |
---|
.. | .. |
---|
582 | 658 | } |
---|
583 | 659 | } |
---|
584 | 660 | |
---|
| 661 | +static GraphicsDevice device = GraphicsEnvironment |
---|
| 662 | + .getLocalGraphicsEnvironment().getScreenDevices()[0]; |
---|
| 663 | + |
---|
| 664 | + Rectangle keeprect; |
---|
| 665 | + cRadio radio; |
---|
| 666 | + |
---|
| 667 | +cButton keepButton; |
---|
| 668 | + cButton twoButton; // Full 3D |
---|
| 669 | + cButton sixButton; |
---|
| 670 | + cButton threeButton; |
---|
| 671 | + cButton sevenButton; |
---|
| 672 | + cButton fourButton; // full panel |
---|
| 673 | + cButton oneButton; // full XYZ |
---|
| 674 | + //cButton currentLayout; |
---|
| 675 | + |
---|
| 676 | + boolean maximized; |
---|
| 677 | + |
---|
| 678 | + cButton fullscreenLayout; |
---|
| 679 | + |
---|
| 680 | + void Minimize() |
---|
| 681 | + { |
---|
| 682 | + frame.setState(Frame.ICONIFIED); |
---|
| 683 | + } |
---|
| 684 | + |
---|
| 685 | + void Maximize() |
---|
| 686 | + { |
---|
| 687 | + if (maximized) |
---|
| 688 | + { |
---|
| 689 | + frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height); |
---|
| 690 | + } |
---|
| 691 | + else |
---|
| 692 | + { |
---|
| 693 | + keeprect = frame.getBounds(); |
---|
| 694 | + Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds(); |
---|
| 695 | + Dimension rect2 = frame.getToolkit().getScreenSize(); |
---|
| 696 | + frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height); |
---|
| 697 | +// frame.setState(Frame.MAXIMIZED_BOTH); |
---|
| 698 | + } |
---|
| 699 | + |
---|
| 700 | + maximized ^= true; |
---|
| 701 | + } |
---|
| 702 | + |
---|
585 | 703 | void ToggleFullScreen() |
---|
586 | 704 | { |
---|
587 | 705 | if (CameraPane.FULLSCREEN) |
---|
588 | 706 | { |
---|
589 | | - frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
590 | | - framePanel.add(bigThree); |
---|
591 | | - frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 707 | + device.setFullScreenWindow(null); |
---|
| 708 | + //frame.setVisible(false); |
---|
| 709 | +// frame.removeNotify(); |
---|
| 710 | +// frame.setUndecorated(false); |
---|
| 711 | +// frame.addNotify(); |
---|
| 712 | + //frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height); |
---|
| 713 | + |
---|
| 714 | +// X frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
| 715 | +// X framePanel.add(bigThree); |
---|
| 716 | +// X frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 717 | + framePanel.setDividerLocation(1); |
---|
| 718 | + |
---|
| 719 | + //frame.setVisible(true); |
---|
| 720 | + radio.layout = keepButton; |
---|
| 721 | + //theFrame = null; |
---|
| 722 | + keepButton = null; |
---|
| 723 | + radio.layout.doClick(); |
---|
| 724 | + |
---|
592 | 725 | } else |
---|
593 | 726 | { |
---|
594 | | - frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
595 | | - framePanel.remove(bigThree); |
---|
596 | | - frame.getContentPane().add(/*"Center",*/bigThree); |
---|
| 727 | + keepButton = radio.layout; |
---|
| 728 | + //keeprect = frame.getBounds(); |
---|
| 729 | +// frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width, |
---|
| 730 | +// frame.getToolkit().getScreenSize().height); |
---|
| 731 | + //frame.setVisible(false); |
---|
| 732 | + device.setFullScreenWindow(frame); |
---|
| 733 | +// frame.removeNotify(); |
---|
| 734 | +// frame.setUndecorated(true); |
---|
| 735 | +// frame.addNotify(); |
---|
| 736 | +// X frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
| 737 | +// X framePanel.remove(bigThree); |
---|
| 738 | +// X frame.getContentPane().add(/*"Center",*/bigThree); |
---|
| 739 | + framePanel.setDividerLocation(0); |
---|
| 740 | + |
---|
| 741 | + radio.layout = fullscreenLayout; |
---|
| 742 | + radio.layout.doClick(); |
---|
| 743 | + //frame.setVisible(true); |
---|
597 | 744 | } |
---|
| 745 | + |
---|
598 | 746 | cameraView.ToggleFullScreen(); |
---|
599 | 747 | } |
---|
600 | 748 | |
---|
.. | .. |
---|
745 | 893 | JButton fasterButton; |
---|
746 | 894 | JButton remarkButton; |
---|
747 | 895 | |
---|
| 896 | + cGridBag editPanel; |
---|
| 897 | + cGridBag editCommandsPanel; |
---|
| 898 | + |
---|
748 | 899 | cGridBag namePanel; |
---|
749 | 900 | cGridBag setupPanel; |
---|
750 | | - cGridBag commandsPanel; |
---|
| 901 | + cGridBag setupPanel2; |
---|
| 902 | + cGridBag objectCommandsPanel; |
---|
751 | 903 | cGridBag pushPanel; |
---|
752 | 904 | cGridBag fillPanel; |
---|
753 | 905 | |
---|
.. | .. |
---|
939 | 1091 | markCB = AddCheckBox(setupPanel, "Mark", copy.marked); |
---|
940 | 1092 | markCB.setToolTipText("Set the animation target transform"); |
---|
941 | 1093 | |
---|
942 | | - rewindCB = AddCheckBox(setupPanel, "Rewind", copy.rewind); |
---|
| 1094 | + setupPanel2 = new cGridBag().setVertical(false); |
---|
| 1095 | + |
---|
| 1096 | + rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind); |
---|
943 | 1097 | rewindCB.setToolTipText("Rewind animation"); |
---|
944 | 1098 | |
---|
945 | | - randomCB = AddCheckBox(setupPanel, "Random", copy.random); |
---|
946 | | - randomCB.setToolTipText("Option for switch node"); |
---|
| 1099 | + randomCB = AddCheckBox(setupPanel2, "Rand", copy.random); |
---|
| 1100 | + randomCB.setToolTipText("Randomly Rewind or Go back and forth"); |
---|
947 | 1101 | |
---|
948 | 1102 | if (Globals.ADVANCED) |
---|
949 | 1103 | { |
---|
950 | | - link2masterCB = AddCheckBox(setupPanel, "Support", copy.link2master); |
---|
| 1104 | + link2masterCB = AddCheckBox(setupPanel2, "Supp", copy.link2master); |
---|
951 | 1105 | link2masterCB.setToolTipText("Attach to support"); |
---|
952 | | - speedupCB = AddCheckBox(setupPanel, "Speed", copy.speedup); |
---|
| 1106 | + speedupCB = AddCheckBox(setupPanel2, "Speed", copy.speedup); |
---|
953 | 1107 | speedupCB.setToolTipText("Option motion capture"); |
---|
954 | 1108 | } |
---|
955 | 1109 | |
---|
956 | 1110 | oe.ctrlPanel.add(setupPanel); |
---|
957 | 1111 | oe.ctrlPanel.Return(); |
---|
| 1112 | + oe.ctrlPanel.add(setupPanel2); |
---|
| 1113 | + oe.ctrlPanel.Return(); |
---|
958 | 1114 | |
---|
959 | | - commandsPanel = new cGridBag().setVertical(false); |
---|
| 1115 | + objectCommandsPanel = new cGridBag().setVertical(false); |
---|
960 | 1116 | |
---|
961 | | - resetButton = AddButton(commandsPanel, "Reset"); |
---|
| 1117 | + resetButton = AddButton(objectCommandsPanel, "Reset"); |
---|
962 | 1118 | resetButton.setToolTipText("Jump to frame zero"); |
---|
963 | | - stepButton = AddButton(commandsPanel, "Step"); |
---|
| 1119 | + stepButton = AddButton(objectCommandsPanel, "Step"); |
---|
964 | 1120 | stepButton.setToolTipText("Step one frame"); |
---|
965 | 1121 | // resetAllButton = AddButton(oe, "Reset All"); |
---|
966 | 1122 | // stepAllButton = AddButton(oe, "Step All"); |
---|
967 | 1123 | // Return(); |
---|
968 | | - slowerButton = AddButton(commandsPanel, "Slow"); |
---|
| 1124 | + slowerButton = AddButton(objectCommandsPanel, "Slow"); |
---|
969 | 1125 | slowerButton.setToolTipText("Decrease animation speed"); |
---|
970 | | - fasterButton = AddButton(commandsPanel, "Fast"); |
---|
| 1126 | + fasterButton = AddButton(objectCommandsPanel, "Fast"); |
---|
971 | 1127 | fasterButton.setToolTipText("Increase animation speed"); |
---|
972 | | - remarkButton = AddButton(commandsPanel, "Remark"); |
---|
| 1128 | + remarkButton = AddButton(objectCommandsPanel, "Remark"); |
---|
973 | 1129 | remarkButton.setToolTipText("Set the current transform as the target"); |
---|
974 | 1130 | |
---|
975 | | - oe.ctrlPanel.add(commandsPanel); |
---|
| 1131 | + oe.ctrlPanel.add(objectCommandsPanel); |
---|
976 | 1132 | oe.ctrlPanel.Return(); |
---|
977 | 1133 | |
---|
978 | 1134 | pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH, 1.1); // To have the buttons |
---|
.. | .. |
---|
1178 | 1334 | //worldPanel.setName("World"); |
---|
1179 | 1335 | centralPanel = new cGridBag(); |
---|
1180 | 1336 | centralPanel.preferredWidth = 20; |
---|
1181 | | - timelinePanel = new JPanel(new BorderLayout()); |
---|
1182 | | - timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); |
---|
| 1337 | + |
---|
| 1338 | + if (Globals.ADVANCED) |
---|
| 1339 | + { |
---|
| 1340 | + timelinePanel = new JPanel(new BorderLayout()); |
---|
| 1341 | + timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); |
---|
1183 | 1342 | |
---|
1184 | 1343 | cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel); |
---|
1185 | 1344 | cameraPanel.setContinuousLayout(true); |
---|
.. | .. |
---|
1188 | 1347 | // cameraPanel.setDividerSize(9); |
---|
1189 | 1348 | cameraPanel.setResizeWeight(1.0); |
---|
1190 | 1349 | |
---|
| 1350 | + } |
---|
| 1351 | + |
---|
1191 | 1352 | centralPanel.add(cameraView); |
---|
| 1353 | + centralPanel.setFocusable(true); |
---|
1192 | 1354 | //frame.setJMenuBar(timelineMenubar); |
---|
1193 | 1355 | //centralPanel.add(timelinePanel); |
---|
1194 | 1356 | |
---|
.. | .. |
---|
1250 | 1412 | |
---|
1251 | 1413 | //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); |
---|
1252 | 1414 | //tmp.setName("Edit"); |
---|
| 1415 | + objectPanel.add(toolboxPanel); |
---|
1253 | 1416 | objectPanel.add(materialPanel); |
---|
1254 | 1417 | // JPanel north = new JPanel(new BorderLayout()); |
---|
1255 | 1418 | // north.setName("Edit"); |
---|
1256 | 1419 | // north.add(ctrlPanel, BorderLayout.NORTH); |
---|
1257 | 1420 | // objectPanel.add(north); |
---|
1258 | | - objectPanel.add(ctrlPanel); |
---|
| 1421 | + objectPanel.add(editPanel); |
---|
1259 | 1422 | objectPanel.add(infoPanel); |
---|
1260 | 1423 | |
---|
1261 | 1424 | /* |
---|
.. | .. |
---|
1386 | 1549 | frame.setSize(1280, 860); |
---|
1387 | 1550 | frame.setVisible(true); |
---|
1388 | 1551 | |
---|
| 1552 | + cameraView.requestFocusInWindow(); |
---|
| 1553 | + |
---|
1389 | 1554 | gridPanel.setDividerLocation(1.0); |
---|
1390 | 1555 | |
---|
1391 | 1556 | frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); |
---|
.. | .. |
---|
2072 | 2237 | |
---|
2073 | 2238 | void LoadObjFile(String fullname) |
---|
2074 | 2239 | { |
---|
2075 | | - /* |
---|
| 2240 | + System.out.println("Loading " + fullname); |
---|
| 2241 | + /**/ |
---|
2076 | 2242 | //lastFilename = fullname; |
---|
2077 | 2243 | if(loadObjThread == null) |
---|
2078 | 2244 | { |
---|
2079 | | - loadObjThread = new LoadOBJThread(); |
---|
2080 | | - loadObjThread.start(); |
---|
| 2245 | + loadObjThread = new LoadOBJThread(); |
---|
| 2246 | + loadObjThread.start(); |
---|
2081 | 2247 | } |
---|
2082 | 2248 | |
---|
2083 | 2249 | loadObjThread.add(fullname); |
---|
2084 | | - */ |
---|
| 2250 | + /**/ |
---|
2085 | 2251 | |
---|
2086 | | - System.out.println("Loading " + fullname); |
---|
2087 | | - makeSomething(new FileObject(fullname, true), true); |
---|
| 2252 | + //makeSomething(new FileObject(fullname, true), true); |
---|
2088 | 2253 | } |
---|
2089 | 2254 | |
---|
2090 | 2255 | void LoadGFDFile(String fullname) |
---|
.. | .. |
---|
3214 | 3379 | objEditor.refreshContents(); |
---|
3215 | 3380 | } |
---|
3216 | 3381 | |
---|
3217 | | - static public byte[] Compress(Object o) |
---|
| 3382 | + static public byte[] Compress(Object3D o) |
---|
3218 | 3383 | { |
---|
3219 | 3384 | try |
---|
3220 | 3385 | { |
---|
.. | .. |
---|
3222 | 3387 | java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos); |
---|
3223 | 3388 | ObjectOutputStream out = new ObjectOutputStream(zstream); |
---|
3224 | 3389 | |
---|
| 3390 | + Object3D parent = o.parent; |
---|
| 3391 | + o.parent = null; |
---|
| 3392 | + |
---|
3225 | 3393 | out.writeObject(o); |
---|
3226 | 3394 | |
---|
| 3395 | + o.parent = parent; |
---|
| 3396 | + |
---|
3227 | 3397 | out.flush(); |
---|
3228 | 3398 | |
---|
3229 | 3399 | zstream.close(); |
---|
.. | .. |
---|
3304 | 3474 | |
---|
3305 | 3475 | public void Save() |
---|
3306 | 3476 | { |
---|
| 3477 | + System.err.println("Save"); |
---|
| 3478 | + |
---|
3307 | 3479 | cRadio tab = GetCurrentTab(); |
---|
| 3480 | + |
---|
| 3481 | + boolean temp = CameraPane.SWITCH; |
---|
| 3482 | + CameraPane.SWITCH = false; |
---|
3308 | 3483 | |
---|
3309 | 3484 | copy.ExtractBigData(hashtable); |
---|
3310 | 3485 | |
---|
.. | .. |
---|
3312 | 3487 | tab.graphs[tab.undoindex++] = Compress(copy); |
---|
3313 | 3488 | |
---|
3314 | 3489 | copy.RestoreBigData(hashtable); |
---|
| 3490 | + |
---|
| 3491 | + CameraPane.SWITCH = temp; |
---|
3315 | 3492 | |
---|
3316 | 3493 | //assert(hashtable.isEmpty()); |
---|
3317 | 3494 | |
---|
.. | .. |
---|
3342 | 3519 | |
---|
3343 | 3520 | void CopyChanged(Object3D obj) |
---|
3344 | 3521 | { |
---|
| 3522 | + boolean temp = CameraPane.SWITCH; |
---|
| 3523 | + CameraPane.SWITCH = false; |
---|
| 3524 | + |
---|
3345 | 3525 | copy.ExtractBigData(hashtable); |
---|
3346 | 3526 | |
---|
3347 | 3527 | copy.clear(); |
---|
.. | .. |
---|
3352 | 3532 | } |
---|
3353 | 3533 | |
---|
3354 | 3534 | copy.RestoreBigData(hashtable); |
---|
| 3535 | + |
---|
| 3536 | + CameraPane.SWITCH = temp; |
---|
3355 | 3537 | |
---|
3356 | 3538 | //assert(hashtable.isEmpty()); |
---|
3357 | 3539 | |
---|
.. | .. |
---|
3378 | 3560 | |
---|
3379 | 3561 | public void Undo() |
---|
3380 | 3562 | { |
---|
| 3563 | + System.err.println("Undo"); |
---|
| 3564 | + |
---|
3381 | 3565 | cRadio tab = GetCurrentTab(); |
---|
3382 | 3566 | |
---|
3383 | 3567 | if (tab.undoindex == 0) |
---|
.. | .. |
---|
3561 | 3745 | assert false; |
---|
3562 | 3746 | } |
---|
3563 | 3747 | |
---|
3564 | | - void EditSelection() |
---|
| 3748 | + void EditSelection(boolean newWindow) |
---|
3565 | 3749 | { |
---|
3566 | 3750 | } |
---|
3567 | 3751 | |
---|
.. | .. |
---|
4056 | 4240 | |
---|
4057 | 4241 | void makeSomething(Object3D thing, boolean resetmodel) // deselect) |
---|
4058 | 4242 | { |
---|
4059 | | - Save(); |
---|
| 4243 | + if (Globals.SAVEONMAKE) // && resetmodel) |
---|
| 4244 | + Save(); |
---|
4060 | 4245 | //Tween.set(thing, 0).target(1).start(tweenManager); |
---|
4061 | 4246 | //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager); |
---|
4062 | 4247 | // if (thing instanceof GenericJointDemo) |
---|
.. | .. |
---|
4143 | 4328 | { |
---|
4144 | 4329 | ResetModel(); |
---|
4145 | 4330 | Select(thing.GetTreePath(), true, false); // unselect... false); |
---|
| 4331 | + |
---|
| 4332 | + if (thing.Size() == 0) |
---|
| 4333 | + { |
---|
| 4334 | + //EditSelection(false); |
---|
| 4335 | + } |
---|
| 4336 | + |
---|
4146 | 4337 | refreshContents(); |
---|
4147 | 4338 | } |
---|
4148 | 4339 | |
---|
.. | .. |
---|
4280 | 4471 | |
---|
4281 | 4472 | try |
---|
4282 | 4473 | { |
---|
| 4474 | + // Try compressed version first. |
---|
4283 | 4475 | java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
4284 | 4476 | java.util.zip.GZIPInputStream zstream = new java.util.zip.GZIPInputStream(istream); |
---|
4285 | 4477 | java.io.ObjectInputStream p = new java.io.ObjectInputStream(zstream); |
---|
.. | .. |
---|
4349 | 4541 | |
---|
4350 | 4542 | void LoadIt(Object obj) |
---|
4351 | 4543 | { |
---|
| 4544 | + if (obj == null) |
---|
| 4545 | + { |
---|
| 4546 | + // Invalid file |
---|
| 4547 | + return; |
---|
| 4548 | + } |
---|
| 4549 | + |
---|
4352 | 4550 | System.out.println("Loaded " + obj); |
---|
4353 | 4551 | //new Exception().printStackTrace(); |
---|
4354 | 4552 | Object3D readobj = (Object3D) obj; |
---|
.. | .. |
---|
4358 | 4556 | |
---|
4359 | 4557 | if (readobj != null) |
---|
4360 | 4558 | { |
---|
| 4559 | + if (Globals.SAVEONMAKE) |
---|
4361 | 4560 | Save(); |
---|
4362 | 4561 | try |
---|
4363 | 4562 | { |
---|
.. | .. |
---|
4729 | 4928 | CheckboxMenuItem togglePaintItem; |
---|
4730 | 4929 | JSplitPane mainPanel; |
---|
4731 | 4930 | JScrollPane scrollpane; |
---|
| 4931 | + |
---|
4732 | 4932 | JPanel toolbarPanel; |
---|
| 4933 | + |
---|
4733 | 4934 | cGridBag treePanel; |
---|
| 4935 | + |
---|
4734 | 4936 | JPanel radioPanel; |
---|
4735 | 4937 | ButtonGroup buttonGroup; |
---|
4736 | | - cGridBag ctrlPanel; |
---|
| 4938 | + |
---|
| 4939 | + cGridBag toolboxPanel; |
---|
4737 | 4940 | cGridBag materialPanel; |
---|
| 4941 | + cGridBag ctrlPanel; |
---|
| 4942 | + |
---|
4738 | 4943 | JScrollPane infoPanel; |
---|
| 4944 | + |
---|
4739 | 4945 | cGridBag optionsPanel; |
---|
| 4946 | + |
---|
4740 | 4947 | JTabbedPane objectPanel; |
---|
| 4948 | + |
---|
4741 | 4949 | cGridBag XYZPanel; |
---|
| 4950 | + |
---|
4742 | 4951 | JSplitPane gridPanel; |
---|
4743 | 4952 | JSplitPane bigPanel; |
---|
| 4953 | + |
---|
4744 | 4954 | cGridBag bigThree; |
---|
4745 | 4955 | cGridBag scenePanel; |
---|
4746 | 4956 | cGridBag centralPanel; |
---|
.. | .. |
---|
4855 | 5065 | cNumberSlider fogField; |
---|
4856 | 5066 | JLabel opacityPowerLabel; |
---|
4857 | 5067 | cNumberSlider opacityPowerField; |
---|
4858 | | - JTree jTree; |
---|
| 5068 | + cTree jTree; |
---|
4859 | 5069 | //ObjectUI parent; |
---|
4860 | 5070 | |
---|
4861 | 5071 | cNumberSlider normalpushField; |
---|