.. | .. |
---|
34 | 34 | iSendInfo |
---|
35 | 35 | //KeyListener |
---|
36 | 36 | { |
---|
| 37 | + public cToggleButton pinButton; |
---|
37 | 38 | boolean timeline; |
---|
38 | 39 | boolean wasFullScreen; |
---|
39 | 40 | |
---|
.. | .. |
---|
41 | 42 | JFrame frame; |
---|
42 | 43 | |
---|
43 | 44 | static ObjEditor theFrame; |
---|
| 45 | + |
---|
| 46 | + public void AllocProjectedVertices(Object3D object) |
---|
| 47 | + { |
---|
| 48 | + assert (object.projectedVertices != null); |
---|
| 49 | + |
---|
| 50 | + if (object.projectedVertices.length <= 2) |
---|
| 51 | + { |
---|
| 52 | + // Side effect... |
---|
| 53 | + Object3D.cVector2[] keep = object.projectedVertices; |
---|
| 54 | + object.projectedVertices = new Object3D.cVector2[3]; |
---|
| 55 | + for (int i = 0; i < 3; i++) |
---|
| 56 | + { |
---|
| 57 | + if (i < keep.length) |
---|
| 58 | + { |
---|
| 59 | + object.projectedVertices[i] = keep[i]; |
---|
| 60 | + } else |
---|
| 61 | + { |
---|
| 62 | + object.projectedVertices[i] = new Object3D.cVector2(); |
---|
| 63 | + } |
---|
| 64 | + /* |
---|
| 65 | + if(keep.length == 0) |
---|
| 66 | + object.projectedVertices[0] = new Object3D.cVector2(); |
---|
| 67 | + else |
---|
| 68 | + object.projectedVertices[0] = keep[0]; |
---|
| 69 | + object.projectedVertices[1] = new Object3D.cVector2(); |
---|
| 70 | + */ |
---|
| 71 | + } |
---|
| 72 | + } |
---|
| 73 | + } |
---|
| 74 | + |
---|
| 75 | + public cGridBag GetSeparator() |
---|
| 76 | + { |
---|
| 77 | + cGridBag separator = new cGridBag(); |
---|
| 78 | + separator.add(new JSeparator()); |
---|
| 79 | + separator.preferredHeight = 5; |
---|
| 80 | + return separator; |
---|
| 81 | + } |
---|
44 | 82 | |
---|
45 | 83 | cButton GetButton(String name, boolean border) |
---|
46 | 84 | { |
---|
47 | 85 | ImageIcon icon = GetIcon(name); |
---|
48 | 86 | return new cButton(icon, border); |
---|
| 87 | + } |
---|
| 88 | + |
---|
| 89 | + cLabel GetLabel(String name, boolean border) |
---|
| 90 | + { |
---|
| 91 | + //ImageIcon icon = GetIcon(name); |
---|
| 92 | + return new cLabel(GetImage(name), border); |
---|
49 | 93 | } |
---|
50 | 94 | |
---|
51 | 95 | cToggleButton GetToggleButton(String name, boolean border) |
---|
.. | .. |
---|
60 | 104 | return new cCheckBox(icon, border); |
---|
61 | 105 | } |
---|
62 | 106 | |
---|
| 107 | + static java.util.Hashtable<String, javax.swing.ImageIcon> icons = new java.util.Hashtable<String, javax.swing.ImageIcon>(); |
---|
| 108 | + |
---|
63 | 109 | ImageIcon GetIcon(String name) |
---|
64 | 110 | { |
---|
| 111 | + javax.swing.ImageIcon iconCache = icons.get(name); |
---|
| 112 | + if (iconCache != null) |
---|
| 113 | + { |
---|
| 114 | + return iconCache; |
---|
| 115 | + } |
---|
| 116 | + |
---|
65 | 117 | try |
---|
66 | 118 | { |
---|
67 | 119 | BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name)); |
---|
.. | .. |
---|
79 | 131 | // } |
---|
80 | 132 | |
---|
81 | 133 | javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image); |
---|
| 134 | + |
---|
| 135 | + icons.put(name, icon); |
---|
| 136 | + |
---|
82 | 137 | return icon; |
---|
| 138 | + } |
---|
| 139 | + catch (Exception e) |
---|
| 140 | + { |
---|
| 141 | + //icons.put(name, null); |
---|
| 142 | + return null; |
---|
| 143 | + } |
---|
| 144 | + } |
---|
| 145 | + |
---|
| 146 | + BufferedImage GetImage(String name) |
---|
| 147 | + { |
---|
| 148 | + try |
---|
| 149 | + { |
---|
| 150 | + BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name)); |
---|
| 151 | + |
---|
| 152 | + return image; |
---|
83 | 153 | } |
---|
84 | 154 | catch (Exception e) |
---|
85 | 155 | { |
---|
.. | .. |
---|
268 | 338 | client = inClient; |
---|
269 | 339 | copy = client; |
---|
270 | 340 | |
---|
271 | | - if (copy.versions == null) |
---|
272 | | - { |
---|
273 | | - copy.versions = new byte[100][]; |
---|
274 | | - copy.versionindex = -1; |
---|
275 | | - } |
---|
| 341 | +// if (copy.versionlist == null) |
---|
| 342 | +// { |
---|
| 343 | +// copy.versionlist = new Object3D[100]; |
---|
| 344 | +// copy.versionindex = -1; |
---|
| 345 | +// |
---|
| 346 | +// callee.Save(true); |
---|
| 347 | +// } |
---|
276 | 348 | |
---|
277 | 349 | // "this" is not called: SetupUI2(objEditor); |
---|
278 | 350 | } |
---|
.. | .. |
---|
287 | 359 | client = inClient; |
---|
288 | 360 | copy = client; |
---|
289 | 361 | |
---|
290 | | - if (copy.versions == null) |
---|
| 362 | + if (copy.versionlist == null) |
---|
291 | 363 | { |
---|
292 | | - copy.versions = new byte[100][]; |
---|
| 364 | + copy.versionlist = new Object3D[100]; |
---|
293 | 365 | copy.versionindex = -1; |
---|
| 366 | + |
---|
| 367 | +// Save(true); |
---|
294 | 368 | } |
---|
295 | 369 | |
---|
296 | 370 | SetupUI2(callee.GetEditor()); |
---|
.. | .. |
---|
325 | 399 | copy = localCopy; |
---|
326 | 400 | copy.editWindow = this; |
---|
327 | 401 | |
---|
328 | | - if (copy.versions == null) |
---|
329 | | - { |
---|
330 | | -// copy.versions = new byte[100][]; |
---|
| 402 | +// if (copy.versionlist == null) |
---|
| 403 | +// { |
---|
| 404 | +// copy.versionlist = new Object3D[100]; |
---|
331 | 405 | // copy.versionindex = -1; |
---|
332 | | - } |
---|
| 406 | +// |
---|
| 407 | +// Save(true); |
---|
| 408 | +// } |
---|
333 | 409 | |
---|
334 | 410 | SetupMenu(); |
---|
335 | 411 | |
---|
.. | .. |
---|
398 | 474 | |
---|
399 | 475 | ChangeListener changeListener = new ChangeListener() |
---|
400 | 476 | { |
---|
| 477 | + //String name; |
---|
| 478 | + |
---|
401 | 479 | public void stateChanged(ChangeEvent changeEvent) |
---|
402 | 480 | { |
---|
403 | 481 | // if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Material") && !materialFlushed) |
---|
.. | .. |
---|
416 | 494 | // EditSelection(false); |
---|
417 | 495 | // } |
---|
418 | 496 | |
---|
419 | | - refreshContents(false); // To refresh Info tab |
---|
| 497 | +// if (objectPanel.getSelectedIndex() == 4) |
---|
| 498 | +// { |
---|
| 499 | +// name = copy.skyboxname; |
---|
| 500 | +// |
---|
| 501 | +// if (name == null) |
---|
| 502 | +// { |
---|
| 503 | +// name = ""; |
---|
| 504 | +// } |
---|
| 505 | +// |
---|
| 506 | +// copy.skyboxname = "cubemaps/default-skyboxes/rgb"; |
---|
| 507 | +// copy.skyboxext = "jpg"; |
---|
| 508 | +// } |
---|
| 509 | +// else |
---|
| 510 | +// { |
---|
| 511 | +// if (name != null) |
---|
| 512 | +// { |
---|
| 513 | +// if (name.equals("")) |
---|
| 514 | +// { |
---|
| 515 | +// copy.skyboxname = null; |
---|
| 516 | +// copy.skyboxext = null; |
---|
| 517 | +// } |
---|
| 518 | +// else |
---|
| 519 | +// { |
---|
| 520 | +// copy.skyboxname = name; |
---|
| 521 | +// } |
---|
| 522 | +// } |
---|
| 523 | +// } |
---|
| 524 | + cameraView.transformMode = objectPanel.getSelectedIndex() == 4; |
---|
| 525 | + |
---|
| 526 | +// refreshContents(false); // To refresh Info tab |
---|
| 527 | + cameraView.repaint(); |
---|
420 | 528 | } |
---|
421 | 529 | }; |
---|
422 | 530 | objectPanel.addChangeListener(changeListener); |
---|
.. | .. |
---|
439 | 547 | toolboxPanel = new cGridBag().setVertical(true); |
---|
440 | 548 | //toolboxPanel.setName("Toolbox"); |
---|
441 | 549 | |
---|
442 | | - materialPanel = new cGridBag().setVertical(true); |
---|
| 550 | + skyboxPanel = new cGridBag().setVertical(true); |
---|
| 551 | + |
---|
| 552 | + materialPanel = new cGridBag().setVertical(false); |
---|
443 | 553 | //materialPanel.setName("Material"); |
---|
444 | 554 | |
---|
445 | 555 | /*JTextPane*/ |
---|
.. | .. |
---|
723 | 833 | boolean maximized; |
---|
724 | 834 | |
---|
725 | 835 | cButton fullscreenLayout; |
---|
| 836 | + cButton expandedLayout; |
---|
726 | 837 | |
---|
727 | 838 | void Minimize() |
---|
728 | 839 | { |
---|
.. | .. |
---|
762 | 873 | cButton minButton; |
---|
763 | 874 | cButton maxButton; |
---|
764 | 875 | cButton fullButton; |
---|
| 876 | + cButton collapseButton; |
---|
| 877 | + cButton maximize3DButton; |
---|
765 | 878 | |
---|
766 | 879 | void ToggleFullScreen() |
---|
767 | 880 | { |
---|
768 | | -GraphicsDevice device = frame.getGraphicsConfiguration().getDevice(); |
---|
| 881 | + GraphicsDevice device = frame.getGraphicsConfiguration().getDevice(); |
---|
769 | 882 | |
---|
770 | 883 | cameraView.ToggleFullScreen(); |
---|
771 | 884 | |
---|
.. | .. |
---|
786 | 899 | // X frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
787 | 900 | // X framePanel.add(bigThree); |
---|
788 | 901 | // X frame.getContentPane().add(/*"Center",*/framePanel); |
---|
789 | | - framePanel.setDividerLocation(46); |
---|
| 902 | +// framePanel.setDividerLocation(46); // icons are 24x24 |
---|
790 | 903 | |
---|
791 | 904 | //frame.setVisible(true); |
---|
792 | | - radio.layout = keepButton; |
---|
| 905 | +// radio.layout = keepButton; |
---|
793 | 906 | //theFrame = null; |
---|
794 | 907 | keepButton = null; |
---|
795 | | - radio.layout.doClick(); |
---|
| 908 | +// radio.layout.doClick(); |
---|
796 | 909 | |
---|
797 | 910 | } else |
---|
798 | 911 | { |
---|
.. | .. |
---|
813 | 926 | // X frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
814 | 927 | // X framePanel.remove(bigThree); |
---|
815 | 928 | // X frame.getContentPane().add(/*"Center",*/bigThree); |
---|
816 | | - framePanel.setDividerLocation(0); |
---|
| 929 | +// framePanel.setDividerLocation(0); |
---|
817 | 930 | |
---|
818 | | - radio.layout = fullscreenLayout; |
---|
819 | | - radio.layout.doClick(); |
---|
| 931 | +// radio.layout = fullscreenLayout; |
---|
| 932 | +// radio.layout.doClick(); |
---|
820 | 933 | //frame.setVisible(true); |
---|
821 | 934 | } |
---|
822 | 935 | frame.validate(); |
---|
| 936 | + |
---|
| 937 | + cameraView.requestFocusInWindow(); |
---|
823 | 938 | } |
---|
824 | 939 | |
---|
825 | | - private byte[] CompressCopy() |
---|
| 940 | + void CollapseToolbar() |
---|
| 941 | + { |
---|
| 942 | + framePanel.setDividerLocation(0); |
---|
| 943 | + //frame.validate(); |
---|
| 944 | + |
---|
| 945 | + cameraView.requestFocusInWindow(); |
---|
| 946 | + } |
---|
| 947 | + |
---|
| 948 | + private Object3D Duplicate(Object3D object) |
---|
826 | 949 | { |
---|
827 | 950 | boolean temp = CameraPane.SWITCH; |
---|
828 | 951 | CameraPane.SWITCH = false; |
---|
829 | 952 | |
---|
830 | | - copy.ExtractBigData(versiontable); |
---|
| 953 | + object.ExtractBigData(versiontable); |
---|
831 | 954 | // if (copy == client) |
---|
832 | 955 | |
---|
833 | | - byte[] versions[] = copy.versions; |
---|
834 | | - copy.versions = null; |
---|
| 956 | + Object3D versions[] = object.versionlist; |
---|
| 957 | + object.versionlist = null; |
---|
835 | 958 | |
---|
836 | | - byte[] compress = Compress(copy); |
---|
| 959 | + //byte[] compress = Compress(copy); |
---|
| 960 | + Object3D compress = (Object3D)Grafreed.clone(object); |
---|
837 | 961 | |
---|
838 | | - copy.versions = versions; |
---|
| 962 | + object.versionlist = versions; |
---|
839 | 963 | |
---|
840 | | - copy.RestoreBigData(versiontable); |
---|
| 964 | + object.RestoreBigData(versiontable); |
---|
841 | 965 | |
---|
842 | 966 | CameraPane.SWITCH = temp; |
---|
843 | 967 | |
---|
.. | .. |
---|
965 | 1089 | { |
---|
966 | 1090 | SetupMaterial(materialPanel); |
---|
967 | 1091 | } |
---|
| 1092 | + |
---|
968 | 1093 | //SetupName(); |
---|
969 | 1094 | //SetupViews(); |
---|
970 | 1095 | } |
---|
.. | .. |
---|
1173 | 1298 | |
---|
1174 | 1299 | namePanel = new cGridBag(); |
---|
1175 | 1300 | |
---|
| 1301 | + //if (copy.pinned) |
---|
| 1302 | + { |
---|
| 1303 | + pinButton = GetToggleButton("icons/pin.png", !Grafreed.NIMBUSLAF); |
---|
| 1304 | + pinButton.setSelected(copy.pinned); |
---|
| 1305 | + cGridBag t = new cGridBag(); |
---|
| 1306 | + t.preferredWidth = 2; |
---|
| 1307 | + t.add(pinButton); |
---|
| 1308 | + namePanel.add(t); |
---|
| 1309 | + |
---|
| 1310 | + pinButton.addItemListener(this); |
---|
| 1311 | + } |
---|
| 1312 | + |
---|
1176 | 1313 | nameField = AddText(namePanel, copy.GetName()); |
---|
1177 | 1314 | namePanel.add(new JScrollPane(nameField, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER)); |
---|
1178 | 1315 | oe.ctrlPanel.add(namePanel); |
---|
.. | .. |
---|
1522 | 1659 | //tmp.setName("Edit"); |
---|
1523 | 1660 | objectPanel.add(materialPanel); |
---|
1524 | 1661 | objectPanel.setIconAt(0, GetIcon("icons/material.png")); |
---|
| 1662 | + objectPanel.setToolTipTextAt(0, "Material"); |
---|
| 1663 | + |
---|
| 1664 | + objectPanel.add(toolboxPanel); |
---|
| 1665 | + objectPanel.setIconAt(1, GetIcon("icons/primitives.png")); |
---|
| 1666 | + objectPanel.setToolTipTextAt(1, "Objects & textures"); |
---|
| 1667 | + |
---|
| 1668 | + objectPanel.add(skyboxPanel); |
---|
| 1669 | + objectPanel.setIconAt(2, GetIcon("icons/skybox.jpg")); |
---|
| 1670 | + objectPanel.setToolTipTextAt(2, "Backgrounds"); |
---|
| 1671 | + |
---|
1525 | 1672 | // JPanel north = new JPanel(new BorderLayout()); |
---|
1526 | 1673 | // north.setName("Edit"); |
---|
1527 | 1674 | // north.add(ctrlPanel, BorderLayout.NORTH); |
---|
1528 | 1675 | // objectPanel.add(north); |
---|
1529 | 1676 | objectPanel.add(editPanel); |
---|
1530 | | - objectPanel.setIconAt(1, GetIcon("icons/write.png")); |
---|
1531 | | - |
---|
1532 | | - //if (Globals.ADVANCED) |
---|
1533 | | - objectPanel.add(infoPanel); |
---|
1534 | | - objectPanel.setIconAt(2, GetIcon("icons/info.png")); |
---|
| 1677 | + objectPanel.setIconAt(3, GetIcon("icons/write.png")); |
---|
| 1678 | + objectPanel.setToolTipTextAt(3, "Edit controls"); |
---|
1535 | 1679 | |
---|
1536 | 1680 | objectPanel.add(XYZPanel); |
---|
1537 | | - objectPanel.setIconAt(3, GetIcon("icons/XYZ.png")); |
---|
| 1681 | + objectPanel.setIconAt(4, GetIcon("icons/XYZ.png")); |
---|
| 1682 | + objectPanel.setToolTipTextAt(4, "XYZ/RGB transform"); |
---|
1538 | 1683 | |
---|
1539 | | - objectPanel.add(toolboxPanel); |
---|
1540 | | - objectPanel.setIconAt(4, GetIcon("icons/primitives.png")); |
---|
1541 | | - |
---|
1542 | 1684 | /* |
---|
1543 | 1685 | aConstraints.gridx = 0; |
---|
1544 | 1686 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1575 | 1717 | |
---|
1576 | 1718 | scenePanel.add(tabbedPane); |
---|
1577 | 1719 | |
---|
| 1720 | + //if (Globals.ADVANCED) |
---|
| 1721 | +// tabbedPane.add(infoPanel); |
---|
| 1722 | +// tabbedPane.setIconAt(3, GetIcon("icons/info.png")); |
---|
| 1723 | +// tabbedPane.setToolTipTextAt(3, "Information"); |
---|
| 1724 | + |
---|
1578 | 1725 | /* |
---|
1579 | 1726 | cTree jTree = new cTree(null); |
---|
1580 | 1727 | ToolTipManager.sharedInstance().registerComponent(jTree); |
---|
.. | .. |
---|
1634 | 1781 | /**/ |
---|
1635 | 1782 | |
---|
1636 | 1783 | bigThree = new cGridBag(); |
---|
1637 | | - bigThree.addComponent(centralPanel); |
---|
1638 | 1784 | bigThree.addComponent(scenePanel); |
---|
| 1785 | + bigThree.addComponent(centralPanel); |
---|
1639 | 1786 | //bigThree.addComponent(XYZPanel); |
---|
1640 | 1787 | |
---|
1641 | 1788 | // // SIDE EFFECT!!! |
---|
.. | .. |
---|
1645 | 1792 | // aConstraints.gridheight = 1; |
---|
1646 | 1793 | |
---|
1647 | 1794 | framePanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, toolbarPanel, bigThree); |
---|
| 1795 | + |
---|
| 1796 | + framePanel.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY, |
---|
| 1797 | + new java.beans.PropertyChangeListener() |
---|
| 1798 | + { |
---|
| 1799 | + public void propertyChange(java.beans.PropertyChangeEvent pce) |
---|
| 1800 | + { |
---|
| 1801 | + if ((Integer)pce.getOldValue() == 1) |
---|
| 1802 | + { |
---|
| 1803 | + if (radio.layout != expandedLayout) |
---|
| 1804 | + { |
---|
| 1805 | + radio.layout = expandedLayout; |
---|
| 1806 | + radio.layout.doClick(); |
---|
| 1807 | + } |
---|
| 1808 | + } |
---|
| 1809 | + } |
---|
| 1810 | + }); |
---|
| 1811 | + |
---|
1648 | 1812 | framePanel.setContinuousLayout(false); |
---|
1649 | 1813 | framePanel.setOneTouchExpandable(false); |
---|
1650 | 1814 | //.setDividerLocation(0.8); |
---|
.. | .. |
---|
1654 | 1818 | |
---|
1655 | 1819 | frame.getContentPane().setLayout(new BorderLayout()); |
---|
1656 | 1820 | /**/ |
---|
1657 | | - JTabbedPane worldPane = new JTabbedPane(); |
---|
| 1821 | + //JTabbedPane worldPane = new JTabbedPane(); |
---|
1658 | 1822 | //worldPane.add(bigPanel); |
---|
1659 | 1823 | //worldPane.add(worldPanel); |
---|
1660 | 1824 | /**/ |
---|
.. | .. |
---|
1677 | 1841 | frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); |
---|
1678 | 1842 | frame.addWindowListener(new WindowAdapter() |
---|
1679 | 1843 | { |
---|
1680 | | - |
---|
1681 | 1844 | public void windowClosing(WindowEvent e) |
---|
1682 | 1845 | { |
---|
1683 | 1846 | Close(); |
---|
.. | .. |
---|
1700 | 1863 | ctrlPanel.removeAll(); |
---|
1701 | 1864 | } |
---|
1702 | 1865 | |
---|
1703 | | - void SetupMaterial(cGridBag panel) |
---|
| 1866 | + void SetupMaterial(cGridBag materialpanel) |
---|
1704 | 1867 | { |
---|
1705 | | - /* |
---|
| 1868 | + cGridBag presetpanel = new cGridBag().setVertical(true); |
---|
| 1869 | + |
---|
| 1870 | + cLabel skin = GetLabel("icons/shadericons/shadericon00000.png", !Grafreed.NIMBUSLAF); |
---|
| 1871 | + skin.setToolTipText("Skin"); |
---|
| 1872 | + skin.addMouseListener(new MouseAdapter() |
---|
| 1873 | + { |
---|
| 1874 | + public void mouseClicked(MouseEvent e) |
---|
| 1875 | + { |
---|
| 1876 | + Object3D object = Grafreed.materials.versionlist[0].get(0); |
---|
| 1877 | + cMaterial material = object.material; |
---|
| 1878 | + |
---|
| 1879 | + // Skin |
---|
| 1880 | + colorField.setFloat(material.color); |
---|
| 1881 | + saturationField.setFloat(material.modulation); |
---|
| 1882 | + subsurfaceField.setFloat(material.subsurface); |
---|
| 1883 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1884 | + diffusenessField.setFloat(material.factor); |
---|
| 1885 | + shininessField.setFloat(material.shininess); |
---|
| 1886 | + shadowbiasField.setFloat(material.shadowbias); |
---|
| 1887 | + diffuseField.setFloat(material.diffuse); |
---|
| 1888 | + specularField.setFloat(material.specular); |
---|
| 1889 | + |
---|
| 1890 | + bumpField.setFloat(object.projectedVertices[0].x / 1000.0); |
---|
| 1891 | + noiseField.setFloat(object.projectedVertices[0].y / 1000.0); |
---|
| 1892 | + powerField.setFloat(object.projectedVertices[2].x / 1000.0); |
---|
| 1893 | + |
---|
| 1894 | + materialtouched = true; |
---|
| 1895 | + applySelf(); |
---|
| 1896 | + } |
---|
| 1897 | + }); |
---|
| 1898 | + presetpanel.add(skin); |
---|
| 1899 | + |
---|
| 1900 | + cLabel lambert = GetLabel("icons/shadericons/shadericon00002.png", !Grafreed.NIMBUSLAF); |
---|
| 1901 | + lambert.setToolTipText("Diffuse"); |
---|
| 1902 | + lambert.addMouseListener(new MouseAdapter() |
---|
| 1903 | + { |
---|
| 1904 | + public void mouseClicked(MouseEvent e) |
---|
| 1905 | + { |
---|
| 1906 | + Object3D object = Grafreed.materials.versionlist[2].get(0); |
---|
| 1907 | + cMaterial material = object.material; |
---|
| 1908 | + |
---|
| 1909 | + diffusenessField.setFloat(material.factor); |
---|
| 1910 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1911 | + |
---|
| 1912 | + materialtouched = true; |
---|
| 1913 | + applySelf(); |
---|
| 1914 | + } |
---|
| 1915 | + }); |
---|
| 1916 | + presetpanel.add(lambert); |
---|
| 1917 | + |
---|
| 1918 | + cLabel diffuse2 = GetLabel("icons/shadericons/shadericon00003.png", !Grafreed.NIMBUSLAF); |
---|
| 1919 | + diffuse2.setToolTipText("Diffuse2"); |
---|
| 1920 | + diffuse2.addMouseListener(new MouseAdapter() |
---|
| 1921 | + { |
---|
| 1922 | + public void mouseClicked(MouseEvent e) |
---|
| 1923 | + { |
---|
| 1924 | + Object3D object = Grafreed.materials.versionlist[3].get(0); |
---|
| 1925 | + cMaterial material = object.material; |
---|
| 1926 | + |
---|
| 1927 | + diffusenessField.setFloat(material.factor); |
---|
| 1928 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1929 | + |
---|
| 1930 | + materialtouched = true; |
---|
| 1931 | + applySelf(); |
---|
| 1932 | + } |
---|
| 1933 | + }); |
---|
| 1934 | + presetpanel.add(diffuse2); |
---|
| 1935 | + |
---|
| 1936 | + cLabel diffusemoon = GetLabel("icons/shadericons/shadericon00004.png", !Grafreed.NIMBUSLAF); |
---|
| 1937 | + diffusemoon.setToolTipText("Moon"); |
---|
| 1938 | + diffusemoon.addMouseListener(new MouseAdapter() |
---|
| 1939 | + { |
---|
| 1940 | + public void mouseClicked(MouseEvent e) |
---|
| 1941 | + { |
---|
| 1942 | + Object3D object = Grafreed.materials.versionlist[4].get(0); |
---|
| 1943 | + cMaterial material = object.material; |
---|
| 1944 | + |
---|
| 1945 | + diffusenessField.setFloat(material.factor); |
---|
| 1946 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1947 | + |
---|
| 1948 | + materialtouched = true; |
---|
| 1949 | + applySelf(); |
---|
| 1950 | + } |
---|
| 1951 | + }); |
---|
| 1952 | + presetpanel.add(diffusemoon); |
---|
| 1953 | + |
---|
| 1954 | + cLabel diffusemoon2 = GetLabel("icons/shadericons/shadericon00005.png", !Grafreed.NIMBUSLAF); |
---|
| 1955 | + diffusemoon2.setToolTipText("Moon2"); |
---|
| 1956 | + diffusemoon2.addMouseListener(new MouseAdapter() |
---|
| 1957 | + { |
---|
| 1958 | + public void mouseClicked(MouseEvent e) |
---|
| 1959 | + { |
---|
| 1960 | + Object3D object = Grafreed.materials.versionlist[5].get(0); |
---|
| 1961 | + cMaterial material = object.material; |
---|
| 1962 | + |
---|
| 1963 | + diffusenessField.setFloat(material.factor); |
---|
| 1964 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1965 | + |
---|
| 1966 | + materialtouched = true; |
---|
| 1967 | + applySelf(); |
---|
| 1968 | + } |
---|
| 1969 | + }); |
---|
| 1970 | + presetpanel.add(diffusemoon2); |
---|
| 1971 | + |
---|
| 1972 | + cLabel diffusemoon3 = GetLabel("icons/shadericons/shadericon00006.png", !Grafreed.NIMBUSLAF); |
---|
| 1973 | + diffusemoon3.setToolTipText("Moon3"); |
---|
| 1974 | + diffusemoon3.addMouseListener(new MouseAdapter() |
---|
| 1975 | + { |
---|
| 1976 | + public void mouseClicked(MouseEvent e) |
---|
| 1977 | + { |
---|
| 1978 | + Object3D object = Grafreed.materials.versionlist[6].get(0); |
---|
| 1979 | + cMaterial material = object.material; |
---|
| 1980 | + |
---|
| 1981 | + diffusenessField.setFloat(material.factor); |
---|
| 1982 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1983 | + |
---|
| 1984 | + materialtouched = true; |
---|
| 1985 | + applySelf(); |
---|
| 1986 | + } |
---|
| 1987 | + }); |
---|
| 1988 | + presetpanel.add(diffusemoon3); |
---|
| 1989 | + |
---|
| 1990 | + cLabel diffusesheen = GetLabel("icons/shadericons/shadericon00007.png", !Grafreed.NIMBUSLAF); |
---|
| 1991 | + diffusesheen.setToolTipText("Sheen"); |
---|
| 1992 | + diffusesheen.addMouseListener(new MouseAdapter() |
---|
| 1993 | + { |
---|
| 1994 | + public void mouseClicked(MouseEvent e) |
---|
| 1995 | + { |
---|
| 1996 | + Object3D object = Grafreed.materials.versionlist[7].get(0); |
---|
| 1997 | + cMaterial material = object.material; |
---|
| 1998 | + |
---|
| 1999 | + sheenField.setFloat(material.sheen); |
---|
| 2000 | + |
---|
| 2001 | + materialtouched = true; |
---|
| 2002 | + applySelf(); |
---|
| 2003 | + } |
---|
| 2004 | + }); |
---|
| 2005 | + presetpanel.add(diffusesheen); |
---|
| 2006 | + |
---|
| 2007 | + cLabel rough = GetLabel("icons/shadericons/shadericon00001.png", !Grafreed.NIMBUSLAF); |
---|
| 2008 | + rough.setToolTipText("Rough metal"); |
---|
| 2009 | + rough.addMouseListener(new MouseAdapter() |
---|
| 2010 | + { |
---|
| 2011 | + public void mouseClicked(MouseEvent e) |
---|
| 2012 | + { |
---|
| 2013 | + Object3D object = Grafreed.materials.versionlist[1].get(0); |
---|
| 2014 | + cMaterial material = object.material; |
---|
| 2015 | + |
---|
| 2016 | + shininessField.setFloat(material.shininess); |
---|
| 2017 | + velvetField.setFloat(material.velvet); |
---|
| 2018 | + |
---|
| 2019 | + materialtouched = true; |
---|
| 2020 | + applySelf(); |
---|
| 2021 | + } |
---|
| 2022 | + }); |
---|
| 2023 | + presetpanel.add(rough); |
---|
| 2024 | + |
---|
| 2025 | + cLabel rough2 = GetLabel("icons/shadericons/shadericon00013.png", !Grafreed.NIMBUSLAF); |
---|
| 2026 | + rough2.setToolTipText("Medium metal"); |
---|
| 2027 | + rough2.addMouseListener(new MouseAdapter() |
---|
| 2028 | + { |
---|
| 2029 | + public void mouseClicked(MouseEvent e) |
---|
| 2030 | + { |
---|
| 2031 | + Object3D object = Grafreed.materials.versionlist[13].get(0); |
---|
| 2032 | + cMaterial material = object.material; |
---|
| 2033 | + |
---|
| 2034 | + shininessField.setFloat(material.shininess); |
---|
| 2035 | + lightareaField.setFloat(material.lightarea); |
---|
| 2036 | + |
---|
| 2037 | + materialtouched = true; |
---|
| 2038 | + applySelf(); |
---|
| 2039 | + } |
---|
| 2040 | + }); |
---|
| 2041 | + presetpanel.add(rough2); |
---|
| 2042 | + |
---|
| 2043 | + cLabel shini0 = GetLabel("icons/shadericons/shadericon00014.png", !Grafreed.NIMBUSLAF); |
---|
| 2044 | + shini0.setToolTipText("Shiny"); |
---|
| 2045 | + shini0.addMouseListener(new MouseAdapter() |
---|
| 2046 | + { |
---|
| 2047 | + public void mouseClicked(MouseEvent e) |
---|
| 2048 | + { |
---|
| 2049 | + Object3D object = Grafreed.materials.versionlist[14].get(0); |
---|
| 2050 | + cMaterial material = object.material; |
---|
| 2051 | + |
---|
| 2052 | + shininessField.setFloat(material.shininess); |
---|
| 2053 | + lightareaField.setFloat(material.lightarea); |
---|
| 2054 | + |
---|
| 2055 | + materialtouched = true; |
---|
| 2056 | + applySelf(); |
---|
| 2057 | + } |
---|
| 2058 | + }); |
---|
| 2059 | + presetpanel.add(shini0); |
---|
| 2060 | + |
---|
| 2061 | + cLabel shini1 = GetLabel("icons/shadericons/shadericon00011.png", !Grafreed.NIMBUSLAF); |
---|
| 2062 | + shini1.setToolTipText("Shiny2"); |
---|
| 2063 | + shini1.addMouseListener(new MouseAdapter() |
---|
| 2064 | + { |
---|
| 2065 | + public void mouseClicked(MouseEvent e) |
---|
| 2066 | + { |
---|
| 2067 | + Object3D object = Grafreed.materials.versionlist[11].get(0); |
---|
| 2068 | + cMaterial material = object.material; |
---|
| 2069 | + |
---|
| 2070 | + shininessField.setFloat(material.shininess); |
---|
| 2071 | + lightareaField.setFloat(material.lightarea); |
---|
| 2072 | + |
---|
| 2073 | + materialtouched = true; |
---|
| 2074 | + applySelf(); |
---|
| 2075 | + } |
---|
| 2076 | + }); |
---|
| 2077 | + presetpanel.add(shini1); |
---|
| 2078 | + |
---|
| 2079 | + cLabel shini2 = GetLabel("icons/shadericons/shadericon00012.png", !Grafreed.NIMBUSLAF); |
---|
| 2080 | + shini2.setToolTipText("Shiny3"); |
---|
| 2081 | + shini2.addMouseListener(new MouseAdapter() |
---|
| 2082 | + { |
---|
| 2083 | + public void mouseClicked(MouseEvent e) |
---|
| 2084 | + { |
---|
| 2085 | + Object3D object = Grafreed.materials.versionlist[12].get(0); |
---|
| 2086 | + cMaterial material = object.material; |
---|
| 2087 | + |
---|
| 2088 | + shininessField.setFloat(material.shininess); |
---|
| 2089 | + lightareaField.setFloat(material.lightarea); |
---|
| 2090 | + |
---|
| 2091 | + materialtouched = true; |
---|
| 2092 | + applySelf(); |
---|
| 2093 | + } |
---|
| 2094 | + }); |
---|
| 2095 | + presetpanel.add(shini2); |
---|
| 2096 | + |
---|
| 2097 | + cLabel aniso = GetLabel("icons/shadericons/shadericon00008.png", !Grafreed.NIMBUSLAF); |
---|
| 2098 | + aniso.setToolTipText("AnisoU"); |
---|
| 2099 | + aniso.addMouseListener(new MouseAdapter() |
---|
| 2100 | + { |
---|
| 2101 | + public void mouseClicked(MouseEvent e) |
---|
| 2102 | + { |
---|
| 2103 | + Object3D object = Grafreed.materials.versionlist[8].get(0); |
---|
| 2104 | + cMaterial material = object.material; |
---|
| 2105 | + |
---|
| 2106 | + anisoField.setFloat(material.aniso); |
---|
| 2107 | + anisoVField.setFloat(material.anisoV); |
---|
| 2108 | + |
---|
| 2109 | + materialtouched = true; |
---|
| 2110 | + applySelf(); |
---|
| 2111 | + } |
---|
| 2112 | + }); |
---|
| 2113 | + presetpanel.add(aniso); |
---|
| 2114 | + |
---|
| 2115 | + cLabel aniso2 = GetLabel("icons/shadericons/shadericon00009.png", !Grafreed.NIMBUSLAF); |
---|
| 2116 | + aniso2.setToolTipText("AnisoV"); |
---|
| 2117 | + aniso2.addMouseListener(new MouseAdapter() |
---|
| 2118 | + { |
---|
| 2119 | + public void mouseClicked(MouseEvent e) |
---|
| 2120 | + { |
---|
| 2121 | + Object3D object = Grafreed.materials.versionlist[9].get(0); |
---|
| 2122 | + cMaterial material = object.material; |
---|
| 2123 | + |
---|
| 2124 | + anisoField.setFloat(material.aniso); |
---|
| 2125 | + anisoVField.setFloat(material.anisoV); |
---|
| 2126 | + |
---|
| 2127 | + materialtouched = true; |
---|
| 2128 | + applySelf(); |
---|
| 2129 | + } |
---|
| 2130 | + }); |
---|
| 2131 | + presetpanel.add(aniso2); |
---|
| 2132 | + |
---|
| 2133 | + cLabel aniso3 = GetLabel("icons/shadericons/shadericon00010.png", !Grafreed.NIMBUSLAF); |
---|
| 2134 | + aniso3.setToolTipText("AnisoUV"); |
---|
| 2135 | + aniso3.addMouseListener(new MouseAdapter() |
---|
| 2136 | + { |
---|
| 2137 | + public void mouseClicked(MouseEvent e) |
---|
| 2138 | + { |
---|
| 2139 | + Object3D object = Grafreed.materials.versionlist[10].get(0); |
---|
| 2140 | + cMaterial material = object.material; |
---|
| 2141 | + |
---|
| 2142 | + anisoField.setFloat(material.aniso); |
---|
| 2143 | + anisoVField.setFloat(material.anisoV); |
---|
| 2144 | + |
---|
| 2145 | + materialtouched = true; |
---|
| 2146 | + applySelf(); |
---|
| 2147 | + } |
---|
| 2148 | + }); |
---|
| 2149 | + presetpanel.add(aniso3); |
---|
| 2150 | + |
---|
| 2151 | + cLabel velvet0 = GetLabel("icons/shadericons/shadericon00015.png", !Grafreed.NIMBUSLAF); |
---|
| 2152 | + velvet0.setToolTipText("Velvet"); |
---|
| 2153 | + velvet0.addMouseListener(new MouseAdapter() |
---|
| 2154 | + { |
---|
| 2155 | + public void mouseClicked(MouseEvent e) |
---|
| 2156 | + { |
---|
| 2157 | + Object3D object = Grafreed.materials.versionlist[15].get(0); |
---|
| 2158 | + cMaterial material = object.material; |
---|
| 2159 | + |
---|
| 2160 | + diffusenessField.setFloat(material.factor); |
---|
| 2161 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 2162 | + sheenField.setFloat(material.sheen); |
---|
| 2163 | + shininessField.setFloat(material.shininess); |
---|
| 2164 | + velvetField.setFloat(material.velvet); |
---|
| 2165 | + shiftField.setFloat(material.shift); |
---|
| 2166 | + |
---|
| 2167 | + materialtouched = true; |
---|
| 2168 | + applySelf(); |
---|
| 2169 | + } |
---|
| 2170 | + }); |
---|
| 2171 | + presetpanel.add(velvet0); |
---|
| 2172 | + |
---|
| 2173 | + cLabel bump0 = GetLabel("icons/shadericons/shadericon00016.png", !Grafreed.NIMBUSLAF); |
---|
| 2174 | + bump0.setToolTipText("Bump texture"); |
---|
| 2175 | + bump0.addMouseListener(new MouseAdapter() |
---|
| 2176 | + { |
---|
| 2177 | + public void mouseClicked(MouseEvent e) |
---|
| 2178 | + { |
---|
| 2179 | + Object3D object = Grafreed.materials.versionlist[16].get(0); |
---|
| 2180 | + cMaterial material = object.material; |
---|
| 2181 | + |
---|
| 2182 | + bumpField.setFloat(object.projectedVertices[0].x / 1000.0); |
---|
| 2183 | + noiseField.setFloat(object.projectedVertices[0].y / 1000.0); |
---|
| 2184 | + powerField.setFloat(object.projectedVertices[2].x / 1000.0); |
---|
| 2185 | + |
---|
| 2186 | + materialtouched = true; |
---|
| 2187 | + applySelf(); |
---|
| 2188 | + } |
---|
| 2189 | + }); |
---|
| 2190 | + presetpanel.add(bump0); |
---|
| 2191 | + |
---|
| 2192 | + cLabel borderShader = GetLabel("icons/shadericons/borderfade.jpg", !Grafreed.NIMBUSLAF); |
---|
| 2193 | + borderShader.setToolTipText("Border fade"); |
---|
| 2194 | + borderShader.addMouseListener(new MouseAdapter() |
---|
| 2195 | + { |
---|
| 2196 | + public void mouseClicked(MouseEvent e) |
---|
| 2197 | + { |
---|
| 2198 | + borderfadeField.setFloat(0.5); |
---|
| 2199 | + opacityField.setFloat(0.6); |
---|
| 2200 | + |
---|
| 2201 | + materialtouched = true; |
---|
| 2202 | + applySelf(); |
---|
| 2203 | + } |
---|
| 2204 | + }); |
---|
| 2205 | + presetpanel.add(borderShader); |
---|
| 2206 | + |
---|
| 2207 | + cLabel halo = GetLabel("icons/shadericons/shadericon00017.png", !Grafreed.NIMBUSLAF); |
---|
| 2208 | + halo.setToolTipText("Halo"); |
---|
| 2209 | + halo.addMouseListener(new MouseAdapter() |
---|
| 2210 | + { |
---|
| 2211 | + public void mouseClicked(MouseEvent e) |
---|
| 2212 | + { |
---|
| 2213 | + Object3D object = Grafreed.materials.versionlist[17].get(0); |
---|
| 2214 | + cMaterial material = object.material; |
---|
| 2215 | + |
---|
| 2216 | + opacityPowerField.setFloat(object.projectedVertices[2].y / 1000.0); |
---|
| 2217 | + |
---|
| 2218 | + materialtouched = true; |
---|
| 2219 | + applySelf(); |
---|
| 2220 | + } |
---|
| 2221 | + }); |
---|
| 2222 | + presetpanel.add(halo); |
---|
| 2223 | + |
---|
| 2224 | + cLabel candle = GetLabel("icons/shadericons/shadericon00018.png", !Grafreed.NIMBUSLAF); |
---|
| 2225 | + candle.setToolTipText("Candle"); |
---|
| 2226 | + candle.addMouseListener(new MouseAdapter() |
---|
| 2227 | + { |
---|
| 2228 | + public void mouseClicked(MouseEvent e) |
---|
| 2229 | + { |
---|
| 2230 | + Object3D object = Grafreed.materials.versionlist[18].get(0); |
---|
| 2231 | + cMaterial material = object.material; |
---|
| 2232 | + |
---|
| 2233 | + subsurfaceField.setFloat(material.subsurface); |
---|
| 2234 | + shadowbiasField.setFloat(material.shadowbias); |
---|
| 2235 | + ambientField.setFloat(material.ambient); |
---|
| 2236 | + specularField.setFloat(material.specular); |
---|
| 2237 | + lightareaField.setFloat(material.lightarea); |
---|
| 2238 | + shininessField.setFloat(material.shininess); |
---|
| 2239 | + |
---|
| 2240 | + materialtouched = true; |
---|
| 2241 | + applySelf(); |
---|
| 2242 | + } |
---|
| 2243 | + }); |
---|
| 2244 | + presetpanel.add(candle); |
---|
| 2245 | + |
---|
| 2246 | + cLabel shadowShader = GetLabel("icons/shadericons/shadow.png", !Grafreed.NIMBUSLAF); |
---|
| 2247 | + shadowShader.setToolTipText("Shadow"); |
---|
| 2248 | + shadowShader.addMouseListener(new MouseAdapter() |
---|
| 2249 | + { |
---|
| 2250 | + public void mouseClicked(MouseEvent e) |
---|
| 2251 | + { |
---|
| 2252 | + diffuseField.setFloat(0.001); |
---|
| 2253 | + ambientField.setFloat(0.001); |
---|
| 2254 | + cameraField.setFloat(0.001); |
---|
| 2255 | + specularField.setFloat(0.001); |
---|
| 2256 | + fakedepthField.setFloat(0.001); |
---|
| 2257 | + opacityField.setFloat(0.6); |
---|
| 2258 | + |
---|
| 2259 | + materialtouched = true; |
---|
| 2260 | + applySelf(); |
---|
| 2261 | + } |
---|
| 2262 | + }); |
---|
| 2263 | + presetpanel.add(shadowShader); |
---|
| 2264 | + |
---|
| 2265 | + cGridBag panel = new cGridBag().setVertical(true); |
---|
| 2266 | + |
---|
| 2267 | + presetpanel.preferredWidth = 1; |
---|
| 2268 | + |
---|
| 2269 | + materialpanel.add(presetpanel); |
---|
| 2270 | + materialpanel.add(panel); |
---|
| 2271 | + |
---|
| 2272 | + panel.preferredWidth = 8; |
---|
| 2273 | + |
---|
| 2274 | + /* |
---|
1706 | 2275 | ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints); |
---|
1707 | 2276 | materialLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1708 | | - */ |
---|
| 2277 | + */ |
---|
1709 | 2278 | |
---|
1710 | 2279 | cGridBag editBar = new cGridBag().setVertical(false); |
---|
1711 | 2280 | |
---|
.. | .. |
---|
1739 | 2308 | //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1740 | 2309 | |
---|
1741 | 2310 | cGridBag colorSection = new cGridBag().setVertical(true); |
---|
| 2311 | + |
---|
| 2312 | + cGridBag huepanel = new cGridBag(); |
---|
| 2313 | + cGridBag huelabel = new cGridBag(); |
---|
| 2314 | + skin = GetLabel("icons/hue.png", false); |
---|
| 2315 | + skin.fit = true; |
---|
| 2316 | + huelabel.add(skin); |
---|
| 2317 | + huelabel.preferredWidth = 20; |
---|
| 2318 | + huepanel.add(new cGridBag()); // Label |
---|
| 2319 | + huepanel.add(huelabel); // Field/slider |
---|
| 2320 | + |
---|
| 2321 | + huepanel.preferredHeight = 7; |
---|
| 2322 | + |
---|
| 2323 | + colorSection.add(huepanel); |
---|
1742 | 2324 | |
---|
1743 | 2325 | cGridBag color = new cGridBag(); |
---|
1744 | | - color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints); |
---|
1745 | | - colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1746 | | - color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 2326 | + |
---|
| 2327 | + color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints); |
---|
| 2328 | + colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2329 | + color.add(colorField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
| 2330 | + |
---|
1747 | 2331 | //colorField.preferredWidth = 200; |
---|
1748 | 2332 | colorSection.add(color); |
---|
1749 | 2333 | |
---|
1750 | 2334 | cGridBag modulation = new cGridBag(); |
---|
1751 | 2335 | modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints); |
---|
1752 | 2336 | modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1753 | | - modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 2337 | + modulation.add(saturationField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
1754 | 2338 | colorSection.add(modulation); |
---|
1755 | 2339 | |
---|
| 2340 | + cGridBag opacity = new cGridBag(); |
---|
| 2341 | + opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints); |
---|
| 2342 | + opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2343 | + opacity.add(opacityField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
| 2344 | + colorSection.add(opacity); |
---|
| 2345 | + |
---|
| 2346 | + colorSection.add(GetSeparator()); |
---|
| 2347 | + |
---|
1756 | 2348 | cGridBag texture = new cGridBag(); |
---|
1757 | 2349 | texture.add(textureLabel = new JLabel("Texture")); // , aConstraints); |
---|
1758 | 2350 | textureLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1759 | 2351 | texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1760 | 2352 | colorSection.add(texture); |
---|
1761 | 2353 | |
---|
1762 | | - panel.add(new JSeparator()); |
---|
| 2354 | + panel.add(GetSeparator()); |
---|
1763 | 2355 | |
---|
1764 | 2356 | panel.add(colorSection); |
---|
1765 | 2357 | |
---|
.. | .. |
---|
1815 | 2407 | shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1816 | 2408 | diffuseSection.add(shadowbias); |
---|
1817 | 2409 | |
---|
1818 | | - panel.add(new JSeparator()); |
---|
| 2410 | + panel.add(GetSeparator()); |
---|
1819 | 2411 | |
---|
1820 | 2412 | panel.add(diffuseSection); |
---|
1821 | 2413 | |
---|
.. | .. |
---|
1878 | 2470 | specularSection.add(anisoV); |
---|
1879 | 2471 | |
---|
1880 | 2472 | |
---|
1881 | | - panel.add(new JSeparator()); |
---|
| 2473 | + panel.add(GetSeparator()); |
---|
1882 | 2474 | |
---|
1883 | 2475 | panel.add(specularSection); |
---|
1884 | 2476 | |
---|
.. | .. |
---|
1903 | 2495 | backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1904 | 2496 | backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1905 | 2497 | colorSection.add(backlit); |
---|
1906 | | - |
---|
1907 | | - cGridBag opacity = new cGridBag(); |
---|
1908 | | - opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints); |
---|
1909 | | - opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1910 | | - opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1911 | | - colorSection.add(opacity); |
---|
1912 | 2498 | |
---|
1913 | 2499 | //panel.add(new JSeparator()); |
---|
1914 | 2500 | |
---|
.. | .. |
---|
1954 | 2540 | opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints); |
---|
1955 | 2541 | textureSection.add(opacityPower); |
---|
1956 | 2542 | |
---|
1957 | | - panel.add(new JSeparator()); |
---|
| 2543 | + panel.add(GetSeparator()); |
---|
1958 | 2544 | |
---|
1959 | 2545 | panel.add(textureSection); |
---|
1960 | 2546 | |
---|
.. | .. |
---|
2941 | 3527 | |
---|
2942 | 3528 | freezematerial = true; |
---|
2943 | 3529 | colorField.setFloat(mat.color); |
---|
2944 | | - modulationField.setFloat(mat.modulation); |
---|
| 3530 | + saturationField.setFloat(mat.modulation); |
---|
2945 | 3531 | metalnessField.setFloat(mat.metalness); |
---|
2946 | 3532 | diffuseField.setFloat(mat.diffuse); |
---|
2947 | 3533 | specularField.setFloat(mat.specular); |
---|
.. | .. |
---|
3003 | 3589 | |
---|
3004 | 3590 | if (multiplyToggle != null) |
---|
3005 | 3591 | multiplyToggle.setSelected(mat.multiply); |
---|
3006 | | - |
---|
3007 | | - assert (object.projectedVertices != null); |
---|
3008 | | - |
---|
3009 | | - if (object.projectedVertices.length <= 2) |
---|
3010 | | - { |
---|
3011 | | - // Side effect... |
---|
3012 | | - Object3D.cVector2[] keep = object.projectedVertices; |
---|
3013 | | - object.projectedVertices = new Object3D.cVector2[3]; |
---|
3014 | | - for (int i = 0; i < 3; i++) |
---|
3015 | | - { |
---|
3016 | | - if (i < keep.length) |
---|
3017 | | - { |
---|
3018 | | - object.projectedVertices[i] = keep[i]; |
---|
3019 | | - } else |
---|
3020 | | - { |
---|
3021 | | - object.projectedVertices[i] = new Object3D.cVector2(); |
---|
3022 | | - } |
---|
3023 | | - /* |
---|
3024 | | - if(keep.length == 0) |
---|
3025 | | - object.projectedVertices[0] = new Object3D.cVector2(); |
---|
3026 | | - else |
---|
3027 | | - object.projectedVertices[0] = keep[0]; |
---|
3028 | | - object.projectedVertices[1] = new Object3D.cVector2(); |
---|
3029 | | - */ |
---|
3030 | | - } |
---|
3031 | | - } |
---|
| 3592 | + |
---|
| 3593 | + AllocProjectedVertices(object); |
---|
3032 | 3594 | |
---|
3033 | 3595 | SetMaterial(mat, object.projectedVertices); |
---|
3034 | 3596 | } |
---|
.. | .. |
---|
3148 | 3710 | public void itemStateChanged(ItemEvent event) |
---|
3149 | 3711 | { |
---|
3150 | 3712 | // System.out.println("Propagate = " + propagate); |
---|
| 3713 | + if (event.getSource() == pinButton) |
---|
| 3714 | + { |
---|
| 3715 | + copy.pinned ^= true; |
---|
| 3716 | + if (!copy.pinned && !copy.editWindow.copy.selection.contains(copy)) |
---|
| 3717 | + { |
---|
| 3718 | + ((GroupEditor)copy.editWindow).listUI.remove(copy); |
---|
| 3719 | + copy.CloseUI(); |
---|
| 3720 | + //copy.editWindow.refreshContents(); |
---|
| 3721 | + } |
---|
| 3722 | + } |
---|
| 3723 | + else |
---|
3151 | 3724 | if (event.getSource() == propagateToggle) |
---|
3152 | 3725 | { |
---|
3153 | 3726 | propagate ^= true; |
---|
.. | .. |
---|
3252 | 3825 | } else if (event.getSource() == liveCB) |
---|
3253 | 3826 | { |
---|
3254 | 3827 | copy.live ^= true; |
---|
| 3828 | + objEditor.refreshContents(true); // To show item colors |
---|
3255 | 3829 | return; |
---|
3256 | 3830 | } else if (event.getSource() == selectableCB) |
---|
3257 | 3831 | { |
---|
.. | .. |
---|
3261 | 3835 | { |
---|
3262 | 3836 | copy.hide ^= true; |
---|
3263 | 3837 | copy.Touch(); // display list issue |
---|
3264 | | - objEditor.refreshContents(); |
---|
| 3838 | + objEditor.refreshContents(true); // To show item colors |
---|
3265 | 3839 | return; |
---|
3266 | 3840 | } else if (event.getSource() == link2masterCB) |
---|
3267 | 3841 | { |
---|
.. | .. |
---|
3517 | 4091 | |
---|
3518 | 4092 | static public byte[] Compress(Object3D o) |
---|
3519 | 4093 | { |
---|
| 4094 | + // Slower to actually compress. |
---|
3520 | 4095 | try |
---|
3521 | 4096 | { |
---|
3522 | 4097 | ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
---|
.. | .. |
---|
3618 | 4193 | { |
---|
3619 | 4194 | //Save(true); |
---|
3620 | 4195 | Replace(); |
---|
| 4196 | + SetVersionStates(); |
---|
3621 | 4197 | } |
---|
3622 | 4198 | |
---|
3623 | 4199 | private boolean Equal(byte[] compress, byte[] name) |
---|
.. | .. |
---|
3638 | 4214 | |
---|
3639 | 4215 | java.util.Hashtable<java.util.UUID, Object3D> versiontable = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
3640 | 4216 | |
---|
| 4217 | + void DeleteVersion() |
---|
| 4218 | + { |
---|
| 4219 | + for (int i = copy.versionindex; i < copy.versionlist.length-1; i++) |
---|
| 4220 | + { |
---|
| 4221 | + copy.versionlist[i] = copy.versionlist[i+1]; |
---|
| 4222 | + } |
---|
| 4223 | + |
---|
| 4224 | + CopyChanged(); |
---|
| 4225 | + |
---|
| 4226 | + SetVersionStates(); |
---|
| 4227 | + } |
---|
| 4228 | + |
---|
3641 | 4229 | public boolean Save(boolean user) |
---|
3642 | 4230 | { |
---|
3643 | 4231 | System.err.println("Save"); |
---|
| 4232 | + Replace(); |
---|
3644 | 4233 | |
---|
3645 | | - cRadio tab = GetCurrentTab(); |
---|
| 4234 | + //cRadio tab = GetCurrentTab(); |
---|
3646 | 4235 | |
---|
3647 | | - byte[] compress = CompressCopy(); |
---|
| 4236 | + Object3D compress = Duplicate(copy); // Saved version. No need for "Replace"? |
---|
3648 | 4237 | |
---|
3649 | 4238 | boolean thesame = false; |
---|
3650 | 4239 | |
---|
3651 | | - // Quick heuristic using length. Works only when stream is compressed. |
---|
3652 | | - if (copy.versionindex > 0 && copy.versions[copy.versionindex-1] != null && Equal(compress, copy.versions[copy.versionindex-1])) |
---|
3653 | | - { |
---|
3654 | | - thesame = true; |
---|
3655 | | - } |
---|
| 4240 | +// if (copy.versionindex > 0 && copy.versions[copy.versionindex-1] != null && Equal(compress, copy.versions[copy.versionindex-1])) |
---|
| 4241 | +// { |
---|
| 4242 | +// thesame = true; |
---|
| 4243 | +// } |
---|
3656 | 4244 | |
---|
3657 | 4245 | //EditorFrame.m_MainFrame.requestFocusInWindow(); |
---|
3658 | 4246 | if (!thesame) |
---|
3659 | 4247 | { |
---|
| 4248 | + for (int i = copy.versionlist.length; --i > copy.versionindex+1;) |
---|
| 4249 | + { |
---|
| 4250 | + copy.versionlist[i] = copy.versionlist[i-1]; |
---|
| 4251 | + } |
---|
| 4252 | + |
---|
3660 | 4253 | //tab.user[tab.versionindex] = user; |
---|
3661 | 4254 | //boolean increment = true; // tab.graphs[tab.versionindex] == null; |
---|
3662 | 4255 | |
---|
3663 | | - copy.versions[++copy.versionindex] = compress; |
---|
| 4256 | + copy.versionlist[++copy.versionindex] = compress; |
---|
3664 | 4257 | |
---|
3665 | 4258 | // if (increment) |
---|
3666 | 4259 | // tab.versionindex++; |
---|
.. | .. |
---|
3670 | 4263 | |
---|
3671 | 4264 | //assert(hashtable.isEmpty()); |
---|
3672 | 4265 | |
---|
3673 | | - for (int i = copy.versionindex+1; i < copy.versions.length; i++) |
---|
3674 | | - { |
---|
3675 | | - //tab.user[i] = false; |
---|
3676 | | - copy.versions[i] = null; |
---|
3677 | | - } |
---|
| 4266 | +// for (int i = copy.versionindex+1; i < copy.versionlist.length; i++) |
---|
| 4267 | +// { |
---|
| 4268 | +// //tab.user[i] = false; |
---|
| 4269 | +// copy.versionlist[i] = null; |
---|
| 4270 | +// } |
---|
3678 | 4271 | |
---|
3679 | | - SetUndoStates(); |
---|
| 4272 | + SetVersionStates(); |
---|
3680 | 4273 | |
---|
3681 | 4274 | // test save |
---|
3682 | 4275 | if (false) |
---|
.. | .. |
---|
3699 | 4292 | |
---|
3700 | 4293 | return !thesame; |
---|
3701 | 4294 | } |
---|
3702 | | - |
---|
3703 | | - void CopyChanged(Object3D obj) |
---|
| 4295 | + |
---|
| 4296 | + boolean flashIt = true; |
---|
| 4297 | + |
---|
| 4298 | + void RefreshSelection() |
---|
3704 | 4299 | { |
---|
3705 | | - SetUndoStates(); |
---|
| 4300 | + Object3D selection = new Object3D(); |
---|
| 4301 | + |
---|
| 4302 | + for (int i = 0; i < copy.selection.size(); i++) |
---|
| 4303 | + { |
---|
| 4304 | + Object3D elem = copy.selection.elementAt(i); |
---|
| 4305 | + |
---|
| 4306 | + Object3D obj = copy.GetObject(elem.GetUUID()); |
---|
| 4307 | + |
---|
| 4308 | + if (obj == null) |
---|
| 4309 | + { |
---|
| 4310 | + copy.selection.remove(i--); |
---|
| 4311 | + } |
---|
| 4312 | + else |
---|
| 4313 | + { |
---|
| 4314 | + selection.add(obj); |
---|
| 4315 | + copy.selection.setElementAt(obj, i); |
---|
| 4316 | + } |
---|
| 4317 | + } |
---|
| 4318 | + |
---|
| 4319 | + flashIt = false; |
---|
| 4320 | + GetTree().clearSelection(); |
---|
| 4321 | + for (int i = 0; i < selection.size(); i++) |
---|
| 4322 | + GetTree().addSelectionPath(selection.elementAt(i).GetTreePath().GetTreePath()); |
---|
| 4323 | + flashIt = true; |
---|
| 4324 | + |
---|
| 4325 | + //refreshContents(false); |
---|
| 4326 | + } |
---|
| 4327 | + |
---|
| 4328 | + void CopyChanged() |
---|
| 4329 | + { |
---|
| 4330 | + Object3D obj = (Object3D)Grafreed.clone(copy.versionlist[copy.versionindex]); |
---|
| 4331 | + |
---|
| 4332 | + SetVersionStates(); |
---|
3706 | 4333 | |
---|
3707 | 4334 | boolean temp = CameraPane.SWITCH; |
---|
3708 | 4335 | CameraPane.SWITCH = false; |
---|
.. | .. |
---|
3711 | 4338 | |
---|
3712 | 4339 | copy.clear(); |
---|
3713 | 4340 | |
---|
| 4341 | + copy.skyboxname = obj.skyboxname; |
---|
| 4342 | + copy.skyboxext = obj.skyboxext; |
---|
| 4343 | + |
---|
3714 | 4344 | for (int i=0; i<obj.Size(); i++) |
---|
3715 | 4345 | { |
---|
3716 | 4346 | copy.add(obj.get(i)); |
---|
.. | .. |
---|
3720 | 4350 | |
---|
3721 | 4351 | CameraPane.SWITCH = temp; |
---|
3722 | 4352 | |
---|
| 4353 | + RefreshSelection(); |
---|
3723 | 4354 | //assert(hashtable.isEmpty()); |
---|
3724 | 4355 | |
---|
3725 | 4356 | copy.Touch(); |
---|
.. | .. |
---|
3740 | 4371 | } |
---|
3741 | 4372 | } |
---|
3742 | 4373 | |
---|
3743 | | - refreshContents(); |
---|
| 4374 | + refreshContents(true); |
---|
3744 | 4375 | } |
---|
3745 | 4376 | |
---|
3746 | | - cButton undoButton; |
---|
| 4377 | + cButton previousVersionButton; |
---|
3747 | 4378 | cButton restoreButton; |
---|
3748 | 4379 | cButton replaceButton; |
---|
3749 | | - cButton redoButton; |
---|
| 4380 | + cButton nextVersionButton; |
---|
| 4381 | + cButton saveVersionButton; |
---|
| 4382 | + cButton deleteVersionButton; |
---|
3750 | 4383 | |
---|
3751 | 4384 | boolean muteSlider; |
---|
3752 | 4385 | |
---|
.. | .. |
---|
3754 | 4387 | { |
---|
3755 | 4388 | int count = 0; |
---|
3756 | 4389 | |
---|
3757 | | - for (int i = copy.versions.length; --i >= 0;) |
---|
| 4390 | + for (int i = copy.versionlist.length; --i >= 0;) |
---|
3758 | 4391 | { |
---|
3759 | | - if (copy.versions[i] != null) |
---|
| 4392 | + if (copy.versionlist[i] != null) |
---|
3760 | 4393 | count++; |
---|
3761 | 4394 | } |
---|
3762 | 4395 | |
---|
3763 | 4396 | return count; |
---|
3764 | 4397 | } |
---|
3765 | 4398 | |
---|
3766 | | - void SetUndoStates() |
---|
| 4399 | + void SetVersionStates() |
---|
3767 | 4400 | { |
---|
3768 | | - cRadio tab = GetCurrentTab(); |
---|
| 4401 | + //if (true) |
---|
| 4402 | + // return; |
---|
| 4403 | + |
---|
| 4404 | + //cRadio tab = GetCurrentTab(); |
---|
3769 | 4405 | |
---|
3770 | 4406 | restoreButton.setEnabled(copy.versionindex != -1); |
---|
3771 | 4407 | replaceButton.setEnabled(copy.versionindex != -1); |
---|
3772 | 4408 | |
---|
3773 | | - undoButton.setEnabled(copy.versionindex > 0); |
---|
3774 | | - redoButton.setEnabled(copy.versions[copy.versionindex + 1] != null); |
---|
| 4409 | + previousVersionButton.setEnabled(copy.versionindex > 0); |
---|
| 4410 | + nextVersionButton.setEnabled(copy.versionlist[copy.versionindex + 1] != null); |
---|
| 4411 | + |
---|
| 4412 | + deleteVersionButton.setEnabled(//copy.versionindex > 0 && |
---|
| 4413 | + copy.versionlist[copy.versionindex + 1] != null); |
---|
3775 | 4414 | |
---|
3776 | 4415 | muteSlider = true; |
---|
| 4416 | + versionSlider.setMinimum(0); |
---|
3777 | 4417 | versionSlider.setMaximum(VersionCount() - 1); |
---|
3778 | 4418 | versionSlider.setInteger(copy.versionindex); |
---|
| 4419 | + versionSlider.setEnabled(copy.versionindex != -1); |
---|
3779 | 4420 | muteSlider = false; |
---|
3780 | 4421 | } |
---|
3781 | 4422 | |
---|
3782 | | - public boolean Undo() |
---|
| 4423 | + public boolean PreviousVersion() |
---|
3783 | 4424 | { |
---|
3784 | 4425 | // Option? |
---|
3785 | 4426 | Replace(); |
---|
3786 | 4427 | |
---|
3787 | 4428 | System.err.println("Undo"); |
---|
3788 | 4429 | |
---|
3789 | | - cRadio tab = GetCurrentTab(); |
---|
| 4430 | + //cRadio tab = GetCurrentTab(); |
---|
3790 | 4431 | |
---|
3791 | 4432 | if (copy.versionindex == 0) |
---|
3792 | 4433 | { |
---|
.. | .. |
---|
3809 | 4450 | |
---|
3810 | 4451 | copy.versionindex -= 1; |
---|
3811 | 4452 | |
---|
3812 | | - CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
| 4453 | + CopyChanged(); |
---|
3813 | 4454 | |
---|
3814 | 4455 | return true; |
---|
3815 | 4456 | } |
---|
.. | .. |
---|
3818 | 4459 | { |
---|
3819 | 4460 | System.err.println("Restore"); |
---|
3820 | 4461 | |
---|
3821 | | - cRadio tab = GetCurrentTab(); |
---|
| 4462 | + //cRadio tab = GetCurrentTab(); |
---|
3822 | 4463 | |
---|
3823 | | - if (copy.versionindex == -1 || copy.versions[copy.versionindex] == null) |
---|
| 4464 | + if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
3824 | 4465 | { |
---|
3825 | 4466 | java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
3826 | 4467 | return false; |
---|
3827 | 4468 | } |
---|
3828 | 4469 | |
---|
3829 | | - CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
| 4470 | + //CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
| 4471 | + CopyChanged(); |
---|
3830 | 4472 | |
---|
3831 | 4473 | return true; |
---|
3832 | 4474 | } |
---|
.. | .. |
---|
3835 | 4477 | { |
---|
3836 | 4478 | System.err.println("Replace"); |
---|
3837 | 4479 | |
---|
3838 | | - cRadio tab = GetCurrentTab(); |
---|
| 4480 | + //cRadio tab = GetCurrentTab(); |
---|
3839 | 4481 | |
---|
3840 | | - if (copy.versionindex == -1 || copy.versions[copy.versionindex] == null) |
---|
| 4482 | + if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
3841 | 4483 | { |
---|
3842 | 4484 | // No version yet. OK. java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
3843 | 4485 | return false; |
---|
3844 | 4486 | } |
---|
3845 | 4487 | |
---|
3846 | | - copy.versions[copy.versionindex] = CompressCopy(); |
---|
| 4488 | + copy.versionlist[copy.versionindex] = Duplicate(copy); |
---|
3847 | 4489 | |
---|
3848 | 4490 | return true; |
---|
3849 | 4491 | } |
---|
3850 | 4492 | |
---|
3851 | | - public void Redo() |
---|
| 4493 | + public void NextVersion() |
---|
3852 | 4494 | { |
---|
3853 | 4495 | // Option? |
---|
3854 | 4496 | Replace(); |
---|
3855 | 4497 | |
---|
3856 | | - cRadio tab = GetCurrentTab(); |
---|
| 4498 | + //cRadio tab = GetCurrentTab(); |
---|
3857 | 4499 | |
---|
3858 | | - if (copy.versions[copy.versionindex + 1] == null) |
---|
| 4500 | + if (copy.versionlist[copy.versionindex + 1] == null) |
---|
3859 | 4501 | { |
---|
3860 | 4502 | java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
3861 | 4503 | return; |
---|
.. | .. |
---|
3863 | 4505 | |
---|
3864 | 4506 | copy.versionindex += 1; |
---|
3865 | 4507 | |
---|
3866 | | - CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
| 4508 | + CopyChanged(); |
---|
3867 | 4509 | |
---|
3868 | 4510 | //if (!tab.user[tab.versionindex]) |
---|
3869 | 4511 | // tab.graphs[tab.versionindex] = null; |
---|
.. | .. |
---|
4077 | 4719 | //copy.material = new cMaterial(copy.GetMaterial()); |
---|
4078 | 4720 | |
---|
4079 | 4721 | current.color = (float) colorField.getFloat(); |
---|
4080 | | - current.modulation = (float) modulationField.getFloat(); |
---|
| 4722 | + current.modulation = (float) saturationField.getFloat(); |
---|
4081 | 4723 | current.metalness = (float) metalnessField.getFloat(); |
---|
4082 | 4724 | current.diffuse = (float) diffuseField.getFloat(); |
---|
4083 | 4725 | current.specular = (float) specularField.getFloat(); |
---|
.. | .. |
---|
4110 | 4752 | cMaterial mat = copy.material; |
---|
4111 | 4753 | |
---|
4112 | 4754 | colorField.SetToolTipValue((mat.color)); |
---|
4113 | | - modulationField.SetToolTipValue((mat.modulation)); |
---|
| 4755 | + saturationField.SetToolTipValue((mat.modulation)); |
---|
4114 | 4756 | metalnessField.SetToolTipValue((mat.metalness)); |
---|
4115 | 4757 | diffuseField.SetToolTipValue((mat.diffuse)); |
---|
4116 | 4758 | specularField.SetToolTipValue((mat.specular)); |
---|
.. | .. |
---|
4172 | 4814 | if (muteSlider) |
---|
4173 | 4815 | return; |
---|
4174 | 4816 | |
---|
| 4817 | + Replace(); |
---|
| 4818 | + |
---|
4175 | 4819 | int version = versionSlider.getInteger(); |
---|
4176 | 4820 | |
---|
4177 | | - if (copy.versions[version] != null) |
---|
| 4821 | + if (version != -1 && copy.versionlist[version] != null) |
---|
4178 | 4822 | { |
---|
4179 | | - CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex = version])); |
---|
| 4823 | + copy.versionindex = version; |
---|
| 4824 | + CopyChanged(); |
---|
4180 | 4825 | } |
---|
4181 | 4826 | |
---|
4182 | 4827 | return; |
---|
.. | .. |
---|
4216 | 4861 | { |
---|
4217 | 4862 | //System.out.println("stateChanged = " + this); |
---|
4218 | 4863 | materialtouched = true; |
---|
| 4864 | + |
---|
| 4865 | + if (Globals.AUTOSATURATE && e.getSource() == colorField && saturationField.getFloat() == 0.001) |
---|
| 4866 | + { |
---|
| 4867 | + saturationField.setFloat(1); |
---|
| 4868 | + } |
---|
| 4869 | + |
---|
4219 | 4870 | applySelf(); |
---|
4220 | 4871 | //System.out.println("this = " + this); |
---|
4221 | 4872 | //System.out.println("PARENT = " + parent); |
---|
.. | .. |
---|
4515 | 5166 | { |
---|
4516 | 5167 | if (GetTree() != null) |
---|
4517 | 5168 | { |
---|
| 5169 | + GetTree().revalidate(); |
---|
4518 | 5170 | GetTree().repaint(); |
---|
4519 | 5171 | } |
---|
4520 | 5172 | |
---|
.. | .. |
---|
4523 | 5175 | ctrlPanel.validate(); // ? new |
---|
4524 | 5176 | ctrlPanel.repaint(); |
---|
4525 | 5177 | } |
---|
| 5178 | + |
---|
| 5179 | + if (previousVersionButton != null && copy.versionlist != null) |
---|
| 5180 | + SetVersionStates(); |
---|
4526 | 5181 | } |
---|
4527 | 5182 | |
---|
4528 | 5183 | static TweenManager tweenManager = new TweenManager(); |
---|
.. | .. |
---|
4853 | 5508 | { |
---|
4854 | 5509 | //readobj.deepCopySelf(copy); |
---|
4855 | 5510 | copy.clear(); // june 2014 |
---|
| 5511 | + copy.skyboxname = readobj.skyboxname; |
---|
| 5512 | + copy.skyboxext = readobj.skyboxext; |
---|
4856 | 5513 | for (int i = 0; i < readobj.size(); i++) |
---|
4857 | 5514 | { |
---|
4858 | 5515 | Object3D child = readobj.get(i); // reserve(i); |
---|
.. | .. |
---|
4904 | 5561 | c.addChild(csg); |
---|
4905 | 5562 | } |
---|
4906 | 5563 | |
---|
4907 | | - copy.versions = readobj.versions; |
---|
| 5564 | + copy.versionlist = readobj.versionlist; |
---|
4908 | 5565 | copy.versionindex = readobj.versionindex; |
---|
4909 | 5566 | |
---|
4910 | | - if (copy.versions == null) |
---|
| 5567 | + if (copy.versionlist == null) |
---|
4911 | 5568 | { |
---|
4912 | | - copy.versions = new byte[100][]; |
---|
| 5569 | + // Backward compatibility |
---|
| 5570 | + copy.versionlist = new Object3D[100]; |
---|
4913 | 5571 | copy.versionindex = -1; |
---|
| 5572 | + |
---|
| 5573 | + //Save(true); |
---|
4914 | 5574 | } |
---|
4915 | 5575 | |
---|
4916 | 5576 | //? SetUndoStates(); |
---|
.. | .. |
---|
4925 | 5585 | { |
---|
4926 | 5586 | if (Grafreed.standAlone) |
---|
4927 | 5587 | { |
---|
4928 | | - FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD); |
---|
| 5588 | + FileDialog browser = new FileDialog(frame, "Open", FileDialog.LOAD); |
---|
4929 | 5589 | browser.show(); |
---|
4930 | 5590 | String filename = browser.getFile(); |
---|
4931 | 5591 | if (filename != null && filename.length() > 0) |
---|
.. | .. |
---|
5002 | 5662 | |
---|
5003 | 5663 | void save() |
---|
5004 | 5664 | { |
---|
| 5665 | + Replace(); |
---|
| 5666 | + |
---|
5005 | 5667 | if (lastname == null) |
---|
5006 | 5668 | { |
---|
5007 | 5669 | return; |
---|
.. | .. |
---|
5244 | 5906 | ButtonGroup buttonGroup; |
---|
5245 | 5907 | |
---|
5246 | 5908 | cGridBag toolboxPanel; |
---|
| 5909 | + cGridBag skyboxPanel; |
---|
5247 | 5910 | cGridBag materialPanel; |
---|
5248 | 5911 | cGridBag ctrlPanel; |
---|
5249 | 5912 | |
---|
.. | .. |
---|
5317 | 5980 | JLabel colorLabel; |
---|
5318 | 5981 | cNumberSlider colorField; |
---|
5319 | 5982 | JLabel modulationLabel; |
---|
5320 | | - cNumberSlider modulationField; |
---|
| 5983 | + cNumberSlider saturationField; |
---|
5321 | 5984 | JLabel metalnessLabel; |
---|
5322 | 5985 | cNumberSlider metalnessField; |
---|
5323 | 5986 | JLabel diffuseLabel; |
---|
.. | .. |
---|
5348 | 6011 | cNumberSlider anisoField; |
---|
5349 | 6012 | JLabel anisoVLabel; |
---|
5350 | 6013 | cNumberSlider anisoVField; |
---|
| 6014 | + |
---|
5351 | 6015 | JLabel cameraLabel; |
---|
5352 | 6016 | cNumberSlider cameraField; |
---|
5353 | 6017 | JLabel selfshadowLabel; |
---|
.. | .. |
---|
5362 | 6026 | cNumberSlider fakedepthField; |
---|
5363 | 6027 | JLabel shadowbiasLabel; |
---|
5364 | 6028 | cNumberSlider shadowbiasField; |
---|
| 6029 | + |
---|
5365 | 6030 | JLabel bumpLabel; |
---|
5366 | 6031 | cNumberSlider bumpField; |
---|
5367 | 6032 | JLabel noiseLabel; |
---|