.. | .. |
---|
41 | 41 | JFrame frame; |
---|
42 | 42 | |
---|
43 | 43 | static ObjEditor theFrame; |
---|
| 44 | + |
---|
| 45 | + public cGridBag GetSeparator() |
---|
| 46 | + { |
---|
| 47 | + cGridBag separator = new cGridBag(); |
---|
| 48 | + separator.add(new JSeparator()); |
---|
| 49 | + separator.preferredHeight = 5; |
---|
| 50 | + return separator; |
---|
| 51 | + } |
---|
44 | 52 | |
---|
45 | 53 | cButton GetButton(String name, boolean border) |
---|
46 | 54 | { |
---|
47 | | - try |
---|
48 | | - { |
---|
49 | | - ImageIcon icon = GetIcon(name); |
---|
50 | | - return new cButton(icon, border); |
---|
51 | | - } |
---|
52 | | - catch (Exception e) |
---|
53 | | - { |
---|
54 | | - return new cButton(name, border); |
---|
55 | | - } |
---|
| 55 | + ImageIcon icon = GetIcon(name); |
---|
| 56 | + return new cButton(icon, border); |
---|
| 57 | + } |
---|
| 58 | + |
---|
| 59 | + cLabel GetLabel(String name, boolean border) |
---|
| 60 | + { |
---|
| 61 | + //ImageIcon icon = GetIcon(name); |
---|
| 62 | + return new cLabel(GetImage(name), border); |
---|
56 | 63 | } |
---|
57 | 64 | |
---|
58 | 65 | cToggleButton GetToggleButton(String name, boolean border) |
---|
59 | 66 | { |
---|
60 | | - try |
---|
61 | | - { |
---|
62 | | - ImageIcon icon = GetIcon(name); |
---|
63 | | - return new cToggleButton(icon, border); |
---|
64 | | - } |
---|
65 | | - catch (Exception e) |
---|
66 | | - { |
---|
67 | | - return new cToggleButton(name, border); |
---|
68 | | - } |
---|
| 67 | + ImageIcon icon = GetIcon(name); |
---|
| 68 | + return new cToggleButton(icon, border); |
---|
69 | 69 | } |
---|
70 | 70 | |
---|
71 | 71 | cCheckBox GetCheckBox(String name, boolean border) |
---|
72 | 72 | { |
---|
| 73 | + ImageIcon icon = GetIcon(name); |
---|
| 74 | + return new cCheckBox(icon, border); |
---|
| 75 | + } |
---|
| 76 | + |
---|
| 77 | + ImageIcon GetIcon(String name) |
---|
| 78 | + { |
---|
73 | 79 | try |
---|
74 | 80 | { |
---|
75 | | - ImageIcon icon = GetIcon(name); |
---|
76 | | - return new cCheckBox(icon, border); |
---|
| 81 | + BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name)); |
---|
| 82 | + |
---|
| 83 | +// if (image.getWidth() > 48 && image.getHeight() > 48) |
---|
| 84 | +// { |
---|
| 85 | +// BufferedImage resized = new BufferedImage(48, 48, image.getType()); |
---|
| 86 | +// Graphics2D g = resized.createGraphics(); |
---|
| 87 | +// g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); |
---|
| 88 | +// //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
---|
| 89 | +// g.drawImage(image, 0, 0, 48, 48, 0, 0, image.getWidth(), image.getHeight(), null); |
---|
| 90 | +// g.dispose(); |
---|
| 91 | +// |
---|
| 92 | +// image = resized; |
---|
| 93 | +// } |
---|
| 94 | + |
---|
| 95 | + javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image); |
---|
| 96 | + return icon; |
---|
77 | 97 | } |
---|
78 | 98 | catch (Exception e) |
---|
79 | 99 | { |
---|
80 | | - return new cCheckBox(name, border); |
---|
| 100 | + return null; |
---|
81 | 101 | } |
---|
82 | 102 | } |
---|
83 | | - |
---|
84 | | - private ImageIcon GetIcon(String name) throws IOException |
---|
| 103 | + |
---|
| 104 | + BufferedImage GetImage(String name) |
---|
85 | 105 | { |
---|
86 | | - BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name)); |
---|
87 | | - |
---|
88 | | - if (image.getWidth() != 24 && image.getHeight() != 24) |
---|
| 106 | + try |
---|
89 | 107 | { |
---|
90 | | - BufferedImage resized = new BufferedImage(24, 24, image.getType()); |
---|
91 | | - Graphics2D g = resized.createGraphics(); |
---|
92 | | - g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); |
---|
93 | | - //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
---|
94 | | - g.drawImage(image, 0, 0, 24, 24, 0, 0, image.getWidth(), image.getHeight(), null); |
---|
95 | | - g.dispose(); |
---|
96 | | - |
---|
97 | | - image = resized; |
---|
| 108 | + BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name)); |
---|
| 109 | + |
---|
| 110 | + return image; |
---|
98 | 111 | } |
---|
99 | | - |
---|
100 | | - javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image); |
---|
101 | | - return icon; |
---|
| 112 | + catch (Exception e) |
---|
| 113 | + { |
---|
| 114 | + return null; |
---|
| 115 | + } |
---|
102 | 116 | } |
---|
103 | 117 | |
---|
104 | 118 | // SCRIPT |
---|
.. | .. |
---|
284 | 298 | |
---|
285 | 299 | if (copy.versions == null) |
---|
286 | 300 | { |
---|
287 | | - copy.versions = new byte[100][]; |
---|
| 301 | + copy.versions = new Object3D[100]; |
---|
288 | 302 | copy.versionindex = -1; |
---|
289 | 303 | } |
---|
290 | 304 | |
---|
.. | .. |
---|
303 | 317 | |
---|
304 | 318 | if (copy.versions == null) |
---|
305 | 319 | { |
---|
306 | | - copy.versions = new byte[100][]; |
---|
| 320 | + copy.versions = new Object3D[100]; |
---|
307 | 321 | copy.versionindex = -1; |
---|
308 | 322 | } |
---|
309 | 323 | |
---|
.. | .. |
---|
341 | 355 | |
---|
342 | 356 | if (copy.versions == null) |
---|
343 | 357 | { |
---|
344 | | - copy.versions = new byte[100][]; |
---|
345 | | - copy.versionindex = -1; |
---|
| 358 | +// copy.versions = new byte[100][]; |
---|
| 359 | +// copy.versionindex = -1; |
---|
346 | 360 | } |
---|
347 | 361 | |
---|
348 | 362 | SetupMenu(); |
---|
.. | .. |
---|
437 | 451 | |
---|
438 | 452 | toolbarPanel = new JPanel(); |
---|
439 | 453 | toolbarPanel.setName("Toolbar"); |
---|
| 454 | + |
---|
440 | 455 | treePanel = new cGridBag(); |
---|
441 | 456 | treePanel.setName("Tree"); |
---|
442 | 457 | |
---|
443 | 458 | editPanel = new cGridBag().setVertical(true); |
---|
444 | | - editPanel.setName("Edit"); |
---|
| 459 | + //editPanel.setName("Edit"); |
---|
445 | 460 | |
---|
446 | 461 | ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout()); |
---|
447 | 462 | |
---|
.. | .. |
---|
449 | 464 | editPanel.add(editCommandsPanel); |
---|
450 | 465 | editPanel.add(ctrlPanel); |
---|
451 | 466 | |
---|
452 | | - toolboxPanel = new cGridBag().setVertical(false); |
---|
453 | | - toolboxPanel.setName("Toolbox"); |
---|
| 467 | + toolboxPanel = new cGridBag().setVertical(true); |
---|
| 468 | + //toolboxPanel.setName("Toolbox"); |
---|
454 | 469 | |
---|
455 | 470 | materialPanel = new cGridBag().setVertical(true); |
---|
456 | | - materialPanel.setName("Material"); |
---|
| 471 | + //materialPanel.setName("Material"); |
---|
457 | 472 | |
---|
458 | 473 | /*JTextPane*/ |
---|
459 | 474 | infoarea = createTextPane(); |
---|
.. | .. |
---|
461 | 476 | |
---|
462 | 477 | infoarea.setEditable(true); |
---|
463 | 478 | SetText(); |
---|
| 479 | + |
---|
464 | 480 | // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f)); |
---|
465 | 481 | // infoarea.setOpaque(false); |
---|
466 | 482 | // //infoarea.setForeground(textcolor); |
---|
.. | .. |
---|
468 | 484 | // TEXTAREA infoarea.setWrapStyleWord(true); |
---|
469 | 485 | infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED); |
---|
470 | 486 | infoPanel.setPreferredSize(new Dimension(1, 1)); |
---|
471 | | - infoPanel.setName("Info"); |
---|
| 487 | + //infoPanel.setName("Info"); |
---|
472 | 488 | //infoPanel.setLayout(new BorderLayout()); |
---|
473 | 489 | //infoPanel.add(createTextPane()); |
---|
474 | 490 | |
---|
.. | .. |
---|
834 | 850 | frame.validate(); |
---|
835 | 851 | } |
---|
836 | 852 | |
---|
837 | | - private byte[] CompressCopy() |
---|
| 853 | + private Object3D CompressCopy() |
---|
838 | 854 | { |
---|
839 | 855 | boolean temp = CameraPane.SWITCH; |
---|
840 | 856 | CameraPane.SWITCH = false; |
---|
.. | .. |
---|
842 | 858 | copy.ExtractBigData(versiontable); |
---|
843 | 859 | // if (copy == client) |
---|
844 | 860 | |
---|
845 | | - byte[] versions[] = copy.versions; |
---|
| 861 | + Object3D versions[] = copy.versions; |
---|
846 | 862 | copy.versions = null; |
---|
847 | 863 | |
---|
848 | | - byte[] compress = Compress(copy); |
---|
| 864 | + //byte[] compress = Compress(copy); |
---|
| 865 | + Object3D compress = (Object3D)Grafreed.clone(copy); |
---|
849 | 866 | |
---|
850 | 867 | copy.versions = versions; |
---|
851 | 868 | |
---|
.. | .. |
---|
986 | 1003 | // NumberSlider vDivsField; |
---|
987 | 1004 | // JCheckBox endcaps; |
---|
988 | 1005 | JCheckBox liveCB; |
---|
989 | | - JCheckBox selectCB; |
---|
| 1006 | + JCheckBox selectableCB; |
---|
990 | 1007 | JCheckBox hideCB; |
---|
991 | 1008 | JCheckBox link2masterCB; |
---|
992 | 1009 | JCheckBox markCB; |
---|
.. | .. |
---|
1198 | 1215 | |
---|
1199 | 1216 | liveCB = AddCheckBox(setupPanel, "Live", copy.live); |
---|
1200 | 1217 | liveCB.setToolTipText("Animate object"); |
---|
1201 | | - selectCB = AddCheckBox(setupPanel, "Select", !copy.dontselect); |
---|
1202 | | - selectCB.setToolTipText("Make object selectable"); |
---|
| 1218 | + selectableCB = AddCheckBox(setupPanel, "Select", !copy.dontselect); |
---|
| 1219 | + selectableCB.setToolTipText("Make object selectable"); |
---|
1203 | 1220 | // Return(); |
---|
| 1221 | + |
---|
1204 | 1222 | hideCB = AddCheckBox(setupPanel, "Hide", copy.hide); |
---|
1205 | 1223 | hideCB.setToolTipText("Hide object"); |
---|
1206 | 1224 | markCB = AddCheckBox(setupPanel, "Mark", copy.marked); |
---|
1207 | 1225 | markCB.setToolTipText("As animation target transform"); |
---|
| 1226 | + |
---|
| 1227 | + ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false); |
---|
1208 | 1228 | |
---|
1209 | 1229 | setupPanel2 = new cGridBag().setVertical(false); |
---|
1210 | 1230 | |
---|
.. | .. |
---|
1492 | 1512 | XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll); |
---|
1493 | 1513 | XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll); |
---|
1494 | 1514 | XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll); |
---|
| 1515 | + //XYZPanel.setName("XYZ"); |
---|
1495 | 1516 | |
---|
1496 | 1517 | /* |
---|
1497 | 1518 | gridPanel = new JPanel(); //new BorderLayout()); |
---|
.. | .. |
---|
1529 | 1550 | //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); |
---|
1530 | 1551 | //tmp.setName("Edit"); |
---|
1531 | 1552 | objectPanel.add(materialPanel); |
---|
| 1553 | + objectPanel.setIconAt(0, GetIcon("icons/material.png")); |
---|
| 1554 | + objectPanel.setToolTipTextAt(0, "Material panel"); |
---|
| 1555 | + |
---|
1532 | 1556 | // JPanel north = new JPanel(new BorderLayout()); |
---|
1533 | 1557 | // north.setName("Edit"); |
---|
1534 | 1558 | // north.add(ctrlPanel, BorderLayout.NORTH); |
---|
1535 | 1559 | // objectPanel.add(north); |
---|
1536 | 1560 | objectPanel.add(editPanel); |
---|
| 1561 | + objectPanel.setIconAt(1, GetIcon("icons/write.png")); |
---|
| 1562 | + objectPanel.setToolTipTextAt(1, "Edit panel"); |
---|
1537 | 1563 | |
---|
1538 | 1564 | //if (Globals.ADVANCED) |
---|
1539 | 1565 | objectPanel.add(infoPanel); |
---|
| 1566 | + objectPanel.setIconAt(2, GetIcon("icons/info.png")); |
---|
| 1567 | + objectPanel.setToolTipTextAt(2, "Info panel"); |
---|
| 1568 | + |
---|
| 1569 | + objectPanel.add(XYZPanel); |
---|
| 1570 | + objectPanel.setIconAt(3, GetIcon("icons/XYZ.png")); |
---|
| 1571 | + objectPanel.setToolTipTextAt(3, "XYZ/RGB panel"); |
---|
1540 | 1572 | |
---|
1541 | 1573 | objectPanel.add(toolboxPanel); |
---|
| 1574 | + objectPanel.setIconAt(4, GetIcon("icons/primitives.png")); |
---|
| 1575 | + objectPanel.setToolTipTextAt(4, "Objects/backgrounds panel"); |
---|
1542 | 1576 | |
---|
1543 | 1577 | /* |
---|
1544 | 1578 | aConstraints.gridx = 0; |
---|
.. | .. |
---|
1559 | 1593 | scrollpane.addMouseWheelListener(this); // Default not fast enough |
---|
1560 | 1594 | |
---|
1561 | 1595 | /*JTabbedPane*/ scenePanel = new cGridBag(); |
---|
1562 | | - scenePanel.preferredWidth = 6; |
---|
| 1596 | + scenePanel.preferredWidth = 5; |
---|
1563 | 1597 | |
---|
1564 | 1598 | JTabbedPane tabbedPane = new JTabbedPane(); |
---|
1565 | 1599 | tabbedPane.add(scrollpane); |
---|
.. | .. |
---|
1637 | 1671 | bigThree = new cGridBag(); |
---|
1638 | 1672 | bigThree.addComponent(scenePanel); |
---|
1639 | 1673 | bigThree.addComponent(centralPanel); |
---|
1640 | | - bigThree.addComponent(XYZPanel); |
---|
| 1674 | + //bigThree.addComponent(XYZPanel); |
---|
1641 | 1675 | |
---|
1642 | 1676 | // // SIDE EFFECT!!! |
---|
1643 | 1677 | // aConstraints.gridx = 0; |
---|
.. | .. |
---|
1678 | 1712 | frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); |
---|
1679 | 1713 | frame.addWindowListener(new WindowAdapter() |
---|
1680 | 1714 | { |
---|
1681 | | - |
---|
1682 | 1715 | public void windowClosing(WindowEvent e) |
---|
1683 | 1716 | { |
---|
1684 | 1717 | Close(); |
---|
.. | .. |
---|
1740 | 1773 | //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1741 | 1774 | |
---|
1742 | 1775 | cGridBag colorSection = new cGridBag().setVertical(true); |
---|
| 1776 | + |
---|
| 1777 | + cGridBag huepanel = new cGridBag(); |
---|
| 1778 | + cGridBag huelabel = new cGridBag(); |
---|
| 1779 | + huelabel.add(GetLabel("icons/hue.png", false)); |
---|
| 1780 | + huelabel.preferredWidth = 20; |
---|
| 1781 | + huepanel.add(new cGridBag()); // Label |
---|
| 1782 | + huepanel.add(huelabel); // Field/slider |
---|
| 1783 | + |
---|
| 1784 | + huepanel.preferredHeight = 7; |
---|
| 1785 | + |
---|
| 1786 | + colorSection.add(huepanel); |
---|
1743 | 1787 | |
---|
1744 | 1788 | cGridBag color = new cGridBag(); |
---|
1745 | | - color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints); |
---|
1746 | | - colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1747 | | - color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1789 | + |
---|
| 1790 | + color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints); |
---|
| 1791 | + colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1792 | + color.add(colorField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
| 1793 | + |
---|
1748 | 1794 | //colorField.preferredWidth = 200; |
---|
1749 | 1795 | colorSection.add(color); |
---|
1750 | 1796 | |
---|
1751 | 1797 | cGridBag modulation = new cGridBag(); |
---|
1752 | 1798 | modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints); |
---|
1753 | 1799 | modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1754 | | - modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1800 | + modulation.add(modulationField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
1755 | 1801 | colorSection.add(modulation); |
---|
1756 | 1802 | |
---|
| 1803 | + cGridBag opacity = new cGridBag(); |
---|
| 1804 | + opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints); |
---|
| 1805 | + opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1806 | + opacity.add(opacityField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
| 1807 | + colorSection.add(opacity); |
---|
| 1808 | + |
---|
| 1809 | + colorSection.add(GetSeparator()); |
---|
| 1810 | + |
---|
1757 | 1811 | cGridBag texture = new cGridBag(); |
---|
1758 | 1812 | texture.add(textureLabel = new JLabel("Texture")); // , aConstraints); |
---|
1759 | 1813 | textureLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1760 | 1814 | texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1761 | 1815 | colorSection.add(texture); |
---|
1762 | 1816 | |
---|
1763 | | - panel.add(new JSeparator()); |
---|
| 1817 | + panel.add(GetSeparator()); |
---|
1764 | 1818 | |
---|
1765 | 1819 | panel.add(colorSection); |
---|
1766 | 1820 | |
---|
.. | .. |
---|
1816 | 1870 | shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1817 | 1871 | diffuseSection.add(shadowbias); |
---|
1818 | 1872 | |
---|
1819 | | - panel.add(new JSeparator()); |
---|
| 1873 | + panel.add(GetSeparator()); |
---|
1820 | 1874 | |
---|
1821 | 1875 | panel.add(diffuseSection); |
---|
1822 | 1876 | |
---|
.. | .. |
---|
1879 | 1933 | specularSection.add(anisoV); |
---|
1880 | 1934 | |
---|
1881 | 1935 | |
---|
1882 | | - panel.add(new JSeparator()); |
---|
| 1936 | + panel.add(GetSeparator()); |
---|
1883 | 1937 | |
---|
1884 | 1938 | panel.add(specularSection); |
---|
1885 | 1939 | |
---|
.. | .. |
---|
1904 | 1958 | backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1905 | 1959 | backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1906 | 1960 | colorSection.add(backlit); |
---|
1907 | | - |
---|
1908 | | - cGridBag opacity = new cGridBag(); |
---|
1909 | | - opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints); |
---|
1910 | | - opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1911 | | - opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1912 | | - colorSection.add(opacity); |
---|
1913 | 1961 | |
---|
1914 | 1962 | //panel.add(new JSeparator()); |
---|
1915 | 1963 | |
---|
.. | .. |
---|
1955 | 2003 | opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints); |
---|
1956 | 2004 | textureSection.add(opacityPower); |
---|
1957 | 2005 | |
---|
1958 | | - panel.add(new JSeparator()); |
---|
| 2006 | + panel.add(GetSeparator()); |
---|
1959 | 2007 | |
---|
1960 | 2008 | panel.add(textureSection); |
---|
1961 | 2009 | |
---|
.. | .. |
---|
3254 | 3302 | { |
---|
3255 | 3303 | copy.live ^= true; |
---|
3256 | 3304 | return; |
---|
3257 | | - } else if (event.getSource() == selectCB) |
---|
| 3305 | + } else if (event.getSource() == selectableCB) |
---|
3258 | 3306 | { |
---|
3259 | 3307 | copy.dontselect ^= true; |
---|
3260 | 3308 | return; |
---|
.. | .. |
---|
3518 | 3566 | |
---|
3519 | 3567 | static public byte[] Compress(Object3D o) |
---|
3520 | 3568 | { |
---|
| 3569 | + // Slower to actually compress. |
---|
3521 | 3570 | try |
---|
3522 | 3571 | { |
---|
3523 | 3572 | ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
---|
.. | .. |
---|
3645 | 3694 | |
---|
3646 | 3695 | cRadio tab = GetCurrentTab(); |
---|
3647 | 3696 | |
---|
3648 | | - byte[] compress = CompressCopy(); |
---|
| 3697 | + Object3D compress = CompressCopy(); // Saved version. No need for "Replace". |
---|
3649 | 3698 | |
---|
3650 | 3699 | boolean thesame = false; |
---|
3651 | 3700 | |
---|
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 | | - } |
---|
| 3701 | +// if (copy.versionindex > 0 && copy.versions[copy.versionindex-1] != null && Equal(compress, copy.versions[copy.versionindex-1])) |
---|
| 3702 | +// { |
---|
| 3703 | +// thesame = true; |
---|
| 3704 | +// } |
---|
3657 | 3705 | |
---|
3658 | 3706 | //EditorFrame.m_MainFrame.requestFocusInWindow(); |
---|
3659 | 3707 | if (!thesame) |
---|
.. | .. |
---|
3712 | 3760 | |
---|
3713 | 3761 | copy.clear(); |
---|
3714 | 3762 | |
---|
| 3763 | + copy.skyboxname = obj.skyboxname; |
---|
| 3764 | + copy.skyboxext = obj.skyboxext; |
---|
| 3765 | + |
---|
3715 | 3766 | for (int i=0; i<obj.Size(); i++) |
---|
3716 | 3767 | { |
---|
3717 | 3768 | copy.add(obj.get(i)); |
---|
.. | .. |
---|
3810 | 3861 | |
---|
3811 | 3862 | copy.versionindex -= 1; |
---|
3812 | 3863 | |
---|
3813 | | - CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
| 3864 | + CopyChanged((Object3D)copy.versions[copy.versionindex]); |
---|
3814 | 3865 | |
---|
3815 | 3866 | return true; |
---|
3816 | 3867 | } |
---|
.. | .. |
---|
3827 | 3878 | return false; |
---|
3828 | 3879 | } |
---|
3829 | 3880 | |
---|
3830 | | - CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
| 3881 | + //CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
| 3882 | + CopyChanged(copy.versions[copy.versionindex]); |
---|
3831 | 3883 | |
---|
3832 | 3884 | return true; |
---|
3833 | 3885 | } |
---|
.. | .. |
---|
3864 | 3916 | |
---|
3865 | 3917 | copy.versionindex += 1; |
---|
3866 | 3918 | |
---|
3867 | | - CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
| 3919 | + CopyChanged(copy.versions[copy.versionindex]); |
---|
3868 | 3920 | |
---|
3869 | 3921 | //if (!tab.user[tab.versionindex]) |
---|
3870 | 3922 | // tab.graphs[tab.versionindex] = null; |
---|
.. | .. |
---|
4177 | 4229 | |
---|
4178 | 4230 | if (copy.versions[version] != null) |
---|
4179 | 4231 | { |
---|
4180 | | - CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex = version])); |
---|
| 4232 | + CopyChanged(copy.versions[copy.versionindex = version]); |
---|
4181 | 4233 | } |
---|
4182 | 4234 | |
---|
4183 | 4235 | return; |
---|
.. | .. |
---|
4772 | 4824 | readobj.ResetDisplayList(); |
---|
4773 | 4825 | } catch (Exception e) |
---|
4774 | 4826 | { |
---|
4775 | | - //e.printStackTrace(); |
---|
| 4827 | + if (!e.toString().contains("GZIP")) |
---|
| 4828 | + e.printStackTrace(); |
---|
| 4829 | + |
---|
4776 | 4830 | try |
---|
4777 | 4831 | { |
---|
4778 | 4832 | java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
.. | .. |
---|
4852 | 4906 | { |
---|
4853 | 4907 | //readobj.deepCopySelf(copy); |
---|
4854 | 4908 | copy.clear(); // june 2014 |
---|
| 4909 | + copy.skyboxname = readobj.skyboxname; |
---|
| 4910 | + copy.skyboxext = readobj.skyboxext; |
---|
4855 | 4911 | for (int i = 0; i < readobj.size(); i++) |
---|
4856 | 4912 | { |
---|
4857 | 4913 | Object3D child = readobj.get(i); // reserve(i); |
---|
.. | .. |
---|
4892 | 4948 | } |
---|
4893 | 4949 | } catch (ClassCastException e) |
---|
4894 | 4950 | { |
---|
| 4951 | + e.printStackTrace(); |
---|
4895 | 4952 | assert (false); |
---|
4896 | 4953 | Composite c = (Composite) copy; |
---|
4897 | 4954 | c.children.clear(); |
---|
.. | .. |
---|
4907 | 4964 | |
---|
4908 | 4965 | if (copy.versions == null) |
---|
4909 | 4966 | { |
---|
4910 | | - copy.versions = new byte[100][]; |
---|
| 4967 | + copy.versions = new Object3D[100]; |
---|
4911 | 4968 | copy.versionindex = -1; |
---|
4912 | 4969 | } |
---|
4913 | 4970 | |
---|
.. | .. |
---|
5022 | 5079 | //ps.print(buffer.toString()); |
---|
5023 | 5080 | } catch (IOException e) |
---|
5024 | 5081 | { |
---|
| 5082 | + e.printStackTrace(); |
---|
5025 | 5083 | } |
---|
5026 | 5084 | } |
---|
5027 | 5085 | |
---|