.. | .. |
---|
34 | 34 | iSendInfo |
---|
35 | 35 | //KeyListener |
---|
36 | 36 | { |
---|
| 37 | + public cToggleButton pinButton; |
---|
37 | 38 | boolean timeline; |
---|
38 | 39 | boolean wasFullScreen; |
---|
39 | 40 | |
---|
.. | .. |
---|
296 | 297 | client = inClient; |
---|
297 | 298 | copy = client; |
---|
298 | 299 | |
---|
299 | | - if (copy.versionlist == null) |
---|
300 | | - { |
---|
301 | | - copy.versionlist = new Object3D[100]; |
---|
302 | | - copy.versionindex = -1; |
---|
303 | | - } |
---|
| 300 | +// if (copy.versionlist == null) |
---|
| 301 | +// { |
---|
| 302 | +// copy.versionlist = new Object3D[100]; |
---|
| 303 | +// copy.versionindex = -1; |
---|
| 304 | +// |
---|
| 305 | +// callee.Save(true); |
---|
| 306 | +// } |
---|
304 | 307 | |
---|
305 | 308 | // "this" is not called: SetupUI2(objEditor); |
---|
306 | 309 | } |
---|
.. | .. |
---|
319 | 322 | { |
---|
320 | 323 | copy.versionlist = new Object3D[100]; |
---|
321 | 324 | copy.versionindex = -1; |
---|
| 325 | + |
---|
| 326 | +// Save(true); |
---|
322 | 327 | } |
---|
323 | 328 | |
---|
324 | 329 | SetupUI2(callee.GetEditor()); |
---|
.. | .. |
---|
353 | 358 | copy = localCopy; |
---|
354 | 359 | copy.editWindow = this; |
---|
355 | 360 | |
---|
356 | | - if (copy.versionlist == null) |
---|
357 | | - { |
---|
358 | | -// copy.versions = new byte[100][]; |
---|
| 361 | +// if (copy.versionlist == null) |
---|
| 362 | +// { |
---|
| 363 | +// copy.versionlist = new Object3D[100]; |
---|
359 | 364 | // copy.versionindex = -1; |
---|
360 | | - } |
---|
| 365 | +// |
---|
| 366 | +// Save(true); |
---|
| 367 | +// } |
---|
361 | 368 | |
---|
362 | 369 | SetupMenu(); |
---|
363 | 370 | |
---|
.. | .. |
---|
444 | 451 | // EditSelection(false); |
---|
445 | 452 | // } |
---|
446 | 453 | |
---|
447 | | - refreshContents(false); // To refresh Info tab |
---|
| 454 | +// refreshContents(false); // To refresh Info tab |
---|
448 | 455 | } |
---|
449 | 456 | }; |
---|
450 | 457 | objectPanel.addChangeListener(changeListener); |
---|
.. | .. |
---|
466 | 473 | |
---|
467 | 474 | toolboxPanel = new cGridBag().setVertical(true); |
---|
468 | 475 | //toolboxPanel.setName("Toolbox"); |
---|
| 476 | + |
---|
| 477 | + skyboxPanel = new cGridBag().setVertical(true); |
---|
469 | 478 | |
---|
470 | 479 | materialPanel = new cGridBag().setVertical(false); |
---|
471 | 480 | //materialPanel.setName("Material"); |
---|
.. | .. |
---|
751 | 760 | boolean maximized; |
---|
752 | 761 | |
---|
753 | 762 | cButton fullscreenLayout; |
---|
| 763 | + cButton expandedLayout; |
---|
754 | 764 | |
---|
755 | 765 | void Minimize() |
---|
756 | 766 | { |
---|
.. | .. |
---|
790 | 800 | cButton minButton; |
---|
791 | 801 | cButton maxButton; |
---|
792 | 802 | cButton fullButton; |
---|
| 803 | + cButton collapseButton; |
---|
| 804 | + cButton maximize3DButton; |
---|
793 | 805 | |
---|
794 | 806 | void ToggleFullScreen() |
---|
795 | 807 | { |
---|
796 | | -GraphicsDevice device = frame.getGraphicsConfiguration().getDevice(); |
---|
| 808 | + GraphicsDevice device = frame.getGraphicsConfiguration().getDevice(); |
---|
797 | 809 | |
---|
798 | 810 | cameraView.ToggleFullScreen(); |
---|
799 | 811 | |
---|
.. | .. |
---|
814 | 826 | // X frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
815 | 827 | // X framePanel.add(bigThree); |
---|
816 | 828 | // X frame.getContentPane().add(/*"Center",*/framePanel); |
---|
817 | | - framePanel.setDividerLocation(46); |
---|
| 829 | +// framePanel.setDividerLocation(46); // icons are 24x24 |
---|
818 | 830 | |
---|
819 | 831 | //frame.setVisible(true); |
---|
820 | | - radio.layout = keepButton; |
---|
| 832 | +// radio.layout = keepButton; |
---|
821 | 833 | //theFrame = null; |
---|
822 | 834 | keepButton = null; |
---|
823 | | - radio.layout.doClick(); |
---|
| 835 | +// radio.layout.doClick(); |
---|
824 | 836 | |
---|
825 | 837 | } else |
---|
826 | 838 | { |
---|
.. | .. |
---|
841 | 853 | // X frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
842 | 854 | // X framePanel.remove(bigThree); |
---|
843 | 855 | // X frame.getContentPane().add(/*"Center",*/bigThree); |
---|
844 | | - framePanel.setDividerLocation(0); |
---|
| 856 | +// framePanel.setDividerLocation(0); |
---|
845 | 857 | |
---|
846 | | - radio.layout = fullscreenLayout; |
---|
847 | | - radio.layout.doClick(); |
---|
| 858 | +// radio.layout = fullscreenLayout; |
---|
| 859 | +// radio.layout.doClick(); |
---|
848 | 860 | //frame.setVisible(true); |
---|
849 | 861 | } |
---|
850 | 862 | frame.validate(); |
---|
.. | .. |
---|
852 | 864 | cameraView.requestFocusInWindow(); |
---|
853 | 865 | } |
---|
854 | 866 | |
---|
855 | | - private Object3D CompressCopy() |
---|
| 867 | + void CollapseToolbar() |
---|
| 868 | + { |
---|
| 869 | + framePanel.setDividerLocation(0); |
---|
| 870 | + //frame.validate(); |
---|
| 871 | + |
---|
| 872 | + cameraView.requestFocusInWindow(); |
---|
| 873 | + } |
---|
| 874 | + |
---|
| 875 | + private Object3D Duplicate(Object3D object) |
---|
856 | 876 | { |
---|
857 | 877 | boolean temp = CameraPane.SWITCH; |
---|
858 | 878 | CameraPane.SWITCH = false; |
---|
859 | 879 | |
---|
860 | | - copy.ExtractBigData(versiontable); |
---|
| 880 | + object.ExtractBigData(versiontable); |
---|
861 | 881 | // if (copy == client) |
---|
862 | 882 | |
---|
863 | | - Object3D versions[] = copy.versionlist; |
---|
864 | | - copy.versionlist = null; |
---|
| 883 | + Object3D versions[] = object.versionlist; |
---|
| 884 | + object.versionlist = null; |
---|
865 | 885 | |
---|
866 | 886 | //byte[] compress = Compress(copy); |
---|
867 | | - Object3D compress = (Object3D)Grafreed.clone(copy); |
---|
| 887 | + Object3D compress = (Object3D)Grafreed.clone(object); |
---|
868 | 888 | |
---|
869 | | - copy.versionlist = versions; |
---|
| 889 | + object.versionlist = versions; |
---|
870 | 890 | |
---|
871 | | - copy.RestoreBigData(versiontable); |
---|
| 891 | + object.RestoreBigData(versiontable); |
---|
872 | 892 | |
---|
873 | 893 | CameraPane.SWITCH = temp; |
---|
874 | 894 | |
---|
.. | .. |
---|
1205 | 1225 | |
---|
1206 | 1226 | namePanel = new cGridBag(); |
---|
1207 | 1227 | |
---|
| 1228 | + //if (copy.pinned) |
---|
| 1229 | + { |
---|
| 1230 | + pinButton = GetToggleButton("icons/pin.png", !Grafreed.NIMBUSLAF); |
---|
| 1231 | + pinButton.setSelected(copy.pinned); |
---|
| 1232 | + cGridBag t = new cGridBag(); |
---|
| 1233 | + t.preferredWidth = 2; |
---|
| 1234 | + t.add(pinButton); |
---|
| 1235 | + namePanel.add(t); |
---|
| 1236 | + |
---|
| 1237 | + pinButton.addItemListener(this); |
---|
| 1238 | + } |
---|
| 1239 | + |
---|
1208 | 1240 | nameField = AddText(namePanel, copy.GetName()); |
---|
1209 | 1241 | namePanel.add(new JScrollPane(nameField, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER)); |
---|
1210 | 1242 | oe.ctrlPanel.add(namePanel); |
---|
.. | .. |
---|
1556 | 1588 | objectPanel.setIconAt(0, GetIcon("icons/material.png")); |
---|
1557 | 1589 | objectPanel.setToolTipTextAt(0, "Material"); |
---|
1558 | 1590 | |
---|
| 1591 | + objectPanel.add(toolboxPanel); |
---|
| 1592 | + objectPanel.setIconAt(1, GetIcon("icons/primitives.png")); |
---|
| 1593 | + objectPanel.setToolTipTextAt(1, "Objects & textures"); |
---|
| 1594 | + |
---|
| 1595 | + objectPanel.add(skyboxPanel); |
---|
| 1596 | + objectPanel.setIconAt(2, GetIcon("icons/skybox.jpg")); |
---|
| 1597 | + objectPanel.setToolTipTextAt(2, "Backgrounds"); |
---|
| 1598 | + |
---|
1559 | 1599 | // JPanel north = new JPanel(new BorderLayout()); |
---|
1560 | 1600 | // north.setName("Edit"); |
---|
1561 | 1601 | // north.add(ctrlPanel, BorderLayout.NORTH); |
---|
1562 | 1602 | // objectPanel.add(north); |
---|
1563 | 1603 | objectPanel.add(editPanel); |
---|
1564 | | - objectPanel.setIconAt(1, GetIcon("icons/write.png")); |
---|
1565 | | - objectPanel.setToolTipTextAt(1, "Edit controls"); |
---|
1566 | | - |
---|
1567 | | - //if (Globals.ADVANCED) |
---|
1568 | | - objectPanel.add(infoPanel); |
---|
1569 | | - objectPanel.setIconAt(2, GetIcon("icons/info.png")); |
---|
1570 | | - objectPanel.setToolTipTextAt(2, "Information"); |
---|
| 1604 | + objectPanel.setIconAt(3, GetIcon("icons/write.png")); |
---|
| 1605 | + objectPanel.setToolTipTextAt(3, "Edit controls"); |
---|
1571 | 1606 | |
---|
1572 | 1607 | objectPanel.add(XYZPanel); |
---|
1573 | | - objectPanel.setIconAt(3, GetIcon("icons/XYZ.png")); |
---|
1574 | | - objectPanel.setToolTipTextAt(3, "XYZ/RGB transform"); |
---|
| 1608 | + objectPanel.setIconAt(4, GetIcon("icons/XYZ.png")); |
---|
| 1609 | + objectPanel.setToolTipTextAt(4, "XYZ/RGB transform"); |
---|
1575 | 1610 | |
---|
1576 | | - objectPanel.add(toolboxPanel); |
---|
1577 | | - objectPanel.setIconAt(4, GetIcon("icons/primitives.png")); |
---|
1578 | | - objectPanel.setToolTipTextAt(4, "Objects & backgrounds"); |
---|
1579 | | - |
---|
1580 | 1611 | /* |
---|
1581 | 1612 | aConstraints.gridx = 0; |
---|
1582 | 1613 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1613 | 1644 | |
---|
1614 | 1645 | scenePanel.add(tabbedPane); |
---|
1615 | 1646 | |
---|
| 1647 | + //if (Globals.ADVANCED) |
---|
| 1648 | + tabbedPane.add(infoPanel); |
---|
| 1649 | + tabbedPane.setIconAt(3, GetIcon("icons/info.png")); |
---|
| 1650 | + tabbedPane.setToolTipTextAt(3, "Information"); |
---|
| 1651 | + |
---|
1616 | 1652 | /* |
---|
1617 | 1653 | cTree jTree = new cTree(null); |
---|
1618 | 1654 | ToolTipManager.sharedInstance().registerComponent(jTree); |
---|
.. | .. |
---|
1683 | 1719 | // aConstraints.gridheight = 1; |
---|
1684 | 1720 | |
---|
1685 | 1721 | framePanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, toolbarPanel, bigThree); |
---|
| 1722 | + |
---|
| 1723 | + framePanel.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY, |
---|
| 1724 | + new java.beans.PropertyChangeListener() |
---|
| 1725 | + { |
---|
| 1726 | + public void propertyChange(java.beans.PropertyChangeEvent pce) |
---|
| 1727 | + { |
---|
| 1728 | + if ((Integer)pce.getOldValue() == 1) |
---|
| 1729 | + { |
---|
| 1730 | + if (radio.layout != expandedLayout) |
---|
| 1731 | + { |
---|
| 1732 | + radio.layout = expandedLayout; |
---|
| 1733 | + radio.layout.doClick(); |
---|
| 1734 | + } |
---|
| 1735 | + } |
---|
| 1736 | + } |
---|
| 1737 | + }); |
---|
| 1738 | + |
---|
1686 | 1739 | framePanel.setContinuousLayout(false); |
---|
1687 | 1740 | framePanel.setOneTouchExpandable(false); |
---|
1688 | 1741 | //.setDividerLocation(0.8); |
---|
.. | .. |
---|
1740 | 1793 | void SetupMaterial(cGridBag materialpanel) |
---|
1741 | 1794 | { |
---|
1742 | 1795 | cGridBag presetpanel = new cGridBag().setVertical(true); |
---|
| 1796 | + |
---|
1743 | 1797 | cLabel skin = GetLabel("icons/shadericons/shadericon00000.png", !Grafreed.NIMBUSLAF); |
---|
| 1798 | + skin.setToolTipText("Skin"); |
---|
1744 | 1799 | skin.addMouseListener(new MouseAdapter() |
---|
1745 | 1800 | { |
---|
1746 | 1801 | public void mouseClicked(MouseEvent e) |
---|
.. | .. |
---|
1769 | 1824 | }); |
---|
1770 | 1825 | presetpanel.add(skin); |
---|
1771 | 1826 | |
---|
1772 | | - cLabel rough2 = GetLabel("icons/shadericons/shadericon00001.png", !Grafreed.NIMBUSLAF); |
---|
1773 | | - rough2.addMouseListener(new MouseAdapter() |
---|
| 1827 | + cLabel lambert = GetLabel("icons/shadericons/shadericon00002.png", !Grafreed.NIMBUSLAF); |
---|
| 1828 | + lambert.setToolTipText("Diffuse"); |
---|
| 1829 | + lambert.addMouseListener(new MouseAdapter() |
---|
| 1830 | + { |
---|
| 1831 | + public void mouseClicked(MouseEvent e) |
---|
| 1832 | + { |
---|
| 1833 | + Object3D object = Grafreed.materials.versionlist[2].get(0); |
---|
| 1834 | + cMaterial material = object.material; |
---|
| 1835 | + |
---|
| 1836 | + diffusenessField.setFloat(material.factor); |
---|
| 1837 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1838 | + |
---|
| 1839 | + materialtouched = true; |
---|
| 1840 | + applySelf(); |
---|
| 1841 | + } |
---|
| 1842 | + }); |
---|
| 1843 | + presetpanel.add(lambert); |
---|
| 1844 | + |
---|
| 1845 | + cLabel diffuse2 = GetLabel("icons/shadericons/shadericon00003.png", !Grafreed.NIMBUSLAF); |
---|
| 1846 | + diffuse2.setToolTipText("Diffuse2"); |
---|
| 1847 | + diffuse2.addMouseListener(new MouseAdapter() |
---|
| 1848 | + { |
---|
| 1849 | + public void mouseClicked(MouseEvent e) |
---|
| 1850 | + { |
---|
| 1851 | + Object3D object = Grafreed.materials.versionlist[3].get(0); |
---|
| 1852 | + cMaterial material = object.material; |
---|
| 1853 | + |
---|
| 1854 | + diffusenessField.setFloat(material.factor); |
---|
| 1855 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1856 | + |
---|
| 1857 | + materialtouched = true; |
---|
| 1858 | + applySelf(); |
---|
| 1859 | + } |
---|
| 1860 | + }); |
---|
| 1861 | + presetpanel.add(diffuse2); |
---|
| 1862 | + |
---|
| 1863 | + cLabel diffusemoon = GetLabel("icons/shadericons/shadericon00004.png", !Grafreed.NIMBUSLAF); |
---|
| 1864 | + diffusemoon.setToolTipText("Moon"); |
---|
| 1865 | + diffusemoon.addMouseListener(new MouseAdapter() |
---|
| 1866 | + { |
---|
| 1867 | + public void mouseClicked(MouseEvent e) |
---|
| 1868 | + { |
---|
| 1869 | + Object3D object = Grafreed.materials.versionlist[4].get(0); |
---|
| 1870 | + cMaterial material = object.material; |
---|
| 1871 | + |
---|
| 1872 | + diffusenessField.setFloat(material.factor); |
---|
| 1873 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1874 | + |
---|
| 1875 | + materialtouched = true; |
---|
| 1876 | + applySelf(); |
---|
| 1877 | + } |
---|
| 1878 | + }); |
---|
| 1879 | + presetpanel.add(diffusemoon); |
---|
| 1880 | + |
---|
| 1881 | + cLabel diffusemoon2 = GetLabel("icons/shadericons/shadericon00005.png", !Grafreed.NIMBUSLAF); |
---|
| 1882 | + diffusemoon2.setToolTipText("Moon2"); |
---|
| 1883 | + diffusemoon2.addMouseListener(new MouseAdapter() |
---|
| 1884 | + { |
---|
| 1885 | + public void mouseClicked(MouseEvent e) |
---|
| 1886 | + { |
---|
| 1887 | + Object3D object = Grafreed.materials.versionlist[5].get(0); |
---|
| 1888 | + cMaterial material = object.material; |
---|
| 1889 | + |
---|
| 1890 | + diffusenessField.setFloat(material.factor); |
---|
| 1891 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1892 | + |
---|
| 1893 | + materialtouched = true; |
---|
| 1894 | + applySelf(); |
---|
| 1895 | + } |
---|
| 1896 | + }); |
---|
| 1897 | + presetpanel.add(diffusemoon2); |
---|
| 1898 | + |
---|
| 1899 | + cLabel diffusemoon3 = GetLabel("icons/shadericons/shadericon00006.png", !Grafreed.NIMBUSLAF); |
---|
| 1900 | + diffusemoon3.setToolTipText("Moon3"); |
---|
| 1901 | + diffusemoon3.addMouseListener(new MouseAdapter() |
---|
| 1902 | + { |
---|
| 1903 | + public void mouseClicked(MouseEvent e) |
---|
| 1904 | + { |
---|
| 1905 | + Object3D object = Grafreed.materials.versionlist[6].get(0); |
---|
| 1906 | + cMaterial material = object.material; |
---|
| 1907 | + |
---|
| 1908 | + diffusenessField.setFloat(material.factor); |
---|
| 1909 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1910 | + |
---|
| 1911 | + materialtouched = true; |
---|
| 1912 | + applySelf(); |
---|
| 1913 | + } |
---|
| 1914 | + }); |
---|
| 1915 | + presetpanel.add(diffusemoon3); |
---|
| 1916 | + |
---|
| 1917 | + cLabel diffusesheen = GetLabel("icons/shadericons/shadericon00007.png", !Grafreed.NIMBUSLAF); |
---|
| 1918 | + diffusesheen.setToolTipText("Sheen"); |
---|
| 1919 | + diffusesheen.addMouseListener(new MouseAdapter() |
---|
| 1920 | + { |
---|
| 1921 | + public void mouseClicked(MouseEvent e) |
---|
| 1922 | + { |
---|
| 1923 | + Object3D object = Grafreed.materials.versionlist[7].get(0); |
---|
| 1924 | + cMaterial material = object.material; |
---|
| 1925 | + |
---|
| 1926 | + sheenField.setFloat(material.sheen); |
---|
| 1927 | + |
---|
| 1928 | + materialtouched = true; |
---|
| 1929 | + applySelf(); |
---|
| 1930 | + } |
---|
| 1931 | + }); |
---|
| 1932 | + presetpanel.add(diffusesheen); |
---|
| 1933 | + |
---|
| 1934 | + cLabel rough = GetLabel("icons/shadericons/shadericon00001.png", !Grafreed.NIMBUSLAF); |
---|
| 1935 | + rough.setToolTipText("Rough metal"); |
---|
| 1936 | + rough.addMouseListener(new MouseAdapter() |
---|
1774 | 1937 | { |
---|
1775 | 1938 | public void mouseClicked(MouseEvent e) |
---|
1776 | 1939 | { |
---|
.. | .. |
---|
1784 | 1947 | applySelf(); |
---|
1785 | 1948 | } |
---|
1786 | 1949 | }); |
---|
| 1950 | + presetpanel.add(rough); |
---|
| 1951 | + |
---|
| 1952 | + cLabel rough2 = GetLabel("icons/shadericons/shadericon00013.png", !Grafreed.NIMBUSLAF); |
---|
| 1953 | + rough2.setToolTipText("Medium metal"); |
---|
| 1954 | + rough2.addMouseListener(new MouseAdapter() |
---|
| 1955 | + { |
---|
| 1956 | + public void mouseClicked(MouseEvent e) |
---|
| 1957 | + { |
---|
| 1958 | + Object3D object = Grafreed.materials.versionlist[13].get(0); |
---|
| 1959 | + cMaterial material = object.material; |
---|
| 1960 | + |
---|
| 1961 | + shininessField.setFloat(material.shininess); |
---|
| 1962 | + lightareaField.setFloat(material.lightarea); |
---|
| 1963 | + |
---|
| 1964 | + materialtouched = true; |
---|
| 1965 | + applySelf(); |
---|
| 1966 | + } |
---|
| 1967 | + }); |
---|
1787 | 1968 | presetpanel.add(rough2); |
---|
1788 | 1969 | |
---|
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)); |
---|
| 1970 | + cLabel shini0 = GetLabel("icons/shadericons/shadericon00014.png", !Grafreed.NIMBUSLAF); |
---|
| 1971 | + shini0.setToolTipText("Shiny"); |
---|
| 1972 | + shini0.addMouseListener(new MouseAdapter() |
---|
| 1973 | + { |
---|
| 1974 | + public void mouseClicked(MouseEvent e) |
---|
| 1975 | + { |
---|
| 1976 | + Object3D object = Grafreed.materials.versionlist[14].get(0); |
---|
| 1977 | + cMaterial material = object.material; |
---|
| 1978 | + |
---|
| 1979 | + shininessField.setFloat(material.shininess); |
---|
| 1980 | + lightareaField.setFloat(material.lightarea); |
---|
| 1981 | + |
---|
| 1982 | + materialtouched = true; |
---|
| 1983 | + applySelf(); |
---|
| 1984 | + } |
---|
| 1985 | + }); |
---|
| 1986 | + presetpanel.add(shini0); |
---|
| 1987 | + |
---|
| 1988 | + cLabel shini1 = GetLabel("icons/shadericons/shadericon00011.png", !Grafreed.NIMBUSLAF); |
---|
| 1989 | + shini1.setToolTipText("Shiny2"); |
---|
| 1990 | + shini1.addMouseListener(new MouseAdapter() |
---|
| 1991 | + { |
---|
| 1992 | + public void mouseClicked(MouseEvent e) |
---|
| 1993 | + { |
---|
| 1994 | + Object3D object = Grafreed.materials.versionlist[11].get(0); |
---|
| 1995 | + cMaterial material = object.material; |
---|
| 1996 | + |
---|
| 1997 | + shininessField.setFloat(material.shininess); |
---|
| 1998 | + lightareaField.setFloat(material.lightarea); |
---|
| 1999 | + |
---|
| 2000 | + materialtouched = true; |
---|
| 2001 | + applySelf(); |
---|
| 2002 | + } |
---|
| 2003 | + }); |
---|
| 2004 | + presetpanel.add(shini1); |
---|
| 2005 | + |
---|
| 2006 | + cLabel shini2 = GetLabel("icons/shadericons/shadericon00012.png", !Grafreed.NIMBUSLAF); |
---|
| 2007 | + shini2.setToolTipText("Shiny3"); |
---|
| 2008 | + shini2.addMouseListener(new MouseAdapter() |
---|
| 2009 | + { |
---|
| 2010 | + public void mouseClicked(MouseEvent e) |
---|
| 2011 | + { |
---|
| 2012 | + Object3D object = Grafreed.materials.versionlist[12].get(0); |
---|
| 2013 | + cMaterial material = object.material; |
---|
| 2014 | + |
---|
| 2015 | + shininessField.setFloat(material.shininess); |
---|
| 2016 | + lightareaField.setFloat(material.lightarea); |
---|
| 2017 | + |
---|
| 2018 | + materialtouched = true; |
---|
| 2019 | + applySelf(); |
---|
| 2020 | + } |
---|
| 2021 | + }); |
---|
| 2022 | + presetpanel.add(shini2); |
---|
| 2023 | + |
---|
| 2024 | + cLabel aniso = GetLabel("icons/shadericons/shadericon00008.png", !Grafreed.NIMBUSLAF); |
---|
| 2025 | + aniso.setToolTipText("AnisoU"); |
---|
| 2026 | + aniso.addMouseListener(new MouseAdapter() |
---|
| 2027 | + { |
---|
| 2028 | + public void mouseClicked(MouseEvent e) |
---|
| 2029 | + { |
---|
| 2030 | + Object3D object = Grafreed.materials.versionlist[8].get(0); |
---|
| 2031 | + cMaterial material = object.material; |
---|
| 2032 | + |
---|
| 2033 | + anisoField.setFloat(material.aniso); |
---|
| 2034 | + anisoVField.setFloat(material.anisoV); |
---|
| 2035 | + |
---|
| 2036 | + materialtouched = true; |
---|
| 2037 | + applySelf(); |
---|
| 2038 | + } |
---|
| 2039 | + }); |
---|
| 2040 | + presetpanel.add(aniso); |
---|
| 2041 | + |
---|
| 2042 | + cLabel aniso2 = GetLabel("icons/shadericons/shadericon00009.png", !Grafreed.NIMBUSLAF); |
---|
| 2043 | + aniso2.setToolTipText("AnisoV"); |
---|
| 2044 | + aniso2.addMouseListener(new MouseAdapter() |
---|
| 2045 | + { |
---|
| 2046 | + public void mouseClicked(MouseEvent e) |
---|
| 2047 | + { |
---|
| 2048 | + Object3D object = Grafreed.materials.versionlist[9].get(0); |
---|
| 2049 | + cMaterial material = object.material; |
---|
| 2050 | + |
---|
| 2051 | + anisoField.setFloat(material.aniso); |
---|
| 2052 | + anisoVField.setFloat(material.anisoV); |
---|
| 2053 | + |
---|
| 2054 | + materialtouched = true; |
---|
| 2055 | + applySelf(); |
---|
| 2056 | + } |
---|
| 2057 | + }); |
---|
| 2058 | + presetpanel.add(aniso2); |
---|
| 2059 | + |
---|
| 2060 | + cLabel aniso3 = GetLabel("icons/shadericons/shadericon00010.png", !Grafreed.NIMBUSLAF); |
---|
| 2061 | + aniso3.setToolTipText("AnisoUV"); |
---|
| 2062 | + aniso3.addMouseListener(new MouseAdapter() |
---|
| 2063 | + { |
---|
| 2064 | + public void mouseClicked(MouseEvent e) |
---|
| 2065 | + { |
---|
| 2066 | + Object3D object = Grafreed.materials.versionlist[10].get(0); |
---|
| 2067 | + cMaterial material = object.material; |
---|
| 2068 | + |
---|
| 2069 | + anisoField.setFloat(material.aniso); |
---|
| 2070 | + anisoVField.setFloat(material.anisoV); |
---|
| 2071 | + |
---|
| 2072 | + materialtouched = true; |
---|
| 2073 | + applySelf(); |
---|
| 2074 | + } |
---|
| 2075 | + }); |
---|
| 2076 | + presetpanel.add(aniso3); |
---|
| 2077 | + |
---|
| 2078 | + cLabel velvet0 = GetLabel("icons/shadericons/shadericon00015.png", !Grafreed.NIMBUSLAF); |
---|
| 2079 | + velvet0.setToolTipText("Velvet"); |
---|
| 2080 | + velvet0.addMouseListener(new MouseAdapter() |
---|
| 2081 | + { |
---|
| 2082 | + public void mouseClicked(MouseEvent e) |
---|
| 2083 | + { |
---|
| 2084 | + Object3D object = Grafreed.materials.versionlist[15].get(0); |
---|
| 2085 | + cMaterial material = object.material; |
---|
| 2086 | + |
---|
| 2087 | + diffusenessField.setFloat(material.factor); |
---|
| 2088 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 2089 | + sheenField.setFloat(material.sheen); |
---|
| 2090 | + shininessField.setFloat(material.shininess); |
---|
| 2091 | + velvetField.setFloat(material.velvet); |
---|
| 2092 | + shiftField.setFloat(material.shift); |
---|
| 2093 | + |
---|
| 2094 | + materialtouched = true; |
---|
| 2095 | + applySelf(); |
---|
| 2096 | + } |
---|
| 2097 | + }); |
---|
| 2098 | + presetpanel.add(velvet0); |
---|
| 2099 | + |
---|
| 2100 | + cLabel bump0 = GetLabel("icons/shadericons/shadericon00016.png", !Grafreed.NIMBUSLAF); |
---|
| 2101 | + bump0.setToolTipText("Bump texture"); |
---|
| 2102 | + bump0.addMouseListener(new MouseAdapter() |
---|
| 2103 | + { |
---|
| 2104 | + public void mouseClicked(MouseEvent e) |
---|
| 2105 | + { |
---|
| 2106 | + Object3D object = Grafreed.materials.versionlist[16].get(0); |
---|
| 2107 | + cMaterial material = object.material; |
---|
| 2108 | + |
---|
| 2109 | + bumpField.setFloat(object.projectedVertices[0].x / 1000.0); |
---|
| 2110 | + noiseField.setFloat(object.projectedVertices[0].y / 1000.0); |
---|
| 2111 | + powerField.setFloat(object.projectedVertices[2].x / 1000.0); |
---|
| 2112 | + |
---|
| 2113 | + materialtouched = true; |
---|
| 2114 | + applySelf(); |
---|
| 2115 | + } |
---|
| 2116 | + }); |
---|
| 2117 | + presetpanel.add(bump0); |
---|
| 2118 | + |
---|
| 2119 | + cLabel halo = GetLabel("icons/shadericons/shadericon00017.png", !Grafreed.NIMBUSLAF); |
---|
| 2120 | + halo.setToolTipText("Halo"); |
---|
| 2121 | + halo.addMouseListener(new MouseAdapter() |
---|
| 2122 | + { |
---|
| 2123 | + public void mouseClicked(MouseEvent e) |
---|
| 2124 | + { |
---|
| 2125 | + Object3D object = Grafreed.materials.versionlist[17].get(0); |
---|
| 2126 | + cMaterial material = object.material; |
---|
| 2127 | + |
---|
| 2128 | + opacityPowerField.setFloat(object.projectedVertices[2].y / 1000.0); |
---|
| 2129 | + |
---|
| 2130 | + materialtouched = true; |
---|
| 2131 | + applySelf(); |
---|
| 2132 | + } |
---|
| 2133 | + }); |
---|
| 2134 | + presetpanel.add(halo); |
---|
| 2135 | + |
---|
| 2136 | + cLabel candle = GetLabel("icons/shadericons/shadericon00018.png", !Grafreed.NIMBUSLAF); |
---|
| 2137 | + candle.setToolTipText("Candle"); |
---|
| 2138 | + candle.addMouseListener(new MouseAdapter() |
---|
| 2139 | + { |
---|
| 2140 | + public void mouseClicked(MouseEvent e) |
---|
| 2141 | + { |
---|
| 2142 | + Object3D object = Grafreed.materials.versionlist[18].get(0); |
---|
| 2143 | + cMaterial material = object.material; |
---|
| 2144 | + |
---|
| 2145 | + subsurfaceField.setFloat(material.subsurface); |
---|
| 2146 | + shadowbiasField.setFloat(material.shadowbias); |
---|
| 2147 | + ambientField.setFloat(material.ambient); |
---|
| 2148 | + specularField.setFloat(material.specular); |
---|
| 2149 | + lightareaField.setFloat(material.lightarea); |
---|
| 2150 | + shininessField.setFloat(material.shininess); |
---|
| 2151 | + |
---|
| 2152 | + materialtouched = true; |
---|
| 2153 | + applySelf(); |
---|
| 2154 | + } |
---|
| 2155 | + }); |
---|
| 2156 | + presetpanel.add(candle); |
---|
| 2157 | + |
---|
| 2158 | + cLabel shadowShader = GetLabel("icons/shadericons/shadow.png", !Grafreed.NIMBUSLAF); |
---|
| 2159 | + shadowShader.setToolTipText("Shadow"); |
---|
| 2160 | + shadowShader.addMouseListener(new MouseAdapter() |
---|
| 2161 | + { |
---|
| 2162 | + public void mouseClicked(MouseEvent e) |
---|
| 2163 | + { |
---|
| 2164 | + diffuseField.setFloat(0.001); |
---|
| 2165 | + ambientField.setFloat(0.001); |
---|
| 2166 | + cameraField.setFloat(0.001); |
---|
| 2167 | + specularField.setFloat(0.001); |
---|
| 2168 | + fakedepthField.setFloat(0.001); |
---|
| 2169 | + opacityField.setFloat(0.6); |
---|
| 2170 | + |
---|
| 2171 | + materialtouched = true; |
---|
| 2172 | + applySelf(); |
---|
| 2173 | + } |
---|
| 2174 | + }); |
---|
| 2175 | + presetpanel.add(shadowShader); |
---|
1805 | 2176 | |
---|
1806 | 2177 | cGridBag panel = new cGridBag().setVertical(true); |
---|
1807 | 2178 | |
---|
1808 | 2179 | presetpanel.preferredWidth = 1; |
---|
1809 | 2180 | |
---|
1810 | | - materialpanel.add(panel); |
---|
1811 | 2181 | materialpanel.add(presetpanel); |
---|
| 2182 | + materialpanel.add(panel); |
---|
1812 | 2183 | |
---|
1813 | 2184 | panel.preferredWidth = 8; |
---|
1814 | 2185 | |
---|
.. | .. |
---|
3275 | 3646 | public void itemStateChanged(ItemEvent event) |
---|
3276 | 3647 | { |
---|
3277 | 3648 | // System.out.println("Propagate = " + propagate); |
---|
| 3649 | + if (event.getSource() == pinButton) |
---|
| 3650 | + { |
---|
| 3651 | + copy.pinned ^= true; |
---|
| 3652 | + if (!copy.pinned && !copy.editWindow.copy.selection.contains(copy)) |
---|
| 3653 | + { |
---|
| 3654 | + ((GroupEditor)copy.editWindow).listUI.remove(copy); |
---|
| 3655 | + copy.CloseUI(); |
---|
| 3656 | + //copy.editWindow.refreshContents(); |
---|
| 3657 | + } |
---|
| 3658 | + } |
---|
| 3659 | + else |
---|
3278 | 3660 | if (event.getSource() == propagateToggle) |
---|
3279 | 3661 | { |
---|
3280 | 3662 | propagate ^= true; |
---|
.. | .. |
---|
3747 | 4129 | { |
---|
3748 | 4130 | //Save(true); |
---|
3749 | 4131 | Replace(); |
---|
3750 | | - SetUndoStates(); |
---|
| 4132 | + SetVersionStates(); |
---|
3751 | 4133 | } |
---|
3752 | 4134 | |
---|
3753 | 4135 | private boolean Equal(byte[] compress, byte[] name) |
---|
.. | .. |
---|
3777 | 4159 | |
---|
3778 | 4160 | CopyChanged(); |
---|
3779 | 4161 | |
---|
3780 | | - SetUndoStates(); |
---|
| 4162 | + SetVersionStates(); |
---|
3781 | 4163 | } |
---|
3782 | 4164 | |
---|
3783 | 4165 | public boolean Save(boolean user) |
---|
3784 | 4166 | { |
---|
3785 | 4167 | System.err.println("Save"); |
---|
3786 | | - //Replace(); |
---|
| 4168 | + Replace(); |
---|
3787 | 4169 | |
---|
3788 | | - cRadio tab = GetCurrentTab(); |
---|
| 4170 | + //cRadio tab = GetCurrentTab(); |
---|
3789 | 4171 | |
---|
3790 | | - Object3D compress = CompressCopy(); // Saved version. No need for "Replace"? |
---|
| 4172 | + Object3D compress = Duplicate(copy); // Saved version. No need for "Replace"? |
---|
3791 | 4173 | |
---|
3792 | 4174 | boolean thesame = false; |
---|
3793 | 4175 | |
---|
.. | .. |
---|
3823 | 4205 | // copy.versionlist[i] = null; |
---|
3824 | 4206 | // } |
---|
3825 | 4207 | |
---|
3826 | | - SetUndoStates(); |
---|
| 4208 | + SetVersionStates(); |
---|
3827 | 4209 | |
---|
3828 | 4210 | // test save |
---|
3829 | 4211 | if (false) |
---|
.. | .. |
---|
3881 | 4263 | |
---|
3882 | 4264 | void CopyChanged() |
---|
3883 | 4265 | { |
---|
3884 | | - Object3D obj = copy.versionlist[copy.versionindex]; |
---|
| 4266 | + Object3D obj = (Object3D)Grafreed.clone(copy.versionlist[copy.versionindex]); |
---|
3885 | 4267 | |
---|
3886 | | - SetUndoStates(); |
---|
| 4268 | + SetVersionStates(); |
---|
3887 | 4269 | |
---|
3888 | 4270 | boolean temp = CameraPane.SWITCH; |
---|
3889 | 4271 | CameraPane.SWITCH = false; |
---|
.. | .. |
---|
3950 | 4332 | return count; |
---|
3951 | 4333 | } |
---|
3952 | 4334 | |
---|
3953 | | - void SetUndoStates() |
---|
| 4335 | + void SetVersionStates() |
---|
3954 | 4336 | { |
---|
3955 | | - cRadio tab = GetCurrentTab(); |
---|
| 4337 | + //if (true) |
---|
| 4338 | + // return; |
---|
| 4339 | + |
---|
| 4340 | + //cRadio tab = GetCurrentTab(); |
---|
3956 | 4341 | |
---|
3957 | | - restoreButton.setEnabled(true); // copy.versionindex != -1); |
---|
3958 | | - replaceButton.setEnabled(true); // copy.versionindex != -1); |
---|
| 4342 | + restoreButton.setEnabled(copy.versionindex != -1); |
---|
| 4343 | + replaceButton.setEnabled(copy.versionindex != -1); |
---|
3959 | 4344 | |
---|
3960 | 4345 | previousVersionButton.setEnabled(copy.versionindex > 0); |
---|
3961 | 4346 | nextVersionButton.setEnabled(copy.versionlist[copy.versionindex + 1] != null); |
---|
.. | .. |
---|
3964 | 4349 | copy.versionlist[copy.versionindex + 1] != null); |
---|
3965 | 4350 | |
---|
3966 | 4351 | muteSlider = true; |
---|
| 4352 | + versionSlider.setMinimum(0); |
---|
3967 | 4353 | versionSlider.setMaximum(VersionCount() - 1); |
---|
3968 | 4354 | versionSlider.setInteger(copy.versionindex); |
---|
| 4355 | + versionSlider.setEnabled(copy.versionindex != -1); |
---|
3969 | 4356 | muteSlider = false; |
---|
3970 | 4357 | } |
---|
3971 | 4358 | |
---|
.. | .. |
---|
3976 | 4363 | |
---|
3977 | 4364 | System.err.println("Undo"); |
---|
3978 | 4365 | |
---|
3979 | | - cRadio tab = GetCurrentTab(); |
---|
| 4366 | + //cRadio tab = GetCurrentTab(); |
---|
3980 | 4367 | |
---|
3981 | 4368 | if (copy.versionindex == 0) |
---|
3982 | 4369 | { |
---|
.. | .. |
---|
4008 | 4395 | { |
---|
4009 | 4396 | System.err.println("Restore"); |
---|
4010 | 4397 | |
---|
4011 | | - cRadio tab = GetCurrentTab(); |
---|
| 4398 | + //cRadio tab = GetCurrentTab(); |
---|
4012 | 4399 | |
---|
4013 | 4400 | if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
4014 | 4401 | { |
---|
.. | .. |
---|
4026 | 4413 | { |
---|
4027 | 4414 | System.err.println("Replace"); |
---|
4028 | 4415 | |
---|
4029 | | - cRadio tab = GetCurrentTab(); |
---|
| 4416 | + //cRadio tab = GetCurrentTab(); |
---|
4030 | 4417 | |
---|
4031 | 4418 | if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
4032 | 4419 | { |
---|
.. | .. |
---|
4034 | 4421 | return false; |
---|
4035 | 4422 | } |
---|
4036 | 4423 | |
---|
4037 | | - copy.versionlist[copy.versionindex] = CompressCopy(); |
---|
| 4424 | + copy.versionlist[copy.versionindex] = Duplicate(copy); |
---|
4038 | 4425 | |
---|
4039 | 4426 | return true; |
---|
4040 | 4427 | } |
---|
.. | .. |
---|
4044 | 4431 | // Option? |
---|
4045 | 4432 | Replace(); |
---|
4046 | 4433 | |
---|
4047 | | - cRadio tab = GetCurrentTab(); |
---|
| 4434 | + //cRadio tab = GetCurrentTab(); |
---|
4048 | 4435 | |
---|
4049 | 4436 | if (copy.versionlist[copy.versionindex + 1] == null) |
---|
4050 | 4437 | { |
---|
.. | .. |
---|
4365 | 4752 | |
---|
4366 | 4753 | int version = versionSlider.getInteger(); |
---|
4367 | 4754 | |
---|
4368 | | - if (copy.versionlist[version] != null) |
---|
| 4755 | + if (version != -1 && copy.versionlist[version] != null) |
---|
4369 | 4756 | { |
---|
4370 | 4757 | copy.versionindex = version; |
---|
4371 | 4758 | CopyChanged(); |
---|
.. | .. |
---|
4409 | 4796 | //System.out.println("stateChanged = " + this); |
---|
4410 | 4797 | materialtouched = true; |
---|
4411 | 4798 | |
---|
4412 | | - if (e.getSource() == colorField && saturationField.getFloat() == 0.001) |
---|
| 4799 | + if (Globals.AUTOSATURATE && e.getSource() == colorField && saturationField.getFloat() == 0.001) |
---|
4413 | 4800 | { |
---|
4414 | 4801 | saturationField.setFloat(1); |
---|
4415 | 4802 | } |
---|
.. | .. |
---|
4724 | 5111 | } |
---|
4725 | 5112 | |
---|
4726 | 5113 | if (previousVersionButton != null && copy.versionlist != null) |
---|
4727 | | - SetUndoStates(); |
---|
| 5114 | + SetVersionStates(); |
---|
4728 | 5115 | } |
---|
4729 | 5116 | |
---|
4730 | 5117 | static TweenManager tweenManager = new TweenManager(); |
---|
.. | .. |
---|
5113 | 5500 | |
---|
5114 | 5501 | if (copy.versionlist == null) |
---|
5115 | 5502 | { |
---|
| 5503 | + // Backward compatibility |
---|
5116 | 5504 | copy.versionlist = new Object3D[100]; |
---|
5117 | 5505 | copy.versionindex = -1; |
---|
| 5506 | + |
---|
| 5507 | + Save(true); |
---|
5118 | 5508 | } |
---|
5119 | 5509 | |
---|
5120 | 5510 | //? SetUndoStates(); |
---|
.. | .. |
---|
5206 | 5596 | |
---|
5207 | 5597 | void save() |
---|
5208 | 5598 | { |
---|
| 5599 | + Replace(); |
---|
| 5600 | + |
---|
5209 | 5601 | if (lastname == null) |
---|
5210 | 5602 | { |
---|
5211 | 5603 | return; |
---|
.. | .. |
---|
5448 | 5840 | ButtonGroup buttonGroup; |
---|
5449 | 5841 | |
---|
5450 | 5842 | cGridBag toolboxPanel; |
---|
| 5843 | + cGridBag skyboxPanel; |
---|
5451 | 5844 | cGridBag materialPanel; |
---|
5452 | 5845 | cGridBag ctrlPanel; |
---|
5453 | 5846 | |
---|
.. | .. |
---|
5552 | 5945 | cNumberSlider anisoField; |
---|
5553 | 5946 | JLabel anisoVLabel; |
---|
5554 | 5947 | cNumberSlider anisoVField; |
---|
| 5948 | + |
---|
5555 | 5949 | JLabel cameraLabel; |
---|
5556 | 5950 | cNumberSlider cameraField; |
---|
5557 | 5951 | JLabel selfshadowLabel; |
---|
.. | .. |
---|
5566 | 5960 | cNumberSlider fakedepthField; |
---|
5567 | 5961 | JLabel shadowbiasLabel; |
---|
5568 | 5962 | cNumberSlider shadowbiasField; |
---|
| 5963 | + |
---|
5569 | 5964 | JLabel bumpLabel; |
---|
5570 | 5965 | cNumberSlider bumpField; |
---|
5571 | 5966 | JLabel noiseLabel; |
---|