.. | .. |
---|
848 | 848 | //frame.setVisible(true); |
---|
849 | 849 | } |
---|
850 | 850 | frame.validate(); |
---|
| 851 | + |
---|
| 852 | + cameraView.requestFocusInWindow(); |
---|
851 | 853 | } |
---|
852 | 854 | |
---|
853 | 855 | private Object3D CompressCopy() |
---|
.. | .. |
---|
1738 | 1740 | void SetupMaterial(cGridBag materialpanel) |
---|
1739 | 1741 | { |
---|
1740 | 1742 | cGridBag presetpanel = new cGridBag().setVertical(true); |
---|
1741 | | - cLabel label = GetLabel("icons/shadericons/shadericon00000.png", !Grafreed.NIMBUSLAF); |
---|
1742 | | - label.addMouseListener(new MouseAdapter() |
---|
| 1743 | + |
---|
| 1744 | + cLabel skin = GetLabel("icons/shadericons/shadericon00000.png", !Grafreed.NIMBUSLAF); |
---|
| 1745 | + skin.setToolTipText("Skin"); |
---|
| 1746 | + skin.addMouseListener(new MouseAdapter() |
---|
1743 | 1747 | { |
---|
1744 | 1748 | public void mouseClicked(MouseEvent e) |
---|
1745 | 1749 | { |
---|
1746 | | - colorField.setFloat(0); |
---|
1747 | | - saturationField.setFloat(1); |
---|
| 1750 | + Object3D object = Grafreed.materials.versionlist[0].get(0); |
---|
| 1751 | + cMaterial material = object.material; |
---|
| 1752 | + |
---|
| 1753 | + // Skin |
---|
| 1754 | + colorField.setFloat(material.color); |
---|
| 1755 | + saturationField.setFloat(material.modulation); |
---|
| 1756 | + subsurfaceField.setFloat(material.subsurface); |
---|
| 1757 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1758 | + diffusenessField.setFloat(material.factor); |
---|
| 1759 | + shininessField.setFloat(material.shininess); |
---|
| 1760 | + shadowbiasField.setFloat(material.shadowbias); |
---|
| 1761 | + diffuseField.setFloat(material.diffuse); |
---|
| 1762 | + specularField.setFloat(material.specular); |
---|
| 1763 | + |
---|
| 1764 | + bumpField.setFloat(object.projectedVertices[0].x / 1000.0); |
---|
| 1765 | + noiseField.setFloat(object.projectedVertices[0].y / 1000.0); |
---|
| 1766 | + powerField.setFloat(object.projectedVertices[2].x / 1000.0); |
---|
| 1767 | + |
---|
1748 | 1768 | materialtouched = true; |
---|
1749 | 1769 | applySelf(); |
---|
1750 | 1770 | } |
---|
1751 | 1771 | }); |
---|
1752 | | - presetpanel.add(label); |
---|
| 1772 | + presetpanel.add(skin); |
---|
1753 | 1773 | |
---|
1754 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00001.png", !Grafreed.NIMBUSLAF)); |
---|
1755 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00002.png", !Grafreed.NIMBUSLAF)); |
---|
1756 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00003.png", !Grafreed.NIMBUSLAF)); |
---|
1757 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00004.png", !Grafreed.NIMBUSLAF)); |
---|
1758 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00005.png", !Grafreed.NIMBUSLAF)); |
---|
1759 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00006.png", !Grafreed.NIMBUSLAF)); |
---|
1760 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00007.png", !Grafreed.NIMBUSLAF)); |
---|
1761 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00008.png", !Grafreed.NIMBUSLAF)); |
---|
1762 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00009.png", !Grafreed.NIMBUSLAF)); |
---|
1763 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00010.png", !Grafreed.NIMBUSLAF)); |
---|
1764 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00011.png", !Grafreed.NIMBUSLAF)); |
---|
1765 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00012.png", !Grafreed.NIMBUSLAF)); |
---|
1766 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00013.png", !Grafreed.NIMBUSLAF)); |
---|
1767 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00014.png", !Grafreed.NIMBUSLAF)); |
---|
1768 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00015.png", !Grafreed.NIMBUSLAF)); |
---|
1769 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00016.png", !Grafreed.NIMBUSLAF)); |
---|
1770 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00017.png", !Grafreed.NIMBUSLAF)); |
---|
1771 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00018.png", !Grafreed.NIMBUSLAF)); |
---|
1772 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00019.png", !Grafreed.NIMBUSLAF)); |
---|
1773 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00020.png", !Grafreed.NIMBUSLAF)); |
---|
| 1774 | + cLabel lambert = GetLabel("icons/shadericons/shadericon00002.png", !Grafreed.NIMBUSLAF); |
---|
| 1775 | + lambert.setToolTipText("Diffuse"); |
---|
| 1776 | + lambert.addMouseListener(new MouseAdapter() |
---|
| 1777 | + { |
---|
| 1778 | + public void mouseClicked(MouseEvent e) |
---|
| 1779 | + { |
---|
| 1780 | + Object3D object = Grafreed.materials.versionlist[2].get(0); |
---|
| 1781 | + cMaterial material = object.material; |
---|
| 1782 | + |
---|
| 1783 | + diffusenessField.setFloat(material.factor); |
---|
| 1784 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1785 | + |
---|
| 1786 | + materialtouched = true; |
---|
| 1787 | + applySelf(); |
---|
| 1788 | + } |
---|
| 1789 | + }); |
---|
| 1790 | + presetpanel.add(lambert); |
---|
| 1791 | + |
---|
| 1792 | + cLabel diffuse2 = GetLabel("icons/shadericons/shadericon00003.png", !Grafreed.NIMBUSLAF); |
---|
| 1793 | + diffuse2.setToolTipText("Diffuse2"); |
---|
| 1794 | + diffuse2.addMouseListener(new MouseAdapter() |
---|
| 1795 | + { |
---|
| 1796 | + public void mouseClicked(MouseEvent e) |
---|
| 1797 | + { |
---|
| 1798 | + Object3D object = Grafreed.materials.versionlist[3].get(0); |
---|
| 1799 | + cMaterial material = object.material; |
---|
| 1800 | + |
---|
| 1801 | + diffusenessField.setFloat(material.factor); |
---|
| 1802 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1803 | + |
---|
| 1804 | + materialtouched = true; |
---|
| 1805 | + applySelf(); |
---|
| 1806 | + } |
---|
| 1807 | + }); |
---|
| 1808 | + presetpanel.add(diffuse2); |
---|
| 1809 | + |
---|
| 1810 | + cLabel diffusemoon = GetLabel("icons/shadericons/shadericon00004.png", !Grafreed.NIMBUSLAF); |
---|
| 1811 | + diffusemoon.setToolTipText("Moon"); |
---|
| 1812 | + diffusemoon.addMouseListener(new MouseAdapter() |
---|
| 1813 | + { |
---|
| 1814 | + public void mouseClicked(MouseEvent e) |
---|
| 1815 | + { |
---|
| 1816 | + Object3D object = Grafreed.materials.versionlist[4].get(0); |
---|
| 1817 | + cMaterial material = object.material; |
---|
| 1818 | + |
---|
| 1819 | + diffusenessField.setFloat(material.factor); |
---|
| 1820 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1821 | + |
---|
| 1822 | + materialtouched = true; |
---|
| 1823 | + applySelf(); |
---|
| 1824 | + } |
---|
| 1825 | + }); |
---|
| 1826 | + presetpanel.add(diffusemoon); |
---|
| 1827 | + |
---|
| 1828 | + cLabel diffusemoon2 = GetLabel("icons/shadericons/shadericon00005.png", !Grafreed.NIMBUSLAF); |
---|
| 1829 | + diffusemoon2.setToolTipText("Moon2"); |
---|
| 1830 | + diffusemoon2.addMouseListener(new MouseAdapter() |
---|
| 1831 | + { |
---|
| 1832 | + public void mouseClicked(MouseEvent e) |
---|
| 1833 | + { |
---|
| 1834 | + Object3D object = Grafreed.materials.versionlist[5].get(0); |
---|
| 1835 | + cMaterial material = object.material; |
---|
| 1836 | + |
---|
| 1837 | + diffusenessField.setFloat(material.factor); |
---|
| 1838 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1839 | + |
---|
| 1840 | + materialtouched = true; |
---|
| 1841 | + applySelf(); |
---|
| 1842 | + } |
---|
| 1843 | + }); |
---|
| 1844 | + presetpanel.add(diffusemoon2); |
---|
| 1845 | + |
---|
| 1846 | + cLabel diffusemoon3 = GetLabel("icons/shadericons/shadericon00006.png", !Grafreed.NIMBUSLAF); |
---|
| 1847 | + diffusemoon3.setToolTipText("Moon3"); |
---|
| 1848 | + diffusemoon3.addMouseListener(new MouseAdapter() |
---|
| 1849 | + { |
---|
| 1850 | + public void mouseClicked(MouseEvent e) |
---|
| 1851 | + { |
---|
| 1852 | + Object3D object = Grafreed.materials.versionlist[6].get(0); |
---|
| 1853 | + cMaterial material = object.material; |
---|
| 1854 | + |
---|
| 1855 | + diffusenessField.setFloat(material.factor); |
---|
| 1856 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1857 | + |
---|
| 1858 | + materialtouched = true; |
---|
| 1859 | + applySelf(); |
---|
| 1860 | + } |
---|
| 1861 | + }); |
---|
| 1862 | + presetpanel.add(diffusemoon3); |
---|
| 1863 | + |
---|
| 1864 | + cLabel diffusesheen = GetLabel("icons/shadericons/shadericon00007.png", !Grafreed.NIMBUSLAF); |
---|
| 1865 | + diffusesheen.setToolTipText("Sheen"); |
---|
| 1866 | + diffusesheen.addMouseListener(new MouseAdapter() |
---|
| 1867 | + { |
---|
| 1868 | + public void mouseClicked(MouseEvent e) |
---|
| 1869 | + { |
---|
| 1870 | + Object3D object = Grafreed.materials.versionlist[7].get(0); |
---|
| 1871 | + cMaterial material = object.material; |
---|
| 1872 | + |
---|
| 1873 | + sheenField.setFloat(material.sheen); |
---|
| 1874 | + |
---|
| 1875 | + materialtouched = true; |
---|
| 1876 | + applySelf(); |
---|
| 1877 | + } |
---|
| 1878 | + }); |
---|
| 1879 | + presetpanel.add(diffusesheen); |
---|
| 1880 | + |
---|
| 1881 | + cLabel rough = GetLabel("icons/shadericons/shadericon00001.png", !Grafreed.NIMBUSLAF); |
---|
| 1882 | + rough.setToolTipText("Rough metal"); |
---|
| 1883 | + rough.addMouseListener(new MouseAdapter() |
---|
| 1884 | + { |
---|
| 1885 | + public void mouseClicked(MouseEvent e) |
---|
| 1886 | + { |
---|
| 1887 | + Object3D object = Grafreed.materials.versionlist[1].get(0); |
---|
| 1888 | + cMaterial material = object.material; |
---|
| 1889 | + |
---|
| 1890 | + shininessField.setFloat(material.shininess); |
---|
| 1891 | + velvetField.setFloat(material.velvet); |
---|
| 1892 | + |
---|
| 1893 | + materialtouched = true; |
---|
| 1894 | + applySelf(); |
---|
| 1895 | + } |
---|
| 1896 | + }); |
---|
| 1897 | + presetpanel.add(rough); |
---|
| 1898 | + |
---|
| 1899 | + cLabel rough2 = GetLabel("icons/shadericons/shadericon00013.png", !Grafreed.NIMBUSLAF); |
---|
| 1900 | + rough2.setToolTipText("Medium metal"); |
---|
| 1901 | + rough2.addMouseListener(new MouseAdapter() |
---|
| 1902 | + { |
---|
| 1903 | + public void mouseClicked(MouseEvent e) |
---|
| 1904 | + { |
---|
| 1905 | + Object3D object = Grafreed.materials.versionlist[13].get(0); |
---|
| 1906 | + cMaterial material = object.material; |
---|
| 1907 | + |
---|
| 1908 | + shininessField.setFloat(material.shininess); |
---|
| 1909 | + lightareaField.setFloat(material.lightarea); |
---|
| 1910 | + |
---|
| 1911 | + materialtouched = true; |
---|
| 1912 | + applySelf(); |
---|
| 1913 | + } |
---|
| 1914 | + }); |
---|
| 1915 | + presetpanel.add(rough2); |
---|
| 1916 | + |
---|
| 1917 | + cLabel shini0 = GetLabel("icons/shadericons/shadericon00014.png", !Grafreed.NIMBUSLAF); |
---|
| 1918 | + shini0.setToolTipText("Shiny"); |
---|
| 1919 | + shini0.addMouseListener(new MouseAdapter() |
---|
| 1920 | + { |
---|
| 1921 | + public void mouseClicked(MouseEvent e) |
---|
| 1922 | + { |
---|
| 1923 | + Object3D object = Grafreed.materials.versionlist[14].get(0); |
---|
| 1924 | + cMaterial material = object.material; |
---|
| 1925 | + |
---|
| 1926 | + shininessField.setFloat(material.shininess); |
---|
| 1927 | + lightareaField.setFloat(material.lightarea); |
---|
| 1928 | + |
---|
| 1929 | + materialtouched = true; |
---|
| 1930 | + applySelf(); |
---|
| 1931 | + } |
---|
| 1932 | + }); |
---|
| 1933 | + presetpanel.add(shini0); |
---|
| 1934 | + |
---|
| 1935 | + cLabel shini1 = GetLabel("icons/shadericons/shadericon00011.png", !Grafreed.NIMBUSLAF); |
---|
| 1936 | + shini1.setToolTipText("Shiny2"); |
---|
| 1937 | + shini1.addMouseListener(new MouseAdapter() |
---|
| 1938 | + { |
---|
| 1939 | + public void mouseClicked(MouseEvent e) |
---|
| 1940 | + { |
---|
| 1941 | + Object3D object = Grafreed.materials.versionlist[11].get(0); |
---|
| 1942 | + cMaterial material = object.material; |
---|
| 1943 | + |
---|
| 1944 | + shininessField.setFloat(material.shininess); |
---|
| 1945 | + lightareaField.setFloat(material.lightarea); |
---|
| 1946 | + |
---|
| 1947 | + materialtouched = true; |
---|
| 1948 | + applySelf(); |
---|
| 1949 | + } |
---|
| 1950 | + }); |
---|
| 1951 | + presetpanel.add(shini1); |
---|
| 1952 | + |
---|
| 1953 | + cLabel shini2 = GetLabel("icons/shadericons/shadericon00012.png", !Grafreed.NIMBUSLAF); |
---|
| 1954 | + shini2.setToolTipText("Shiny3"); |
---|
| 1955 | + shini2.addMouseListener(new MouseAdapter() |
---|
| 1956 | + { |
---|
| 1957 | + public void mouseClicked(MouseEvent e) |
---|
| 1958 | + { |
---|
| 1959 | + Object3D object = Grafreed.materials.versionlist[12].get(0); |
---|
| 1960 | + cMaterial material = object.material; |
---|
| 1961 | + |
---|
| 1962 | + shininessField.setFloat(material.shininess); |
---|
| 1963 | + lightareaField.setFloat(material.lightarea); |
---|
| 1964 | + |
---|
| 1965 | + materialtouched = true; |
---|
| 1966 | + applySelf(); |
---|
| 1967 | + } |
---|
| 1968 | + }); |
---|
| 1969 | + presetpanel.add(shini2); |
---|
| 1970 | + |
---|
| 1971 | + cLabel aniso = GetLabel("icons/shadericons/shadericon00008.png", !Grafreed.NIMBUSLAF); |
---|
| 1972 | + aniso.setToolTipText("AnisoU"); |
---|
| 1973 | + aniso.addMouseListener(new MouseAdapter() |
---|
| 1974 | + { |
---|
| 1975 | + public void mouseClicked(MouseEvent e) |
---|
| 1976 | + { |
---|
| 1977 | + Object3D object = Grafreed.materials.versionlist[8].get(0); |
---|
| 1978 | + cMaterial material = object.material; |
---|
| 1979 | + |
---|
| 1980 | + anisoField.setFloat(material.aniso); |
---|
| 1981 | + anisoVField.setFloat(material.anisoV); |
---|
| 1982 | + |
---|
| 1983 | + materialtouched = true; |
---|
| 1984 | + applySelf(); |
---|
| 1985 | + } |
---|
| 1986 | + }); |
---|
| 1987 | + presetpanel.add(aniso); |
---|
| 1988 | + |
---|
| 1989 | + cLabel aniso2 = GetLabel("icons/shadericons/shadericon00009.png", !Grafreed.NIMBUSLAF); |
---|
| 1990 | + aniso2.setToolTipText("AnisoV"); |
---|
| 1991 | + aniso2.addMouseListener(new MouseAdapter() |
---|
| 1992 | + { |
---|
| 1993 | + public void mouseClicked(MouseEvent e) |
---|
| 1994 | + { |
---|
| 1995 | + Object3D object = Grafreed.materials.versionlist[9].get(0); |
---|
| 1996 | + cMaterial material = object.material; |
---|
| 1997 | + |
---|
| 1998 | + anisoField.setFloat(material.aniso); |
---|
| 1999 | + anisoVField.setFloat(material.anisoV); |
---|
| 2000 | + |
---|
| 2001 | + materialtouched = true; |
---|
| 2002 | + applySelf(); |
---|
| 2003 | + } |
---|
| 2004 | + }); |
---|
| 2005 | + presetpanel.add(aniso2); |
---|
| 2006 | + |
---|
| 2007 | + cLabel aniso3 = GetLabel("icons/shadericons/shadericon00010.png", !Grafreed.NIMBUSLAF); |
---|
| 2008 | + aniso3.setToolTipText("AnisoUV"); |
---|
| 2009 | + aniso3.addMouseListener(new MouseAdapter() |
---|
| 2010 | + { |
---|
| 2011 | + public void mouseClicked(MouseEvent e) |
---|
| 2012 | + { |
---|
| 2013 | + Object3D object = Grafreed.materials.versionlist[10].get(0); |
---|
| 2014 | + cMaterial material = object.material; |
---|
| 2015 | + |
---|
| 2016 | + anisoField.setFloat(material.aniso); |
---|
| 2017 | + anisoVField.setFloat(material.anisoV); |
---|
| 2018 | + |
---|
| 2019 | + materialtouched = true; |
---|
| 2020 | + applySelf(); |
---|
| 2021 | + } |
---|
| 2022 | + }); |
---|
| 2023 | + presetpanel.add(aniso3); |
---|
| 2024 | + |
---|
| 2025 | + cLabel velvet0 = GetLabel("icons/shadericons/shadericon00015.png", !Grafreed.NIMBUSLAF); |
---|
| 2026 | + velvet0.setToolTipText("Velvet"); |
---|
| 2027 | + velvet0.addMouseListener(new MouseAdapter() |
---|
| 2028 | + { |
---|
| 2029 | + public void mouseClicked(MouseEvent e) |
---|
| 2030 | + { |
---|
| 2031 | + Object3D object = Grafreed.materials.versionlist[15].get(0); |
---|
| 2032 | + cMaterial material = object.material; |
---|
| 2033 | + |
---|
| 2034 | + diffusenessField.setFloat(material.factor); |
---|
| 2035 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 2036 | + sheenField.setFloat(material.sheen); |
---|
| 2037 | + shininessField.setFloat(material.shininess); |
---|
| 2038 | + velvetField.setFloat(material.velvet); |
---|
| 2039 | + shiftField.setFloat(material.shift); |
---|
| 2040 | + |
---|
| 2041 | + materialtouched = true; |
---|
| 2042 | + applySelf(); |
---|
| 2043 | + } |
---|
| 2044 | + }); |
---|
| 2045 | + presetpanel.add(velvet0); |
---|
| 2046 | + |
---|
| 2047 | + cLabel bump0 = GetLabel("icons/shadericons/shadericon00016.png", !Grafreed.NIMBUSLAF); |
---|
| 2048 | + bump0.setToolTipText("Bump texture"); |
---|
| 2049 | + bump0.addMouseListener(new MouseAdapter() |
---|
| 2050 | + { |
---|
| 2051 | + public void mouseClicked(MouseEvent e) |
---|
| 2052 | + { |
---|
| 2053 | + Object3D object = Grafreed.materials.versionlist[16].get(0); |
---|
| 2054 | + cMaterial material = object.material; |
---|
| 2055 | + |
---|
| 2056 | + bumpField.setFloat(object.projectedVertices[0].x / 1000.0); |
---|
| 2057 | + noiseField.setFloat(object.projectedVertices[0].y / 1000.0); |
---|
| 2058 | + powerField.setFloat(object.projectedVertices[2].x / 1000.0); |
---|
| 2059 | + |
---|
| 2060 | + materialtouched = true; |
---|
| 2061 | + applySelf(); |
---|
| 2062 | + } |
---|
| 2063 | + }); |
---|
| 2064 | + presetpanel.add(bump0); |
---|
| 2065 | + |
---|
| 2066 | + cLabel halo = GetLabel("icons/shadericons/shadericon00017.png", !Grafreed.NIMBUSLAF); |
---|
| 2067 | + halo.setToolTipText("Halo"); |
---|
| 2068 | + halo.addMouseListener(new MouseAdapter() |
---|
| 2069 | + { |
---|
| 2070 | + public void mouseClicked(MouseEvent e) |
---|
| 2071 | + { |
---|
| 2072 | + Object3D object = Grafreed.materials.versionlist[17].get(0); |
---|
| 2073 | + cMaterial material = object.material; |
---|
| 2074 | + |
---|
| 2075 | + opacityPowerField.setFloat(object.projectedVertices[2].y / 1000.0); |
---|
| 2076 | + |
---|
| 2077 | + materialtouched = true; |
---|
| 2078 | + applySelf(); |
---|
| 2079 | + } |
---|
| 2080 | + }); |
---|
| 2081 | + presetpanel.add(halo); |
---|
| 2082 | + |
---|
| 2083 | + cLabel candle = GetLabel("icons/shadericons/shadericon00018.png", !Grafreed.NIMBUSLAF); |
---|
| 2084 | + candle.setToolTipText("Candle"); |
---|
| 2085 | + candle.addMouseListener(new MouseAdapter() |
---|
| 2086 | + { |
---|
| 2087 | + public void mouseClicked(MouseEvent e) |
---|
| 2088 | + { |
---|
| 2089 | + Object3D object = Grafreed.materials.versionlist[18].get(0); |
---|
| 2090 | + cMaterial material = object.material; |
---|
| 2091 | + |
---|
| 2092 | + subsurfaceField.setFloat(material.subsurface); |
---|
| 2093 | + shadowbiasField.setFloat(material.shadowbias); |
---|
| 2094 | + ambientField.setFloat(material.ambient); |
---|
| 2095 | + specularField.setFloat(material.specular); |
---|
| 2096 | + lightareaField.setFloat(material.lightarea); |
---|
| 2097 | + shininessField.setFloat(material.shininess); |
---|
| 2098 | + |
---|
| 2099 | + materialtouched = true; |
---|
| 2100 | + applySelf(); |
---|
| 2101 | + } |
---|
| 2102 | + }); |
---|
| 2103 | + presetpanel.add(candle); |
---|
1774 | 2104 | |
---|
1775 | 2105 | cGridBag panel = new cGridBag().setVertical(true); |
---|
1776 | 2106 | |
---|
1777 | 2107 | presetpanel.preferredWidth = 1; |
---|
1778 | 2108 | |
---|
1779 | | - materialpanel.add(panel); |
---|
1780 | 2109 | materialpanel.add(presetpanel); |
---|
| 2110 | + materialpanel.add(panel); |
---|
1781 | 2111 | |
---|
1782 | 2112 | panel.preferredWidth = 8; |
---|
1783 | 2113 | |
---|
.. | .. |
---|
1821 | 2151 | |
---|
1822 | 2152 | cGridBag huepanel = new cGridBag(); |
---|
1823 | 2153 | cGridBag huelabel = new cGridBag(); |
---|
1824 | | - label = GetLabel("icons/hue.png", false); |
---|
1825 | | - label.fit = true; |
---|
1826 | | - huelabel.add(label); |
---|
| 2154 | + skin = GetLabel("icons/hue.png", false); |
---|
| 2155 | + skin.fit = true; |
---|
| 2156 | + huelabel.add(skin); |
---|
1827 | 2157 | huelabel.preferredWidth = 20; |
---|
1828 | 2158 | huepanel.add(new cGridBag()); // Label |
---|
1829 | 2159 | huepanel.add(huelabel); // Field/slider |
---|
.. | .. |
---|
3737 | 4067 | |
---|
3738 | 4068 | java.util.Hashtable<java.util.UUID, Object3D> versiontable = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
3739 | 4069 | |
---|
| 4070 | + void DeleteVersion() |
---|
| 4071 | + { |
---|
| 4072 | + for (int i = copy.versionindex; i < copy.versionlist.length-1; i++) |
---|
| 4073 | + { |
---|
| 4074 | + copy.versionlist[i] = copy.versionlist[i+1]; |
---|
| 4075 | + } |
---|
| 4076 | + |
---|
| 4077 | + CopyChanged(); |
---|
| 4078 | + |
---|
| 4079 | + SetUndoStates(); |
---|
| 4080 | + } |
---|
| 4081 | + |
---|
3740 | 4082 | public boolean Save(boolean user) |
---|
3741 | 4083 | { |
---|
3742 | 4084 | System.err.println("Save"); |
---|
3743 | | - Replace(); |
---|
| 4085 | + //Replace(); |
---|
3744 | 4086 | |
---|
3745 | 4087 | cRadio tab = GetCurrentTab(); |
---|
3746 | 4088 | |
---|
3747 | | - Object3D compress = CompressCopy(); // Saved version. No need for "Replace". |
---|
| 4089 | + Object3D compress = CompressCopy(); // Saved version. No need for "Replace"? |
---|
3748 | 4090 | |
---|
3749 | 4091 | boolean thesame = false; |
---|
3750 | 4092 | |
---|
.. | .. |
---|
3756 | 4098 | //EditorFrame.m_MainFrame.requestFocusInWindow(); |
---|
3757 | 4099 | if (!thesame) |
---|
3758 | 4100 | { |
---|
| 4101 | + for (int i = copy.versionlist.length; --i > copy.versionindex+1;) |
---|
| 4102 | + { |
---|
| 4103 | + copy.versionlist[i] = copy.versionlist[i-1]; |
---|
| 4104 | + } |
---|
| 4105 | + |
---|
3759 | 4106 | //tab.user[tab.versionindex] = user; |
---|
3760 | 4107 | //boolean increment = true; // tab.graphs[tab.versionindex] == null; |
---|
3761 | 4108 | |
---|
.. | .. |
---|
3769 | 4116 | |
---|
3770 | 4117 | //assert(hashtable.isEmpty()); |
---|
3771 | 4118 | |
---|
3772 | | - for (int i = copy.versionindex+1; i < copy.versionlist.length; i++) |
---|
3773 | | - { |
---|
3774 | | - //tab.user[i] = false; |
---|
3775 | | - copy.versionlist[i] = null; |
---|
3776 | | - } |
---|
| 4119 | +// for (int i = copy.versionindex+1; i < copy.versionlist.length; i++) |
---|
| 4120 | +// { |
---|
| 4121 | +// //tab.user[i] = false; |
---|
| 4122 | +// copy.versionlist[i] = null; |
---|
| 4123 | +// } |
---|
3777 | 4124 | |
---|
3778 | 4125 | SetUndoStates(); |
---|
3779 | 4126 | |
---|
.. | .. |
---|
3828 | 4175 | GetTree().addSelectionPath(selection.elementAt(i).GetTreePath().GetTreePath()); |
---|
3829 | 4176 | flashIt = true; |
---|
3830 | 4177 | |
---|
3831 | | - refreshContents(false); |
---|
| 4178 | + //refreshContents(false); |
---|
3832 | 4179 | } |
---|
3833 | 4180 | |
---|
3834 | | - void CopyChanged(Object3D obj) |
---|
| 4181 | + void CopyChanged() |
---|
3835 | 4182 | { |
---|
| 4183 | + Object3D obj = copy.versionlist[copy.versionindex]; |
---|
| 4184 | + |
---|
3836 | 4185 | SetUndoStates(); |
---|
3837 | 4186 | |
---|
3838 | 4187 | boolean temp = CameraPane.SWITCH; |
---|
.. | .. |
---|
3875 | 4224 | } |
---|
3876 | 4225 | } |
---|
3877 | 4226 | |
---|
3878 | | - refreshContents(); |
---|
| 4227 | + refreshContents(true); |
---|
3879 | 4228 | } |
---|
3880 | 4229 | |
---|
3881 | | - cButton undoButton; |
---|
| 4230 | + cButton previousVersionButton; |
---|
3882 | 4231 | cButton restoreButton; |
---|
3883 | 4232 | cButton replaceButton; |
---|
3884 | | - cButton redoButton; |
---|
| 4233 | + cButton nextVersionButton; |
---|
| 4234 | + cButton saveVersionButton; |
---|
| 4235 | + cButton deleteVersionButton; |
---|
3885 | 4236 | |
---|
3886 | 4237 | boolean muteSlider; |
---|
3887 | 4238 | |
---|
.. | .. |
---|
3902 | 4253 | { |
---|
3903 | 4254 | cRadio tab = GetCurrentTab(); |
---|
3904 | 4255 | |
---|
3905 | | - restoreButton.setEnabled(copy.versionindex != -1); |
---|
3906 | | - replaceButton.setEnabled(copy.versionindex != -1); |
---|
| 4256 | + restoreButton.setEnabled(true); // copy.versionindex != -1); |
---|
| 4257 | + replaceButton.setEnabled(true); // copy.versionindex != -1); |
---|
3907 | 4258 | |
---|
3908 | | - undoButton.setEnabled(copy.versionindex > 0); |
---|
3909 | | - redoButton.setEnabled(copy.versionlist[copy.versionindex + 1] != null); |
---|
| 4259 | + previousVersionButton.setEnabled(copy.versionindex > 0); |
---|
| 4260 | + nextVersionButton.setEnabled(copy.versionlist[copy.versionindex + 1] != null); |
---|
| 4261 | + |
---|
| 4262 | + deleteVersionButton.setEnabled(//copy.versionindex > 0 && |
---|
| 4263 | + copy.versionlist[copy.versionindex + 1] != null); |
---|
3910 | 4264 | |
---|
3911 | 4265 | muteSlider = true; |
---|
3912 | 4266 | versionSlider.setMaximum(VersionCount() - 1); |
---|
.. | .. |
---|
3914 | 4268 | muteSlider = false; |
---|
3915 | 4269 | } |
---|
3916 | 4270 | |
---|
3917 | | - public boolean Undo() |
---|
| 4271 | + public boolean PreviousVersion() |
---|
3918 | 4272 | { |
---|
3919 | 4273 | // Option? |
---|
3920 | 4274 | Replace(); |
---|
.. | .. |
---|
3944 | 4298 | |
---|
3945 | 4299 | copy.versionindex -= 1; |
---|
3946 | 4300 | |
---|
3947 | | - CopyChanged((Object3D)copy.versionlist[copy.versionindex]); |
---|
| 4301 | + CopyChanged(); |
---|
3948 | 4302 | |
---|
3949 | 4303 | return true; |
---|
3950 | 4304 | } |
---|
.. | .. |
---|
3962 | 4316 | } |
---|
3963 | 4317 | |
---|
3964 | 4318 | //CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
3965 | | - CopyChanged(copy.versionlist[copy.versionindex]); |
---|
| 4319 | + CopyChanged(); |
---|
3966 | 4320 | |
---|
3967 | 4321 | return true; |
---|
3968 | 4322 | } |
---|
.. | .. |
---|
3984 | 4338 | return true; |
---|
3985 | 4339 | } |
---|
3986 | 4340 | |
---|
3987 | | - public void Redo() |
---|
| 4341 | + public void NextVersion() |
---|
3988 | 4342 | { |
---|
3989 | 4343 | // Option? |
---|
3990 | 4344 | Replace(); |
---|
.. | .. |
---|
3999 | 4353 | |
---|
4000 | 4354 | copy.versionindex += 1; |
---|
4001 | 4355 | |
---|
4002 | | - CopyChanged(copy.versionlist[copy.versionindex]); |
---|
| 4356 | + CopyChanged(); |
---|
4003 | 4357 | |
---|
4004 | 4358 | //if (!tab.user[tab.versionindex]) |
---|
4005 | 4359 | // tab.graphs[tab.versionindex] = null; |
---|
.. | .. |
---|
4312 | 4666 | |
---|
4313 | 4667 | if (copy.versionlist[version] != null) |
---|
4314 | 4668 | { |
---|
4315 | | - CopyChanged(copy.versionlist[copy.versionindex = version]); |
---|
| 4669 | + copy.versionindex = version; |
---|
| 4670 | + CopyChanged(); |
---|
4316 | 4671 | } |
---|
4317 | 4672 | |
---|
4318 | 4673 | return; |
---|
.. | .. |
---|
4666 | 5021 | ctrlPanel.validate(); // ? new |
---|
4667 | 5022 | ctrlPanel.repaint(); |
---|
4668 | 5023 | } |
---|
| 5024 | + |
---|
| 5025 | + if (previousVersionButton != null && copy.versionlist != null) |
---|
| 5026 | + SetUndoStates(); |
---|
4669 | 5027 | } |
---|
4670 | 5028 | |
---|
4671 | 5029 | static TweenManager tweenManager = new TweenManager(); |
---|
.. | .. |
---|
5070 | 5428 | { |
---|
5071 | 5429 | if (Grafreed.standAlone) |
---|
5072 | 5430 | { |
---|
5073 | | - FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD); |
---|
| 5431 | + FileDialog browser = new FileDialog(frame, "Open", FileDialog.LOAD); |
---|
5074 | 5432 | browser.show(); |
---|
5075 | 5433 | String filename = browser.getFile(); |
---|
5076 | 5434 | if (filename != null && filename.length() > 0) |
---|