.. | .. |
---|
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 | |
---|
285 | | - if (copy.versions == null) |
---|
| 299 | + if (copy.versionlist == null) |
---|
286 | 300 | { |
---|
287 | | - copy.versions = new byte[100][]; |
---|
| 301 | + copy.versionlist = new Object3D[100]; |
---|
288 | 302 | copy.versionindex = -1; |
---|
289 | 303 | } |
---|
290 | 304 | |
---|
.. | .. |
---|
301 | 315 | client = inClient; |
---|
302 | 316 | copy = client; |
---|
303 | 317 | |
---|
304 | | - if (copy.versions == null) |
---|
| 318 | + if (copy.versionlist == null) |
---|
305 | 319 | { |
---|
306 | | - copy.versions = new byte[100][]; |
---|
| 320 | + copy.versionlist = new Object3D[100]; |
---|
307 | 321 | copy.versionindex = -1; |
---|
308 | 322 | } |
---|
309 | 323 | |
---|
.. | .. |
---|
339 | 353 | copy = localCopy; |
---|
340 | 354 | copy.editWindow = this; |
---|
341 | 355 | |
---|
342 | | - if (copy.versions == null) |
---|
| 356 | + if (copy.versionlist == 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 | | - materialPanel = new cGridBag().setVertical(true); |
---|
456 | | - materialPanel.setName("Material"); |
---|
| 470 | + materialPanel = new cGridBag().setVertical(false); |
---|
| 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 | |
---|
.. | .. |
---|
832 | 848 | //frame.setVisible(true); |
---|
833 | 849 | } |
---|
834 | 850 | frame.validate(); |
---|
| 851 | + |
---|
| 852 | + cameraView.requestFocusInWindow(); |
---|
835 | 853 | } |
---|
836 | 854 | |
---|
837 | | - private byte[] CompressCopy() |
---|
| 855 | + private Object3D CompressCopy() |
---|
838 | 856 | { |
---|
839 | 857 | boolean temp = CameraPane.SWITCH; |
---|
840 | 858 | CameraPane.SWITCH = false; |
---|
.. | .. |
---|
842 | 860 | copy.ExtractBigData(versiontable); |
---|
843 | 861 | // if (copy == client) |
---|
844 | 862 | |
---|
845 | | - byte[] versions[] = copy.versions; |
---|
846 | | - copy.versions = null; |
---|
| 863 | + Object3D versions[] = copy.versionlist; |
---|
| 864 | + copy.versionlist = null; |
---|
847 | 865 | |
---|
848 | | - byte[] compress = Compress(copy); |
---|
| 866 | + //byte[] compress = Compress(copy); |
---|
| 867 | + Object3D compress = (Object3D)Grafreed.clone(copy); |
---|
849 | 868 | |
---|
850 | | - copy.versions = versions; |
---|
| 869 | + copy.versionlist = versions; |
---|
851 | 870 | |
---|
852 | 871 | copy.RestoreBigData(versiontable); |
---|
853 | 872 | |
---|
.. | .. |
---|
977 | 996 | { |
---|
978 | 997 | SetupMaterial(materialPanel); |
---|
979 | 998 | } |
---|
| 999 | + |
---|
980 | 1000 | //SetupName(); |
---|
981 | 1001 | //SetupViews(); |
---|
982 | 1002 | } |
---|
.. | .. |
---|
986 | 1006 | // NumberSlider vDivsField; |
---|
987 | 1007 | // JCheckBox endcaps; |
---|
988 | 1008 | JCheckBox liveCB; |
---|
989 | | - JCheckBox selectCB; |
---|
| 1009 | + JCheckBox selectableCB; |
---|
990 | 1010 | JCheckBox hideCB; |
---|
991 | 1011 | JCheckBox link2masterCB; |
---|
992 | 1012 | JCheckBox markCB; |
---|
.. | .. |
---|
1198 | 1218 | |
---|
1199 | 1219 | liveCB = AddCheckBox(setupPanel, "Live", copy.live); |
---|
1200 | 1220 | liveCB.setToolTipText("Animate object"); |
---|
1201 | | - selectCB = AddCheckBox(setupPanel, "Select", !copy.dontselect); |
---|
1202 | | - selectCB.setToolTipText("Make object selectable"); |
---|
| 1221 | + selectableCB = AddCheckBox(setupPanel, "Select", !copy.dontselect); |
---|
| 1222 | + selectableCB.setToolTipText("Make object selectable"); |
---|
1203 | 1223 | // Return(); |
---|
| 1224 | + |
---|
1204 | 1225 | hideCB = AddCheckBox(setupPanel, "Hide", copy.hide); |
---|
1205 | 1226 | hideCB.setToolTipText("Hide object"); |
---|
1206 | 1227 | markCB = AddCheckBox(setupPanel, "Mark", copy.marked); |
---|
1207 | 1228 | markCB.setToolTipText("As animation target transform"); |
---|
| 1229 | + |
---|
| 1230 | + ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false); |
---|
1208 | 1231 | |
---|
1209 | 1232 | setupPanel2 = new cGridBag().setVertical(false); |
---|
1210 | 1233 | |
---|
.. | .. |
---|
1492 | 1515 | XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll); |
---|
1493 | 1516 | XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll); |
---|
1494 | 1517 | XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll); |
---|
| 1518 | + //XYZPanel.setName("XYZ"); |
---|
1495 | 1519 | |
---|
1496 | 1520 | /* |
---|
1497 | 1521 | gridPanel = new JPanel(); //new BorderLayout()); |
---|
.. | .. |
---|
1529 | 1553 | //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); |
---|
1530 | 1554 | //tmp.setName("Edit"); |
---|
1531 | 1555 | objectPanel.add(materialPanel); |
---|
| 1556 | + objectPanel.setIconAt(0, GetIcon("icons/material.png")); |
---|
| 1557 | + objectPanel.setToolTipTextAt(0, "Material"); |
---|
| 1558 | + |
---|
1532 | 1559 | // JPanel north = new JPanel(new BorderLayout()); |
---|
1533 | 1560 | // north.setName("Edit"); |
---|
1534 | 1561 | // north.add(ctrlPanel, BorderLayout.NORTH); |
---|
1535 | 1562 | // objectPanel.add(north); |
---|
1536 | 1563 | objectPanel.add(editPanel); |
---|
| 1564 | + objectPanel.setIconAt(1, GetIcon("icons/write.png")); |
---|
| 1565 | + objectPanel.setToolTipTextAt(1, "Edit controls"); |
---|
1537 | 1566 | |
---|
1538 | 1567 | //if (Globals.ADVANCED) |
---|
1539 | 1568 | objectPanel.add(infoPanel); |
---|
| 1569 | + objectPanel.setIconAt(2, GetIcon("icons/info.png")); |
---|
| 1570 | + objectPanel.setToolTipTextAt(2, "Information"); |
---|
| 1571 | + |
---|
| 1572 | + objectPanel.add(XYZPanel); |
---|
| 1573 | + objectPanel.setIconAt(3, GetIcon("icons/XYZ.png")); |
---|
| 1574 | + objectPanel.setToolTipTextAt(3, "XYZ/RGB transform"); |
---|
1540 | 1575 | |
---|
1541 | 1576 | objectPanel.add(toolboxPanel); |
---|
| 1577 | + objectPanel.setIconAt(4, GetIcon("icons/primitives.png")); |
---|
| 1578 | + objectPanel.setToolTipTextAt(4, "Objects & backgrounds"); |
---|
1542 | 1579 | |
---|
1543 | 1580 | /* |
---|
1544 | 1581 | aConstraints.gridx = 0; |
---|
.. | .. |
---|
1559 | 1596 | scrollpane.addMouseWheelListener(this); // Default not fast enough |
---|
1560 | 1597 | |
---|
1561 | 1598 | /*JTabbedPane*/ scenePanel = new cGridBag(); |
---|
1562 | | - scenePanel.preferredWidth = 6; |
---|
| 1599 | + scenePanel.preferredWidth = 5; |
---|
1563 | 1600 | |
---|
1564 | 1601 | JTabbedPane tabbedPane = new JTabbedPane(); |
---|
1565 | 1602 | tabbedPane.add(scrollpane); |
---|
.. | .. |
---|
1637 | 1674 | bigThree = new cGridBag(); |
---|
1638 | 1675 | bigThree.addComponent(scenePanel); |
---|
1639 | 1676 | bigThree.addComponent(centralPanel); |
---|
1640 | | - bigThree.addComponent(XYZPanel); |
---|
| 1677 | + //bigThree.addComponent(XYZPanel); |
---|
1641 | 1678 | |
---|
1642 | 1679 | // // SIDE EFFECT!!! |
---|
1643 | 1680 | // aConstraints.gridx = 0; |
---|
.. | .. |
---|
1678 | 1715 | frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); |
---|
1679 | 1716 | frame.addWindowListener(new WindowAdapter() |
---|
1680 | 1717 | { |
---|
1681 | | - |
---|
1682 | 1718 | public void windowClosing(WindowEvent e) |
---|
1683 | 1719 | { |
---|
1684 | 1720 | Close(); |
---|
.. | .. |
---|
1701 | 1737 | ctrlPanel.removeAll(); |
---|
1702 | 1738 | } |
---|
1703 | 1739 | |
---|
1704 | | - void SetupMaterial(cGridBag panel) |
---|
| 1740 | + void SetupMaterial(cGridBag materialpanel) |
---|
1705 | 1741 | { |
---|
1706 | | - /* |
---|
| 1742 | + cGridBag presetpanel = new cGridBag().setVertical(true); |
---|
| 1743 | + cLabel skin = GetLabel("icons/shadericons/shadericon00000.png", !Grafreed.NIMBUSLAF); |
---|
| 1744 | + skin.addMouseListener(new MouseAdapter() |
---|
| 1745 | + { |
---|
| 1746 | + public void mouseClicked(MouseEvent e) |
---|
| 1747 | + { |
---|
| 1748 | + Object3D object = Grafreed.materials.versionlist[0].get(0); |
---|
| 1749 | + cMaterial material = object.material; |
---|
| 1750 | + |
---|
| 1751 | + // Skin |
---|
| 1752 | + colorField.setFloat(material.color); |
---|
| 1753 | + saturationField.setFloat(material.modulation); |
---|
| 1754 | + subsurfaceField.setFloat(material.subsurface); |
---|
| 1755 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1756 | + diffusenessField.setFloat(material.factor); |
---|
| 1757 | + shininessField.setFloat(material.shininess); |
---|
| 1758 | + shadowbiasField.setFloat(material.shadowbias); |
---|
| 1759 | + diffuseField.setFloat(material.diffuse); |
---|
| 1760 | + specularField.setFloat(material.specular); |
---|
| 1761 | + |
---|
| 1762 | + bumpField.setFloat(object.projectedVertices[0].x / 1000.0); |
---|
| 1763 | + noiseField.setFloat(object.projectedVertices[0].y / 1000.0); |
---|
| 1764 | + powerField.setFloat(object.projectedVertices[2].x / 1000.0); |
---|
| 1765 | + |
---|
| 1766 | + materialtouched = true; |
---|
| 1767 | + applySelf(); |
---|
| 1768 | + } |
---|
| 1769 | + }); |
---|
| 1770 | + presetpanel.add(skin); |
---|
| 1771 | + |
---|
| 1772 | + cLabel rough2 = GetLabel("icons/shadericons/shadericon00001.png", !Grafreed.NIMBUSLAF); |
---|
| 1773 | + rough2.addMouseListener(new MouseAdapter() |
---|
| 1774 | + { |
---|
| 1775 | + public void mouseClicked(MouseEvent e) |
---|
| 1776 | + { |
---|
| 1777 | + Object3D object = Grafreed.materials.versionlist[1].get(0); |
---|
| 1778 | + cMaterial material = object.material; |
---|
| 1779 | + |
---|
| 1780 | + shininessField.setFloat(material.shininess); |
---|
| 1781 | + velvetField.setFloat(material.velvet); |
---|
| 1782 | + |
---|
| 1783 | + materialtouched = true; |
---|
| 1784 | + applySelf(); |
---|
| 1785 | + } |
---|
| 1786 | + }); |
---|
| 1787 | + presetpanel.add(rough2); |
---|
| 1788 | + |
---|
| 1789 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00002.png", !Grafreed.NIMBUSLAF)); |
---|
| 1790 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00003.png", !Grafreed.NIMBUSLAF)); |
---|
| 1791 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00004.png", !Grafreed.NIMBUSLAF)); |
---|
| 1792 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00005.png", !Grafreed.NIMBUSLAF)); |
---|
| 1793 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00006.png", !Grafreed.NIMBUSLAF)); |
---|
| 1794 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00007.png", !Grafreed.NIMBUSLAF)); |
---|
| 1795 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00008.png", !Grafreed.NIMBUSLAF)); |
---|
| 1796 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00009.png", !Grafreed.NIMBUSLAF)); |
---|
| 1797 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00010.png", !Grafreed.NIMBUSLAF)); |
---|
| 1798 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00011.png", !Grafreed.NIMBUSLAF)); |
---|
| 1799 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00012.png", !Grafreed.NIMBUSLAF)); |
---|
| 1800 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00013.png", !Grafreed.NIMBUSLAF)); |
---|
| 1801 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00014.png", !Grafreed.NIMBUSLAF)); |
---|
| 1802 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00015.png", !Grafreed.NIMBUSLAF)); |
---|
| 1803 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00016.png", !Grafreed.NIMBUSLAF)); |
---|
| 1804 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00017.png", !Grafreed.NIMBUSLAF)); |
---|
| 1805 | + |
---|
| 1806 | + cGridBag panel = new cGridBag().setVertical(true); |
---|
| 1807 | + |
---|
| 1808 | + presetpanel.preferredWidth = 1; |
---|
| 1809 | + |
---|
| 1810 | + materialpanel.add(panel); |
---|
| 1811 | + materialpanel.add(presetpanel); |
---|
| 1812 | + |
---|
| 1813 | + panel.preferredWidth = 8; |
---|
| 1814 | + |
---|
| 1815 | + /* |
---|
1707 | 1816 | ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints); |
---|
1708 | 1817 | materialLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1709 | | - */ |
---|
| 1818 | + */ |
---|
1710 | 1819 | |
---|
1711 | 1820 | cGridBag editBar = new cGridBag().setVertical(false); |
---|
1712 | 1821 | |
---|
.. | .. |
---|
1740 | 1849 | //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1741 | 1850 | |
---|
1742 | 1851 | cGridBag colorSection = new cGridBag().setVertical(true); |
---|
| 1852 | + |
---|
| 1853 | + cGridBag huepanel = new cGridBag(); |
---|
| 1854 | + cGridBag huelabel = new cGridBag(); |
---|
| 1855 | + skin = GetLabel("icons/hue.png", false); |
---|
| 1856 | + skin.fit = true; |
---|
| 1857 | + huelabel.add(skin); |
---|
| 1858 | + huelabel.preferredWidth = 20; |
---|
| 1859 | + huepanel.add(new cGridBag()); // Label |
---|
| 1860 | + huepanel.add(huelabel); // Field/slider |
---|
| 1861 | + |
---|
| 1862 | + huepanel.preferredHeight = 7; |
---|
| 1863 | + |
---|
| 1864 | + colorSection.add(huepanel); |
---|
1743 | 1865 | |
---|
1744 | 1866 | 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); |
---|
| 1867 | + |
---|
| 1868 | + color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints); |
---|
| 1869 | + colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1870 | + color.add(colorField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
| 1871 | + |
---|
1748 | 1872 | //colorField.preferredWidth = 200; |
---|
1749 | 1873 | colorSection.add(color); |
---|
1750 | 1874 | |
---|
1751 | 1875 | cGridBag modulation = new cGridBag(); |
---|
1752 | 1876 | modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints); |
---|
1753 | 1877 | modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1754 | | - modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1878 | + modulation.add(saturationField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
1755 | 1879 | colorSection.add(modulation); |
---|
1756 | 1880 | |
---|
| 1881 | + cGridBag opacity = new cGridBag(); |
---|
| 1882 | + opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints); |
---|
| 1883 | + opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1884 | + opacity.add(opacityField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
| 1885 | + colorSection.add(opacity); |
---|
| 1886 | + |
---|
| 1887 | + colorSection.add(GetSeparator()); |
---|
| 1888 | + |
---|
1757 | 1889 | cGridBag texture = new cGridBag(); |
---|
1758 | 1890 | texture.add(textureLabel = new JLabel("Texture")); // , aConstraints); |
---|
1759 | 1891 | textureLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1760 | 1892 | texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1761 | 1893 | colorSection.add(texture); |
---|
1762 | 1894 | |
---|
1763 | | - panel.add(new JSeparator()); |
---|
| 1895 | + panel.add(GetSeparator()); |
---|
1764 | 1896 | |
---|
1765 | 1897 | panel.add(colorSection); |
---|
1766 | 1898 | |
---|
.. | .. |
---|
1816 | 1948 | shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1817 | 1949 | diffuseSection.add(shadowbias); |
---|
1818 | 1950 | |
---|
1819 | | - panel.add(new JSeparator()); |
---|
| 1951 | + panel.add(GetSeparator()); |
---|
1820 | 1952 | |
---|
1821 | 1953 | panel.add(diffuseSection); |
---|
1822 | 1954 | |
---|
.. | .. |
---|
1879 | 2011 | specularSection.add(anisoV); |
---|
1880 | 2012 | |
---|
1881 | 2013 | |
---|
1882 | | - panel.add(new JSeparator()); |
---|
| 2014 | + panel.add(GetSeparator()); |
---|
1883 | 2015 | |
---|
1884 | 2016 | panel.add(specularSection); |
---|
1885 | 2017 | |
---|
.. | .. |
---|
1904 | 2036 | backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1905 | 2037 | backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1906 | 2038 | 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 | 2039 | |
---|
1914 | 2040 | //panel.add(new JSeparator()); |
---|
1915 | 2041 | |
---|
.. | .. |
---|
1955 | 2081 | opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints); |
---|
1956 | 2082 | textureSection.add(opacityPower); |
---|
1957 | 2083 | |
---|
1958 | | - panel.add(new JSeparator()); |
---|
| 2084 | + panel.add(GetSeparator()); |
---|
1959 | 2085 | |
---|
1960 | 2086 | panel.add(textureSection); |
---|
1961 | 2087 | |
---|
.. | .. |
---|
2942 | 3068 | |
---|
2943 | 3069 | freezematerial = true; |
---|
2944 | 3070 | colorField.setFloat(mat.color); |
---|
2945 | | - modulationField.setFloat(mat.modulation); |
---|
| 3071 | + saturationField.setFloat(mat.modulation); |
---|
2946 | 3072 | metalnessField.setFloat(mat.metalness); |
---|
2947 | 3073 | diffuseField.setFloat(mat.diffuse); |
---|
2948 | 3074 | specularField.setFloat(mat.specular); |
---|
.. | .. |
---|
3253 | 3379 | } else if (event.getSource() == liveCB) |
---|
3254 | 3380 | { |
---|
3255 | 3381 | copy.live ^= true; |
---|
| 3382 | + objEditor.refreshContents(true); // To show item colors |
---|
3256 | 3383 | return; |
---|
3257 | | - } else if (event.getSource() == selectCB) |
---|
| 3384 | + } else if (event.getSource() == selectableCB) |
---|
3258 | 3385 | { |
---|
3259 | 3386 | copy.dontselect ^= true; |
---|
3260 | 3387 | return; |
---|
.. | .. |
---|
3262 | 3389 | { |
---|
3263 | 3390 | copy.hide ^= true; |
---|
3264 | 3391 | copy.Touch(); // display list issue |
---|
3265 | | - objEditor.refreshContents(); |
---|
| 3392 | + objEditor.refreshContents(true); // To show item colors |
---|
3266 | 3393 | return; |
---|
3267 | 3394 | } else if (event.getSource() == link2masterCB) |
---|
3268 | 3395 | { |
---|
.. | .. |
---|
3518 | 3645 | |
---|
3519 | 3646 | static public byte[] Compress(Object3D o) |
---|
3520 | 3647 | { |
---|
| 3648 | + // Slower to actually compress. |
---|
3521 | 3649 | try |
---|
3522 | 3650 | { |
---|
3523 | 3651 | ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
---|
.. | .. |
---|
3619 | 3747 | { |
---|
3620 | 3748 | //Save(true); |
---|
3621 | 3749 | Replace(); |
---|
| 3750 | + SetUndoStates(); |
---|
3622 | 3751 | } |
---|
3623 | 3752 | |
---|
3624 | 3753 | private boolean Equal(byte[] compress, byte[] name) |
---|
.. | .. |
---|
3639 | 3768 | |
---|
3640 | 3769 | java.util.Hashtable<java.util.UUID, Object3D> versiontable = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
3641 | 3770 | |
---|
| 3771 | + void DeleteVersion() |
---|
| 3772 | + { |
---|
| 3773 | + for (int i = copy.versionindex; i < copy.versionlist.length-1; i++) |
---|
| 3774 | + { |
---|
| 3775 | + copy.versionlist[i] = copy.versionlist[i+1]; |
---|
| 3776 | + } |
---|
| 3777 | + |
---|
| 3778 | + CopyChanged(); |
---|
| 3779 | + |
---|
| 3780 | + SetUndoStates(); |
---|
| 3781 | + } |
---|
| 3782 | + |
---|
3642 | 3783 | public boolean Save(boolean user) |
---|
3643 | 3784 | { |
---|
3644 | 3785 | System.err.println("Save"); |
---|
| 3786 | + //Replace(); |
---|
3645 | 3787 | |
---|
3646 | 3788 | cRadio tab = GetCurrentTab(); |
---|
3647 | 3789 | |
---|
3648 | | - byte[] compress = CompressCopy(); |
---|
| 3790 | + Object3D compress = CompressCopy(); // Saved version. No need for "Replace"? |
---|
3649 | 3791 | |
---|
3650 | 3792 | boolean thesame = false; |
---|
3651 | 3793 | |
---|
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 | | - } |
---|
| 3794 | +// if (copy.versionindex > 0 && copy.versions[copy.versionindex-1] != null && Equal(compress, copy.versions[copy.versionindex-1])) |
---|
| 3795 | +// { |
---|
| 3796 | +// thesame = true; |
---|
| 3797 | +// } |
---|
3657 | 3798 | |
---|
3658 | 3799 | //EditorFrame.m_MainFrame.requestFocusInWindow(); |
---|
3659 | 3800 | if (!thesame) |
---|
3660 | 3801 | { |
---|
| 3802 | + for (int i = copy.versionlist.length; --i > copy.versionindex+1;) |
---|
| 3803 | + { |
---|
| 3804 | + copy.versionlist[i] = copy.versionlist[i-1]; |
---|
| 3805 | + } |
---|
| 3806 | + |
---|
3661 | 3807 | //tab.user[tab.versionindex] = user; |
---|
3662 | 3808 | //boolean increment = true; // tab.graphs[tab.versionindex] == null; |
---|
3663 | 3809 | |
---|
3664 | | - copy.versions[++copy.versionindex] = compress; |
---|
| 3810 | + copy.versionlist[++copy.versionindex] = compress; |
---|
3665 | 3811 | |
---|
3666 | 3812 | // if (increment) |
---|
3667 | 3813 | // tab.versionindex++; |
---|
.. | .. |
---|
3671 | 3817 | |
---|
3672 | 3818 | //assert(hashtable.isEmpty()); |
---|
3673 | 3819 | |
---|
3674 | | - for (int i = copy.versionindex+1; i < copy.versions.length; i++) |
---|
3675 | | - { |
---|
3676 | | - //tab.user[i] = false; |
---|
3677 | | - copy.versions[i] = null; |
---|
3678 | | - } |
---|
| 3820 | +// for (int i = copy.versionindex+1; i < copy.versionlist.length; i++) |
---|
| 3821 | +// { |
---|
| 3822 | +// //tab.user[i] = false; |
---|
| 3823 | +// copy.versionlist[i] = null; |
---|
| 3824 | +// } |
---|
3679 | 3825 | |
---|
3680 | 3826 | SetUndoStates(); |
---|
3681 | 3827 | |
---|
.. | .. |
---|
3700 | 3846 | |
---|
3701 | 3847 | return !thesame; |
---|
3702 | 3848 | } |
---|
3703 | | - |
---|
3704 | | - void CopyChanged(Object3D obj) |
---|
| 3849 | + |
---|
| 3850 | + boolean flashIt = true; |
---|
| 3851 | + |
---|
| 3852 | + void RefreshSelection() |
---|
3705 | 3853 | { |
---|
| 3854 | + Object3D selection = new Object3D(); |
---|
| 3855 | + |
---|
| 3856 | + for (int i = 0; i < copy.selection.size(); i++) |
---|
| 3857 | + { |
---|
| 3858 | + Object3D elem = copy.selection.elementAt(i); |
---|
| 3859 | + |
---|
| 3860 | + Object3D obj = copy.GetObject(elem.GetUUID()); |
---|
| 3861 | + |
---|
| 3862 | + if (obj == null) |
---|
| 3863 | + { |
---|
| 3864 | + copy.selection.remove(i--); |
---|
| 3865 | + } |
---|
| 3866 | + else |
---|
| 3867 | + { |
---|
| 3868 | + selection.add(obj); |
---|
| 3869 | + copy.selection.setElementAt(obj, i); |
---|
| 3870 | + } |
---|
| 3871 | + } |
---|
| 3872 | + |
---|
| 3873 | + flashIt = false; |
---|
| 3874 | + GetTree().clearSelection(); |
---|
| 3875 | + for (int i = 0; i < selection.size(); i++) |
---|
| 3876 | + GetTree().addSelectionPath(selection.elementAt(i).GetTreePath().GetTreePath()); |
---|
| 3877 | + flashIt = true; |
---|
| 3878 | + |
---|
| 3879 | + //refreshContents(false); |
---|
| 3880 | + } |
---|
| 3881 | + |
---|
| 3882 | + void CopyChanged() |
---|
| 3883 | + { |
---|
| 3884 | + Object3D obj = copy.versionlist[copy.versionindex]; |
---|
| 3885 | + |
---|
3706 | 3886 | SetUndoStates(); |
---|
3707 | 3887 | |
---|
3708 | 3888 | boolean temp = CameraPane.SWITCH; |
---|
.. | .. |
---|
3712 | 3892 | |
---|
3713 | 3893 | copy.clear(); |
---|
3714 | 3894 | |
---|
| 3895 | + copy.skyboxname = obj.skyboxname; |
---|
| 3896 | + copy.skyboxext = obj.skyboxext; |
---|
| 3897 | + |
---|
3715 | 3898 | for (int i=0; i<obj.Size(); i++) |
---|
3716 | 3899 | { |
---|
3717 | 3900 | copy.add(obj.get(i)); |
---|
.. | .. |
---|
3721 | 3904 | |
---|
3722 | 3905 | CameraPane.SWITCH = temp; |
---|
3723 | 3906 | |
---|
| 3907 | + RefreshSelection(); |
---|
3724 | 3908 | //assert(hashtable.isEmpty()); |
---|
3725 | 3909 | |
---|
3726 | 3910 | copy.Touch(); |
---|
.. | .. |
---|
3741 | 3925 | } |
---|
3742 | 3926 | } |
---|
3743 | 3927 | |
---|
3744 | | - refreshContents(); |
---|
| 3928 | + refreshContents(true); |
---|
3745 | 3929 | } |
---|
3746 | 3930 | |
---|
3747 | | - cButton undoButton; |
---|
| 3931 | + cButton previousVersionButton; |
---|
3748 | 3932 | cButton restoreButton; |
---|
3749 | 3933 | cButton replaceButton; |
---|
3750 | | - cButton redoButton; |
---|
| 3934 | + cButton nextVersionButton; |
---|
| 3935 | + cButton saveVersionButton; |
---|
| 3936 | + cButton deleteVersionButton; |
---|
3751 | 3937 | |
---|
3752 | 3938 | boolean muteSlider; |
---|
3753 | 3939 | |
---|
.. | .. |
---|
3755 | 3941 | { |
---|
3756 | 3942 | int count = 0; |
---|
3757 | 3943 | |
---|
3758 | | - for (int i = copy.versions.length; --i >= 0;) |
---|
| 3944 | + for (int i = copy.versionlist.length; --i >= 0;) |
---|
3759 | 3945 | { |
---|
3760 | | - if (copy.versions[i] != null) |
---|
| 3946 | + if (copy.versionlist[i] != null) |
---|
3761 | 3947 | count++; |
---|
3762 | 3948 | } |
---|
3763 | 3949 | |
---|
.. | .. |
---|
3768 | 3954 | { |
---|
3769 | 3955 | cRadio tab = GetCurrentTab(); |
---|
3770 | 3956 | |
---|
3771 | | - restoreButton.setEnabled(copy.versionindex != -1); |
---|
3772 | | - replaceButton.setEnabled(copy.versionindex != -1); |
---|
| 3957 | + restoreButton.setEnabled(true); // copy.versionindex != -1); |
---|
| 3958 | + replaceButton.setEnabled(true); // copy.versionindex != -1); |
---|
3773 | 3959 | |
---|
3774 | | - undoButton.setEnabled(copy.versionindex > 0); |
---|
3775 | | - redoButton.setEnabled(copy.versions[copy.versionindex + 1] != null); |
---|
| 3960 | + previousVersionButton.setEnabled(copy.versionindex > 0); |
---|
| 3961 | + nextVersionButton.setEnabled(copy.versionlist[copy.versionindex + 1] != null); |
---|
| 3962 | + |
---|
| 3963 | + deleteVersionButton.setEnabled(//copy.versionindex > 0 && |
---|
| 3964 | + copy.versionlist[copy.versionindex + 1] != null); |
---|
3776 | 3965 | |
---|
3777 | 3966 | muteSlider = true; |
---|
3778 | 3967 | versionSlider.setMaximum(VersionCount() - 1); |
---|
.. | .. |
---|
3780 | 3969 | muteSlider = false; |
---|
3781 | 3970 | } |
---|
3782 | 3971 | |
---|
3783 | | - public boolean Undo() |
---|
| 3972 | + public boolean PreviousVersion() |
---|
3784 | 3973 | { |
---|
3785 | 3974 | // Option? |
---|
3786 | 3975 | Replace(); |
---|
.. | .. |
---|
3810 | 3999 | |
---|
3811 | 4000 | copy.versionindex -= 1; |
---|
3812 | 4001 | |
---|
3813 | | - CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
| 4002 | + CopyChanged(); |
---|
3814 | 4003 | |
---|
3815 | 4004 | return true; |
---|
3816 | 4005 | } |
---|
.. | .. |
---|
3821 | 4010 | |
---|
3822 | 4011 | cRadio tab = GetCurrentTab(); |
---|
3823 | 4012 | |
---|
3824 | | - if (copy.versionindex == -1 || copy.versions[copy.versionindex] == null) |
---|
| 4013 | + if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
3825 | 4014 | { |
---|
3826 | 4015 | java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
3827 | 4016 | return false; |
---|
3828 | 4017 | } |
---|
3829 | 4018 | |
---|
3830 | | - CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
| 4019 | + //CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
| 4020 | + CopyChanged(); |
---|
3831 | 4021 | |
---|
3832 | 4022 | return true; |
---|
3833 | 4023 | } |
---|
.. | .. |
---|
3838 | 4028 | |
---|
3839 | 4029 | cRadio tab = GetCurrentTab(); |
---|
3840 | 4030 | |
---|
3841 | | - if (copy.versionindex == -1 || copy.versions[copy.versionindex] == null) |
---|
| 4031 | + if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
3842 | 4032 | { |
---|
3843 | 4033 | // No version yet. OK. java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
3844 | 4034 | return false; |
---|
3845 | 4035 | } |
---|
3846 | 4036 | |
---|
3847 | | - copy.versions[copy.versionindex] = CompressCopy(); |
---|
| 4037 | + copy.versionlist[copy.versionindex] = CompressCopy(); |
---|
3848 | 4038 | |
---|
3849 | 4039 | return true; |
---|
3850 | 4040 | } |
---|
3851 | 4041 | |
---|
3852 | | - public void Redo() |
---|
| 4042 | + public void NextVersion() |
---|
3853 | 4043 | { |
---|
3854 | 4044 | // Option? |
---|
3855 | 4045 | Replace(); |
---|
3856 | 4046 | |
---|
3857 | 4047 | cRadio tab = GetCurrentTab(); |
---|
3858 | 4048 | |
---|
3859 | | - if (copy.versions[copy.versionindex + 1] == null) |
---|
| 4049 | + if (copy.versionlist[copy.versionindex + 1] == null) |
---|
3860 | 4050 | { |
---|
3861 | 4051 | java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
3862 | 4052 | return; |
---|
.. | .. |
---|
3864 | 4054 | |
---|
3865 | 4055 | copy.versionindex += 1; |
---|
3866 | 4056 | |
---|
3867 | | - CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
| 4057 | + CopyChanged(); |
---|
3868 | 4058 | |
---|
3869 | 4059 | //if (!tab.user[tab.versionindex]) |
---|
3870 | 4060 | // tab.graphs[tab.versionindex] = null; |
---|
.. | .. |
---|
4078 | 4268 | //copy.material = new cMaterial(copy.GetMaterial()); |
---|
4079 | 4269 | |
---|
4080 | 4270 | current.color = (float) colorField.getFloat(); |
---|
4081 | | - current.modulation = (float) modulationField.getFloat(); |
---|
| 4271 | + current.modulation = (float) saturationField.getFloat(); |
---|
4082 | 4272 | current.metalness = (float) metalnessField.getFloat(); |
---|
4083 | 4273 | current.diffuse = (float) diffuseField.getFloat(); |
---|
4084 | 4274 | current.specular = (float) specularField.getFloat(); |
---|
.. | .. |
---|
4111 | 4301 | cMaterial mat = copy.material; |
---|
4112 | 4302 | |
---|
4113 | 4303 | colorField.SetToolTipValue((mat.color)); |
---|
4114 | | - modulationField.SetToolTipValue((mat.modulation)); |
---|
| 4304 | + saturationField.SetToolTipValue((mat.modulation)); |
---|
4115 | 4305 | metalnessField.SetToolTipValue((mat.metalness)); |
---|
4116 | 4306 | diffuseField.SetToolTipValue((mat.diffuse)); |
---|
4117 | 4307 | specularField.SetToolTipValue((mat.specular)); |
---|
.. | .. |
---|
4175 | 4365 | |
---|
4176 | 4366 | int version = versionSlider.getInteger(); |
---|
4177 | 4367 | |
---|
4178 | | - if (copy.versions[version] != null) |
---|
| 4368 | + if (copy.versionlist[version] != null) |
---|
4179 | 4369 | { |
---|
4180 | | - CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex = version])); |
---|
| 4370 | + copy.versionindex = version; |
---|
| 4371 | + CopyChanged(); |
---|
4181 | 4372 | } |
---|
4182 | 4373 | |
---|
4183 | 4374 | return; |
---|
.. | .. |
---|
4217 | 4408 | { |
---|
4218 | 4409 | //System.out.println("stateChanged = " + this); |
---|
4219 | 4410 | materialtouched = true; |
---|
| 4411 | + |
---|
| 4412 | + if (e.getSource() == colorField && saturationField.getFloat() == 0.001) |
---|
| 4413 | + { |
---|
| 4414 | + saturationField.setFloat(1); |
---|
| 4415 | + } |
---|
| 4416 | + |
---|
4220 | 4417 | applySelf(); |
---|
4221 | 4418 | //System.out.println("this = " + this); |
---|
4222 | 4419 | //System.out.println("PARENT = " + parent); |
---|
.. | .. |
---|
4516 | 4713 | { |
---|
4517 | 4714 | if (GetTree() != null) |
---|
4518 | 4715 | { |
---|
| 4716 | + GetTree().revalidate(); |
---|
4519 | 4717 | GetTree().repaint(); |
---|
4520 | 4718 | } |
---|
4521 | 4719 | |
---|
.. | .. |
---|
4524 | 4722 | ctrlPanel.validate(); // ? new |
---|
4525 | 4723 | ctrlPanel.repaint(); |
---|
4526 | 4724 | } |
---|
| 4725 | + |
---|
| 4726 | + if (previousVersionButton != null && copy.versionlist != null) |
---|
| 4727 | + SetUndoStates(); |
---|
4527 | 4728 | } |
---|
4528 | 4729 | |
---|
4529 | 4730 | static TweenManager tweenManager = new TweenManager(); |
---|
.. | .. |
---|
4772 | 4973 | readobj.ResetDisplayList(); |
---|
4773 | 4974 | } catch (Exception e) |
---|
4774 | 4975 | { |
---|
4775 | | - //e.printStackTrace(); |
---|
| 4976 | + if (!e.toString().contains("GZIP")) |
---|
| 4977 | + e.printStackTrace(); |
---|
| 4978 | + |
---|
4776 | 4979 | try |
---|
4777 | 4980 | { |
---|
4778 | 4981 | java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
.. | .. |
---|
4852 | 5055 | { |
---|
4853 | 5056 | //readobj.deepCopySelf(copy); |
---|
4854 | 5057 | copy.clear(); // june 2014 |
---|
| 5058 | + copy.skyboxname = readobj.skyboxname; |
---|
| 5059 | + copy.skyboxext = readobj.skyboxext; |
---|
4855 | 5060 | for (int i = 0; i < readobj.size(); i++) |
---|
4856 | 5061 | { |
---|
4857 | 5062 | Object3D child = readobj.get(i); // reserve(i); |
---|
.. | .. |
---|
4892 | 5097 | } |
---|
4893 | 5098 | } catch (ClassCastException e) |
---|
4894 | 5099 | { |
---|
| 5100 | + e.printStackTrace(); |
---|
4895 | 5101 | assert (false); |
---|
4896 | 5102 | Composite c = (Composite) copy; |
---|
4897 | 5103 | c.children.clear(); |
---|
.. | .. |
---|
4902 | 5108 | c.addChild(csg); |
---|
4903 | 5109 | } |
---|
4904 | 5110 | |
---|
4905 | | - copy.versions = readobj.versions; |
---|
| 5111 | + copy.versionlist = readobj.versionlist; |
---|
4906 | 5112 | copy.versionindex = readobj.versionindex; |
---|
4907 | 5113 | |
---|
4908 | | - if (copy.versions == null) |
---|
| 5114 | + if (copy.versionlist == null) |
---|
4909 | 5115 | { |
---|
4910 | | - copy.versions = new byte[100][]; |
---|
| 5116 | + copy.versionlist = new Object3D[100]; |
---|
4911 | 5117 | copy.versionindex = -1; |
---|
4912 | 5118 | } |
---|
4913 | 5119 | |
---|
.. | .. |
---|
4923 | 5129 | { |
---|
4924 | 5130 | if (Grafreed.standAlone) |
---|
4925 | 5131 | { |
---|
4926 | | - FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD); |
---|
| 5132 | + FileDialog browser = new FileDialog(frame, "Open", FileDialog.LOAD); |
---|
4927 | 5133 | browser.show(); |
---|
4928 | 5134 | String filename = browser.getFile(); |
---|
4929 | 5135 | if (filename != null && filename.length() > 0) |
---|
.. | .. |
---|
5022 | 5228 | //ps.print(buffer.toString()); |
---|
5023 | 5229 | } catch (IOException e) |
---|
5024 | 5230 | { |
---|
| 5231 | + e.printStackTrace(); |
---|
5025 | 5232 | } |
---|
5026 | 5233 | } |
---|
5027 | 5234 | |
---|
.. | .. |
---|
5314 | 5521 | JLabel colorLabel; |
---|
5315 | 5522 | cNumberSlider colorField; |
---|
5316 | 5523 | JLabel modulationLabel; |
---|
5317 | | - cNumberSlider modulationField; |
---|
| 5524 | + cNumberSlider saturationField; |
---|
5318 | 5525 | JLabel metalnessLabel; |
---|
5319 | 5526 | cNumberSlider metalnessField; |
---|
5320 | 5527 | JLabel diffuseLabel; |
---|