.. | .. |
---|
34 | 34 | iSendInfo |
---|
35 | 35 | //KeyListener |
---|
36 | 36 | { |
---|
| 37 | + public cToggleButton pinButton; |
---|
37 | 38 | boolean timeline; |
---|
38 | 39 | boolean wasFullScreen; |
---|
39 | 40 | |
---|
.. | .. |
---|
74 | 75 | return new cCheckBox(icon, border); |
---|
75 | 76 | } |
---|
76 | 77 | |
---|
| 78 | + static java.util.Hashtable<String, javax.swing.ImageIcon> icons = new java.util.Hashtable<String, javax.swing.ImageIcon>(); |
---|
| 79 | + |
---|
77 | 80 | ImageIcon GetIcon(String name) |
---|
78 | 81 | { |
---|
| 82 | + javax.swing.ImageIcon iconCache = icons.get(name); |
---|
| 83 | + if (iconCache != null) |
---|
| 84 | + { |
---|
| 85 | + return iconCache; |
---|
| 86 | + } |
---|
| 87 | + |
---|
79 | 88 | try |
---|
80 | 89 | { |
---|
81 | 90 | BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name)); |
---|
.. | .. |
---|
93 | 102 | // } |
---|
94 | 103 | |
---|
95 | 104 | javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image); |
---|
| 105 | + |
---|
| 106 | + icons.put(name, icon); |
---|
| 107 | + |
---|
96 | 108 | return icon; |
---|
97 | 109 | } |
---|
98 | 110 | catch (Exception e) |
---|
99 | 111 | { |
---|
| 112 | + //icons.put(name, null); |
---|
100 | 113 | return null; |
---|
101 | 114 | } |
---|
102 | 115 | } |
---|
.. | .. |
---|
296 | 309 | client = inClient; |
---|
297 | 310 | copy = client; |
---|
298 | 311 | |
---|
299 | | - if (copy.versionlist == null) |
---|
300 | | - { |
---|
301 | | - copy.versionlist = new Object3D[100]; |
---|
302 | | - copy.versionindex = -1; |
---|
303 | | - } |
---|
| 312 | +// if (copy.versionlist == null) |
---|
| 313 | +// { |
---|
| 314 | +// copy.versionlist = new Object3D[100]; |
---|
| 315 | +// copy.versionindex = -1; |
---|
| 316 | +// |
---|
| 317 | +// callee.Save(true); |
---|
| 318 | +// } |
---|
304 | 319 | |
---|
305 | 320 | // "this" is not called: SetupUI2(objEditor); |
---|
306 | 321 | } |
---|
.. | .. |
---|
319 | 334 | { |
---|
320 | 335 | copy.versionlist = new Object3D[100]; |
---|
321 | 336 | copy.versionindex = -1; |
---|
| 337 | + |
---|
| 338 | +// Save(true); |
---|
322 | 339 | } |
---|
323 | 340 | |
---|
324 | 341 | SetupUI2(callee.GetEditor()); |
---|
.. | .. |
---|
353 | 370 | copy = localCopy; |
---|
354 | 371 | copy.editWindow = this; |
---|
355 | 372 | |
---|
356 | | - if (copy.versionlist == null) |
---|
357 | | - { |
---|
358 | | -// copy.versions = new byte[100][]; |
---|
| 373 | +// if (copy.versionlist == null) |
---|
| 374 | +// { |
---|
| 375 | +// copy.versionlist = new Object3D[100]; |
---|
359 | 376 | // copy.versionindex = -1; |
---|
360 | | - } |
---|
| 377 | +// |
---|
| 378 | +// Save(true); |
---|
| 379 | +// } |
---|
361 | 380 | |
---|
362 | 381 | SetupMenu(); |
---|
363 | 382 | |
---|
.. | .. |
---|
426 | 445 | |
---|
427 | 446 | ChangeListener changeListener = new ChangeListener() |
---|
428 | 447 | { |
---|
| 448 | + //String name; |
---|
| 449 | + |
---|
429 | 450 | public void stateChanged(ChangeEvent changeEvent) |
---|
430 | 451 | { |
---|
431 | 452 | // if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Material") && !materialFlushed) |
---|
.. | .. |
---|
444 | 465 | // EditSelection(false); |
---|
445 | 466 | // } |
---|
446 | 467 | |
---|
447 | | - refreshContents(false); // To refresh Info tab |
---|
| 468 | +// if (objectPanel.getSelectedIndex() == 4) |
---|
| 469 | +// { |
---|
| 470 | +// name = copy.skyboxname; |
---|
| 471 | +// |
---|
| 472 | +// if (name == null) |
---|
| 473 | +// { |
---|
| 474 | +// name = ""; |
---|
| 475 | +// } |
---|
| 476 | +// |
---|
| 477 | +// copy.skyboxname = "cubemaps/default-skyboxes/rgb"; |
---|
| 478 | +// copy.skyboxext = "jpg"; |
---|
| 479 | +// } |
---|
| 480 | +// else |
---|
| 481 | +// { |
---|
| 482 | +// if (name != null) |
---|
| 483 | +// { |
---|
| 484 | +// if (name.equals("")) |
---|
| 485 | +// { |
---|
| 486 | +// copy.skyboxname = null; |
---|
| 487 | +// copy.skyboxext = null; |
---|
| 488 | +// } |
---|
| 489 | +// else |
---|
| 490 | +// { |
---|
| 491 | +// copy.skyboxname = name; |
---|
| 492 | +// } |
---|
| 493 | +// } |
---|
| 494 | +// } |
---|
| 495 | + cameraView.transformMode = objectPanel.getSelectedIndex() == 4; |
---|
| 496 | + |
---|
| 497 | +// refreshContents(false); // To refresh Info tab |
---|
| 498 | + cameraView.repaint(); |
---|
448 | 499 | } |
---|
449 | 500 | }; |
---|
450 | 501 | objectPanel.addChangeListener(changeListener); |
---|
.. | .. |
---|
466 | 517 | |
---|
467 | 518 | toolboxPanel = new cGridBag().setVertical(true); |
---|
468 | 519 | //toolboxPanel.setName("Toolbox"); |
---|
| 520 | + |
---|
| 521 | + skyboxPanel = new cGridBag().setVertical(true); |
---|
469 | 522 | |
---|
470 | 523 | materialPanel = new cGridBag().setVertical(false); |
---|
471 | 524 | //materialPanel.setName("Material"); |
---|
.. | .. |
---|
751 | 804 | boolean maximized; |
---|
752 | 805 | |
---|
753 | 806 | cButton fullscreenLayout; |
---|
| 807 | + cButton expandedLayout; |
---|
754 | 808 | |
---|
755 | 809 | void Minimize() |
---|
756 | 810 | { |
---|
.. | .. |
---|
790 | 844 | cButton minButton; |
---|
791 | 845 | cButton maxButton; |
---|
792 | 846 | cButton fullButton; |
---|
| 847 | + cButton collapseButton; |
---|
| 848 | + cButton maximize3DButton; |
---|
793 | 849 | |
---|
794 | 850 | void ToggleFullScreen() |
---|
795 | 851 | { |
---|
796 | | -GraphicsDevice device = frame.getGraphicsConfiguration().getDevice(); |
---|
| 852 | + GraphicsDevice device = frame.getGraphicsConfiguration().getDevice(); |
---|
797 | 853 | |
---|
798 | 854 | cameraView.ToggleFullScreen(); |
---|
799 | 855 | |
---|
.. | .. |
---|
814 | 870 | // X frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
815 | 871 | // X framePanel.add(bigThree); |
---|
816 | 872 | // X frame.getContentPane().add(/*"Center",*/framePanel); |
---|
817 | | - framePanel.setDividerLocation(46); |
---|
| 873 | +// framePanel.setDividerLocation(46); // icons are 24x24 |
---|
818 | 874 | |
---|
819 | 875 | //frame.setVisible(true); |
---|
820 | | - radio.layout = keepButton; |
---|
| 876 | +// radio.layout = keepButton; |
---|
821 | 877 | //theFrame = null; |
---|
822 | 878 | keepButton = null; |
---|
823 | | - radio.layout.doClick(); |
---|
| 879 | +// radio.layout.doClick(); |
---|
824 | 880 | |
---|
825 | 881 | } else |
---|
826 | 882 | { |
---|
.. | .. |
---|
841 | 897 | // X frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
842 | 898 | // X framePanel.remove(bigThree); |
---|
843 | 899 | // X frame.getContentPane().add(/*"Center",*/bigThree); |
---|
844 | | - framePanel.setDividerLocation(0); |
---|
| 900 | +// framePanel.setDividerLocation(0); |
---|
845 | 901 | |
---|
846 | | - radio.layout = fullscreenLayout; |
---|
847 | | - radio.layout.doClick(); |
---|
| 902 | +// radio.layout = fullscreenLayout; |
---|
| 903 | +// radio.layout.doClick(); |
---|
848 | 904 | //frame.setVisible(true); |
---|
849 | 905 | } |
---|
850 | 906 | frame.validate(); |
---|
| 907 | + |
---|
| 908 | + cameraView.requestFocusInWindow(); |
---|
851 | 909 | } |
---|
852 | 910 | |
---|
853 | | - private Object3D CompressCopy() |
---|
| 911 | + void CollapseToolbar() |
---|
| 912 | + { |
---|
| 913 | + framePanel.setDividerLocation(0); |
---|
| 914 | + //frame.validate(); |
---|
| 915 | + |
---|
| 916 | + cameraView.requestFocusInWindow(); |
---|
| 917 | + } |
---|
| 918 | + |
---|
| 919 | + private Object3D Duplicate(Object3D object) |
---|
854 | 920 | { |
---|
855 | 921 | boolean temp = CameraPane.SWITCH; |
---|
856 | 922 | CameraPane.SWITCH = false; |
---|
857 | 923 | |
---|
858 | | - copy.ExtractBigData(versiontable); |
---|
| 924 | + object.ExtractBigData(versiontable); |
---|
859 | 925 | // if (copy == client) |
---|
860 | 926 | |
---|
861 | | - Object3D versions[] = copy.versionlist; |
---|
862 | | - copy.versionlist = null; |
---|
| 927 | + Object3D versions[] = object.versionlist; |
---|
| 928 | + object.versionlist = null; |
---|
863 | 929 | |
---|
864 | 930 | //byte[] compress = Compress(copy); |
---|
865 | | - Object3D compress = (Object3D)Grafreed.clone(copy); |
---|
| 931 | + Object3D compress = (Object3D)Grafreed.clone(object); |
---|
866 | 932 | |
---|
867 | | - copy.versionlist = versions; |
---|
| 933 | + object.versionlist = versions; |
---|
868 | 934 | |
---|
869 | | - copy.RestoreBigData(versiontable); |
---|
| 935 | + object.RestoreBigData(versiontable); |
---|
870 | 936 | |
---|
871 | 937 | CameraPane.SWITCH = temp; |
---|
872 | 938 | |
---|
.. | .. |
---|
1203 | 1269 | |
---|
1204 | 1270 | namePanel = new cGridBag(); |
---|
1205 | 1271 | |
---|
| 1272 | + //if (copy.pinned) |
---|
| 1273 | + { |
---|
| 1274 | + pinButton = GetToggleButton("icons/pin.png", !Grafreed.NIMBUSLAF); |
---|
| 1275 | + pinButton.setSelected(copy.pinned); |
---|
| 1276 | + cGridBag t = new cGridBag(); |
---|
| 1277 | + t.preferredWidth = 2; |
---|
| 1278 | + t.add(pinButton); |
---|
| 1279 | + namePanel.add(t); |
---|
| 1280 | + |
---|
| 1281 | + pinButton.addItemListener(this); |
---|
| 1282 | + } |
---|
| 1283 | + |
---|
1206 | 1284 | nameField = AddText(namePanel, copy.GetName()); |
---|
1207 | 1285 | namePanel.add(new JScrollPane(nameField, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER)); |
---|
1208 | 1286 | oe.ctrlPanel.add(namePanel); |
---|
.. | .. |
---|
1554 | 1632 | objectPanel.setIconAt(0, GetIcon("icons/material.png")); |
---|
1555 | 1633 | objectPanel.setToolTipTextAt(0, "Material"); |
---|
1556 | 1634 | |
---|
| 1635 | + objectPanel.add(toolboxPanel); |
---|
| 1636 | + objectPanel.setIconAt(1, GetIcon("icons/primitives.png")); |
---|
| 1637 | + objectPanel.setToolTipTextAt(1, "Objects & textures"); |
---|
| 1638 | + |
---|
| 1639 | + objectPanel.add(skyboxPanel); |
---|
| 1640 | + objectPanel.setIconAt(2, GetIcon("icons/skybox.jpg")); |
---|
| 1641 | + objectPanel.setToolTipTextAt(2, "Backgrounds"); |
---|
| 1642 | + |
---|
1557 | 1643 | // JPanel north = new JPanel(new BorderLayout()); |
---|
1558 | 1644 | // north.setName("Edit"); |
---|
1559 | 1645 | // north.add(ctrlPanel, BorderLayout.NORTH); |
---|
1560 | 1646 | // objectPanel.add(north); |
---|
1561 | 1647 | objectPanel.add(editPanel); |
---|
1562 | | - objectPanel.setIconAt(1, GetIcon("icons/write.png")); |
---|
1563 | | - objectPanel.setToolTipTextAt(1, "Edit controls"); |
---|
1564 | | - |
---|
1565 | | - //if (Globals.ADVANCED) |
---|
1566 | | - objectPanel.add(infoPanel); |
---|
1567 | | - objectPanel.setIconAt(2, GetIcon("icons/info.png")); |
---|
1568 | | - objectPanel.setToolTipTextAt(2, "Information"); |
---|
| 1648 | + objectPanel.setIconAt(3, GetIcon("icons/write.png")); |
---|
| 1649 | + objectPanel.setToolTipTextAt(3, "Edit controls"); |
---|
1569 | 1650 | |
---|
1570 | 1651 | objectPanel.add(XYZPanel); |
---|
1571 | | - objectPanel.setIconAt(3, GetIcon("icons/XYZ.png")); |
---|
1572 | | - objectPanel.setToolTipTextAt(3, "XYZ/RGB transform"); |
---|
| 1652 | + objectPanel.setIconAt(4, GetIcon("icons/XYZ.png")); |
---|
| 1653 | + objectPanel.setToolTipTextAt(4, "XYZ/RGB transform"); |
---|
1573 | 1654 | |
---|
1574 | | - objectPanel.add(toolboxPanel); |
---|
1575 | | - objectPanel.setIconAt(4, GetIcon("icons/primitives.png")); |
---|
1576 | | - objectPanel.setToolTipTextAt(4, "Objects & backgrounds"); |
---|
1577 | | - |
---|
1578 | 1655 | /* |
---|
1579 | 1656 | aConstraints.gridx = 0; |
---|
1580 | 1657 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1611 | 1688 | |
---|
1612 | 1689 | scenePanel.add(tabbedPane); |
---|
1613 | 1690 | |
---|
| 1691 | + //if (Globals.ADVANCED) |
---|
| 1692 | +// tabbedPane.add(infoPanel); |
---|
| 1693 | +// tabbedPane.setIconAt(3, GetIcon("icons/info.png")); |
---|
| 1694 | +// tabbedPane.setToolTipTextAt(3, "Information"); |
---|
| 1695 | + |
---|
1614 | 1696 | /* |
---|
1615 | 1697 | cTree jTree = new cTree(null); |
---|
1616 | 1698 | ToolTipManager.sharedInstance().registerComponent(jTree); |
---|
.. | .. |
---|
1681 | 1763 | // aConstraints.gridheight = 1; |
---|
1682 | 1764 | |
---|
1683 | 1765 | framePanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, toolbarPanel, bigThree); |
---|
| 1766 | + |
---|
| 1767 | + framePanel.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY, |
---|
| 1768 | + new java.beans.PropertyChangeListener() |
---|
| 1769 | + { |
---|
| 1770 | + public void propertyChange(java.beans.PropertyChangeEvent pce) |
---|
| 1771 | + { |
---|
| 1772 | + if ((Integer)pce.getOldValue() == 1) |
---|
| 1773 | + { |
---|
| 1774 | + if (radio.layout != expandedLayout) |
---|
| 1775 | + { |
---|
| 1776 | + radio.layout = expandedLayout; |
---|
| 1777 | + radio.layout.doClick(); |
---|
| 1778 | + } |
---|
| 1779 | + } |
---|
| 1780 | + } |
---|
| 1781 | + }); |
---|
| 1782 | + |
---|
1684 | 1783 | framePanel.setContinuousLayout(false); |
---|
1685 | 1784 | framePanel.setOneTouchExpandable(false); |
---|
1686 | 1785 | //.setDividerLocation(0.8); |
---|
.. | .. |
---|
1690 | 1789 | |
---|
1691 | 1790 | frame.getContentPane().setLayout(new BorderLayout()); |
---|
1692 | 1791 | /**/ |
---|
1693 | | - JTabbedPane worldPane = new JTabbedPane(); |
---|
| 1792 | + //JTabbedPane worldPane = new JTabbedPane(); |
---|
1694 | 1793 | //worldPane.add(bigPanel); |
---|
1695 | 1794 | //worldPane.add(worldPanel); |
---|
1696 | 1795 | /**/ |
---|
.. | .. |
---|
1738 | 1837 | void SetupMaterial(cGridBag materialpanel) |
---|
1739 | 1838 | { |
---|
1740 | 1839 | cGridBag presetpanel = new cGridBag().setVertical(true); |
---|
1741 | | - cLabel label = GetLabel("icons/shadericons/shadericon00000.png", !Grafreed.NIMBUSLAF); |
---|
1742 | | - label.addMouseListener(new MouseAdapter() |
---|
| 1840 | + |
---|
| 1841 | + cLabel skin = GetLabel("icons/shadericons/shadericon00000.png", !Grafreed.NIMBUSLAF); |
---|
| 1842 | + skin.setToolTipText("Skin"); |
---|
| 1843 | + skin.addMouseListener(new MouseAdapter() |
---|
1743 | 1844 | { |
---|
1744 | 1845 | public void mouseClicked(MouseEvent e) |
---|
1745 | 1846 | { |
---|
1746 | | - colorField.setFloat(0); |
---|
1747 | | - saturationField.setFloat(1); |
---|
| 1847 | + Object3D object = Grafreed.materials.versionlist[0].get(0); |
---|
| 1848 | + cMaterial material = object.material; |
---|
| 1849 | + |
---|
| 1850 | + // Skin |
---|
| 1851 | + colorField.setFloat(material.color); |
---|
| 1852 | + saturationField.setFloat(material.modulation); |
---|
| 1853 | + subsurfaceField.setFloat(material.subsurface); |
---|
| 1854 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1855 | + diffusenessField.setFloat(material.factor); |
---|
| 1856 | + shininessField.setFloat(material.shininess); |
---|
| 1857 | + shadowbiasField.setFloat(material.shadowbias); |
---|
| 1858 | + diffuseField.setFloat(material.diffuse); |
---|
| 1859 | + specularField.setFloat(material.specular); |
---|
| 1860 | + |
---|
| 1861 | + bumpField.setFloat(object.projectedVertices[0].x / 1000.0); |
---|
| 1862 | + noiseField.setFloat(object.projectedVertices[0].y / 1000.0); |
---|
| 1863 | + powerField.setFloat(object.projectedVertices[2].x / 1000.0); |
---|
| 1864 | + |
---|
1748 | 1865 | materialtouched = true; |
---|
1749 | 1866 | applySelf(); |
---|
1750 | 1867 | } |
---|
1751 | 1868 | }); |
---|
1752 | | - presetpanel.add(label); |
---|
| 1869 | + presetpanel.add(skin); |
---|
1753 | 1870 | |
---|
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)); |
---|
| 1871 | + cLabel lambert = GetLabel("icons/shadericons/shadericon00002.png", !Grafreed.NIMBUSLAF); |
---|
| 1872 | + lambert.setToolTipText("Diffuse"); |
---|
| 1873 | + lambert.addMouseListener(new MouseAdapter() |
---|
| 1874 | + { |
---|
| 1875 | + public void mouseClicked(MouseEvent e) |
---|
| 1876 | + { |
---|
| 1877 | + Object3D object = Grafreed.materials.versionlist[2].get(0); |
---|
| 1878 | + cMaterial material = object.material; |
---|
| 1879 | + |
---|
| 1880 | + diffusenessField.setFloat(material.factor); |
---|
| 1881 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1882 | + |
---|
| 1883 | + materialtouched = true; |
---|
| 1884 | + applySelf(); |
---|
| 1885 | + } |
---|
| 1886 | + }); |
---|
| 1887 | + presetpanel.add(lambert); |
---|
| 1888 | + |
---|
| 1889 | + cLabel diffuse2 = GetLabel("icons/shadericons/shadericon00003.png", !Grafreed.NIMBUSLAF); |
---|
| 1890 | + diffuse2.setToolTipText("Diffuse2"); |
---|
| 1891 | + diffuse2.addMouseListener(new MouseAdapter() |
---|
| 1892 | + { |
---|
| 1893 | + public void mouseClicked(MouseEvent e) |
---|
| 1894 | + { |
---|
| 1895 | + Object3D object = Grafreed.materials.versionlist[3].get(0); |
---|
| 1896 | + cMaterial material = object.material; |
---|
| 1897 | + |
---|
| 1898 | + diffusenessField.setFloat(material.factor); |
---|
| 1899 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1900 | + |
---|
| 1901 | + materialtouched = true; |
---|
| 1902 | + applySelf(); |
---|
| 1903 | + } |
---|
| 1904 | + }); |
---|
| 1905 | + presetpanel.add(diffuse2); |
---|
| 1906 | + |
---|
| 1907 | + cLabel diffusemoon = GetLabel("icons/shadericons/shadericon00004.png", !Grafreed.NIMBUSLAF); |
---|
| 1908 | + diffusemoon.setToolTipText("Moon"); |
---|
| 1909 | + diffusemoon.addMouseListener(new MouseAdapter() |
---|
| 1910 | + { |
---|
| 1911 | + public void mouseClicked(MouseEvent e) |
---|
| 1912 | + { |
---|
| 1913 | + Object3D object = Grafreed.materials.versionlist[4].get(0); |
---|
| 1914 | + cMaterial material = object.material; |
---|
| 1915 | + |
---|
| 1916 | + diffusenessField.setFloat(material.factor); |
---|
| 1917 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1918 | + |
---|
| 1919 | + materialtouched = true; |
---|
| 1920 | + applySelf(); |
---|
| 1921 | + } |
---|
| 1922 | + }); |
---|
| 1923 | + presetpanel.add(diffusemoon); |
---|
| 1924 | + |
---|
| 1925 | + cLabel diffusemoon2 = GetLabel("icons/shadericons/shadericon00005.png", !Grafreed.NIMBUSLAF); |
---|
| 1926 | + diffusemoon2.setToolTipText("Moon2"); |
---|
| 1927 | + diffusemoon2.addMouseListener(new MouseAdapter() |
---|
| 1928 | + { |
---|
| 1929 | + public void mouseClicked(MouseEvent e) |
---|
| 1930 | + { |
---|
| 1931 | + Object3D object = Grafreed.materials.versionlist[5].get(0); |
---|
| 1932 | + cMaterial material = object.material; |
---|
| 1933 | + |
---|
| 1934 | + diffusenessField.setFloat(material.factor); |
---|
| 1935 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1936 | + |
---|
| 1937 | + materialtouched = true; |
---|
| 1938 | + applySelf(); |
---|
| 1939 | + } |
---|
| 1940 | + }); |
---|
| 1941 | + presetpanel.add(diffusemoon2); |
---|
| 1942 | + |
---|
| 1943 | + cLabel diffusemoon3 = GetLabel("icons/shadericons/shadericon00006.png", !Grafreed.NIMBUSLAF); |
---|
| 1944 | + diffusemoon3.setToolTipText("Moon3"); |
---|
| 1945 | + diffusemoon3.addMouseListener(new MouseAdapter() |
---|
| 1946 | + { |
---|
| 1947 | + public void mouseClicked(MouseEvent e) |
---|
| 1948 | + { |
---|
| 1949 | + Object3D object = Grafreed.materials.versionlist[6].get(0); |
---|
| 1950 | + cMaterial material = object.material; |
---|
| 1951 | + |
---|
| 1952 | + diffusenessField.setFloat(material.factor); |
---|
| 1953 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1954 | + |
---|
| 1955 | + materialtouched = true; |
---|
| 1956 | + applySelf(); |
---|
| 1957 | + } |
---|
| 1958 | + }); |
---|
| 1959 | + presetpanel.add(diffusemoon3); |
---|
| 1960 | + |
---|
| 1961 | + cLabel diffusesheen = GetLabel("icons/shadericons/shadericon00007.png", !Grafreed.NIMBUSLAF); |
---|
| 1962 | + diffusesheen.setToolTipText("Sheen"); |
---|
| 1963 | + diffusesheen.addMouseListener(new MouseAdapter() |
---|
| 1964 | + { |
---|
| 1965 | + public void mouseClicked(MouseEvent e) |
---|
| 1966 | + { |
---|
| 1967 | + Object3D object = Grafreed.materials.versionlist[7].get(0); |
---|
| 1968 | + cMaterial material = object.material; |
---|
| 1969 | + |
---|
| 1970 | + sheenField.setFloat(material.sheen); |
---|
| 1971 | + |
---|
| 1972 | + materialtouched = true; |
---|
| 1973 | + applySelf(); |
---|
| 1974 | + } |
---|
| 1975 | + }); |
---|
| 1976 | + presetpanel.add(diffusesheen); |
---|
| 1977 | + |
---|
| 1978 | + cLabel rough = GetLabel("icons/shadericons/shadericon00001.png", !Grafreed.NIMBUSLAF); |
---|
| 1979 | + rough.setToolTipText("Rough metal"); |
---|
| 1980 | + rough.addMouseListener(new MouseAdapter() |
---|
| 1981 | + { |
---|
| 1982 | + public void mouseClicked(MouseEvent e) |
---|
| 1983 | + { |
---|
| 1984 | + Object3D object = Grafreed.materials.versionlist[1].get(0); |
---|
| 1985 | + cMaterial material = object.material; |
---|
| 1986 | + |
---|
| 1987 | + shininessField.setFloat(material.shininess); |
---|
| 1988 | + velvetField.setFloat(material.velvet); |
---|
| 1989 | + |
---|
| 1990 | + materialtouched = true; |
---|
| 1991 | + applySelf(); |
---|
| 1992 | + } |
---|
| 1993 | + }); |
---|
| 1994 | + presetpanel.add(rough); |
---|
| 1995 | + |
---|
| 1996 | + cLabel rough2 = GetLabel("icons/shadericons/shadericon00013.png", !Grafreed.NIMBUSLAF); |
---|
| 1997 | + rough2.setToolTipText("Medium metal"); |
---|
| 1998 | + rough2.addMouseListener(new MouseAdapter() |
---|
| 1999 | + { |
---|
| 2000 | + public void mouseClicked(MouseEvent e) |
---|
| 2001 | + { |
---|
| 2002 | + Object3D object = Grafreed.materials.versionlist[13].get(0); |
---|
| 2003 | + cMaterial material = object.material; |
---|
| 2004 | + |
---|
| 2005 | + shininessField.setFloat(material.shininess); |
---|
| 2006 | + lightareaField.setFloat(material.lightarea); |
---|
| 2007 | + |
---|
| 2008 | + materialtouched = true; |
---|
| 2009 | + applySelf(); |
---|
| 2010 | + } |
---|
| 2011 | + }); |
---|
| 2012 | + presetpanel.add(rough2); |
---|
| 2013 | + |
---|
| 2014 | + cLabel shini0 = GetLabel("icons/shadericons/shadericon00014.png", !Grafreed.NIMBUSLAF); |
---|
| 2015 | + shini0.setToolTipText("Shiny"); |
---|
| 2016 | + shini0.addMouseListener(new MouseAdapter() |
---|
| 2017 | + { |
---|
| 2018 | + public void mouseClicked(MouseEvent e) |
---|
| 2019 | + { |
---|
| 2020 | + Object3D object = Grafreed.materials.versionlist[14].get(0); |
---|
| 2021 | + cMaterial material = object.material; |
---|
| 2022 | + |
---|
| 2023 | + shininessField.setFloat(material.shininess); |
---|
| 2024 | + lightareaField.setFloat(material.lightarea); |
---|
| 2025 | + |
---|
| 2026 | + materialtouched = true; |
---|
| 2027 | + applySelf(); |
---|
| 2028 | + } |
---|
| 2029 | + }); |
---|
| 2030 | + presetpanel.add(shini0); |
---|
| 2031 | + |
---|
| 2032 | + cLabel shini1 = GetLabel("icons/shadericons/shadericon00011.png", !Grafreed.NIMBUSLAF); |
---|
| 2033 | + shini1.setToolTipText("Shiny2"); |
---|
| 2034 | + shini1.addMouseListener(new MouseAdapter() |
---|
| 2035 | + { |
---|
| 2036 | + public void mouseClicked(MouseEvent e) |
---|
| 2037 | + { |
---|
| 2038 | + Object3D object = Grafreed.materials.versionlist[11].get(0); |
---|
| 2039 | + cMaterial material = object.material; |
---|
| 2040 | + |
---|
| 2041 | + shininessField.setFloat(material.shininess); |
---|
| 2042 | + lightareaField.setFloat(material.lightarea); |
---|
| 2043 | + |
---|
| 2044 | + materialtouched = true; |
---|
| 2045 | + applySelf(); |
---|
| 2046 | + } |
---|
| 2047 | + }); |
---|
| 2048 | + presetpanel.add(shini1); |
---|
| 2049 | + |
---|
| 2050 | + cLabel shini2 = GetLabel("icons/shadericons/shadericon00012.png", !Grafreed.NIMBUSLAF); |
---|
| 2051 | + shini2.setToolTipText("Shiny3"); |
---|
| 2052 | + shini2.addMouseListener(new MouseAdapter() |
---|
| 2053 | + { |
---|
| 2054 | + public void mouseClicked(MouseEvent e) |
---|
| 2055 | + { |
---|
| 2056 | + Object3D object = Grafreed.materials.versionlist[12].get(0); |
---|
| 2057 | + cMaterial material = object.material; |
---|
| 2058 | + |
---|
| 2059 | + shininessField.setFloat(material.shininess); |
---|
| 2060 | + lightareaField.setFloat(material.lightarea); |
---|
| 2061 | + |
---|
| 2062 | + materialtouched = true; |
---|
| 2063 | + applySelf(); |
---|
| 2064 | + } |
---|
| 2065 | + }); |
---|
| 2066 | + presetpanel.add(shini2); |
---|
| 2067 | + |
---|
| 2068 | + cLabel aniso = GetLabel("icons/shadericons/shadericon00008.png", !Grafreed.NIMBUSLAF); |
---|
| 2069 | + aniso.setToolTipText("AnisoU"); |
---|
| 2070 | + aniso.addMouseListener(new MouseAdapter() |
---|
| 2071 | + { |
---|
| 2072 | + public void mouseClicked(MouseEvent e) |
---|
| 2073 | + { |
---|
| 2074 | + Object3D object = Grafreed.materials.versionlist[8].get(0); |
---|
| 2075 | + cMaterial material = object.material; |
---|
| 2076 | + |
---|
| 2077 | + anisoField.setFloat(material.aniso); |
---|
| 2078 | + anisoVField.setFloat(material.anisoV); |
---|
| 2079 | + |
---|
| 2080 | + materialtouched = true; |
---|
| 2081 | + applySelf(); |
---|
| 2082 | + } |
---|
| 2083 | + }); |
---|
| 2084 | + presetpanel.add(aniso); |
---|
| 2085 | + |
---|
| 2086 | + cLabel aniso2 = GetLabel("icons/shadericons/shadericon00009.png", !Grafreed.NIMBUSLAF); |
---|
| 2087 | + aniso2.setToolTipText("AnisoV"); |
---|
| 2088 | + aniso2.addMouseListener(new MouseAdapter() |
---|
| 2089 | + { |
---|
| 2090 | + public void mouseClicked(MouseEvent e) |
---|
| 2091 | + { |
---|
| 2092 | + Object3D object = Grafreed.materials.versionlist[9].get(0); |
---|
| 2093 | + cMaterial material = object.material; |
---|
| 2094 | + |
---|
| 2095 | + anisoField.setFloat(material.aniso); |
---|
| 2096 | + anisoVField.setFloat(material.anisoV); |
---|
| 2097 | + |
---|
| 2098 | + materialtouched = true; |
---|
| 2099 | + applySelf(); |
---|
| 2100 | + } |
---|
| 2101 | + }); |
---|
| 2102 | + presetpanel.add(aniso2); |
---|
| 2103 | + |
---|
| 2104 | + cLabel aniso3 = GetLabel("icons/shadericons/shadericon00010.png", !Grafreed.NIMBUSLAF); |
---|
| 2105 | + aniso3.setToolTipText("AnisoUV"); |
---|
| 2106 | + aniso3.addMouseListener(new MouseAdapter() |
---|
| 2107 | + { |
---|
| 2108 | + public void mouseClicked(MouseEvent e) |
---|
| 2109 | + { |
---|
| 2110 | + Object3D object = Grafreed.materials.versionlist[10].get(0); |
---|
| 2111 | + cMaterial material = object.material; |
---|
| 2112 | + |
---|
| 2113 | + anisoField.setFloat(material.aniso); |
---|
| 2114 | + anisoVField.setFloat(material.anisoV); |
---|
| 2115 | + |
---|
| 2116 | + materialtouched = true; |
---|
| 2117 | + applySelf(); |
---|
| 2118 | + } |
---|
| 2119 | + }); |
---|
| 2120 | + presetpanel.add(aniso3); |
---|
| 2121 | + |
---|
| 2122 | + cLabel velvet0 = GetLabel("icons/shadericons/shadericon00015.png", !Grafreed.NIMBUSLAF); |
---|
| 2123 | + velvet0.setToolTipText("Velvet"); |
---|
| 2124 | + velvet0.addMouseListener(new MouseAdapter() |
---|
| 2125 | + { |
---|
| 2126 | + public void mouseClicked(MouseEvent e) |
---|
| 2127 | + { |
---|
| 2128 | + Object3D object = Grafreed.materials.versionlist[15].get(0); |
---|
| 2129 | + cMaterial material = object.material; |
---|
| 2130 | + |
---|
| 2131 | + diffusenessField.setFloat(material.factor); |
---|
| 2132 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 2133 | + sheenField.setFloat(material.sheen); |
---|
| 2134 | + shininessField.setFloat(material.shininess); |
---|
| 2135 | + velvetField.setFloat(material.velvet); |
---|
| 2136 | + shiftField.setFloat(material.shift); |
---|
| 2137 | + |
---|
| 2138 | + materialtouched = true; |
---|
| 2139 | + applySelf(); |
---|
| 2140 | + } |
---|
| 2141 | + }); |
---|
| 2142 | + presetpanel.add(velvet0); |
---|
| 2143 | + |
---|
| 2144 | + cLabel bump0 = GetLabel("icons/shadericons/shadericon00016.png", !Grafreed.NIMBUSLAF); |
---|
| 2145 | + bump0.setToolTipText("Bump texture"); |
---|
| 2146 | + bump0.addMouseListener(new MouseAdapter() |
---|
| 2147 | + { |
---|
| 2148 | + public void mouseClicked(MouseEvent e) |
---|
| 2149 | + { |
---|
| 2150 | + Object3D object = Grafreed.materials.versionlist[16].get(0); |
---|
| 2151 | + cMaterial material = object.material; |
---|
| 2152 | + |
---|
| 2153 | + bumpField.setFloat(object.projectedVertices[0].x / 1000.0); |
---|
| 2154 | + noiseField.setFloat(object.projectedVertices[0].y / 1000.0); |
---|
| 2155 | + powerField.setFloat(object.projectedVertices[2].x / 1000.0); |
---|
| 2156 | + |
---|
| 2157 | + materialtouched = true; |
---|
| 2158 | + applySelf(); |
---|
| 2159 | + } |
---|
| 2160 | + }); |
---|
| 2161 | + presetpanel.add(bump0); |
---|
| 2162 | + |
---|
| 2163 | + cLabel halo = GetLabel("icons/shadericons/shadericon00017.png", !Grafreed.NIMBUSLAF); |
---|
| 2164 | + halo.setToolTipText("Halo"); |
---|
| 2165 | + halo.addMouseListener(new MouseAdapter() |
---|
| 2166 | + { |
---|
| 2167 | + public void mouseClicked(MouseEvent e) |
---|
| 2168 | + { |
---|
| 2169 | + Object3D object = Grafreed.materials.versionlist[17].get(0); |
---|
| 2170 | + cMaterial material = object.material; |
---|
| 2171 | + |
---|
| 2172 | + opacityPowerField.setFloat(object.projectedVertices[2].y / 1000.0); |
---|
| 2173 | + |
---|
| 2174 | + materialtouched = true; |
---|
| 2175 | + applySelf(); |
---|
| 2176 | + } |
---|
| 2177 | + }); |
---|
| 2178 | + presetpanel.add(halo); |
---|
| 2179 | + |
---|
| 2180 | + cLabel candle = GetLabel("icons/shadericons/shadericon00018.png", !Grafreed.NIMBUSLAF); |
---|
| 2181 | + candle.setToolTipText("Candle"); |
---|
| 2182 | + candle.addMouseListener(new MouseAdapter() |
---|
| 2183 | + { |
---|
| 2184 | + public void mouseClicked(MouseEvent e) |
---|
| 2185 | + { |
---|
| 2186 | + Object3D object = Grafreed.materials.versionlist[18].get(0); |
---|
| 2187 | + cMaterial material = object.material; |
---|
| 2188 | + |
---|
| 2189 | + subsurfaceField.setFloat(material.subsurface); |
---|
| 2190 | + shadowbiasField.setFloat(material.shadowbias); |
---|
| 2191 | + ambientField.setFloat(material.ambient); |
---|
| 2192 | + specularField.setFloat(material.specular); |
---|
| 2193 | + lightareaField.setFloat(material.lightarea); |
---|
| 2194 | + shininessField.setFloat(material.shininess); |
---|
| 2195 | + |
---|
| 2196 | + materialtouched = true; |
---|
| 2197 | + applySelf(); |
---|
| 2198 | + } |
---|
| 2199 | + }); |
---|
| 2200 | + presetpanel.add(candle); |
---|
| 2201 | + |
---|
| 2202 | + cLabel shadowShader = GetLabel("icons/shadericons/shadow.png", !Grafreed.NIMBUSLAF); |
---|
| 2203 | + shadowShader.setToolTipText("Shadow"); |
---|
| 2204 | + shadowShader.addMouseListener(new MouseAdapter() |
---|
| 2205 | + { |
---|
| 2206 | + public void mouseClicked(MouseEvent e) |
---|
| 2207 | + { |
---|
| 2208 | + diffuseField.setFloat(0.001); |
---|
| 2209 | + ambientField.setFloat(0.001); |
---|
| 2210 | + cameraField.setFloat(0.001); |
---|
| 2211 | + specularField.setFloat(0.001); |
---|
| 2212 | + fakedepthField.setFloat(0.001); |
---|
| 2213 | + opacityField.setFloat(0.6); |
---|
| 2214 | + |
---|
| 2215 | + materialtouched = true; |
---|
| 2216 | + applySelf(); |
---|
| 2217 | + } |
---|
| 2218 | + }); |
---|
| 2219 | + presetpanel.add(shadowShader); |
---|
1774 | 2220 | |
---|
1775 | 2221 | cGridBag panel = new cGridBag().setVertical(true); |
---|
1776 | 2222 | |
---|
1777 | 2223 | presetpanel.preferredWidth = 1; |
---|
1778 | 2224 | |
---|
1779 | | - materialpanel.add(panel); |
---|
1780 | 2225 | materialpanel.add(presetpanel); |
---|
| 2226 | + materialpanel.add(panel); |
---|
1781 | 2227 | |
---|
1782 | 2228 | panel.preferredWidth = 8; |
---|
1783 | 2229 | |
---|
.. | .. |
---|
1821 | 2267 | |
---|
1822 | 2268 | cGridBag huepanel = new cGridBag(); |
---|
1823 | 2269 | cGridBag huelabel = new cGridBag(); |
---|
1824 | | - label = GetLabel("icons/hue.png", false); |
---|
1825 | | - label.fit = true; |
---|
1826 | | - huelabel.add(label); |
---|
| 2270 | + skin = GetLabel("icons/hue.png", false); |
---|
| 2271 | + skin.fit = true; |
---|
| 2272 | + huelabel.add(skin); |
---|
1827 | 2273 | huelabel.preferredWidth = 20; |
---|
1828 | 2274 | huepanel.add(new cGridBag()); // Label |
---|
1829 | 2275 | huepanel.add(huelabel); // Field/slider |
---|
.. | .. |
---|
3244 | 3690 | public void itemStateChanged(ItemEvent event) |
---|
3245 | 3691 | { |
---|
3246 | 3692 | // System.out.println("Propagate = " + propagate); |
---|
| 3693 | + if (event.getSource() == pinButton) |
---|
| 3694 | + { |
---|
| 3695 | + copy.pinned ^= true; |
---|
| 3696 | + if (!copy.pinned && !copy.editWindow.copy.selection.contains(copy)) |
---|
| 3697 | + { |
---|
| 3698 | + ((GroupEditor)copy.editWindow).listUI.remove(copy); |
---|
| 3699 | + copy.CloseUI(); |
---|
| 3700 | + //copy.editWindow.refreshContents(); |
---|
| 3701 | + } |
---|
| 3702 | + } |
---|
| 3703 | + else |
---|
3247 | 3704 | if (event.getSource() == propagateToggle) |
---|
3248 | 3705 | { |
---|
3249 | 3706 | propagate ^= true; |
---|
.. | .. |
---|
3716 | 4173 | { |
---|
3717 | 4174 | //Save(true); |
---|
3718 | 4175 | Replace(); |
---|
3719 | | - SetUndoStates(); |
---|
| 4176 | + SetVersionStates(); |
---|
3720 | 4177 | } |
---|
3721 | 4178 | |
---|
3722 | 4179 | private boolean Equal(byte[] compress, byte[] name) |
---|
.. | .. |
---|
3737 | 4194 | |
---|
3738 | 4195 | java.util.Hashtable<java.util.UUID, Object3D> versiontable = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
3739 | 4196 | |
---|
| 4197 | + void DeleteVersion() |
---|
| 4198 | + { |
---|
| 4199 | + for (int i = copy.versionindex; i < copy.versionlist.length-1; i++) |
---|
| 4200 | + { |
---|
| 4201 | + copy.versionlist[i] = copy.versionlist[i+1]; |
---|
| 4202 | + } |
---|
| 4203 | + |
---|
| 4204 | + CopyChanged(); |
---|
| 4205 | + |
---|
| 4206 | + SetVersionStates(); |
---|
| 4207 | + } |
---|
| 4208 | + |
---|
3740 | 4209 | public boolean Save(boolean user) |
---|
3741 | 4210 | { |
---|
3742 | 4211 | System.err.println("Save"); |
---|
3743 | 4212 | Replace(); |
---|
3744 | 4213 | |
---|
3745 | | - cRadio tab = GetCurrentTab(); |
---|
| 4214 | + //cRadio tab = GetCurrentTab(); |
---|
3746 | 4215 | |
---|
3747 | | - Object3D compress = CompressCopy(); // Saved version. No need for "Replace". |
---|
| 4216 | + Object3D compress = Duplicate(copy); // Saved version. No need for "Replace"? |
---|
3748 | 4217 | |
---|
3749 | 4218 | boolean thesame = false; |
---|
3750 | 4219 | |
---|
.. | .. |
---|
3756 | 4225 | //EditorFrame.m_MainFrame.requestFocusInWindow(); |
---|
3757 | 4226 | if (!thesame) |
---|
3758 | 4227 | { |
---|
| 4228 | + for (int i = copy.versionlist.length; --i > copy.versionindex+1;) |
---|
| 4229 | + { |
---|
| 4230 | + copy.versionlist[i] = copy.versionlist[i-1]; |
---|
| 4231 | + } |
---|
| 4232 | + |
---|
3759 | 4233 | //tab.user[tab.versionindex] = user; |
---|
3760 | 4234 | //boolean increment = true; // tab.graphs[tab.versionindex] == null; |
---|
3761 | 4235 | |
---|
.. | .. |
---|
3769 | 4243 | |
---|
3770 | 4244 | //assert(hashtable.isEmpty()); |
---|
3771 | 4245 | |
---|
3772 | | - for (int i = copy.versionindex+1; i < copy.versionlist.length; i++) |
---|
3773 | | - { |
---|
3774 | | - //tab.user[i] = false; |
---|
3775 | | - copy.versionlist[i] = null; |
---|
3776 | | - } |
---|
| 4246 | +// for (int i = copy.versionindex+1; i < copy.versionlist.length; i++) |
---|
| 4247 | +// { |
---|
| 4248 | +// //tab.user[i] = false; |
---|
| 4249 | +// copy.versionlist[i] = null; |
---|
| 4250 | +// } |
---|
3777 | 4251 | |
---|
3778 | | - SetUndoStates(); |
---|
| 4252 | + SetVersionStates(); |
---|
3779 | 4253 | |
---|
3780 | 4254 | // test save |
---|
3781 | 4255 | if (false) |
---|
.. | .. |
---|
3828 | 4302 | GetTree().addSelectionPath(selection.elementAt(i).GetTreePath().GetTreePath()); |
---|
3829 | 4303 | flashIt = true; |
---|
3830 | 4304 | |
---|
3831 | | - refreshContents(false); |
---|
| 4305 | + //refreshContents(false); |
---|
3832 | 4306 | } |
---|
3833 | 4307 | |
---|
3834 | | - void CopyChanged(Object3D obj) |
---|
| 4308 | + void CopyChanged() |
---|
3835 | 4309 | { |
---|
3836 | | - SetUndoStates(); |
---|
| 4310 | + Object3D obj = (Object3D)Grafreed.clone(copy.versionlist[copy.versionindex]); |
---|
| 4311 | + |
---|
| 4312 | + SetVersionStates(); |
---|
3837 | 4313 | |
---|
3838 | 4314 | boolean temp = CameraPane.SWITCH; |
---|
3839 | 4315 | CameraPane.SWITCH = false; |
---|
.. | .. |
---|
3875 | 4351 | } |
---|
3876 | 4352 | } |
---|
3877 | 4353 | |
---|
3878 | | - refreshContents(); |
---|
| 4354 | + refreshContents(true); |
---|
3879 | 4355 | } |
---|
3880 | 4356 | |
---|
3881 | | - cButton undoButton; |
---|
| 4357 | + cButton previousVersionButton; |
---|
3882 | 4358 | cButton restoreButton; |
---|
3883 | 4359 | cButton replaceButton; |
---|
3884 | | - cButton redoButton; |
---|
| 4360 | + cButton nextVersionButton; |
---|
| 4361 | + cButton saveVersionButton; |
---|
| 4362 | + cButton deleteVersionButton; |
---|
3885 | 4363 | |
---|
3886 | 4364 | boolean muteSlider; |
---|
3887 | 4365 | |
---|
.. | .. |
---|
3898 | 4376 | return count; |
---|
3899 | 4377 | } |
---|
3900 | 4378 | |
---|
3901 | | - void SetUndoStates() |
---|
| 4379 | + void SetVersionStates() |
---|
3902 | 4380 | { |
---|
3903 | | - cRadio tab = GetCurrentTab(); |
---|
| 4381 | + //if (true) |
---|
| 4382 | + // return; |
---|
| 4383 | + |
---|
| 4384 | + //cRadio tab = GetCurrentTab(); |
---|
3904 | 4385 | |
---|
3905 | 4386 | restoreButton.setEnabled(copy.versionindex != -1); |
---|
3906 | 4387 | replaceButton.setEnabled(copy.versionindex != -1); |
---|
3907 | 4388 | |
---|
3908 | | - undoButton.setEnabled(copy.versionindex > 0); |
---|
3909 | | - redoButton.setEnabled(copy.versionlist[copy.versionindex + 1] != null); |
---|
| 4389 | + previousVersionButton.setEnabled(copy.versionindex > 0); |
---|
| 4390 | + nextVersionButton.setEnabled(copy.versionlist[copy.versionindex + 1] != null); |
---|
| 4391 | + |
---|
| 4392 | + deleteVersionButton.setEnabled(//copy.versionindex > 0 && |
---|
| 4393 | + copy.versionlist[copy.versionindex + 1] != null); |
---|
3910 | 4394 | |
---|
3911 | 4395 | muteSlider = true; |
---|
| 4396 | + versionSlider.setMinimum(0); |
---|
3912 | 4397 | versionSlider.setMaximum(VersionCount() - 1); |
---|
3913 | 4398 | versionSlider.setInteger(copy.versionindex); |
---|
| 4399 | + versionSlider.setEnabled(copy.versionindex != -1); |
---|
3914 | 4400 | muteSlider = false; |
---|
3915 | 4401 | } |
---|
3916 | 4402 | |
---|
3917 | | - public boolean Undo() |
---|
| 4403 | + public boolean PreviousVersion() |
---|
3918 | 4404 | { |
---|
3919 | 4405 | // Option? |
---|
3920 | 4406 | Replace(); |
---|
3921 | 4407 | |
---|
3922 | 4408 | System.err.println("Undo"); |
---|
3923 | 4409 | |
---|
3924 | | - cRadio tab = GetCurrentTab(); |
---|
| 4410 | + //cRadio tab = GetCurrentTab(); |
---|
3925 | 4411 | |
---|
3926 | 4412 | if (copy.versionindex == 0) |
---|
3927 | 4413 | { |
---|
.. | .. |
---|
3944 | 4430 | |
---|
3945 | 4431 | copy.versionindex -= 1; |
---|
3946 | 4432 | |
---|
3947 | | - CopyChanged((Object3D)copy.versionlist[copy.versionindex]); |
---|
| 4433 | + CopyChanged(); |
---|
3948 | 4434 | |
---|
3949 | 4435 | return true; |
---|
3950 | 4436 | } |
---|
.. | .. |
---|
3953 | 4439 | { |
---|
3954 | 4440 | System.err.println("Restore"); |
---|
3955 | 4441 | |
---|
3956 | | - cRadio tab = GetCurrentTab(); |
---|
| 4442 | + //cRadio tab = GetCurrentTab(); |
---|
3957 | 4443 | |
---|
3958 | 4444 | if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
3959 | 4445 | { |
---|
.. | .. |
---|
3962 | 4448 | } |
---|
3963 | 4449 | |
---|
3964 | 4450 | //CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
3965 | | - CopyChanged(copy.versionlist[copy.versionindex]); |
---|
| 4451 | + CopyChanged(); |
---|
3966 | 4452 | |
---|
3967 | 4453 | return true; |
---|
3968 | 4454 | } |
---|
.. | .. |
---|
3971 | 4457 | { |
---|
3972 | 4458 | System.err.println("Replace"); |
---|
3973 | 4459 | |
---|
3974 | | - cRadio tab = GetCurrentTab(); |
---|
| 4460 | + //cRadio tab = GetCurrentTab(); |
---|
3975 | 4461 | |
---|
3976 | 4462 | if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
3977 | 4463 | { |
---|
.. | .. |
---|
3979 | 4465 | return false; |
---|
3980 | 4466 | } |
---|
3981 | 4467 | |
---|
3982 | | - copy.versionlist[copy.versionindex] = CompressCopy(); |
---|
| 4468 | + copy.versionlist[copy.versionindex] = Duplicate(copy); |
---|
3983 | 4469 | |
---|
3984 | 4470 | return true; |
---|
3985 | 4471 | } |
---|
3986 | 4472 | |
---|
3987 | | - public void Redo() |
---|
| 4473 | + public void NextVersion() |
---|
3988 | 4474 | { |
---|
3989 | 4475 | // Option? |
---|
3990 | 4476 | Replace(); |
---|
3991 | 4477 | |
---|
3992 | | - cRadio tab = GetCurrentTab(); |
---|
| 4478 | + //cRadio tab = GetCurrentTab(); |
---|
3993 | 4479 | |
---|
3994 | 4480 | if (copy.versionlist[copy.versionindex + 1] == null) |
---|
3995 | 4481 | { |
---|
.. | .. |
---|
3999 | 4485 | |
---|
4000 | 4486 | copy.versionindex += 1; |
---|
4001 | 4487 | |
---|
4002 | | - CopyChanged(copy.versionlist[copy.versionindex]); |
---|
| 4488 | + CopyChanged(); |
---|
4003 | 4489 | |
---|
4004 | 4490 | //if (!tab.user[tab.versionindex]) |
---|
4005 | 4491 | // tab.graphs[tab.versionindex] = null; |
---|
.. | .. |
---|
4308 | 4794 | if (muteSlider) |
---|
4309 | 4795 | return; |
---|
4310 | 4796 | |
---|
| 4797 | + Replace(); |
---|
| 4798 | + |
---|
4311 | 4799 | int version = versionSlider.getInteger(); |
---|
4312 | 4800 | |
---|
4313 | | - if (copy.versionlist[version] != null) |
---|
| 4801 | + if (version != -1 && copy.versionlist[version] != null) |
---|
4314 | 4802 | { |
---|
4315 | | - CopyChanged(copy.versionlist[copy.versionindex = version]); |
---|
| 4803 | + copy.versionindex = version; |
---|
| 4804 | + CopyChanged(); |
---|
4316 | 4805 | } |
---|
4317 | 4806 | |
---|
4318 | 4807 | return; |
---|
.. | .. |
---|
4353 | 4842 | //System.out.println("stateChanged = " + this); |
---|
4354 | 4843 | materialtouched = true; |
---|
4355 | 4844 | |
---|
4356 | | - if (e.getSource() == colorField && saturationField.getFloat() == 0.001) |
---|
| 4845 | + if (Globals.AUTOSATURATE && e.getSource() == colorField && saturationField.getFloat() == 0.001) |
---|
4357 | 4846 | { |
---|
4358 | 4847 | saturationField.setFloat(1); |
---|
4359 | 4848 | } |
---|
.. | .. |
---|
4666 | 5155 | ctrlPanel.validate(); // ? new |
---|
4667 | 5156 | ctrlPanel.repaint(); |
---|
4668 | 5157 | } |
---|
| 5158 | + |
---|
| 5159 | + if (previousVersionButton != null && copy.versionlist != null) |
---|
| 5160 | + SetVersionStates(); |
---|
4669 | 5161 | } |
---|
4670 | 5162 | |
---|
4671 | 5163 | static TweenManager tweenManager = new TweenManager(); |
---|
.. | .. |
---|
5054 | 5546 | |
---|
5055 | 5547 | if (copy.versionlist == null) |
---|
5056 | 5548 | { |
---|
| 5549 | + // Backward compatibility |
---|
5057 | 5550 | copy.versionlist = new Object3D[100]; |
---|
5058 | 5551 | copy.versionindex = -1; |
---|
| 5552 | + |
---|
| 5553 | + //Save(true); |
---|
5059 | 5554 | } |
---|
5060 | 5555 | |
---|
5061 | 5556 | //? SetUndoStates(); |
---|
.. | .. |
---|
5070 | 5565 | { |
---|
5071 | 5566 | if (Grafreed.standAlone) |
---|
5072 | 5567 | { |
---|
5073 | | - FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD); |
---|
| 5568 | + FileDialog browser = new FileDialog(frame, "Open", FileDialog.LOAD); |
---|
5074 | 5569 | browser.show(); |
---|
5075 | 5570 | String filename = browser.getFile(); |
---|
5076 | 5571 | if (filename != null && filename.length() > 0) |
---|
.. | .. |
---|
5147 | 5642 | |
---|
5148 | 5643 | void save() |
---|
5149 | 5644 | { |
---|
| 5645 | + Replace(); |
---|
| 5646 | + |
---|
5150 | 5647 | if (lastname == null) |
---|
5151 | 5648 | { |
---|
5152 | 5649 | return; |
---|
.. | .. |
---|
5389 | 5886 | ButtonGroup buttonGroup; |
---|
5390 | 5887 | |
---|
5391 | 5888 | cGridBag toolboxPanel; |
---|
| 5889 | + cGridBag skyboxPanel; |
---|
5392 | 5890 | cGridBag materialPanel; |
---|
5393 | 5891 | cGridBag ctrlPanel; |
---|
5394 | 5892 | |
---|
.. | .. |
---|
5493 | 5991 | cNumberSlider anisoField; |
---|
5494 | 5992 | JLabel anisoVLabel; |
---|
5495 | 5993 | cNumberSlider anisoVField; |
---|
| 5994 | + |
---|
5496 | 5995 | JLabel cameraLabel; |
---|
5497 | 5996 | cNumberSlider cameraField; |
---|
5498 | 5997 | JLabel selfshadowLabel; |
---|
.. | .. |
---|
5507 | 6006 | cNumberSlider fakedepthField; |
---|
5508 | 6007 | JLabel shadowbiasLabel; |
---|
5509 | 6008 | cNumberSlider shadowbiasField; |
---|
| 6009 | + |
---|
5510 | 6010 | JLabel bumpLabel; |
---|
5511 | 6011 | cNumberSlider bumpField; |
---|
5512 | 6012 | JLabel noiseLabel; |
---|