.. | .. |
---|
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 |
---|
.. | .. |
---|
282 | 296 | client = inClient; |
---|
283 | 297 | copy = client; |
---|
284 | 298 | |
---|
| 299 | + if (copy.versionlist == null) |
---|
| 300 | + { |
---|
| 301 | + copy.versionlist = new Object3D[100]; |
---|
| 302 | + copy.versionindex = -1; |
---|
| 303 | + } |
---|
| 304 | + |
---|
285 | 305 | // "this" is not called: SetupUI2(objEditor); |
---|
286 | 306 | } |
---|
287 | 307 | |
---|
.. | .. |
---|
295 | 315 | client = inClient; |
---|
296 | 316 | copy = client; |
---|
297 | 317 | |
---|
| 318 | + if (copy.versionlist == null) |
---|
| 319 | + { |
---|
| 320 | + copy.versionlist = new Object3D[100]; |
---|
| 321 | + copy.versionindex = -1; |
---|
| 322 | + } |
---|
| 323 | + |
---|
298 | 324 | SetupUI2(callee.GetEditor()); |
---|
299 | 325 | } |
---|
300 | 326 | |
---|
.. | .. |
---|
327 | 353 | copy = localCopy; |
---|
328 | 354 | copy.editWindow = this; |
---|
329 | 355 | |
---|
| 356 | + if (copy.versionlist == null) |
---|
| 357 | + { |
---|
| 358 | +// copy.versions = new byte[100][]; |
---|
| 359 | +// copy.versionindex = -1; |
---|
| 360 | + } |
---|
| 361 | + |
---|
330 | 362 | SetupMenu(); |
---|
331 | 363 | |
---|
332 | 364 | //SetupName(objEditor); // new |
---|
.. | .. |
---|
419 | 451 | |
---|
420 | 452 | toolbarPanel = new JPanel(); |
---|
421 | 453 | toolbarPanel.setName("Toolbar"); |
---|
| 454 | + |
---|
422 | 455 | treePanel = new cGridBag(); |
---|
423 | 456 | treePanel.setName("Tree"); |
---|
424 | 457 | |
---|
425 | 458 | editPanel = new cGridBag().setVertical(true); |
---|
426 | | - editPanel.setName("Edit"); |
---|
| 459 | + //editPanel.setName("Edit"); |
---|
427 | 460 | |
---|
428 | 461 | ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout()); |
---|
429 | 462 | |
---|
.. | .. |
---|
431 | 464 | editPanel.add(editCommandsPanel); |
---|
432 | 465 | editPanel.add(ctrlPanel); |
---|
433 | 466 | |
---|
434 | | - toolboxPanel = new cGridBag().setVertical(false); |
---|
435 | | - toolboxPanel.setName("Toolbox"); |
---|
| 467 | + toolboxPanel = new cGridBag().setVertical(true); |
---|
| 468 | + //toolboxPanel.setName("Toolbox"); |
---|
436 | 469 | |
---|
437 | | - materialPanel = new cGridBag().setVertical(true); |
---|
438 | | - materialPanel.setName("Material"); |
---|
| 470 | + materialPanel = new cGridBag().setVertical(false); |
---|
| 471 | + //materialPanel.setName("Material"); |
---|
439 | 472 | |
---|
440 | 473 | /*JTextPane*/ |
---|
441 | 474 | infoarea = createTextPane(); |
---|
.. | .. |
---|
443 | 476 | |
---|
444 | 477 | infoarea.setEditable(true); |
---|
445 | 478 | SetText(); |
---|
| 479 | + |
---|
446 | 480 | // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f)); |
---|
447 | 481 | // infoarea.setOpaque(false); |
---|
448 | 482 | // //infoarea.setForeground(textcolor); |
---|
.. | .. |
---|
450 | 484 | // TEXTAREA infoarea.setWrapStyleWord(true); |
---|
451 | 485 | infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED); |
---|
452 | 486 | infoPanel.setPreferredSize(new Dimension(1, 1)); |
---|
453 | | - infoPanel.setName("Info"); |
---|
| 487 | + //infoPanel.setName("Info"); |
---|
454 | 488 | //infoPanel.setLayout(new BorderLayout()); |
---|
455 | 489 | //infoPanel.add(createTextPane()); |
---|
456 | 490 | |
---|
.. | .. |
---|
816 | 850 | frame.validate(); |
---|
817 | 851 | } |
---|
818 | 852 | |
---|
| 853 | + private Object3D CompressCopy() |
---|
| 854 | + { |
---|
| 855 | + boolean temp = CameraPane.SWITCH; |
---|
| 856 | + CameraPane.SWITCH = false; |
---|
| 857 | + |
---|
| 858 | + copy.ExtractBigData(versiontable); |
---|
| 859 | + // if (copy == client) |
---|
| 860 | + |
---|
| 861 | + Object3D versions[] = copy.versionlist; |
---|
| 862 | + copy.versionlist = null; |
---|
| 863 | + |
---|
| 864 | + //byte[] compress = Compress(copy); |
---|
| 865 | + Object3D compress = (Object3D)Grafreed.clone(copy); |
---|
| 866 | + |
---|
| 867 | + copy.versionlist = versions; |
---|
| 868 | + |
---|
| 869 | + copy.RestoreBigData(versiontable); |
---|
| 870 | + |
---|
| 871 | + CameraPane.SWITCH = temp; |
---|
| 872 | + |
---|
| 873 | + return compress; |
---|
| 874 | + } |
---|
| 875 | + |
---|
819 | 876 | private JTextPane createTextPane() |
---|
820 | 877 | { |
---|
821 | 878 | // TEXTAREA String[] initString = |
---|
.. | .. |
---|
937 | 994 | { |
---|
938 | 995 | SetupMaterial(materialPanel); |
---|
939 | 996 | } |
---|
| 997 | + |
---|
940 | 998 | //SetupName(); |
---|
941 | 999 | //SetupViews(); |
---|
942 | 1000 | } |
---|
.. | .. |
---|
946 | 1004 | // NumberSlider vDivsField; |
---|
947 | 1005 | // JCheckBox endcaps; |
---|
948 | 1006 | JCheckBox liveCB; |
---|
949 | | - JCheckBox selectCB; |
---|
| 1007 | + JCheckBox selectableCB; |
---|
950 | 1008 | JCheckBox hideCB; |
---|
951 | 1009 | JCheckBox link2masterCB; |
---|
952 | 1010 | JCheckBox markCB; |
---|
.. | .. |
---|
1158 | 1216 | |
---|
1159 | 1217 | liveCB = AddCheckBox(setupPanel, "Live", copy.live); |
---|
1160 | 1218 | liveCB.setToolTipText("Animate object"); |
---|
1161 | | - selectCB = AddCheckBox(setupPanel, "Select", !copy.dontselect); |
---|
1162 | | - selectCB.setToolTipText("Make object selectable"); |
---|
| 1219 | + selectableCB = AddCheckBox(setupPanel, "Select", !copy.dontselect); |
---|
| 1220 | + selectableCB.setToolTipText("Make object selectable"); |
---|
1163 | 1221 | // Return(); |
---|
| 1222 | + |
---|
1164 | 1223 | hideCB = AddCheckBox(setupPanel, "Hide", copy.hide); |
---|
1165 | 1224 | hideCB.setToolTipText("Hide object"); |
---|
1166 | 1225 | markCB = AddCheckBox(setupPanel, "Mark", copy.marked); |
---|
1167 | 1226 | markCB.setToolTipText("As animation target transform"); |
---|
| 1227 | + |
---|
| 1228 | + ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false); |
---|
1168 | 1229 | |
---|
1169 | 1230 | setupPanel2 = new cGridBag().setVertical(false); |
---|
1170 | 1231 | |
---|
.. | .. |
---|
1452 | 1513 | XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll); |
---|
1453 | 1514 | XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll); |
---|
1454 | 1515 | XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll); |
---|
| 1516 | + //XYZPanel.setName("XYZ"); |
---|
1455 | 1517 | |
---|
1456 | 1518 | /* |
---|
1457 | 1519 | gridPanel = new JPanel(); //new BorderLayout()); |
---|
.. | .. |
---|
1489 | 1551 | //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); |
---|
1490 | 1552 | //tmp.setName("Edit"); |
---|
1491 | 1553 | objectPanel.add(materialPanel); |
---|
| 1554 | + objectPanel.setIconAt(0, GetIcon("icons/material.png")); |
---|
| 1555 | + objectPanel.setToolTipTextAt(0, "Material"); |
---|
| 1556 | + |
---|
1492 | 1557 | // JPanel north = new JPanel(new BorderLayout()); |
---|
1493 | 1558 | // north.setName("Edit"); |
---|
1494 | 1559 | // north.add(ctrlPanel, BorderLayout.NORTH); |
---|
1495 | 1560 | // objectPanel.add(north); |
---|
1496 | 1561 | objectPanel.add(editPanel); |
---|
| 1562 | + objectPanel.setIconAt(1, GetIcon("icons/write.png")); |
---|
| 1563 | + objectPanel.setToolTipTextAt(1, "Edit controls"); |
---|
1497 | 1564 | |
---|
1498 | 1565 | //if (Globals.ADVANCED) |
---|
1499 | 1566 | objectPanel.add(infoPanel); |
---|
| 1567 | + objectPanel.setIconAt(2, GetIcon("icons/info.png")); |
---|
| 1568 | + objectPanel.setToolTipTextAt(2, "Information"); |
---|
| 1569 | + |
---|
| 1570 | + objectPanel.add(XYZPanel); |
---|
| 1571 | + objectPanel.setIconAt(3, GetIcon("icons/XYZ.png")); |
---|
| 1572 | + objectPanel.setToolTipTextAt(3, "XYZ/RGB transform"); |
---|
1500 | 1573 | |
---|
1501 | 1574 | objectPanel.add(toolboxPanel); |
---|
| 1575 | + objectPanel.setIconAt(4, GetIcon("icons/primitives.png")); |
---|
| 1576 | + objectPanel.setToolTipTextAt(4, "Objects & backgrounds"); |
---|
1502 | 1577 | |
---|
1503 | 1578 | /* |
---|
1504 | 1579 | aConstraints.gridx = 0; |
---|
.. | .. |
---|
1519 | 1594 | scrollpane.addMouseWheelListener(this); // Default not fast enough |
---|
1520 | 1595 | |
---|
1521 | 1596 | /*JTabbedPane*/ scenePanel = new cGridBag(); |
---|
1522 | | - scenePanel.preferredWidth = 6; |
---|
| 1597 | + scenePanel.preferredWidth = 5; |
---|
1523 | 1598 | |
---|
1524 | 1599 | JTabbedPane tabbedPane = new JTabbedPane(); |
---|
1525 | 1600 | tabbedPane.add(scrollpane); |
---|
.. | .. |
---|
1597 | 1672 | bigThree = new cGridBag(); |
---|
1598 | 1673 | bigThree.addComponent(scenePanel); |
---|
1599 | 1674 | bigThree.addComponent(centralPanel); |
---|
1600 | | - bigThree.addComponent(XYZPanel); |
---|
| 1675 | + //bigThree.addComponent(XYZPanel); |
---|
1601 | 1676 | |
---|
1602 | 1677 | // // SIDE EFFECT!!! |
---|
1603 | 1678 | // aConstraints.gridx = 0; |
---|
.. | .. |
---|
1638 | 1713 | frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); |
---|
1639 | 1714 | frame.addWindowListener(new WindowAdapter() |
---|
1640 | 1715 | { |
---|
1641 | | - |
---|
1642 | 1716 | public void windowClosing(WindowEvent e) |
---|
1643 | 1717 | { |
---|
1644 | 1718 | Close(); |
---|
.. | .. |
---|
1661 | 1735 | ctrlPanel.removeAll(); |
---|
1662 | 1736 | } |
---|
1663 | 1737 | |
---|
1664 | | - void SetupMaterial(cGridBag panel) |
---|
| 1738 | + void SetupMaterial(cGridBag materialpanel) |
---|
1665 | 1739 | { |
---|
1666 | | - /* |
---|
| 1740 | + cGridBag presetpanel = new cGridBag().setVertical(true); |
---|
| 1741 | + cLabel label = GetLabel("icons/shadericons/shadericon00000.png", !Grafreed.NIMBUSLAF); |
---|
| 1742 | + label.addMouseListener(new MouseAdapter() |
---|
| 1743 | + { |
---|
| 1744 | + public void mouseClicked(MouseEvent e) |
---|
| 1745 | + { |
---|
| 1746 | + colorField.setFloat(0); |
---|
| 1747 | + saturationField.setFloat(1); |
---|
| 1748 | + materialtouched = true; |
---|
| 1749 | + applySelf(); |
---|
| 1750 | + } |
---|
| 1751 | + }); |
---|
| 1752 | + presetpanel.add(label); |
---|
| 1753 | + |
---|
| 1754 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00001.png", !Grafreed.NIMBUSLAF)); |
---|
| 1755 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00002.png", !Grafreed.NIMBUSLAF)); |
---|
| 1756 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00003.png", !Grafreed.NIMBUSLAF)); |
---|
| 1757 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00004.png", !Grafreed.NIMBUSLAF)); |
---|
| 1758 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00005.png", !Grafreed.NIMBUSLAF)); |
---|
| 1759 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00006.png", !Grafreed.NIMBUSLAF)); |
---|
| 1760 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00007.png", !Grafreed.NIMBUSLAF)); |
---|
| 1761 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00008.png", !Grafreed.NIMBUSLAF)); |
---|
| 1762 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00009.png", !Grafreed.NIMBUSLAF)); |
---|
| 1763 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00010.png", !Grafreed.NIMBUSLAF)); |
---|
| 1764 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00011.png", !Grafreed.NIMBUSLAF)); |
---|
| 1765 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00012.png", !Grafreed.NIMBUSLAF)); |
---|
| 1766 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00013.png", !Grafreed.NIMBUSLAF)); |
---|
| 1767 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00014.png", !Grafreed.NIMBUSLAF)); |
---|
| 1768 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00015.png", !Grafreed.NIMBUSLAF)); |
---|
| 1769 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00016.png", !Grafreed.NIMBUSLAF)); |
---|
| 1770 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00017.png", !Grafreed.NIMBUSLAF)); |
---|
| 1771 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00018.png", !Grafreed.NIMBUSLAF)); |
---|
| 1772 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00019.png", !Grafreed.NIMBUSLAF)); |
---|
| 1773 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00020.png", !Grafreed.NIMBUSLAF)); |
---|
| 1774 | + |
---|
| 1775 | + cGridBag panel = new cGridBag().setVertical(true); |
---|
| 1776 | + |
---|
| 1777 | + presetpanel.preferredWidth = 1; |
---|
| 1778 | + |
---|
| 1779 | + materialpanel.add(panel); |
---|
| 1780 | + materialpanel.add(presetpanel); |
---|
| 1781 | + |
---|
| 1782 | + panel.preferredWidth = 8; |
---|
| 1783 | + |
---|
| 1784 | + /* |
---|
1667 | 1785 | ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints); |
---|
1668 | 1786 | materialLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1669 | | - */ |
---|
| 1787 | + */ |
---|
1670 | 1788 | |
---|
1671 | 1789 | cGridBag editBar = new cGridBag().setVertical(false); |
---|
1672 | 1790 | |
---|
.. | .. |
---|
1700 | 1818 | //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1701 | 1819 | |
---|
1702 | 1820 | cGridBag colorSection = new cGridBag().setVertical(true); |
---|
| 1821 | + |
---|
| 1822 | + cGridBag huepanel = new cGridBag(); |
---|
| 1823 | + cGridBag huelabel = new cGridBag(); |
---|
| 1824 | + label = GetLabel("icons/hue.png", false); |
---|
| 1825 | + label.fit = true; |
---|
| 1826 | + huelabel.add(label); |
---|
| 1827 | + huelabel.preferredWidth = 20; |
---|
| 1828 | + huepanel.add(new cGridBag()); // Label |
---|
| 1829 | + huepanel.add(huelabel); // Field/slider |
---|
| 1830 | + |
---|
| 1831 | + huepanel.preferredHeight = 7; |
---|
| 1832 | + |
---|
| 1833 | + colorSection.add(huepanel); |
---|
1703 | 1834 | |
---|
1704 | 1835 | cGridBag color = new cGridBag(); |
---|
1705 | | - color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints); |
---|
1706 | | - colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1707 | | - color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1836 | + |
---|
| 1837 | + color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints); |
---|
| 1838 | + colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1839 | + color.add(colorField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
| 1840 | + |
---|
1708 | 1841 | //colorField.preferredWidth = 200; |
---|
1709 | 1842 | colorSection.add(color); |
---|
1710 | 1843 | |
---|
1711 | 1844 | cGridBag modulation = new cGridBag(); |
---|
1712 | 1845 | modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints); |
---|
1713 | 1846 | modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1714 | | - modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1847 | + modulation.add(saturationField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
1715 | 1848 | colorSection.add(modulation); |
---|
1716 | 1849 | |
---|
| 1850 | + cGridBag opacity = new cGridBag(); |
---|
| 1851 | + opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints); |
---|
| 1852 | + opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1853 | + opacity.add(opacityField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
| 1854 | + colorSection.add(opacity); |
---|
| 1855 | + |
---|
| 1856 | + colorSection.add(GetSeparator()); |
---|
| 1857 | + |
---|
1717 | 1858 | cGridBag texture = new cGridBag(); |
---|
1718 | 1859 | texture.add(textureLabel = new JLabel("Texture")); // , aConstraints); |
---|
1719 | 1860 | textureLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1720 | 1861 | texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1721 | 1862 | colorSection.add(texture); |
---|
1722 | 1863 | |
---|
1723 | | - panel.add(new JSeparator()); |
---|
| 1864 | + panel.add(GetSeparator()); |
---|
1724 | 1865 | |
---|
1725 | 1866 | panel.add(colorSection); |
---|
1726 | 1867 | |
---|
.. | .. |
---|
1776 | 1917 | shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1777 | 1918 | diffuseSection.add(shadowbias); |
---|
1778 | 1919 | |
---|
1779 | | - panel.add(new JSeparator()); |
---|
| 1920 | + panel.add(GetSeparator()); |
---|
1780 | 1921 | |
---|
1781 | 1922 | panel.add(diffuseSection); |
---|
1782 | 1923 | |
---|
.. | .. |
---|
1839 | 1980 | specularSection.add(anisoV); |
---|
1840 | 1981 | |
---|
1841 | 1982 | |
---|
1842 | | - panel.add(new JSeparator()); |
---|
| 1983 | + panel.add(GetSeparator()); |
---|
1843 | 1984 | |
---|
1844 | 1985 | panel.add(specularSection); |
---|
1845 | 1986 | |
---|
.. | .. |
---|
1864 | 2005 | backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1865 | 2006 | backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1866 | 2007 | colorSection.add(backlit); |
---|
1867 | | - |
---|
1868 | | - cGridBag opacity = new cGridBag(); |
---|
1869 | | - opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints); |
---|
1870 | | - opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1871 | | - opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1872 | | - colorSection.add(opacity); |
---|
1873 | 2008 | |
---|
1874 | 2009 | //panel.add(new JSeparator()); |
---|
1875 | 2010 | |
---|
.. | .. |
---|
1915 | 2050 | opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints); |
---|
1916 | 2051 | textureSection.add(opacityPower); |
---|
1917 | 2052 | |
---|
1918 | | - panel.add(new JSeparator()); |
---|
| 2053 | + panel.add(GetSeparator()); |
---|
1919 | 2054 | |
---|
1920 | 2055 | panel.add(textureSection); |
---|
1921 | 2056 | |
---|
.. | .. |
---|
2902 | 3037 | |
---|
2903 | 3038 | freezematerial = true; |
---|
2904 | 3039 | colorField.setFloat(mat.color); |
---|
2905 | | - modulationField.setFloat(mat.modulation); |
---|
| 3040 | + saturationField.setFloat(mat.modulation); |
---|
2906 | 3041 | metalnessField.setFloat(mat.metalness); |
---|
2907 | 3042 | diffuseField.setFloat(mat.diffuse); |
---|
2908 | 3043 | specularField.setFloat(mat.specular); |
---|
.. | .. |
---|
3213 | 3348 | } else if (event.getSource() == liveCB) |
---|
3214 | 3349 | { |
---|
3215 | 3350 | copy.live ^= true; |
---|
| 3351 | + objEditor.refreshContents(true); // To show item colors |
---|
3216 | 3352 | return; |
---|
3217 | | - } else if (event.getSource() == selectCB) |
---|
| 3353 | + } else if (event.getSource() == selectableCB) |
---|
3218 | 3354 | { |
---|
3219 | 3355 | copy.dontselect ^= true; |
---|
3220 | 3356 | return; |
---|
.. | .. |
---|
3222 | 3358 | { |
---|
3223 | 3359 | copy.hide ^= true; |
---|
3224 | 3360 | copy.Touch(); // display list issue |
---|
3225 | | - objEditor.refreshContents(); |
---|
| 3361 | + objEditor.refreshContents(true); // To show item colors |
---|
3226 | 3362 | return; |
---|
3227 | 3363 | } else if (event.getSource() == link2masterCB) |
---|
3228 | 3364 | { |
---|
.. | .. |
---|
3478 | 3614 | |
---|
3479 | 3615 | static public byte[] Compress(Object3D o) |
---|
3480 | 3616 | { |
---|
| 3617 | + // Slower to actually compress. |
---|
3481 | 3618 | try |
---|
3482 | 3619 | { |
---|
3483 | 3620 | ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
---|
.. | .. |
---|
3574 | 3711 | return null; |
---|
3575 | 3712 | } |
---|
3576 | 3713 | |
---|
3577 | | - java.util.Hashtable<java.util.UUID, Object3D> hashtable = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
3578 | 3714 | |
---|
3579 | 3715 | public void Save() |
---|
3580 | 3716 | { |
---|
3581 | | - Save(true); |
---|
| 3717 | + //Save(true); |
---|
| 3718 | + Replace(); |
---|
| 3719 | + SetUndoStates(); |
---|
3582 | 3720 | } |
---|
3583 | 3721 | |
---|
3584 | 3722 | private boolean Equal(byte[] compress, byte[] name) |
---|
.. | .. |
---|
3597 | 3735 | return true; |
---|
3598 | 3736 | } |
---|
3599 | 3737 | |
---|
| 3738 | + java.util.Hashtable<java.util.UUID, Object3D> versiontable = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
| 3739 | + |
---|
3600 | 3740 | public boolean Save(boolean user) |
---|
3601 | 3741 | { |
---|
3602 | 3742 | System.err.println("Save"); |
---|
| 3743 | + Replace(); |
---|
3603 | 3744 | |
---|
3604 | 3745 | cRadio tab = GetCurrentTab(); |
---|
3605 | 3746 | |
---|
3606 | | - boolean temp = CameraPane.SWITCH; |
---|
3607 | | - CameraPane.SWITCH = false; |
---|
3608 | | - |
---|
3609 | | - copy.ExtractBigData(hashtable); |
---|
3610 | | - |
---|
3611 | | - byte[] compress = Compress(copy); |
---|
3612 | | - |
---|
3613 | | - CameraPane.SWITCH = temp; |
---|
| 3747 | + Object3D compress = CompressCopy(); // Saved version. No need for "Replace". |
---|
3614 | 3748 | |
---|
3615 | 3749 | boolean thesame = false; |
---|
3616 | 3750 | |
---|
3617 | | - // Quick heuristic using length. Works only when stream is compressed. |
---|
3618 | | - if (tab.undoindex > 0 && tab.graphs[tab.undoindex-1] != null && Equal(compress, tab.graphs[tab.undoindex-1])) |
---|
3619 | | - { |
---|
3620 | | - thesame = true; |
---|
3621 | | - } |
---|
| 3751 | +// if (copy.versionindex > 0 && copy.versions[copy.versionindex-1] != null && Equal(compress, copy.versions[copy.versionindex-1])) |
---|
| 3752 | +// { |
---|
| 3753 | +// thesame = true; |
---|
| 3754 | +// } |
---|
3622 | 3755 | |
---|
3623 | 3756 | //EditorFrame.m_MainFrame.requestFocusInWindow(); |
---|
3624 | 3757 | if (!thesame) |
---|
3625 | 3758 | { |
---|
3626 | | - //tab.user[tab.undoindex] = user; |
---|
3627 | | - boolean increment = tab.graphs[tab.undoindex] == null; |
---|
| 3759 | + //tab.user[tab.versionindex] = user; |
---|
| 3760 | + //boolean increment = true; // tab.graphs[tab.versionindex] == null; |
---|
3628 | 3761 | |
---|
3629 | | - tab.graphs[tab.undoindex] = compress; |
---|
| 3762 | + copy.versionlist[++copy.versionindex] = compress; |
---|
3630 | 3763 | |
---|
3631 | | - if (increment) |
---|
3632 | | - tab.undoindex++; |
---|
| 3764 | + // if (increment) |
---|
| 3765 | + // tab.versionindex++; |
---|
3633 | 3766 | } |
---|
3634 | 3767 | |
---|
3635 | | - copy.RestoreBigData(hashtable); |
---|
| 3768 | + //copy.RestoreBigData(versiontable); |
---|
3636 | 3769 | |
---|
3637 | 3770 | //assert(hashtable.isEmpty()); |
---|
3638 | 3771 | |
---|
3639 | | - for (int i = tab.undoindex; i < tab.graphs.length; i++) |
---|
| 3772 | + for (int i = copy.versionindex+1; i < copy.versionlist.length; i++) |
---|
3640 | 3773 | { |
---|
3641 | 3774 | //tab.user[i] = false; |
---|
3642 | | - // tab.graphs[i] = null; |
---|
| 3775 | + copy.versionlist[i] = null; |
---|
3643 | 3776 | } |
---|
3644 | 3777 | |
---|
3645 | 3778 | SetUndoStates(); |
---|
.. | .. |
---|
3649 | 3782 | { |
---|
3650 | 3783 | try |
---|
3651 | 3784 | { |
---|
3652 | | - FileOutputStream ostream = new FileOutputStream("save" + tab.undoindex); |
---|
| 3785 | + FileOutputStream ostream = new FileOutputStream("save" + copy.versionindex); |
---|
3653 | 3786 | ObjectOutputStream p = new ObjectOutputStream(ostream); |
---|
3654 | 3787 | |
---|
3655 | 3788 | p.writeObject(copy); |
---|
.. | .. |
---|
3665 | 3798 | |
---|
3666 | 3799 | return !thesame; |
---|
3667 | 3800 | } |
---|
| 3801 | + |
---|
| 3802 | + boolean flashIt = true; |
---|
| 3803 | + |
---|
| 3804 | + void RefreshSelection() |
---|
| 3805 | + { |
---|
| 3806 | + Object3D selection = new Object3D(); |
---|
| 3807 | + |
---|
| 3808 | + for (int i = 0; i < copy.selection.size(); i++) |
---|
| 3809 | + { |
---|
| 3810 | + Object3D elem = copy.selection.elementAt(i); |
---|
| 3811 | + |
---|
| 3812 | + Object3D obj = copy.GetObject(elem.GetUUID()); |
---|
| 3813 | + |
---|
| 3814 | + if (obj == null) |
---|
| 3815 | + { |
---|
| 3816 | + copy.selection.remove(i--); |
---|
| 3817 | + } |
---|
| 3818 | + else |
---|
| 3819 | + { |
---|
| 3820 | + selection.add(obj); |
---|
| 3821 | + copy.selection.setElementAt(obj, i); |
---|
| 3822 | + } |
---|
| 3823 | + } |
---|
| 3824 | + |
---|
| 3825 | + flashIt = false; |
---|
| 3826 | + GetTree().clearSelection(); |
---|
| 3827 | + for (int i = 0; i < selection.size(); i++) |
---|
| 3828 | + GetTree().addSelectionPath(selection.elementAt(i).GetTreePath().GetTreePath()); |
---|
| 3829 | + flashIt = true; |
---|
| 3830 | + |
---|
| 3831 | + refreshContents(false); |
---|
| 3832 | + } |
---|
3668 | 3833 | |
---|
3669 | 3834 | void CopyChanged(Object3D obj) |
---|
3670 | 3835 | { |
---|
.. | .. |
---|
3673 | 3838 | boolean temp = CameraPane.SWITCH; |
---|
3674 | 3839 | CameraPane.SWITCH = false; |
---|
3675 | 3840 | |
---|
3676 | | - copy.ExtractBigData(hashtable); |
---|
| 3841 | + copy.ExtractBigData(versiontable); |
---|
3677 | 3842 | |
---|
3678 | 3843 | copy.clear(); |
---|
3679 | 3844 | |
---|
| 3845 | + copy.skyboxname = obj.skyboxname; |
---|
| 3846 | + copy.skyboxext = obj.skyboxext; |
---|
| 3847 | + |
---|
3680 | 3848 | for (int i=0; i<obj.Size(); i++) |
---|
3681 | 3849 | { |
---|
3682 | 3850 | copy.add(obj.get(i)); |
---|
3683 | 3851 | } |
---|
3684 | 3852 | |
---|
3685 | | - copy.RestoreBigData(hashtable); |
---|
| 3853 | + copy.RestoreBigData(versiontable); |
---|
3686 | 3854 | |
---|
3687 | 3855 | CameraPane.SWITCH = temp; |
---|
3688 | 3856 | |
---|
| 3857 | + RefreshSelection(); |
---|
3689 | 3858 | //assert(hashtable.isEmpty()); |
---|
3690 | 3859 | |
---|
3691 | 3860 | copy.Touch(); |
---|
.. | .. |
---|
3710 | 3879 | } |
---|
3711 | 3880 | |
---|
3712 | 3881 | cButton undoButton; |
---|
| 3882 | + cButton restoreButton; |
---|
| 3883 | + cButton replaceButton; |
---|
3713 | 3884 | cButton redoButton; |
---|
3714 | 3885 | |
---|
| 3886 | + boolean muteSlider; |
---|
| 3887 | + |
---|
| 3888 | + int VersionCount() |
---|
| 3889 | + { |
---|
| 3890 | + int count = 0; |
---|
| 3891 | + |
---|
| 3892 | + for (int i = copy.versionlist.length; --i >= 0;) |
---|
| 3893 | + { |
---|
| 3894 | + if (copy.versionlist[i] != null) |
---|
| 3895 | + count++; |
---|
| 3896 | + } |
---|
| 3897 | + |
---|
| 3898 | + return count; |
---|
| 3899 | + } |
---|
| 3900 | + |
---|
3715 | 3901 | void SetUndoStates() |
---|
3716 | 3902 | { |
---|
3717 | 3903 | cRadio tab = GetCurrentTab(); |
---|
3718 | 3904 | |
---|
3719 | | - undoButton.setEnabled(tab.undoindex > 0); |
---|
3720 | | - redoButton.setEnabled(tab.graphs[tab.undoindex + 1] != null); |
---|
| 3905 | + restoreButton.setEnabled(copy.versionindex != -1); |
---|
| 3906 | + replaceButton.setEnabled(copy.versionindex != -1); |
---|
| 3907 | + |
---|
| 3908 | + undoButton.setEnabled(copy.versionindex > 0); |
---|
| 3909 | + redoButton.setEnabled(copy.versionlist[copy.versionindex + 1] != null); |
---|
| 3910 | + |
---|
| 3911 | + muteSlider = true; |
---|
| 3912 | + versionSlider.setMaximum(VersionCount() - 1); |
---|
| 3913 | + versionSlider.setInteger(copy.versionindex); |
---|
| 3914 | + muteSlider = false; |
---|
3721 | 3915 | } |
---|
3722 | 3916 | |
---|
3723 | 3917 | public boolean Undo() |
---|
3724 | 3918 | { |
---|
| 3919 | + // Option? |
---|
| 3920 | + Replace(); |
---|
| 3921 | + |
---|
3725 | 3922 | System.err.println("Undo"); |
---|
3726 | 3923 | |
---|
3727 | 3924 | cRadio tab = GetCurrentTab(); |
---|
3728 | 3925 | |
---|
3729 | | - if (tab.undoindex == 0) |
---|
| 3926 | + if (copy.versionindex == 0) |
---|
3730 | 3927 | { |
---|
3731 | 3928 | java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
3732 | 3929 | return false; |
---|
3733 | 3930 | } |
---|
3734 | 3931 | |
---|
3735 | | - if (tab.graphs[tab.undoindex] == null) // || !tab.user[tab.undoindex]) |
---|
| 3932 | +// if (tab.graphs[tab.versionindex] == null) // || !tab.user[tab.versionindex]) |
---|
| 3933 | +// { |
---|
| 3934 | +// if (Save(false)) |
---|
| 3935 | +// tab.versionindex -= 1; |
---|
| 3936 | +// else |
---|
| 3937 | +// { |
---|
| 3938 | +// if (tab.versionindex <= 0) |
---|
| 3939 | +// return false; |
---|
| 3940 | +// else |
---|
| 3941 | +// tab.versionindex -= 1; |
---|
| 3942 | +// } |
---|
| 3943 | +// } |
---|
| 3944 | + |
---|
| 3945 | + copy.versionindex -= 1; |
---|
| 3946 | + |
---|
| 3947 | + CopyChanged((Object3D)copy.versionlist[copy.versionindex]); |
---|
| 3948 | + |
---|
| 3949 | + return true; |
---|
| 3950 | + } |
---|
| 3951 | + |
---|
| 3952 | + public boolean Restore() |
---|
| 3953 | + { |
---|
| 3954 | + System.err.println("Restore"); |
---|
| 3955 | + |
---|
| 3956 | + cRadio tab = GetCurrentTab(); |
---|
| 3957 | + |
---|
| 3958 | + if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
3736 | 3959 | { |
---|
3737 | | - if (Save(false)) |
---|
3738 | | - tab.undoindex -= 1; |
---|
3739 | | - else |
---|
3740 | | - { |
---|
3741 | | - if (tab.undoindex <= 0) |
---|
3742 | | - return false; |
---|
3743 | | - else |
---|
3744 | | - tab.undoindex -= 1; |
---|
3745 | | - } |
---|
| 3960 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 3961 | + return false; |
---|
3746 | 3962 | } |
---|
3747 | 3963 | |
---|
3748 | | - tab.undoindex -= 1; |
---|
| 3964 | + //CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
| 3965 | + CopyChanged(copy.versionlist[copy.versionindex]); |
---|
| 3966 | + |
---|
| 3967 | + return true; |
---|
| 3968 | + } |
---|
3749 | 3969 | |
---|
3750 | | - CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex])); |
---|
| 3970 | + public boolean Replace() |
---|
| 3971 | + { |
---|
| 3972 | + System.err.println("Replace"); |
---|
| 3973 | + |
---|
| 3974 | + cRadio tab = GetCurrentTab(); |
---|
| 3975 | + |
---|
| 3976 | + if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
| 3977 | + { |
---|
| 3978 | + // No version yet. OK. java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 3979 | + return false; |
---|
| 3980 | + } |
---|
| 3981 | + |
---|
| 3982 | + copy.versionlist[copy.versionindex] = CompressCopy(); |
---|
3751 | 3983 | |
---|
3752 | 3984 | return true; |
---|
3753 | 3985 | } |
---|
3754 | 3986 | |
---|
3755 | 3987 | public void Redo() |
---|
3756 | 3988 | { |
---|
| 3989 | + // Option? |
---|
| 3990 | + Replace(); |
---|
| 3991 | + |
---|
3757 | 3992 | cRadio tab = GetCurrentTab(); |
---|
3758 | 3993 | |
---|
3759 | | - if (tab.graphs[tab.undoindex + 1] == null) |
---|
| 3994 | + if (copy.versionlist[copy.versionindex + 1] == null) |
---|
3760 | 3995 | { |
---|
3761 | 3996 | java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
3762 | 3997 | return; |
---|
3763 | 3998 | } |
---|
3764 | 3999 | |
---|
3765 | | - tab.undoindex += 1; |
---|
| 4000 | + copy.versionindex += 1; |
---|
3766 | 4001 | |
---|
3767 | | - CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex])); |
---|
| 4002 | + CopyChanged(copy.versionlist[copy.versionindex]); |
---|
3768 | 4003 | |
---|
3769 | | - //if (!tab.user[tab.undoindex]) |
---|
3770 | | - // tab.graphs[tab.undoindex] = null; |
---|
| 4004 | + //if (!tab.user[tab.versionindex]) |
---|
| 4005 | + // tab.graphs[tab.versionindex] = null; |
---|
3771 | 4006 | } |
---|
3772 | 4007 | |
---|
3773 | 4008 | void ImportGFD() |
---|
.. | .. |
---|
3978 | 4213 | //copy.material = new cMaterial(copy.GetMaterial()); |
---|
3979 | 4214 | |
---|
3980 | 4215 | current.color = (float) colorField.getFloat(); |
---|
3981 | | - current.modulation = (float) modulationField.getFloat(); |
---|
| 4216 | + current.modulation = (float) saturationField.getFloat(); |
---|
3982 | 4217 | current.metalness = (float) metalnessField.getFloat(); |
---|
3983 | 4218 | current.diffuse = (float) diffuseField.getFloat(); |
---|
3984 | 4219 | current.specular = (float) specularField.getFloat(); |
---|
.. | .. |
---|
4011 | 4246 | cMaterial mat = copy.material; |
---|
4012 | 4247 | |
---|
4013 | 4248 | colorField.SetToolTipValue((mat.color)); |
---|
4014 | | - modulationField.SetToolTipValue((mat.modulation)); |
---|
| 4249 | + saturationField.SetToolTipValue((mat.modulation)); |
---|
4015 | 4250 | metalnessField.SetToolTipValue((mat.metalness)); |
---|
4016 | 4251 | diffuseField.SetToolTipValue((mat.diffuse)); |
---|
4017 | 4252 | specularField.SetToolTipValue((mat.specular)); |
---|
.. | .. |
---|
4063 | 4298 | //copy.Touch(); |
---|
4064 | 4299 | } |
---|
4065 | 4300 | |
---|
| 4301 | + cNumberSlider versionSlider; |
---|
| 4302 | + |
---|
4066 | 4303 | public void stateChanged(ChangeEvent e) |
---|
4067 | 4304 | { |
---|
4068 | 4305 | // assert(false); |
---|
| 4306 | + if (e.getSource() == versionSlider) |
---|
| 4307 | + { |
---|
| 4308 | + if (muteSlider) |
---|
| 4309 | + return; |
---|
| 4310 | + |
---|
| 4311 | + int version = versionSlider.getInteger(); |
---|
| 4312 | + |
---|
| 4313 | + if (copy.versionlist[version] != null) |
---|
| 4314 | + { |
---|
| 4315 | + CopyChanged(copy.versionlist[copy.versionindex = version]); |
---|
| 4316 | + } |
---|
| 4317 | + |
---|
| 4318 | + return; |
---|
| 4319 | + } |
---|
4069 | 4320 | |
---|
4070 | 4321 | if (freezematerial) |
---|
4071 | 4322 | { |
---|
.. | .. |
---|
4101 | 4352 | { |
---|
4102 | 4353 | //System.out.println("stateChanged = " + this); |
---|
4103 | 4354 | materialtouched = true; |
---|
| 4355 | + |
---|
| 4356 | + if (e.getSource() == colorField && saturationField.getFloat() == 0.001) |
---|
| 4357 | + { |
---|
| 4358 | + saturationField.setFloat(1); |
---|
| 4359 | + } |
---|
| 4360 | + |
---|
4104 | 4361 | applySelf(); |
---|
4105 | 4362 | //System.out.println("this = " + this); |
---|
4106 | 4363 | //System.out.println("PARENT = " + parent); |
---|
.. | .. |
---|
4400 | 4657 | { |
---|
4401 | 4658 | if (GetTree() != null) |
---|
4402 | 4659 | { |
---|
| 4660 | + GetTree().revalidate(); |
---|
4403 | 4661 | GetTree().repaint(); |
---|
4404 | 4662 | } |
---|
4405 | 4663 | |
---|
.. | .. |
---|
4414 | 4672 | |
---|
4415 | 4673 | void makeSomething(Object3D thing, boolean resetmodel) // deselect) |
---|
4416 | 4674 | { |
---|
4417 | | - if (Globals.SAVEONMAKE) // && resetmodel) |
---|
| 4675 | + if (Globals.REPLACEONMAKE) // && resetmodel) |
---|
4418 | 4676 | Save(); |
---|
4419 | 4677 | //Tween.set(thing, 0).target(1).start(tweenManager); |
---|
4420 | 4678 | //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager); |
---|
.. | .. |
---|
4656 | 4914 | readobj.ResetDisplayList(); |
---|
4657 | 4915 | } catch (Exception e) |
---|
4658 | 4916 | { |
---|
4659 | | - //e.printStackTrace(); |
---|
| 4917 | + if (!e.toString().contains("GZIP")) |
---|
| 4918 | + e.printStackTrace(); |
---|
| 4919 | + |
---|
4660 | 4920 | try |
---|
4661 | 4921 | { |
---|
4662 | 4922 | java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
.. | .. |
---|
4736 | 4996 | { |
---|
4737 | 4997 | //readobj.deepCopySelf(copy); |
---|
4738 | 4998 | copy.clear(); // june 2014 |
---|
| 4999 | + copy.skyboxname = readobj.skyboxname; |
---|
| 5000 | + copy.skyboxext = readobj.skyboxext; |
---|
4739 | 5001 | for (int i = 0; i < readobj.size(); i++) |
---|
4740 | 5002 | { |
---|
4741 | 5003 | Object3D child = readobj.get(i); // reserve(i); |
---|
.. | .. |
---|
4776 | 5038 | } |
---|
4777 | 5039 | } catch (ClassCastException e) |
---|
4778 | 5040 | { |
---|
| 5041 | + e.printStackTrace(); |
---|
4779 | 5042 | assert (false); |
---|
4780 | 5043 | Composite c = (Composite) copy; |
---|
4781 | 5044 | c.children.clear(); |
---|
.. | .. |
---|
4786 | 5049 | c.addChild(csg); |
---|
4787 | 5050 | } |
---|
4788 | 5051 | |
---|
| 5052 | + copy.versionlist = readobj.versionlist; |
---|
| 5053 | + copy.versionindex = readobj.versionindex; |
---|
| 5054 | + |
---|
| 5055 | + if (copy.versionlist == null) |
---|
| 5056 | + { |
---|
| 5057 | + copy.versionlist = new Object3D[100]; |
---|
| 5058 | + copy.versionindex = -1; |
---|
| 5059 | + } |
---|
| 5060 | + |
---|
| 5061 | + //? SetUndoStates(); |
---|
| 5062 | + |
---|
4789 | 5063 | ResetModel(); |
---|
4790 | 5064 | copy.HardTouch(); // recompile? |
---|
4791 | 5065 | refreshContents(); |
---|
.. | .. |
---|
4895 | 5169 | //ps.print(buffer.toString()); |
---|
4896 | 5170 | } catch (IOException e) |
---|
4897 | 5171 | { |
---|
| 5172 | + e.printStackTrace(); |
---|
4898 | 5173 | } |
---|
4899 | 5174 | } |
---|
4900 | 5175 | |
---|
.. | .. |
---|
5187 | 5462 | JLabel colorLabel; |
---|
5188 | 5463 | cNumberSlider colorField; |
---|
5189 | 5464 | JLabel modulationLabel; |
---|
5190 | | - cNumberSlider modulationField; |
---|
| 5465 | + cNumberSlider saturationField; |
---|
5191 | 5466 | JLabel metalnessLabel; |
---|
5192 | 5467 | cNumberSlider metalnessField; |
---|
5193 | 5468 | JLabel diffuseLabel; |
---|