.. | .. |
---|
15 | 15 | //import javax.swing.plaf.ColorUIResource; |
---|
16 | 16 | //import javax.swing.plaf.metal.DefaultMetalTheme; |
---|
17 | 17 | |
---|
| 18 | +import javax.swing.plaf.basic.BasicSplitPaneDivider; |
---|
| 19 | +import javax.swing.plaf.basic.BasicSplitPaneUI; |
---|
| 20 | + |
---|
18 | 21 | //import javax.media.opengl.GLCanvas; |
---|
19 | 22 | |
---|
20 | 23 | import //weka.core. |
---|
.. | .. |
---|
207 | 210 | |
---|
208 | 211 | objEditor.ctrlPanel.remove(namePanel); |
---|
209 | 212 | |
---|
210 | | - if (!GroupEditor.allparams) |
---|
| 213 | + if (!allparams) |
---|
211 | 214 | return; |
---|
212 | 215 | |
---|
213 | 216 | // objEditor.ctrlPanel.remove(liveCB); |
---|
.. | .. |
---|
279 | 282 | client = inClient; |
---|
280 | 283 | copy = client; |
---|
281 | 284 | |
---|
| 285 | + if (copy.versions == null) |
---|
| 286 | + { |
---|
| 287 | + copy.versions = new byte[100][]; |
---|
| 288 | + copy.versionindex = -1; |
---|
| 289 | + } |
---|
| 290 | + |
---|
282 | 291 | // "this" is not called: SetupUI2(objEditor); |
---|
283 | 292 | } |
---|
284 | 293 | |
---|
.. | .. |
---|
292 | 301 | client = inClient; |
---|
293 | 302 | copy = client; |
---|
294 | 303 | |
---|
| 304 | + if (copy.versions == null) |
---|
| 305 | + { |
---|
| 306 | + copy.versions = new byte[100][]; |
---|
| 307 | + copy.versionindex = -1; |
---|
| 308 | + } |
---|
| 309 | + |
---|
295 | 310 | SetupUI2(callee.GetEditor()); |
---|
296 | 311 | } |
---|
297 | 312 | |
---|
.. | .. |
---|
306 | 321 | //localCopy.parent = null; |
---|
307 | 322 | |
---|
308 | 323 | frame = new JFrame(); |
---|
309 | | - frame.setUndecorated(true); |
---|
| 324 | + frame.setUndecorated(false); |
---|
310 | 325 | objEditor = this; |
---|
311 | 326 | this.callee = callee; |
---|
312 | 327 | |
---|
.. | .. |
---|
324 | 339 | copy = localCopy; |
---|
325 | 340 | copy.editWindow = this; |
---|
326 | 341 | |
---|
| 342 | + if (copy.versions == null) |
---|
| 343 | + { |
---|
| 344 | + copy.versions = new byte[100][]; |
---|
| 345 | + copy.versionindex = -1; |
---|
| 346 | + } |
---|
| 347 | + |
---|
327 | 348 | SetupMenu(); |
---|
328 | 349 | |
---|
329 | 350 | //SetupName(objEditor); // new |
---|
.. | .. |
---|
337 | 358 | return frame.action(event, obj); |
---|
338 | 359 | } |
---|
339 | 360 | |
---|
| 361 | + // Cannot work without static |
---|
| 362 | + static boolean allparams = true; |
---|
| 363 | + |
---|
| 364 | + static java.util.Vector<Object3D> listUI = new java.util.Vector<Object3D>(); |
---|
| 365 | + |
---|
340 | 366 | void SetupMenu() |
---|
341 | 367 | { |
---|
342 | 368 | frame.setMenuBar(menuBar = new MenuBar()); |
---|
343 | 369 | menuBar.add(fileMenu = new Menu("File")); |
---|
344 | 370 | fileMenu.add(newItem = new MenuItem("New")); |
---|
345 | | - fileMenu.add(loadItem = new MenuItem("Open...")); |
---|
| 371 | + fileMenu.add(openItem = new MenuItem("Open...")); |
---|
346 | 372 | |
---|
347 | 373 | //oe.menuBar.add(menu = new Menu("Include")); |
---|
348 | 374 | Menu menu = new Menu("Import"); |
---|
.. | .. |
---|
374 | 400 | } |
---|
375 | 401 | |
---|
376 | 402 | newItem.addActionListener(this); |
---|
377 | | - loadItem.addActionListener(this); |
---|
| 403 | + openItem.addActionListener(this); |
---|
378 | 404 | saveItem.addActionListener(this); |
---|
379 | 405 | saveAsItem.addActionListener(this); |
---|
380 | 406 | exportAsItem.addActionListener(this); |
---|
.. | .. |
---|
397 | 423 | // } |
---|
398 | 424 | // |
---|
399 | 425 | // materialFlushed = true; |
---|
| 426 | +// } |
---|
| 427 | +// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Edit")) |
---|
| 428 | +// { |
---|
| 429 | +// if (listUI.size() == 0) |
---|
| 430 | +// EditSelection(false); |
---|
400 | 431 | // } |
---|
401 | 432 | |
---|
402 | 433 | refreshContents(false); // To refresh Info tab |
---|
.. | .. |
---|
436 | 467 | // TEXTAREA infoarea.setLineWrap(true); |
---|
437 | 468 | // TEXTAREA infoarea.setWrapStyleWord(true); |
---|
438 | 469 | infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED); |
---|
439 | | - infoPanel.setPreferredSize(new Dimension(50, 200)); |
---|
| 470 | + infoPanel.setPreferredSize(new Dimension(1, 1)); |
---|
440 | 471 | infoPanel.setName("Info"); |
---|
441 | 472 | //infoPanel.setLayout(new BorderLayout()); |
---|
442 | 473 | //infoPanel.add(createTextPane()); |
---|
.. | .. |
---|
448 | 479 | mainPanel.setDividerSize(9); |
---|
449 | 480 | mainPanel.setDividerLocation(0.5); //1.0); |
---|
450 | 481 | mainPanel.setResizeWeight(0.5); |
---|
451 | | - |
---|
| 482 | + |
---|
| 483 | +//mainPanel.setDividerSize((int) (mainPanel.getDividerSize() * 1.5)); |
---|
| 484 | + BasicSplitPaneDivider divider = ( (BasicSplitPaneUI) mainPanel.getUI()).getDivider(); |
---|
| 485 | + divider.setDividerSize(15); |
---|
| 486 | + divider.setBorder(BorderFactory.createTitledBorder(divider.getBorder(), "Custom border title -- gets rid of the one-touch arrows!")); |
---|
| 487 | + |
---|
| 488 | + mainPanel.setUI(new BasicSplitPaneUI()); |
---|
| 489 | + |
---|
452 | 490 | //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5)); |
---|
453 | 491 | //mainPanel.setLayout(new GridBagLayout()); |
---|
454 | 492 | toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); |
---|
.. | .. |
---|
679 | 717 | } |
---|
680 | 718 | } |
---|
681 | 719 | |
---|
682 | | -static GraphicsDevice device = GraphicsEnvironment |
---|
683 | | - .getLocalGraphicsEnvironment().getScreenDevices()[0]; |
---|
| 720 | +//static GraphicsDevice device = GraphicsEnvironment |
---|
| 721 | +// .getLocalGraphicsEnvironment().getScreenDevices()[0]; |
---|
684 | 722 | |
---|
685 | 723 | Rectangle keeprect; |
---|
686 | 724 | cRadio radio; |
---|
.. | .. |
---|
701 | 739 | void Minimize() |
---|
702 | 740 | { |
---|
703 | 741 | frame.setState(Frame.ICONIFIED); |
---|
| 742 | + frame.validate(); |
---|
704 | 743 | } |
---|
705 | 744 | |
---|
| 745 | +// artifactURI=null, type=0, property=${file.reference.jfxrt.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@6767876f, broken=false, additional={} |
---|
| 746 | +// artifactURI=null, type=0, property=${file.reference.mac-ui.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@16bdc817, broken=false, additional={} |
---|
| 747 | +// artifactURI=null, type=0, property=${file.reference.classes.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@9daa9c17, broken=false, additional={} |
---|
706 | 748 | void Maximize() |
---|
707 | 749 | { |
---|
| 750 | + if (CameraPane.FULLSCREEN) |
---|
| 751 | + { |
---|
| 752 | + ToggleFullScreen(); |
---|
| 753 | + } |
---|
| 754 | + |
---|
708 | 755 | if (maximized) |
---|
709 | 756 | { |
---|
710 | 757 | frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height); |
---|
.. | .. |
---|
712 | 759 | else |
---|
713 | 760 | { |
---|
714 | 761 | keeprect = frame.getBounds(); |
---|
715 | | - Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds(); |
---|
716 | | - Dimension rect2 = frame.getToolkit().getScreenSize(); |
---|
717 | | - frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height); |
---|
| 762 | +// Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds(); |
---|
| 763 | +// Dimension rect2 = frame.getToolkit().getScreenSize(); |
---|
| 764 | +// frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height); |
---|
718 | 765 | // frame.setState(Frame.MAXIMIZED_BOTH); |
---|
| 766 | + frame.setBounds(frame.getGraphicsConfiguration().getBounds()); |
---|
719 | 767 | } |
---|
720 | 768 | |
---|
721 | 769 | maximized ^= true; |
---|
| 770 | + |
---|
| 771 | + frame.validate(); |
---|
722 | 772 | } |
---|
| 773 | + |
---|
| 774 | + cButton minButton; |
---|
| 775 | + cButton maxButton; |
---|
| 776 | + cButton fullButton; |
---|
723 | 777 | |
---|
724 | 778 | void ToggleFullScreen() |
---|
725 | 779 | { |
---|
726 | | - if (CameraPane.FULLSCREEN) |
---|
| 780 | +GraphicsDevice device = frame.getGraphicsConfiguration().getDevice(); |
---|
| 781 | + |
---|
| 782 | + cameraView.ToggleFullScreen(); |
---|
| 783 | + |
---|
| 784 | + if (!CameraPane.FULLSCREEN) |
---|
727 | 785 | { |
---|
728 | 786 | device.setFullScreenWindow(null); |
---|
| 787 | + frame.dispose(); |
---|
| 788 | + frame.setUndecorated(false); |
---|
| 789 | + frame.validate(); |
---|
| 790 | + frame.setVisible(true); |
---|
| 791 | + |
---|
729 | 792 | //frame.setVisible(false); |
---|
730 | 793 | // frame.removeNotify(); |
---|
731 | 794 | // frame.setUndecorated(false); |
---|
.. | .. |
---|
735 | 798 | // X frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
736 | 799 | // X framePanel.add(bigThree); |
---|
737 | 800 | // X frame.getContentPane().add(/*"Center",*/framePanel); |
---|
738 | | - framePanel.setDividerLocation(1); |
---|
| 801 | + framePanel.setDividerLocation(46); |
---|
739 | 802 | |
---|
740 | 803 | //frame.setVisible(true); |
---|
741 | 804 | radio.layout = keepButton; |
---|
.. | .. |
---|
750 | 813 | // frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width, |
---|
751 | 814 | // frame.getToolkit().getScreenSize().height); |
---|
752 | 815 | //frame.setVisible(false); |
---|
| 816 | + |
---|
| 817 | + frame.dispose(); |
---|
| 818 | + frame.setUndecorated(true); |
---|
753 | 819 | device.setFullScreenWindow(frame); |
---|
| 820 | + frame.validate(); |
---|
| 821 | + frame.setVisible(true); |
---|
754 | 822 | // frame.removeNotify(); |
---|
755 | 823 | // frame.setUndecorated(true); |
---|
756 | 824 | // frame.addNotify(); |
---|
.. | .. |
---|
763 | 831 | radio.layout.doClick(); |
---|
764 | 832 | //frame.setVisible(true); |
---|
765 | 833 | } |
---|
766 | | - |
---|
767 | | - cameraView.ToggleFullScreen(); |
---|
| 834 | + frame.validate(); |
---|
768 | 835 | } |
---|
| 836 | + |
---|
| 837 | + private byte[] CompressCopy() |
---|
| 838 | + { |
---|
| 839 | + boolean temp = CameraPane.SWITCH; |
---|
| 840 | + CameraPane.SWITCH = false; |
---|
| 841 | + |
---|
| 842 | + copy.ExtractBigData(versiontable); |
---|
| 843 | + // if (copy == client) |
---|
| 844 | + |
---|
| 845 | + byte[] versions[] = copy.versions; |
---|
| 846 | + copy.versions = null; |
---|
| 847 | + |
---|
| 848 | + byte[] compress = Compress(copy); |
---|
| 849 | + |
---|
| 850 | + copy.versions = versions; |
---|
| 851 | + |
---|
| 852 | + copy.RestoreBigData(versiontable); |
---|
| 853 | + |
---|
| 854 | + CameraPane.SWITCH = temp; |
---|
| 855 | + |
---|
| 856 | + return compress; |
---|
| 857 | + } |
---|
769 | 858 | |
---|
770 | 859 | private JTextPane createTextPane() |
---|
771 | 860 | { |
---|
.. | .. |
---|
1097 | 1186 | namePanel = new cGridBag(); |
---|
1098 | 1187 | |
---|
1099 | 1188 | nameField = AddText(namePanel, copy.GetName()); |
---|
1100 | | - namePanel.add(nameField); |
---|
| 1189 | + namePanel.add(new JScrollPane(nameField, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER)); |
---|
1101 | 1190 | oe.ctrlPanel.add(namePanel); |
---|
1102 | 1191 | |
---|
1103 | 1192 | oe.ctrlPanel.Return(); |
---|
1104 | 1193 | |
---|
1105 | | - if (!GroupEditor.allparams) |
---|
| 1194 | + if (!allparams) |
---|
1106 | 1195 | return; |
---|
1107 | 1196 | |
---|
1108 | 1197 | setupPanel = new cGridBag().setVertical(false); |
---|
.. | .. |
---|
1115 | 1204 | hideCB = AddCheckBox(setupPanel, "Hide", copy.hide); |
---|
1116 | 1205 | hideCB.setToolTipText("Hide object"); |
---|
1117 | 1206 | markCB = AddCheckBox(setupPanel, "Mark", copy.marked); |
---|
1118 | | - markCB.setToolTipText("Set the animation target transform"); |
---|
| 1207 | + markCB.setToolTipText("As animation target transform"); |
---|
1119 | 1208 | |
---|
1120 | 1209 | setupPanel2 = new cGridBag().setVertical(false); |
---|
1121 | 1210 | |
---|
1122 | 1211 | rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind); |
---|
1123 | 1212 | rewindCB.setToolTipText("Rewind animation"); |
---|
1124 | 1213 | |
---|
1125 | | - randomCB = AddCheckBox(setupPanel2, "Rand", copy.random); |
---|
1126 | | - randomCB.setToolTipText("Randomly Rewind or Go back and forth"); |
---|
| 1214 | + randomCB = AddCheckBox(setupPanel2, "Random", copy.random); |
---|
| 1215 | + randomCB.setToolTipText("Randomly Rewind (or Go back and forth)"); |
---|
1127 | 1216 | |
---|
| 1217 | + link2masterCB = AddCheckBox(setupPanel2, "Support", copy.link2master); |
---|
| 1218 | + link2masterCB.setToolTipText("Attach to support"); |
---|
| 1219 | + |
---|
1128 | 1220 | if (Globals.ADVANCED) |
---|
1129 | 1221 | { |
---|
1130 | | - link2masterCB = AddCheckBox(setupPanel2, "Supp", copy.link2master); |
---|
1131 | | - link2masterCB.setToolTipText("Attach to support"); |
---|
1132 | 1222 | speedupCB = AddCheckBox(setupPanel2, "Speed", copy.speedup); |
---|
1133 | 1223 | speedupCB.setToolTipText("Option motion capture"); |
---|
1134 | 1224 | } |
---|
.. | .. |
---|
1439 | 1529 | //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); |
---|
1440 | 1530 | //tmp.setName("Edit"); |
---|
1441 | 1531 | objectPanel.add(materialPanel); |
---|
1442 | | - objectPanel.add(toolboxPanel); |
---|
1443 | 1532 | // JPanel north = new JPanel(new BorderLayout()); |
---|
1444 | 1533 | // north.setName("Edit"); |
---|
1445 | 1534 | // north.add(ctrlPanel, BorderLayout.NORTH); |
---|
1446 | 1535 | // objectPanel.add(north); |
---|
1447 | 1536 | objectPanel.add(editPanel); |
---|
1448 | | - objectPanel.add(infoPanel); |
---|
| 1537 | + |
---|
| 1538 | + //if (Globals.ADVANCED) |
---|
| 1539 | + objectPanel.add(infoPanel); |
---|
| 1540 | + |
---|
| 1541 | + objectPanel.add(toolboxPanel); |
---|
1449 | 1542 | |
---|
1450 | 1543 | /* |
---|
1451 | 1544 | aConstraints.gridx = 0; |
---|
.. | .. |
---|
1454 | 1547 | aConstraints.gridy += 1; |
---|
1455 | 1548 | aConstraints.gridwidth = 1; |
---|
1456 | 1549 | mainPanel.add(objectPanel, aConstraints); |
---|
1457 | | - */ |
---|
| 1550 | + */ |
---|
1458 | 1551 | |
---|
1459 | 1552 | scrollpane = new JScrollPane(mainPanel, ScrollPaneConstants.// VERTICAL_SCROLLBAR_ALWAYS, |
---|
1460 | 1553 | VERTICAL_SCROLLBAR_AS_NEEDED, |
---|
.. | .. |
---|
1553 | 1646 | // aConstraints.gridheight = 1; |
---|
1554 | 1647 | |
---|
1555 | 1648 | framePanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, toolbarPanel, bigThree); |
---|
1556 | | - framePanel.setContinuousLayout(true); |
---|
1557 | | - framePanel.setOneTouchExpandable(true); |
---|
1558 | | - framePanel.setDividerLocation(0.8); |
---|
| 1649 | + framePanel.setContinuousLayout(false); |
---|
| 1650 | + framePanel.setOneTouchExpandable(false); |
---|
| 1651 | + //.setDividerLocation(0.8); |
---|
1559 | 1652 | //framePanel.setDividerSize(15); |
---|
1560 | 1653 | //framePanel.setResizeWeight(0.15); |
---|
1561 | 1654 | framePanel.setName("Frame"); |
---|
.. | .. |
---|
1574 | 1667 | |
---|
1575 | 1668 | frame.setSize(1280, 860); |
---|
1576 | 1669 | |
---|
1577 | | - frame.validate(); |
---|
1578 | | - frame.setVisible(true); |
---|
1579 | | - |
---|
1580 | 1670 | cameraView.requestFocusInWindow(); |
---|
1581 | 1671 | |
---|
1582 | 1672 | gridPanel.setDividerLocation(1.0); |
---|
| 1673 | + |
---|
| 1674 | + frame.validate(); |
---|
| 1675 | + |
---|
| 1676 | + frame.setVisible(true); |
---|
1583 | 1677 | |
---|
1584 | 1678 | frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); |
---|
1585 | 1679 | frame.addWindowListener(new WindowAdapter() |
---|
.. | .. |
---|
1666 | 1760 | texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1667 | 1761 | colorSection.add(texture); |
---|
1668 | 1762 | |
---|
1669 | | - cGridBag anisoU = new cGridBag(); |
---|
1670 | | - anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints); |
---|
1671 | | - anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1672 | | - anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1673 | | - colorSection.add(anisoU); |
---|
1674 | | - |
---|
1675 | | - cGridBag anisoV = new cGridBag(); |
---|
1676 | | - anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints); |
---|
1677 | | - anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1678 | | - anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1679 | | - colorSection.add(anisoV); |
---|
1680 | | - |
---|
1681 | | - cGridBag shadowbias = new cGridBag(); |
---|
1682 | | - shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints); |
---|
1683 | | - shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1684 | | - shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1685 | | - colorSection.add(shadowbias); |
---|
1686 | | - |
---|
1687 | 1763 | panel.add(new JSeparator()); |
---|
1688 | 1764 | |
---|
1689 | 1765 | panel.add(colorSection); |
---|
.. | .. |
---|
1733 | 1809 | fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1734 | 1810 | fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1735 | 1811 | diffuseSection.add(fakedepth); |
---|
| 1812 | + |
---|
| 1813 | + cGridBag shadowbias = new cGridBag(); |
---|
| 1814 | + shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints); |
---|
| 1815 | + shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1816 | + shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1817 | + diffuseSection.add(shadowbias); |
---|
1736 | 1818 | |
---|
1737 | 1819 | panel.add(new JSeparator()); |
---|
1738 | 1820 | |
---|
.. | .. |
---|
1784 | 1866 | // aConstraints.gridy += 1; |
---|
1785 | 1867 | // aConstraints.gridwidth = 1; |
---|
1786 | 1868 | |
---|
| 1869 | + cGridBag anisoU = new cGridBag(); |
---|
| 1870 | + anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints); |
---|
| 1871 | + anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1872 | + anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1873 | + specularSection.add(anisoU); |
---|
| 1874 | + |
---|
| 1875 | + cGridBag anisoV = new cGridBag(); |
---|
| 1876 | + anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints); |
---|
| 1877 | + anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1878 | + anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1879 | + specularSection.add(anisoV); |
---|
| 1880 | + |
---|
1787 | 1881 | |
---|
1788 | 1882 | panel.add(new JSeparator()); |
---|
1789 | 1883 | |
---|
.. | .. |
---|
1791 | 1885 | |
---|
1792 | 1886 | //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1793 | 1887 | |
---|
1794 | | - cGridBag globalSection = new cGridBag().setVertical(true); |
---|
| 1888 | + //cGridBag globalSection = new cGridBag().setVertical(true); |
---|
1795 | 1889 | |
---|
1796 | 1890 | cGridBag camera = new cGridBag(); |
---|
1797 | 1891 | camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints); |
---|
1798 | 1892 | cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1799 | 1893 | camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1800 | | - globalSection.add(camera); |
---|
| 1894 | + colorSection.add(camera); |
---|
1801 | 1895 | |
---|
1802 | 1896 | cGridBag ambient = new cGridBag(); |
---|
1803 | 1897 | ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints); |
---|
1804 | 1898 | ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1805 | 1899 | ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1806 | | - globalSection.add(ambient); |
---|
| 1900 | + colorSection.add(ambient); |
---|
1807 | 1901 | |
---|
1808 | 1902 | cGridBag backlit = new cGridBag(); |
---|
1809 | 1903 | backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints); |
---|
1810 | 1904 | backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1811 | 1905 | backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1812 | | - globalSection.add(backlit); |
---|
| 1906 | + colorSection.add(backlit); |
---|
1813 | 1907 | |
---|
1814 | 1908 | cGridBag opacity = new cGridBag(); |
---|
1815 | 1909 | opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints); |
---|
1816 | 1910 | opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1817 | 1911 | opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1818 | | - globalSection.add(opacity); |
---|
| 1912 | + colorSection.add(opacity); |
---|
1819 | 1913 | |
---|
1820 | | - panel.add(new JSeparator()); |
---|
| 1914 | + //panel.add(new JSeparator()); |
---|
1821 | 1915 | |
---|
1822 | | - panel.add(globalSection); |
---|
| 1916 | + //panel.add(globalSection); |
---|
1823 | 1917 | |
---|
1824 | 1918 | //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1825 | 1919 | |
---|
.. | .. |
---|
1926 | 2020 | // 3D models |
---|
1927 | 2021 | if (filename.endsWith(".3ds") || filename.endsWith(".3DS")) |
---|
1928 | 2022 | { |
---|
1929 | | - lastConverter = new com.jmex.model.converters.MaxToJme(); |
---|
1930 | | - LoadFile(filename, lastConverter); |
---|
| 2023 | + //lastConverter = new com.jmex.model.converters.MaxToJme(); |
---|
| 2024 | + //LoadFile(filename, lastConverter); |
---|
| 2025 | + LoadObjFile(filename); // New 3ds loader |
---|
1931 | 2026 | continue; |
---|
1932 | 2027 | } |
---|
1933 | 2028 | if (filename.endsWith(".dae") || filename.endsWith(".DAE")) |
---|
.. | .. |
---|
2653 | 2748 | LA.matXRotate(((Object3D) group.get(group.size() - 1)).toParent, -Math.PI / 2); |
---|
2654 | 2749 | LA.matXRotate(((Object3D) group.get(group.size() - 1)).fromParent, Math.PI / 2); |
---|
2655 | 2750 | } |
---|
| 2751 | + |
---|
2656 | 2752 | //cJME.count++; |
---|
2657 | 2753 | //cJME.count %= 12; |
---|
2658 | 2754 | if (gc) |
---|
.. | .. |
---|
2836 | 2932 | } |
---|
2837 | 2933 | } |
---|
2838 | 2934 | } |
---|
| 2935 | + |
---|
2839 | 2936 | cFileSystemPane FSPane; |
---|
2840 | 2937 | |
---|
2841 | 2938 | void SetMaterial(cMaterial mat, Object3D.cVector2[] others) |
---|
.. | .. |
---|
2889 | 2986 | } |
---|
2890 | 2987 | } |
---|
2891 | 2988 | } |
---|
| 2989 | + |
---|
2892 | 2990 | freezematerial = false; |
---|
2893 | 2991 | } |
---|
2894 | 2992 | |
---|
.. | .. |
---|
3007 | 3105 | // } |
---|
3008 | 3106 | |
---|
3009 | 3107 | /**/ |
---|
3010 | | - if (deselect) |
---|
| 3108 | + if (deselect || child == null) |
---|
3011 | 3109 | { |
---|
3012 | 3110 | //group.deselectAll(); |
---|
3013 | 3111 | //freeze = true; |
---|
3014 | 3112 | GetTree().clearSelection(); |
---|
3015 | 3113 | //freeze = false; |
---|
| 3114 | + |
---|
| 3115 | + if (child == null) |
---|
| 3116 | + { |
---|
| 3117 | + return; |
---|
| 3118 | + } |
---|
3016 | 3119 | } |
---|
3017 | 3120 | |
---|
3018 | 3121 | //group.addSelectee(child); |
---|
.. | .. |
---|
3336 | 3439 | { |
---|
3337 | 3440 | Close(); |
---|
3338 | 3441 | //return true; |
---|
3339 | | - } else if (source == loadItem) |
---|
| 3442 | + } else if (source == openItem) |
---|
3340 | 3443 | { |
---|
3341 | | - load(); |
---|
| 3444 | + Open(); |
---|
3342 | 3445 | //return true; |
---|
3343 | 3446 | } else if (source == newItem) |
---|
3344 | 3447 | { |
---|
.. | .. |
---|
3363 | 3466 | { |
---|
3364 | 3467 | generatePOV(); |
---|
3365 | 3468 | //return true; |
---|
| 3469 | + } else if (event.getSource() == archiveItem) |
---|
| 3470 | + { |
---|
| 3471 | + cTools.Archive(frame); |
---|
| 3472 | + return; |
---|
3366 | 3473 | } else if (source == zBufferItem) |
---|
3367 | 3474 | { |
---|
3368 | 3475 | try |
---|
.. | .. |
---|
3414 | 3521 | try |
---|
3415 | 3522 | { |
---|
3416 | 3523 | ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
---|
3417 | | - java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos); |
---|
3418 | | - ObjectOutputStream out = new ObjectOutputStream(zstream); |
---|
| 3524 | +// java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos); |
---|
| 3525 | + ObjectOutputStream out = new ObjectOutputStream(baos); //zstream); |
---|
3419 | 3526 | |
---|
3420 | 3527 | Object3D parent = o.parent; |
---|
3421 | 3528 | o.parent = null; |
---|
.. | .. |
---|
3426 | 3533 | |
---|
3427 | 3534 | out.flush(); |
---|
3428 | 3535 | |
---|
3429 | | - zstream.close(); |
---|
| 3536 | + baos //zstream |
---|
| 3537 | + .close(); |
---|
3430 | 3538 | out.close(); |
---|
3431 | 3539 | |
---|
3432 | | - return baos.toByteArray(); |
---|
| 3540 | + byte[] bytes = baos.toByteArray(); |
---|
| 3541 | + |
---|
| 3542 | + System.out.println("save #bytes = " + bytes.length); |
---|
| 3543 | + return bytes; |
---|
3433 | 3544 | } catch (Exception e) |
---|
3434 | 3545 | { |
---|
3435 | 3546 | System.err.println(e); |
---|
.. | .. |
---|
3439 | 3550 | |
---|
3440 | 3551 | static public Object Uncompress(byte[] bytes) |
---|
3441 | 3552 | { |
---|
3442 | | - System.out.println("#bytes = " + bytes.length); |
---|
| 3553 | + System.out.println("restore #bytes = " + bytes.length); |
---|
3443 | 3554 | try |
---|
3444 | 3555 | { |
---|
3445 | 3556 | ByteArrayInputStream bais = new ByteArrayInputStream(bytes); |
---|
3446 | | - java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais); |
---|
3447 | | - ObjectInputStream in = new ObjectInputStream(istream); |
---|
| 3557 | + //java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais); |
---|
| 3558 | + ObjectInputStream in = new ObjectInputStream(bais); // istream); |
---|
3448 | 3559 | Object obj = in.readObject(); |
---|
| 3560 | + |
---|
| 3561 | + bais //istream |
---|
| 3562 | + .close(); |
---|
3449 | 3563 | in.close(); |
---|
3450 | 3564 | |
---|
3451 | 3565 | return obj; |
---|
.. | .. |
---|
3500 | 3614 | return null; |
---|
3501 | 3615 | } |
---|
3502 | 3616 | |
---|
3503 | | - java.util.Hashtable<java.util.UUID, Object3D> hashtable = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
3504 | 3617 | |
---|
3505 | 3618 | public void Save() |
---|
| 3619 | + { |
---|
| 3620 | + //Save(true); |
---|
| 3621 | + Replace(); |
---|
| 3622 | + } |
---|
| 3623 | + |
---|
| 3624 | + private boolean Equal(byte[] compress, byte[] name) |
---|
| 3625 | + { |
---|
| 3626 | + if (compress.length != name.length) |
---|
| 3627 | + { |
---|
| 3628 | + return false; |
---|
| 3629 | + } |
---|
| 3630 | + |
---|
| 3631 | + for (int i=compress.length; --i>=0;) |
---|
| 3632 | + { |
---|
| 3633 | + if (compress[i] != name[i]) |
---|
| 3634 | + return false; |
---|
| 3635 | + } |
---|
| 3636 | + |
---|
| 3637 | + return true; |
---|
| 3638 | + } |
---|
| 3639 | + |
---|
| 3640 | + java.util.Hashtable<java.util.UUID, Object3D> versiontable = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
| 3641 | + |
---|
| 3642 | + public boolean Save(boolean user) |
---|
3506 | 3643 | { |
---|
3507 | 3644 | System.err.println("Save"); |
---|
3508 | 3645 | |
---|
3509 | 3646 | cRadio tab = GetCurrentTab(); |
---|
3510 | 3647 | |
---|
3511 | | - boolean temp = CameraPane.SWITCH; |
---|
3512 | | - CameraPane.SWITCH = false; |
---|
| 3648 | + byte[] compress = CompressCopy(); |
---|
3513 | 3649 | |
---|
3514 | | - copy.ExtractBigData(hashtable); |
---|
| 3650 | + boolean thesame = false; |
---|
| 3651 | + |
---|
| 3652 | + // Quick heuristic using length. Works only when stream is compressed. |
---|
| 3653 | + if (copy.versionindex > 0 && copy.versions[copy.versionindex-1] != null && Equal(compress, copy.versions[copy.versionindex-1])) |
---|
| 3654 | + { |
---|
| 3655 | + thesame = true; |
---|
| 3656 | + } |
---|
3515 | 3657 | |
---|
3516 | 3658 | //EditorFrame.m_MainFrame.requestFocusInWindow(); |
---|
3517 | | - tab.graphs[tab.undoindex++] = Compress(copy); |
---|
3518 | | - |
---|
3519 | | - copy.RestoreBigData(hashtable); |
---|
3520 | | - |
---|
3521 | | - CameraPane.SWITCH = temp; |
---|
3522 | | - |
---|
3523 | | - //assert(hashtable.isEmpty()); |
---|
3524 | | - |
---|
3525 | | - for (int i = tab.undoindex; i < tab.graphs.length; i++) |
---|
| 3659 | + if (!thesame) |
---|
3526 | 3660 | { |
---|
3527 | | - tab.graphs[i] = null; |
---|
| 3661 | + //tab.user[tab.versionindex] = user; |
---|
| 3662 | + //boolean increment = true; // tab.graphs[tab.versionindex] == null; |
---|
| 3663 | + |
---|
| 3664 | + copy.versions[++copy.versionindex] = compress; |
---|
| 3665 | + |
---|
| 3666 | + // if (increment) |
---|
| 3667 | + // tab.versionindex++; |
---|
3528 | 3668 | } |
---|
3529 | 3669 | |
---|
| 3670 | + //copy.RestoreBigData(versiontable); |
---|
| 3671 | + |
---|
| 3672 | + //assert(hashtable.isEmpty()); |
---|
| 3673 | + |
---|
| 3674 | + for (int i = copy.versionindex+1; i < copy.versions.length; i++) |
---|
| 3675 | + { |
---|
| 3676 | + //tab.user[i] = false; |
---|
| 3677 | + copy.versions[i] = null; |
---|
| 3678 | + } |
---|
| 3679 | + |
---|
| 3680 | + SetUndoStates(); |
---|
| 3681 | + |
---|
3530 | 3682 | // test save |
---|
3531 | 3683 | if (false) |
---|
3532 | 3684 | { |
---|
3533 | 3685 | try |
---|
3534 | 3686 | { |
---|
3535 | | - FileOutputStream ostream = new FileOutputStream("save" + tab.undoindex); |
---|
| 3687 | + FileOutputStream ostream = new FileOutputStream("save" + copy.versionindex); |
---|
3536 | 3688 | ObjectOutputStream p = new ObjectOutputStream(ostream); |
---|
3537 | 3689 | |
---|
3538 | 3690 | p.writeObject(copy); |
---|
.. | .. |
---|
3545 | 3697 | e.printStackTrace(); |
---|
3546 | 3698 | } |
---|
3547 | 3699 | } |
---|
| 3700 | + |
---|
| 3701 | + return !thesame; |
---|
3548 | 3702 | } |
---|
3549 | 3703 | |
---|
3550 | 3704 | void CopyChanged(Object3D obj) |
---|
3551 | 3705 | { |
---|
| 3706 | + SetUndoStates(); |
---|
| 3707 | + |
---|
3552 | 3708 | boolean temp = CameraPane.SWITCH; |
---|
3553 | 3709 | CameraPane.SWITCH = false; |
---|
3554 | 3710 | |
---|
3555 | | - copy.ExtractBigData(hashtable); |
---|
| 3711 | + copy.ExtractBigData(versiontable); |
---|
3556 | 3712 | |
---|
3557 | 3713 | copy.clear(); |
---|
3558 | 3714 | |
---|
.. | .. |
---|
3561 | 3717 | copy.add(obj.get(i)); |
---|
3562 | 3718 | } |
---|
3563 | 3719 | |
---|
3564 | | - copy.RestoreBigData(hashtable); |
---|
| 3720 | + copy.RestoreBigData(versiontable); |
---|
3565 | 3721 | |
---|
3566 | 3722 | CameraPane.SWITCH = temp; |
---|
3567 | 3723 | |
---|
.. | .. |
---|
3588 | 3744 | refreshContents(); |
---|
3589 | 3745 | } |
---|
3590 | 3746 | |
---|
3591 | | - public void Undo() |
---|
| 3747 | + cButton undoButton; |
---|
| 3748 | + cButton restoreButton; |
---|
| 3749 | + cButton replaceButton; |
---|
| 3750 | + cButton redoButton; |
---|
| 3751 | + |
---|
| 3752 | + boolean muteSlider; |
---|
| 3753 | + |
---|
| 3754 | + int VersionCount() |
---|
3592 | 3755 | { |
---|
| 3756 | + int count = 0; |
---|
| 3757 | + |
---|
| 3758 | + for (int i = copy.versions.length; --i >= 0;) |
---|
| 3759 | + { |
---|
| 3760 | + if (copy.versions[i] != null) |
---|
| 3761 | + count++; |
---|
| 3762 | + } |
---|
| 3763 | + |
---|
| 3764 | + return count; |
---|
| 3765 | + } |
---|
| 3766 | + |
---|
| 3767 | + void SetUndoStates() |
---|
| 3768 | + { |
---|
| 3769 | + cRadio tab = GetCurrentTab(); |
---|
| 3770 | + |
---|
| 3771 | + restoreButton.setEnabled(copy.versionindex != -1); |
---|
| 3772 | + replaceButton.setEnabled(copy.versionindex != -1); |
---|
| 3773 | + |
---|
| 3774 | + undoButton.setEnabled(copy.versionindex > 0); |
---|
| 3775 | + redoButton.setEnabled(copy.versions[copy.versionindex + 1] != null); |
---|
| 3776 | + |
---|
| 3777 | + muteSlider = true; |
---|
| 3778 | + versionSlider.setMaximum(VersionCount() - 1); |
---|
| 3779 | + versionSlider.setInteger(copy.versionindex); |
---|
| 3780 | + muteSlider = false; |
---|
| 3781 | + } |
---|
| 3782 | + |
---|
| 3783 | + public boolean Undo() |
---|
| 3784 | + { |
---|
| 3785 | + // Option? |
---|
| 3786 | + Replace(); |
---|
| 3787 | + |
---|
3593 | 3788 | System.err.println("Undo"); |
---|
3594 | 3789 | |
---|
3595 | 3790 | cRadio tab = GetCurrentTab(); |
---|
3596 | 3791 | |
---|
3597 | | - if (tab.undoindex == 0) |
---|
| 3792 | + if (copy.versionindex == 0) |
---|
3598 | 3793 | { |
---|
3599 | 3794 | java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
3600 | | - return; |
---|
| 3795 | + return false; |
---|
3601 | 3796 | } |
---|
3602 | 3797 | |
---|
3603 | | - if (tab.graphs[tab.undoindex] == null) |
---|
| 3798 | +// if (tab.graphs[tab.versionindex] == null) // || !tab.user[tab.versionindex]) |
---|
| 3799 | +// { |
---|
| 3800 | +// if (Save(false)) |
---|
| 3801 | +// tab.versionindex -= 1; |
---|
| 3802 | +// else |
---|
| 3803 | +// { |
---|
| 3804 | +// if (tab.versionindex <= 0) |
---|
| 3805 | +// return false; |
---|
| 3806 | +// else |
---|
| 3807 | +// tab.versionindex -= 1; |
---|
| 3808 | +// } |
---|
| 3809 | +// } |
---|
| 3810 | + |
---|
| 3811 | + copy.versionindex -= 1; |
---|
| 3812 | + |
---|
| 3813 | + CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
| 3814 | + |
---|
| 3815 | + return true; |
---|
| 3816 | + } |
---|
| 3817 | + |
---|
| 3818 | + public boolean Restore() |
---|
| 3819 | + { |
---|
| 3820 | + System.err.println("Restore"); |
---|
| 3821 | + |
---|
| 3822 | + cRadio tab = GetCurrentTab(); |
---|
| 3823 | + |
---|
| 3824 | + if (copy.versionindex == -1 || copy.versions[copy.versionindex] == null) |
---|
3604 | 3825 | { |
---|
3605 | | - Save(); |
---|
3606 | | - tab.undoindex -= 1; |
---|
| 3826 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 3827 | + return false; |
---|
3607 | 3828 | } |
---|
3608 | 3829 | |
---|
3609 | | - tab.undoindex -= 1; |
---|
| 3830 | + CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
| 3831 | + |
---|
| 3832 | + return true; |
---|
| 3833 | + } |
---|
3610 | 3834 | |
---|
3611 | | - CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex])); |
---|
| 3835 | + public boolean Replace() |
---|
| 3836 | + { |
---|
| 3837 | + System.err.println("Replace"); |
---|
| 3838 | + |
---|
| 3839 | + cRadio tab = GetCurrentTab(); |
---|
| 3840 | + |
---|
| 3841 | + if (copy.versionindex == -1 || copy.versions[copy.versionindex] == null) |
---|
| 3842 | + { |
---|
| 3843 | + // No version yet. OK. java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 3844 | + return false; |
---|
| 3845 | + } |
---|
| 3846 | + |
---|
| 3847 | + copy.versions[copy.versionindex] = CompressCopy(); |
---|
| 3848 | + |
---|
| 3849 | + return true; |
---|
3612 | 3850 | } |
---|
3613 | 3851 | |
---|
3614 | 3852 | public void Redo() |
---|
3615 | 3853 | { |
---|
| 3854 | + // Option? |
---|
| 3855 | + Replace(); |
---|
| 3856 | + |
---|
3616 | 3857 | cRadio tab = GetCurrentTab(); |
---|
3617 | 3858 | |
---|
3618 | | - if (tab.graphs[tab.undoindex + 1] == null) |
---|
| 3859 | + if (copy.versions[copy.versionindex + 1] == null) |
---|
3619 | 3860 | { |
---|
3620 | 3861 | java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
3621 | 3862 | return; |
---|
3622 | 3863 | } |
---|
3623 | 3864 | |
---|
3624 | | - tab.undoindex += 1; |
---|
| 3865 | + copy.versionindex += 1; |
---|
3625 | 3866 | |
---|
3626 | | - CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex])); |
---|
| 3867 | + CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
| 3868 | + |
---|
| 3869 | + //if (!tab.user[tab.versionindex]) |
---|
| 3870 | + // tab.graphs[tab.versionindex] = null; |
---|
3627 | 3871 | } |
---|
3628 | 3872 | |
---|
3629 | 3873 | void ImportGFD() |
---|
.. | .. |
---|
3919 | 4163 | //copy.Touch(); |
---|
3920 | 4164 | } |
---|
3921 | 4165 | |
---|
| 4166 | + cNumberSlider versionSlider; |
---|
| 4167 | + |
---|
3922 | 4168 | public void stateChanged(ChangeEvent e) |
---|
3923 | 4169 | { |
---|
3924 | 4170 | // assert(false); |
---|
| 4171 | + if (e.getSource() == versionSlider) |
---|
| 4172 | + { |
---|
| 4173 | + if (muteSlider) |
---|
| 4174 | + return; |
---|
| 4175 | + |
---|
| 4176 | + int version = versionSlider.getInteger(); |
---|
| 4177 | + |
---|
| 4178 | + if (copy.versions[version] != null) |
---|
| 4179 | + { |
---|
| 4180 | + CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex = version])); |
---|
| 4181 | + } |
---|
| 4182 | + |
---|
| 4183 | + return; |
---|
| 4184 | + } |
---|
3925 | 4185 | |
---|
3926 | 4186 | if (freezematerial) |
---|
3927 | 4187 | { |
---|
.. | .. |
---|
4270 | 4530 | |
---|
4271 | 4531 | void makeSomething(Object3D thing, boolean resetmodel) // deselect) |
---|
4272 | 4532 | { |
---|
4273 | | - if (Globals.SAVEONMAKE) // && resetmodel) |
---|
| 4533 | + if (Globals.REPLACEONMAKE) // && resetmodel) |
---|
4274 | 4534 | Save(); |
---|
4275 | 4535 | //Tween.set(thing, 0).target(1).start(tweenManager); |
---|
4276 | 4536 | //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager); |
---|
.. | .. |
---|
4586 | 4846 | |
---|
4587 | 4847 | if (readobj != null) |
---|
4588 | 4848 | { |
---|
4589 | | - if (Globals.SAVEONMAKE) |
---|
4590 | | - Save(); |
---|
| 4849 | + //if (Globals.SAVEONMAKE) // A new object cannot share meshes |
---|
| 4850 | + // Save(); |
---|
4591 | 4851 | try |
---|
4592 | 4852 | { |
---|
4593 | 4853 | //readobj.deepCopySelf(copy); |
---|
.. | .. |
---|
4642 | 4902 | c.addChild(csg); |
---|
4643 | 4903 | } |
---|
4644 | 4904 | |
---|
| 4905 | + copy.versions = readobj.versions; |
---|
| 4906 | + copy.versionindex = readobj.versionindex; |
---|
| 4907 | + |
---|
| 4908 | + if (copy.versions == null) |
---|
| 4909 | + { |
---|
| 4910 | + copy.versions = new byte[100][]; |
---|
| 4911 | + copy.versionindex = -1; |
---|
| 4912 | + } |
---|
| 4913 | + |
---|
| 4914 | + //? SetUndoStates(); |
---|
| 4915 | + |
---|
4645 | 4916 | ResetModel(); |
---|
4646 | 4917 | copy.HardTouch(); // recompile? |
---|
4647 | 4918 | refreshContents(); |
---|
4648 | 4919 | } |
---|
4649 | 4920 | } |
---|
4650 | 4921 | |
---|
4651 | | - void load() // throws ClassNotFoundException |
---|
| 4922 | + void Open() // throws ClassNotFoundException |
---|
4652 | 4923 | { |
---|
4653 | 4924 | if (Grafreed.standAlone) |
---|
4654 | 4925 | { |
---|
.. | .. |
---|
4765 | 5036 | String filename = browser.getFile(); |
---|
4766 | 5037 | if (filename != null && filename.length() > 0) |
---|
4767 | 5038 | { |
---|
| 5039 | + if (!filename.endsWith(".gfd")) |
---|
| 5040 | + filename += ".gfd"; |
---|
4768 | 5041 | lastname = browser.getDirectory() + filename; |
---|
4769 | 5042 | save(); |
---|
4770 | 5043 | } |
---|
.. | .. |
---|
4931 | 5204 | MenuBar menuBar; |
---|
4932 | 5205 | Menu fileMenu; |
---|
4933 | 5206 | MenuItem newItem; |
---|
4934 | | - MenuItem loadItem; |
---|
| 5207 | + MenuItem openItem; |
---|
4935 | 5208 | MenuItem saveItem; |
---|
4936 | 5209 | MenuItem saveAsItem; |
---|
4937 | 5210 | MenuItem exportAsItem; |
---|
.. | .. |
---|
4954 | 5227 | CheckboxMenuItem toggleSwitchItem; |
---|
4955 | 5228 | CheckboxMenuItem toggleRootItem; |
---|
4956 | 5229 | CheckboxMenuItem animationItem; |
---|
| 5230 | + MenuItem archiveItem; |
---|
4957 | 5231 | CheckboxMenuItem toggleHandleItem; |
---|
4958 | 5232 | CheckboxMenuItem togglePaintItem; |
---|
4959 | 5233 | JSplitPane mainPanel; |
---|