.. | .. |
---|
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 cGridBag GetSeparator() |
---|
| 47 | + { |
---|
| 48 | + cGridBag separator = new cGridBag(); |
---|
| 49 | + separator.add(new JSeparator()); |
---|
| 50 | + separator.preferredHeight = 5; |
---|
| 51 | + return separator; |
---|
| 52 | + } |
---|
44 | 53 | |
---|
45 | 54 | cButton GetButton(String name, boolean border) |
---|
46 | 55 | { |
---|
47 | 56 | ImageIcon icon = GetIcon(name); |
---|
48 | 57 | return new cButton(icon, border); |
---|
| 58 | + } |
---|
| 59 | + |
---|
| 60 | + cLabel GetLabel(String name, boolean border) |
---|
| 61 | + { |
---|
| 62 | + //ImageIcon icon = GetIcon(name); |
---|
| 63 | + return new cLabel(GetImage(name), border); |
---|
49 | 64 | } |
---|
50 | 65 | |
---|
51 | 66 | cToggleButton GetToggleButton(String name, boolean border) |
---|
.. | .. |
---|
60 | 75 | return new cCheckBox(icon, border); |
---|
61 | 76 | } |
---|
62 | 77 | |
---|
63 | | - private ImageIcon GetIcon(String name) |
---|
| 78 | + ImageIcon GetIcon(String name) |
---|
64 | 79 | { |
---|
65 | 80 | try |
---|
66 | 81 | { |
---|
67 | 82 | BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name)); |
---|
68 | 83 | |
---|
69 | | - if (image.getWidth() != 24 && image.getHeight() != 24) |
---|
70 | | - { |
---|
71 | | - BufferedImage resized = new BufferedImage(24, 24, image.getType()); |
---|
72 | | - Graphics2D g = resized.createGraphics(); |
---|
73 | | - g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); |
---|
74 | | - //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
---|
75 | | - g.drawImage(image, 0, 0, 24, 24, 0, 0, image.getWidth(), image.getHeight(), null); |
---|
76 | | - g.dispose(); |
---|
77 | | - |
---|
78 | | - image = resized; |
---|
79 | | - } |
---|
| 84 | +// if (image.getWidth() > 48 && image.getHeight() > 48) |
---|
| 85 | +// { |
---|
| 86 | +// BufferedImage resized = new BufferedImage(48, 48, image.getType()); |
---|
| 87 | +// Graphics2D g = resized.createGraphics(); |
---|
| 88 | +// g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); |
---|
| 89 | +// //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
---|
| 90 | +// g.drawImage(image, 0, 0, 48, 48, 0, 0, image.getWidth(), image.getHeight(), null); |
---|
| 91 | +// g.dispose(); |
---|
| 92 | +// |
---|
| 93 | +// image = resized; |
---|
| 94 | +// } |
---|
80 | 95 | |
---|
81 | 96 | javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image); |
---|
82 | 97 | return icon; |
---|
| 98 | + } |
---|
| 99 | + catch (Exception e) |
---|
| 100 | + { |
---|
| 101 | + return null; |
---|
| 102 | + } |
---|
| 103 | + } |
---|
| 104 | + |
---|
| 105 | + BufferedImage GetImage(String name) |
---|
| 106 | + { |
---|
| 107 | + try |
---|
| 108 | + { |
---|
| 109 | + BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name)); |
---|
| 110 | + |
---|
| 111 | + return image; |
---|
83 | 112 | } |
---|
84 | 113 | catch (Exception e) |
---|
85 | 114 | { |
---|
.. | .. |
---|
268 | 297 | client = inClient; |
---|
269 | 298 | copy = client; |
---|
270 | 299 | |
---|
271 | | - if (copy.versions == null) |
---|
272 | | - { |
---|
273 | | - copy.versions = new byte[100][]; |
---|
274 | | - copy.versionindex = -1; |
---|
275 | | - } |
---|
| 300 | +// if (copy.versionlist == null) |
---|
| 301 | +// { |
---|
| 302 | +// copy.versionlist = new Object3D[100]; |
---|
| 303 | +// copy.versionindex = -1; |
---|
| 304 | +// |
---|
| 305 | +// callee.Save(true); |
---|
| 306 | +// } |
---|
276 | 307 | |
---|
277 | 308 | // "this" is not called: SetupUI2(objEditor); |
---|
278 | 309 | } |
---|
.. | .. |
---|
287 | 318 | client = inClient; |
---|
288 | 319 | copy = client; |
---|
289 | 320 | |
---|
290 | | - if (copy.versions == null) |
---|
| 321 | + if (copy.versionlist == null) |
---|
291 | 322 | { |
---|
292 | | - copy.versions = new byte[100][]; |
---|
| 323 | + copy.versionlist = new Object3D[100]; |
---|
293 | 324 | copy.versionindex = -1; |
---|
| 325 | + |
---|
| 326 | +// Save(true); |
---|
294 | 327 | } |
---|
295 | 328 | |
---|
296 | 329 | SetupUI2(callee.GetEditor()); |
---|
.. | .. |
---|
325 | 358 | copy = localCopy; |
---|
326 | 359 | copy.editWindow = this; |
---|
327 | 360 | |
---|
328 | | - if (copy.versions == null) |
---|
329 | | - { |
---|
330 | | -// copy.versions = new byte[100][]; |
---|
| 361 | +// if (copy.versionlist == null) |
---|
| 362 | +// { |
---|
| 363 | +// copy.versionlist = new Object3D[100]; |
---|
331 | 364 | // copy.versionindex = -1; |
---|
332 | | - } |
---|
| 365 | +// |
---|
| 366 | +// Save(true); |
---|
| 367 | +// } |
---|
333 | 368 | |
---|
334 | 369 | SetupMenu(); |
---|
335 | 370 | |
---|
.. | .. |
---|
398 | 433 | |
---|
399 | 434 | ChangeListener changeListener = new ChangeListener() |
---|
400 | 435 | { |
---|
| 436 | + String name; |
---|
| 437 | + |
---|
401 | 438 | public void stateChanged(ChangeEvent changeEvent) |
---|
402 | 439 | { |
---|
403 | 440 | // if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Material") && !materialFlushed) |
---|
.. | .. |
---|
416 | 453 | // EditSelection(false); |
---|
417 | 454 | // } |
---|
418 | 455 | |
---|
419 | | - refreshContents(false); // To refresh Info tab |
---|
| 456 | + if (objectPanel.getSelectedIndex() == 4) |
---|
| 457 | + { |
---|
| 458 | + name = copy.skyboxname; |
---|
| 459 | + |
---|
| 460 | + if (name == null) |
---|
| 461 | + { |
---|
| 462 | + name = ""; |
---|
| 463 | + } |
---|
| 464 | + |
---|
| 465 | + copy.skyboxname = "cubemaps/default-skyboxes/rgb"; |
---|
| 466 | + copy.skyboxext = "jpg"; |
---|
| 467 | + } |
---|
| 468 | + else |
---|
| 469 | + { |
---|
| 470 | + if (name != null) |
---|
| 471 | + { |
---|
| 472 | + if (name.equals("")) |
---|
| 473 | + { |
---|
| 474 | + copy.skyboxname = null; |
---|
| 475 | + copy.skyboxext = null; |
---|
| 476 | + } |
---|
| 477 | + else |
---|
| 478 | + { |
---|
| 479 | + copy.skyboxname = name; |
---|
| 480 | + } |
---|
| 481 | + } |
---|
| 482 | + } |
---|
| 483 | + |
---|
| 484 | +// refreshContents(false); // To refresh Info tab |
---|
| 485 | + cameraView.repaint(); |
---|
420 | 486 | } |
---|
421 | 487 | }; |
---|
422 | 488 | objectPanel.addChangeListener(changeListener); |
---|
.. | .. |
---|
436 | 502 | editPanel.add(editCommandsPanel); |
---|
437 | 503 | editPanel.add(ctrlPanel); |
---|
438 | 504 | |
---|
439 | | - toolboxPanel = new cGridBag().setVertical(false); |
---|
| 505 | + toolboxPanel = new cGridBag().setVertical(true); |
---|
440 | 506 | //toolboxPanel.setName("Toolbox"); |
---|
441 | 507 | |
---|
442 | | - materialPanel = new cGridBag().setVertical(true); |
---|
| 508 | + skyboxPanel = new cGridBag().setVertical(true); |
---|
| 509 | + |
---|
| 510 | + materialPanel = new cGridBag().setVertical(false); |
---|
443 | 511 | //materialPanel.setName("Material"); |
---|
444 | 512 | |
---|
445 | 513 | /*JTextPane*/ |
---|
.. | .. |
---|
723 | 791 | boolean maximized; |
---|
724 | 792 | |
---|
725 | 793 | cButton fullscreenLayout; |
---|
| 794 | + cButton expandedLayout; |
---|
726 | 795 | |
---|
727 | 796 | void Minimize() |
---|
728 | 797 | { |
---|
.. | .. |
---|
762 | 831 | cButton minButton; |
---|
763 | 832 | cButton maxButton; |
---|
764 | 833 | cButton fullButton; |
---|
| 834 | + cButton collapseButton; |
---|
| 835 | + cButton maximize3DButton; |
---|
765 | 836 | |
---|
766 | 837 | void ToggleFullScreen() |
---|
767 | 838 | { |
---|
768 | | -GraphicsDevice device = frame.getGraphicsConfiguration().getDevice(); |
---|
| 839 | + GraphicsDevice device = frame.getGraphicsConfiguration().getDevice(); |
---|
769 | 840 | |
---|
770 | 841 | cameraView.ToggleFullScreen(); |
---|
771 | 842 | |
---|
.. | .. |
---|
786 | 857 | // X frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
787 | 858 | // X framePanel.add(bigThree); |
---|
788 | 859 | // X frame.getContentPane().add(/*"Center",*/framePanel); |
---|
789 | | - framePanel.setDividerLocation(46); |
---|
| 860 | +// framePanel.setDividerLocation(46); // icons are 24x24 |
---|
790 | 861 | |
---|
791 | 862 | //frame.setVisible(true); |
---|
792 | | - radio.layout = keepButton; |
---|
| 863 | +// radio.layout = keepButton; |
---|
793 | 864 | //theFrame = null; |
---|
794 | 865 | keepButton = null; |
---|
795 | | - radio.layout.doClick(); |
---|
| 866 | +// radio.layout.doClick(); |
---|
796 | 867 | |
---|
797 | 868 | } else |
---|
798 | 869 | { |
---|
.. | .. |
---|
813 | 884 | // X frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
814 | 885 | // X framePanel.remove(bigThree); |
---|
815 | 886 | // X frame.getContentPane().add(/*"Center",*/bigThree); |
---|
816 | | - framePanel.setDividerLocation(0); |
---|
| 887 | +// framePanel.setDividerLocation(0); |
---|
817 | 888 | |
---|
818 | | - radio.layout = fullscreenLayout; |
---|
819 | | - radio.layout.doClick(); |
---|
| 889 | +// radio.layout = fullscreenLayout; |
---|
| 890 | +// radio.layout.doClick(); |
---|
820 | 891 | //frame.setVisible(true); |
---|
821 | 892 | } |
---|
822 | 893 | frame.validate(); |
---|
| 894 | + |
---|
| 895 | + cameraView.requestFocusInWindow(); |
---|
823 | 896 | } |
---|
824 | 897 | |
---|
825 | | - private byte[] CompressCopy() |
---|
| 898 | + void CollapseToolbar() |
---|
| 899 | + { |
---|
| 900 | + framePanel.setDividerLocation(0); |
---|
| 901 | + //frame.validate(); |
---|
| 902 | + |
---|
| 903 | + cameraView.requestFocusInWindow(); |
---|
| 904 | + } |
---|
| 905 | + |
---|
| 906 | + private Object3D Duplicate(Object3D object) |
---|
826 | 907 | { |
---|
827 | 908 | boolean temp = CameraPane.SWITCH; |
---|
828 | 909 | CameraPane.SWITCH = false; |
---|
829 | 910 | |
---|
830 | | - copy.ExtractBigData(versiontable); |
---|
| 911 | + object.ExtractBigData(versiontable); |
---|
831 | 912 | // if (copy == client) |
---|
832 | 913 | |
---|
833 | | - byte[] versions[] = copy.versions; |
---|
834 | | - copy.versions = null; |
---|
| 914 | + Object3D versions[] = object.versionlist; |
---|
| 915 | + object.versionlist = null; |
---|
835 | 916 | |
---|
836 | | - byte[] compress = Compress(copy); |
---|
| 917 | + //byte[] compress = Compress(copy); |
---|
| 918 | + Object3D compress = (Object3D)Grafreed.clone(object); |
---|
837 | 919 | |
---|
838 | | - copy.versions = versions; |
---|
| 920 | + object.versionlist = versions; |
---|
839 | 921 | |
---|
840 | | - copy.RestoreBigData(versiontable); |
---|
| 922 | + object.RestoreBigData(versiontable); |
---|
841 | 923 | |
---|
842 | 924 | CameraPane.SWITCH = temp; |
---|
843 | 925 | |
---|
.. | .. |
---|
965 | 1047 | { |
---|
966 | 1048 | SetupMaterial(materialPanel); |
---|
967 | 1049 | } |
---|
| 1050 | + |
---|
968 | 1051 | //SetupName(); |
---|
969 | 1052 | //SetupViews(); |
---|
970 | 1053 | } |
---|
.. | .. |
---|
1173 | 1256 | |
---|
1174 | 1257 | namePanel = new cGridBag(); |
---|
1175 | 1258 | |
---|
| 1259 | + //if (copy.pinned) |
---|
| 1260 | + { |
---|
| 1261 | + pinButton = GetToggleButton("icons/pin.png", !Grafreed.NIMBUSLAF); |
---|
| 1262 | + pinButton.setSelected(copy.pinned); |
---|
| 1263 | + cGridBag t = new cGridBag(); |
---|
| 1264 | + t.preferredWidth = 2; |
---|
| 1265 | + t.add(pinButton); |
---|
| 1266 | + namePanel.add(t); |
---|
| 1267 | + |
---|
| 1268 | + pinButton.addItemListener(this); |
---|
| 1269 | + } |
---|
| 1270 | + |
---|
1176 | 1271 | nameField = AddText(namePanel, copy.GetName()); |
---|
1177 | 1272 | namePanel.add(new JScrollPane(nameField, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER)); |
---|
1178 | 1273 | oe.ctrlPanel.add(namePanel); |
---|
.. | .. |
---|
1194 | 1289 | hideCB.setToolTipText("Hide object"); |
---|
1195 | 1290 | markCB = AddCheckBox(setupPanel, "Mark", copy.marked); |
---|
1196 | 1291 | markCB.setToolTipText("As animation target transform"); |
---|
| 1292 | + |
---|
| 1293 | + ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false); |
---|
1197 | 1294 | |
---|
1198 | 1295 | setupPanel2 = new cGridBag().setVertical(false); |
---|
1199 | 1296 | |
---|
.. | .. |
---|
1520 | 1617 | //tmp.setName("Edit"); |
---|
1521 | 1618 | objectPanel.add(materialPanel); |
---|
1522 | 1619 | objectPanel.setIconAt(0, GetIcon("icons/material.png")); |
---|
| 1620 | + objectPanel.setToolTipTextAt(0, "Material"); |
---|
| 1621 | + |
---|
| 1622 | + objectPanel.add(toolboxPanel); |
---|
| 1623 | + objectPanel.setIconAt(1, GetIcon("icons/primitives.png")); |
---|
| 1624 | + objectPanel.setToolTipTextAt(1, "Objects & textures"); |
---|
| 1625 | + |
---|
| 1626 | + objectPanel.add(skyboxPanel); |
---|
| 1627 | + objectPanel.setIconAt(2, GetIcon("icons/skybox.jpg")); |
---|
| 1628 | + objectPanel.setToolTipTextAt(2, "Backgrounds"); |
---|
| 1629 | + |
---|
1523 | 1630 | // JPanel north = new JPanel(new BorderLayout()); |
---|
1524 | 1631 | // north.setName("Edit"); |
---|
1525 | 1632 | // north.add(ctrlPanel, BorderLayout.NORTH); |
---|
1526 | 1633 | // objectPanel.add(north); |
---|
1527 | 1634 | objectPanel.add(editPanel); |
---|
1528 | | - objectPanel.setIconAt(1, GetIcon("icons/write.png")); |
---|
1529 | | - |
---|
1530 | | - //if (Globals.ADVANCED) |
---|
1531 | | - objectPanel.add(infoPanel); |
---|
1532 | | - objectPanel.setIconAt(2, GetIcon("icons/info.png")); |
---|
| 1635 | + objectPanel.setIconAt(3, GetIcon("icons/write.png")); |
---|
| 1636 | + objectPanel.setToolTipTextAt(3, "Edit controls"); |
---|
1533 | 1637 | |
---|
1534 | 1638 | objectPanel.add(XYZPanel); |
---|
1535 | | - objectPanel.setIconAt(3, GetIcon("icons/XYZ.png")); |
---|
| 1639 | + objectPanel.setIconAt(4, GetIcon("icons/XYZ.png")); |
---|
| 1640 | + objectPanel.setToolTipTextAt(4, "XYZ/RGB transform"); |
---|
1536 | 1641 | |
---|
1537 | | - objectPanel.add(toolboxPanel); |
---|
1538 | | - objectPanel.setIconAt(4, GetIcon("icons/primitives.png")); |
---|
1539 | | - |
---|
1540 | 1642 | /* |
---|
1541 | 1643 | aConstraints.gridx = 0; |
---|
1542 | 1644 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1573 | 1675 | |
---|
1574 | 1676 | scenePanel.add(tabbedPane); |
---|
1575 | 1677 | |
---|
| 1678 | + //if (Globals.ADVANCED) |
---|
| 1679 | + tabbedPane.add(infoPanel); |
---|
| 1680 | + tabbedPane.setIconAt(3, GetIcon("icons/info.png")); |
---|
| 1681 | + tabbedPane.setToolTipTextAt(3, "Information"); |
---|
| 1682 | + |
---|
1576 | 1683 | /* |
---|
1577 | 1684 | cTree jTree = new cTree(null); |
---|
1578 | 1685 | ToolTipManager.sharedInstance().registerComponent(jTree); |
---|
.. | .. |
---|
1643 | 1750 | // aConstraints.gridheight = 1; |
---|
1644 | 1751 | |
---|
1645 | 1752 | framePanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, toolbarPanel, bigThree); |
---|
| 1753 | + |
---|
| 1754 | + framePanel.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY, |
---|
| 1755 | + new java.beans.PropertyChangeListener() |
---|
| 1756 | + { |
---|
| 1757 | + public void propertyChange(java.beans.PropertyChangeEvent pce) |
---|
| 1758 | + { |
---|
| 1759 | + if ((Integer)pce.getOldValue() == 1) |
---|
| 1760 | + { |
---|
| 1761 | + if (radio.layout != expandedLayout) |
---|
| 1762 | + { |
---|
| 1763 | + radio.layout = expandedLayout; |
---|
| 1764 | + radio.layout.doClick(); |
---|
| 1765 | + } |
---|
| 1766 | + } |
---|
| 1767 | + } |
---|
| 1768 | + }); |
---|
| 1769 | + |
---|
1646 | 1770 | framePanel.setContinuousLayout(false); |
---|
1647 | 1771 | framePanel.setOneTouchExpandable(false); |
---|
1648 | 1772 | //.setDividerLocation(0.8); |
---|
.. | .. |
---|
1675 | 1799 | frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); |
---|
1676 | 1800 | frame.addWindowListener(new WindowAdapter() |
---|
1677 | 1801 | { |
---|
1678 | | - |
---|
1679 | 1802 | public void windowClosing(WindowEvent e) |
---|
1680 | 1803 | { |
---|
1681 | 1804 | Close(); |
---|
.. | .. |
---|
1698 | 1821 | ctrlPanel.removeAll(); |
---|
1699 | 1822 | } |
---|
1700 | 1823 | |
---|
1701 | | - void SetupMaterial(cGridBag panel) |
---|
| 1824 | + void SetupMaterial(cGridBag materialpanel) |
---|
1702 | 1825 | { |
---|
1703 | | - /* |
---|
| 1826 | + cGridBag presetpanel = new cGridBag().setVertical(true); |
---|
| 1827 | + |
---|
| 1828 | + cLabel skin = GetLabel("icons/shadericons/shadericon00000.png", !Grafreed.NIMBUSLAF); |
---|
| 1829 | + skin.setToolTipText("Skin"); |
---|
| 1830 | + skin.addMouseListener(new MouseAdapter() |
---|
| 1831 | + { |
---|
| 1832 | + public void mouseClicked(MouseEvent e) |
---|
| 1833 | + { |
---|
| 1834 | + Object3D object = Grafreed.materials.versionlist[0].get(0); |
---|
| 1835 | + cMaterial material = object.material; |
---|
| 1836 | + |
---|
| 1837 | + // Skin |
---|
| 1838 | + colorField.setFloat(material.color); |
---|
| 1839 | + saturationField.setFloat(material.modulation); |
---|
| 1840 | + subsurfaceField.setFloat(material.subsurface); |
---|
| 1841 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1842 | + diffusenessField.setFloat(material.factor); |
---|
| 1843 | + shininessField.setFloat(material.shininess); |
---|
| 1844 | + shadowbiasField.setFloat(material.shadowbias); |
---|
| 1845 | + diffuseField.setFloat(material.diffuse); |
---|
| 1846 | + specularField.setFloat(material.specular); |
---|
| 1847 | + |
---|
| 1848 | + bumpField.setFloat(object.projectedVertices[0].x / 1000.0); |
---|
| 1849 | + noiseField.setFloat(object.projectedVertices[0].y / 1000.0); |
---|
| 1850 | + powerField.setFloat(object.projectedVertices[2].x / 1000.0); |
---|
| 1851 | + |
---|
| 1852 | + materialtouched = true; |
---|
| 1853 | + applySelf(); |
---|
| 1854 | + } |
---|
| 1855 | + }); |
---|
| 1856 | + presetpanel.add(skin); |
---|
| 1857 | + |
---|
| 1858 | + cLabel lambert = GetLabel("icons/shadericons/shadericon00002.png", !Grafreed.NIMBUSLAF); |
---|
| 1859 | + lambert.setToolTipText("Diffuse"); |
---|
| 1860 | + lambert.addMouseListener(new MouseAdapter() |
---|
| 1861 | + { |
---|
| 1862 | + public void mouseClicked(MouseEvent e) |
---|
| 1863 | + { |
---|
| 1864 | + Object3D object = Grafreed.materials.versionlist[2].get(0); |
---|
| 1865 | + cMaterial material = object.material; |
---|
| 1866 | + |
---|
| 1867 | + diffusenessField.setFloat(material.factor); |
---|
| 1868 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1869 | + |
---|
| 1870 | + materialtouched = true; |
---|
| 1871 | + applySelf(); |
---|
| 1872 | + } |
---|
| 1873 | + }); |
---|
| 1874 | + presetpanel.add(lambert); |
---|
| 1875 | + |
---|
| 1876 | + cLabel diffuse2 = GetLabel("icons/shadericons/shadericon00003.png", !Grafreed.NIMBUSLAF); |
---|
| 1877 | + diffuse2.setToolTipText("Diffuse2"); |
---|
| 1878 | + diffuse2.addMouseListener(new MouseAdapter() |
---|
| 1879 | + { |
---|
| 1880 | + public void mouseClicked(MouseEvent e) |
---|
| 1881 | + { |
---|
| 1882 | + Object3D object = Grafreed.materials.versionlist[3].get(0); |
---|
| 1883 | + cMaterial material = object.material; |
---|
| 1884 | + |
---|
| 1885 | + diffusenessField.setFloat(material.factor); |
---|
| 1886 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1887 | + |
---|
| 1888 | + materialtouched = true; |
---|
| 1889 | + applySelf(); |
---|
| 1890 | + } |
---|
| 1891 | + }); |
---|
| 1892 | + presetpanel.add(diffuse2); |
---|
| 1893 | + |
---|
| 1894 | + cLabel diffusemoon = GetLabel("icons/shadericons/shadericon00004.png", !Grafreed.NIMBUSLAF); |
---|
| 1895 | + diffusemoon.setToolTipText("Moon"); |
---|
| 1896 | + diffusemoon.addMouseListener(new MouseAdapter() |
---|
| 1897 | + { |
---|
| 1898 | + public void mouseClicked(MouseEvent e) |
---|
| 1899 | + { |
---|
| 1900 | + Object3D object = Grafreed.materials.versionlist[4].get(0); |
---|
| 1901 | + cMaterial material = object.material; |
---|
| 1902 | + |
---|
| 1903 | + diffusenessField.setFloat(material.factor); |
---|
| 1904 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1905 | + |
---|
| 1906 | + materialtouched = true; |
---|
| 1907 | + applySelf(); |
---|
| 1908 | + } |
---|
| 1909 | + }); |
---|
| 1910 | + presetpanel.add(diffusemoon); |
---|
| 1911 | + |
---|
| 1912 | + cLabel diffusemoon2 = GetLabel("icons/shadericons/shadericon00005.png", !Grafreed.NIMBUSLAF); |
---|
| 1913 | + diffusemoon2.setToolTipText("Moon2"); |
---|
| 1914 | + diffusemoon2.addMouseListener(new MouseAdapter() |
---|
| 1915 | + { |
---|
| 1916 | + public void mouseClicked(MouseEvent e) |
---|
| 1917 | + { |
---|
| 1918 | + Object3D object = Grafreed.materials.versionlist[5].get(0); |
---|
| 1919 | + cMaterial material = object.material; |
---|
| 1920 | + |
---|
| 1921 | + diffusenessField.setFloat(material.factor); |
---|
| 1922 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1923 | + |
---|
| 1924 | + materialtouched = true; |
---|
| 1925 | + applySelf(); |
---|
| 1926 | + } |
---|
| 1927 | + }); |
---|
| 1928 | + presetpanel.add(diffusemoon2); |
---|
| 1929 | + |
---|
| 1930 | + cLabel diffusemoon3 = GetLabel("icons/shadericons/shadericon00006.png", !Grafreed.NIMBUSLAF); |
---|
| 1931 | + diffusemoon3.setToolTipText("Moon3"); |
---|
| 1932 | + diffusemoon3.addMouseListener(new MouseAdapter() |
---|
| 1933 | + { |
---|
| 1934 | + public void mouseClicked(MouseEvent e) |
---|
| 1935 | + { |
---|
| 1936 | + Object3D object = Grafreed.materials.versionlist[6].get(0); |
---|
| 1937 | + cMaterial material = object.material; |
---|
| 1938 | + |
---|
| 1939 | + diffusenessField.setFloat(material.factor); |
---|
| 1940 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1941 | + |
---|
| 1942 | + materialtouched = true; |
---|
| 1943 | + applySelf(); |
---|
| 1944 | + } |
---|
| 1945 | + }); |
---|
| 1946 | + presetpanel.add(diffusemoon3); |
---|
| 1947 | + |
---|
| 1948 | + cLabel diffusesheen = GetLabel("icons/shadericons/shadericon00007.png", !Grafreed.NIMBUSLAF); |
---|
| 1949 | + diffusesheen.setToolTipText("Sheen"); |
---|
| 1950 | + diffusesheen.addMouseListener(new MouseAdapter() |
---|
| 1951 | + { |
---|
| 1952 | + public void mouseClicked(MouseEvent e) |
---|
| 1953 | + { |
---|
| 1954 | + Object3D object = Grafreed.materials.versionlist[7].get(0); |
---|
| 1955 | + cMaterial material = object.material; |
---|
| 1956 | + |
---|
| 1957 | + sheenField.setFloat(material.sheen); |
---|
| 1958 | + |
---|
| 1959 | + materialtouched = true; |
---|
| 1960 | + applySelf(); |
---|
| 1961 | + } |
---|
| 1962 | + }); |
---|
| 1963 | + presetpanel.add(diffusesheen); |
---|
| 1964 | + |
---|
| 1965 | + cLabel rough = GetLabel("icons/shadericons/shadericon00001.png", !Grafreed.NIMBUSLAF); |
---|
| 1966 | + rough.setToolTipText("Rough metal"); |
---|
| 1967 | + rough.addMouseListener(new MouseAdapter() |
---|
| 1968 | + { |
---|
| 1969 | + public void mouseClicked(MouseEvent e) |
---|
| 1970 | + { |
---|
| 1971 | + Object3D object = Grafreed.materials.versionlist[1].get(0); |
---|
| 1972 | + cMaterial material = object.material; |
---|
| 1973 | + |
---|
| 1974 | + shininessField.setFloat(material.shininess); |
---|
| 1975 | + velvetField.setFloat(material.velvet); |
---|
| 1976 | + |
---|
| 1977 | + materialtouched = true; |
---|
| 1978 | + applySelf(); |
---|
| 1979 | + } |
---|
| 1980 | + }); |
---|
| 1981 | + presetpanel.add(rough); |
---|
| 1982 | + |
---|
| 1983 | + cLabel rough2 = GetLabel("icons/shadericons/shadericon00013.png", !Grafreed.NIMBUSLAF); |
---|
| 1984 | + rough2.setToolTipText("Medium metal"); |
---|
| 1985 | + rough2.addMouseListener(new MouseAdapter() |
---|
| 1986 | + { |
---|
| 1987 | + public void mouseClicked(MouseEvent e) |
---|
| 1988 | + { |
---|
| 1989 | + Object3D object = Grafreed.materials.versionlist[13].get(0); |
---|
| 1990 | + cMaterial material = object.material; |
---|
| 1991 | + |
---|
| 1992 | + shininessField.setFloat(material.shininess); |
---|
| 1993 | + lightareaField.setFloat(material.lightarea); |
---|
| 1994 | + |
---|
| 1995 | + materialtouched = true; |
---|
| 1996 | + applySelf(); |
---|
| 1997 | + } |
---|
| 1998 | + }); |
---|
| 1999 | + presetpanel.add(rough2); |
---|
| 2000 | + |
---|
| 2001 | + cLabel shini0 = GetLabel("icons/shadericons/shadericon00014.png", !Grafreed.NIMBUSLAF); |
---|
| 2002 | + shini0.setToolTipText("Shiny"); |
---|
| 2003 | + shini0.addMouseListener(new MouseAdapter() |
---|
| 2004 | + { |
---|
| 2005 | + public void mouseClicked(MouseEvent e) |
---|
| 2006 | + { |
---|
| 2007 | + Object3D object = Grafreed.materials.versionlist[14].get(0); |
---|
| 2008 | + cMaterial material = object.material; |
---|
| 2009 | + |
---|
| 2010 | + shininessField.setFloat(material.shininess); |
---|
| 2011 | + lightareaField.setFloat(material.lightarea); |
---|
| 2012 | + |
---|
| 2013 | + materialtouched = true; |
---|
| 2014 | + applySelf(); |
---|
| 2015 | + } |
---|
| 2016 | + }); |
---|
| 2017 | + presetpanel.add(shini0); |
---|
| 2018 | + |
---|
| 2019 | + cLabel shini1 = GetLabel("icons/shadericons/shadericon00011.png", !Grafreed.NIMBUSLAF); |
---|
| 2020 | + shini1.setToolTipText("Shiny2"); |
---|
| 2021 | + shini1.addMouseListener(new MouseAdapter() |
---|
| 2022 | + { |
---|
| 2023 | + public void mouseClicked(MouseEvent e) |
---|
| 2024 | + { |
---|
| 2025 | + Object3D object = Grafreed.materials.versionlist[11].get(0); |
---|
| 2026 | + cMaterial material = object.material; |
---|
| 2027 | + |
---|
| 2028 | + shininessField.setFloat(material.shininess); |
---|
| 2029 | + lightareaField.setFloat(material.lightarea); |
---|
| 2030 | + |
---|
| 2031 | + materialtouched = true; |
---|
| 2032 | + applySelf(); |
---|
| 2033 | + } |
---|
| 2034 | + }); |
---|
| 2035 | + presetpanel.add(shini1); |
---|
| 2036 | + |
---|
| 2037 | + cLabel shini2 = GetLabel("icons/shadericons/shadericon00012.png", !Grafreed.NIMBUSLAF); |
---|
| 2038 | + shini2.setToolTipText("Shiny3"); |
---|
| 2039 | + shini2.addMouseListener(new MouseAdapter() |
---|
| 2040 | + { |
---|
| 2041 | + public void mouseClicked(MouseEvent e) |
---|
| 2042 | + { |
---|
| 2043 | + Object3D object = Grafreed.materials.versionlist[12].get(0); |
---|
| 2044 | + cMaterial material = object.material; |
---|
| 2045 | + |
---|
| 2046 | + shininessField.setFloat(material.shininess); |
---|
| 2047 | + lightareaField.setFloat(material.lightarea); |
---|
| 2048 | + |
---|
| 2049 | + materialtouched = true; |
---|
| 2050 | + applySelf(); |
---|
| 2051 | + } |
---|
| 2052 | + }); |
---|
| 2053 | + presetpanel.add(shini2); |
---|
| 2054 | + |
---|
| 2055 | + cLabel aniso = GetLabel("icons/shadericons/shadericon00008.png", !Grafreed.NIMBUSLAF); |
---|
| 2056 | + aniso.setToolTipText("AnisoU"); |
---|
| 2057 | + aniso.addMouseListener(new MouseAdapter() |
---|
| 2058 | + { |
---|
| 2059 | + public void mouseClicked(MouseEvent e) |
---|
| 2060 | + { |
---|
| 2061 | + Object3D object = Grafreed.materials.versionlist[8].get(0); |
---|
| 2062 | + cMaterial material = object.material; |
---|
| 2063 | + |
---|
| 2064 | + anisoField.setFloat(material.aniso); |
---|
| 2065 | + anisoVField.setFloat(material.anisoV); |
---|
| 2066 | + |
---|
| 2067 | + materialtouched = true; |
---|
| 2068 | + applySelf(); |
---|
| 2069 | + } |
---|
| 2070 | + }); |
---|
| 2071 | + presetpanel.add(aniso); |
---|
| 2072 | + |
---|
| 2073 | + cLabel aniso2 = GetLabel("icons/shadericons/shadericon00009.png", !Grafreed.NIMBUSLAF); |
---|
| 2074 | + aniso2.setToolTipText("AnisoV"); |
---|
| 2075 | + aniso2.addMouseListener(new MouseAdapter() |
---|
| 2076 | + { |
---|
| 2077 | + public void mouseClicked(MouseEvent e) |
---|
| 2078 | + { |
---|
| 2079 | + Object3D object = Grafreed.materials.versionlist[9].get(0); |
---|
| 2080 | + cMaterial material = object.material; |
---|
| 2081 | + |
---|
| 2082 | + anisoField.setFloat(material.aniso); |
---|
| 2083 | + anisoVField.setFloat(material.anisoV); |
---|
| 2084 | + |
---|
| 2085 | + materialtouched = true; |
---|
| 2086 | + applySelf(); |
---|
| 2087 | + } |
---|
| 2088 | + }); |
---|
| 2089 | + presetpanel.add(aniso2); |
---|
| 2090 | + |
---|
| 2091 | + cLabel aniso3 = GetLabel("icons/shadericons/shadericon00010.png", !Grafreed.NIMBUSLAF); |
---|
| 2092 | + aniso3.setToolTipText("AnisoUV"); |
---|
| 2093 | + aniso3.addMouseListener(new MouseAdapter() |
---|
| 2094 | + { |
---|
| 2095 | + public void mouseClicked(MouseEvent e) |
---|
| 2096 | + { |
---|
| 2097 | + Object3D object = Grafreed.materials.versionlist[10].get(0); |
---|
| 2098 | + cMaterial material = object.material; |
---|
| 2099 | + |
---|
| 2100 | + anisoField.setFloat(material.aniso); |
---|
| 2101 | + anisoVField.setFloat(material.anisoV); |
---|
| 2102 | + |
---|
| 2103 | + materialtouched = true; |
---|
| 2104 | + applySelf(); |
---|
| 2105 | + } |
---|
| 2106 | + }); |
---|
| 2107 | + presetpanel.add(aniso3); |
---|
| 2108 | + |
---|
| 2109 | + cLabel velvet0 = GetLabel("icons/shadericons/shadericon00015.png", !Grafreed.NIMBUSLAF); |
---|
| 2110 | + velvet0.setToolTipText("Velvet"); |
---|
| 2111 | + velvet0.addMouseListener(new MouseAdapter() |
---|
| 2112 | + { |
---|
| 2113 | + public void mouseClicked(MouseEvent e) |
---|
| 2114 | + { |
---|
| 2115 | + Object3D object = Grafreed.materials.versionlist[15].get(0); |
---|
| 2116 | + cMaterial material = object.material; |
---|
| 2117 | + |
---|
| 2118 | + diffusenessField.setFloat(material.factor); |
---|
| 2119 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 2120 | + sheenField.setFloat(material.sheen); |
---|
| 2121 | + shininessField.setFloat(material.shininess); |
---|
| 2122 | + velvetField.setFloat(material.velvet); |
---|
| 2123 | + shiftField.setFloat(material.shift); |
---|
| 2124 | + |
---|
| 2125 | + materialtouched = true; |
---|
| 2126 | + applySelf(); |
---|
| 2127 | + } |
---|
| 2128 | + }); |
---|
| 2129 | + presetpanel.add(velvet0); |
---|
| 2130 | + |
---|
| 2131 | + cLabel bump0 = GetLabel("icons/shadericons/shadericon00016.png", !Grafreed.NIMBUSLAF); |
---|
| 2132 | + bump0.setToolTipText("Bump texture"); |
---|
| 2133 | + bump0.addMouseListener(new MouseAdapter() |
---|
| 2134 | + { |
---|
| 2135 | + public void mouseClicked(MouseEvent e) |
---|
| 2136 | + { |
---|
| 2137 | + Object3D object = Grafreed.materials.versionlist[16].get(0); |
---|
| 2138 | + cMaterial material = object.material; |
---|
| 2139 | + |
---|
| 2140 | + bumpField.setFloat(object.projectedVertices[0].x / 1000.0); |
---|
| 2141 | + noiseField.setFloat(object.projectedVertices[0].y / 1000.0); |
---|
| 2142 | + powerField.setFloat(object.projectedVertices[2].x / 1000.0); |
---|
| 2143 | + |
---|
| 2144 | + materialtouched = true; |
---|
| 2145 | + applySelf(); |
---|
| 2146 | + } |
---|
| 2147 | + }); |
---|
| 2148 | + presetpanel.add(bump0); |
---|
| 2149 | + |
---|
| 2150 | + cLabel halo = GetLabel("icons/shadericons/shadericon00017.png", !Grafreed.NIMBUSLAF); |
---|
| 2151 | + halo.setToolTipText("Halo"); |
---|
| 2152 | + halo.addMouseListener(new MouseAdapter() |
---|
| 2153 | + { |
---|
| 2154 | + public void mouseClicked(MouseEvent e) |
---|
| 2155 | + { |
---|
| 2156 | + Object3D object = Grafreed.materials.versionlist[17].get(0); |
---|
| 2157 | + cMaterial material = object.material; |
---|
| 2158 | + |
---|
| 2159 | + opacityPowerField.setFloat(object.projectedVertices[2].y / 1000.0); |
---|
| 2160 | + |
---|
| 2161 | + materialtouched = true; |
---|
| 2162 | + applySelf(); |
---|
| 2163 | + } |
---|
| 2164 | + }); |
---|
| 2165 | + presetpanel.add(halo); |
---|
| 2166 | + |
---|
| 2167 | + cLabel candle = GetLabel("icons/shadericons/shadericon00018.png", !Grafreed.NIMBUSLAF); |
---|
| 2168 | + candle.setToolTipText("Candle"); |
---|
| 2169 | + candle.addMouseListener(new MouseAdapter() |
---|
| 2170 | + { |
---|
| 2171 | + public void mouseClicked(MouseEvent e) |
---|
| 2172 | + { |
---|
| 2173 | + Object3D object = Grafreed.materials.versionlist[18].get(0); |
---|
| 2174 | + cMaterial material = object.material; |
---|
| 2175 | + |
---|
| 2176 | + subsurfaceField.setFloat(material.subsurface); |
---|
| 2177 | + shadowbiasField.setFloat(material.shadowbias); |
---|
| 2178 | + ambientField.setFloat(material.ambient); |
---|
| 2179 | + specularField.setFloat(material.specular); |
---|
| 2180 | + lightareaField.setFloat(material.lightarea); |
---|
| 2181 | + shininessField.setFloat(material.shininess); |
---|
| 2182 | + |
---|
| 2183 | + materialtouched = true; |
---|
| 2184 | + applySelf(); |
---|
| 2185 | + } |
---|
| 2186 | + }); |
---|
| 2187 | + presetpanel.add(candle); |
---|
| 2188 | + |
---|
| 2189 | + cLabel shadowShader = GetLabel("icons/shadericons/shadow.png", !Grafreed.NIMBUSLAF); |
---|
| 2190 | + shadowShader.setToolTipText("Shadow"); |
---|
| 2191 | + shadowShader.addMouseListener(new MouseAdapter() |
---|
| 2192 | + { |
---|
| 2193 | + public void mouseClicked(MouseEvent e) |
---|
| 2194 | + { |
---|
| 2195 | + diffuseField.setFloat(0.001); |
---|
| 2196 | + ambientField.setFloat(0.001); |
---|
| 2197 | + cameraField.setFloat(0.001); |
---|
| 2198 | + specularField.setFloat(0.001); |
---|
| 2199 | + fakedepthField.setFloat(0.001); |
---|
| 2200 | + opacityField.setFloat(0.6); |
---|
| 2201 | + |
---|
| 2202 | + materialtouched = true; |
---|
| 2203 | + applySelf(); |
---|
| 2204 | + } |
---|
| 2205 | + }); |
---|
| 2206 | + presetpanel.add(shadowShader); |
---|
| 2207 | + |
---|
| 2208 | + cGridBag panel = new cGridBag().setVertical(true); |
---|
| 2209 | + |
---|
| 2210 | + presetpanel.preferredWidth = 1; |
---|
| 2211 | + |
---|
| 2212 | + materialpanel.add(presetpanel); |
---|
| 2213 | + materialpanel.add(panel); |
---|
| 2214 | + |
---|
| 2215 | + panel.preferredWidth = 8; |
---|
| 2216 | + |
---|
| 2217 | + /* |
---|
1704 | 2218 | ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints); |
---|
1705 | 2219 | materialLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1706 | | - */ |
---|
| 2220 | + */ |
---|
1707 | 2221 | |
---|
1708 | 2222 | cGridBag editBar = new cGridBag().setVertical(false); |
---|
1709 | 2223 | |
---|
.. | .. |
---|
1737 | 2251 | //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1738 | 2252 | |
---|
1739 | 2253 | cGridBag colorSection = new cGridBag().setVertical(true); |
---|
| 2254 | + |
---|
| 2255 | + cGridBag huepanel = new cGridBag(); |
---|
| 2256 | + cGridBag huelabel = new cGridBag(); |
---|
| 2257 | + skin = GetLabel("icons/hue.png", false); |
---|
| 2258 | + skin.fit = true; |
---|
| 2259 | + huelabel.add(skin); |
---|
| 2260 | + huelabel.preferredWidth = 20; |
---|
| 2261 | + huepanel.add(new cGridBag()); // Label |
---|
| 2262 | + huepanel.add(huelabel); // Field/slider |
---|
| 2263 | + |
---|
| 2264 | + huepanel.preferredHeight = 7; |
---|
| 2265 | + |
---|
| 2266 | + colorSection.add(huepanel); |
---|
1740 | 2267 | |
---|
1741 | 2268 | cGridBag color = new cGridBag(); |
---|
1742 | | - color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints); |
---|
1743 | | - colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1744 | | - color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 2269 | + |
---|
| 2270 | + color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints); |
---|
| 2271 | + colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2272 | + color.add(colorField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
| 2273 | + |
---|
1745 | 2274 | //colorField.preferredWidth = 200; |
---|
1746 | 2275 | colorSection.add(color); |
---|
1747 | 2276 | |
---|
1748 | 2277 | cGridBag modulation = new cGridBag(); |
---|
1749 | 2278 | modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints); |
---|
1750 | 2279 | modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1751 | | - modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 2280 | + modulation.add(saturationField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
1752 | 2281 | colorSection.add(modulation); |
---|
1753 | 2282 | |
---|
| 2283 | + cGridBag opacity = new cGridBag(); |
---|
| 2284 | + opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints); |
---|
| 2285 | + opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2286 | + opacity.add(opacityField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
| 2287 | + colorSection.add(opacity); |
---|
| 2288 | + |
---|
| 2289 | + colorSection.add(GetSeparator()); |
---|
| 2290 | + |
---|
1754 | 2291 | cGridBag texture = new cGridBag(); |
---|
1755 | 2292 | texture.add(textureLabel = new JLabel("Texture")); // , aConstraints); |
---|
1756 | 2293 | textureLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1757 | 2294 | texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1758 | 2295 | colorSection.add(texture); |
---|
1759 | 2296 | |
---|
1760 | | - panel.add(new JSeparator()); |
---|
| 2297 | + panel.add(GetSeparator()); |
---|
1761 | 2298 | |
---|
1762 | 2299 | panel.add(colorSection); |
---|
1763 | 2300 | |
---|
.. | .. |
---|
1813 | 2350 | shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1814 | 2351 | diffuseSection.add(shadowbias); |
---|
1815 | 2352 | |
---|
1816 | | - panel.add(new JSeparator()); |
---|
| 2353 | + panel.add(GetSeparator()); |
---|
1817 | 2354 | |
---|
1818 | 2355 | panel.add(diffuseSection); |
---|
1819 | 2356 | |
---|
.. | .. |
---|
1876 | 2413 | specularSection.add(anisoV); |
---|
1877 | 2414 | |
---|
1878 | 2415 | |
---|
1879 | | - panel.add(new JSeparator()); |
---|
| 2416 | + panel.add(GetSeparator()); |
---|
1880 | 2417 | |
---|
1881 | 2418 | panel.add(specularSection); |
---|
1882 | 2419 | |
---|
.. | .. |
---|
1901 | 2438 | backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1902 | 2439 | backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1903 | 2440 | colorSection.add(backlit); |
---|
1904 | | - |
---|
1905 | | - cGridBag opacity = new cGridBag(); |
---|
1906 | | - opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints); |
---|
1907 | | - opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1908 | | - opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1909 | | - colorSection.add(opacity); |
---|
1910 | 2441 | |
---|
1911 | 2442 | //panel.add(new JSeparator()); |
---|
1912 | 2443 | |
---|
.. | .. |
---|
1952 | 2483 | opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints); |
---|
1953 | 2484 | textureSection.add(opacityPower); |
---|
1954 | 2485 | |
---|
1955 | | - panel.add(new JSeparator()); |
---|
| 2486 | + panel.add(GetSeparator()); |
---|
1956 | 2487 | |
---|
1957 | 2488 | panel.add(textureSection); |
---|
1958 | 2489 | |
---|
.. | .. |
---|
2939 | 3470 | |
---|
2940 | 3471 | freezematerial = true; |
---|
2941 | 3472 | colorField.setFloat(mat.color); |
---|
2942 | | - modulationField.setFloat(mat.modulation); |
---|
| 3473 | + saturationField.setFloat(mat.modulation); |
---|
2943 | 3474 | metalnessField.setFloat(mat.metalness); |
---|
2944 | 3475 | diffuseField.setFloat(mat.diffuse); |
---|
2945 | 3476 | specularField.setFloat(mat.specular); |
---|
.. | .. |
---|
3146 | 3677 | public void itemStateChanged(ItemEvent event) |
---|
3147 | 3678 | { |
---|
3148 | 3679 | // System.out.println("Propagate = " + propagate); |
---|
| 3680 | + if (event.getSource() == pinButton) |
---|
| 3681 | + { |
---|
| 3682 | + copy.pinned ^= true; |
---|
| 3683 | + if (!copy.pinned && !copy.editWindow.copy.selection.contains(copy)) |
---|
| 3684 | + { |
---|
| 3685 | + ((GroupEditor)copy.editWindow).listUI.remove(copy); |
---|
| 3686 | + copy.CloseUI(); |
---|
| 3687 | + //copy.editWindow.refreshContents(); |
---|
| 3688 | + } |
---|
| 3689 | + } |
---|
| 3690 | + else |
---|
3149 | 3691 | if (event.getSource() == propagateToggle) |
---|
3150 | 3692 | { |
---|
3151 | 3693 | propagate ^= true; |
---|
.. | .. |
---|
3250 | 3792 | } else if (event.getSource() == liveCB) |
---|
3251 | 3793 | { |
---|
3252 | 3794 | copy.live ^= true; |
---|
| 3795 | + objEditor.refreshContents(true); // To show item colors |
---|
3253 | 3796 | return; |
---|
3254 | 3797 | } else if (event.getSource() == selectableCB) |
---|
3255 | 3798 | { |
---|
.. | .. |
---|
3259 | 3802 | { |
---|
3260 | 3803 | copy.hide ^= true; |
---|
3261 | 3804 | copy.Touch(); // display list issue |
---|
3262 | | - objEditor.refreshContents(); |
---|
| 3805 | + objEditor.refreshContents(true); // To show item colors |
---|
3263 | 3806 | return; |
---|
3264 | 3807 | } else if (event.getSource() == link2masterCB) |
---|
3265 | 3808 | { |
---|
.. | .. |
---|
3515 | 4058 | |
---|
3516 | 4059 | static public byte[] Compress(Object3D o) |
---|
3517 | 4060 | { |
---|
| 4061 | + // Slower to actually compress. |
---|
3518 | 4062 | try |
---|
3519 | 4063 | { |
---|
3520 | 4064 | ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
---|
.. | .. |
---|
3616 | 4160 | { |
---|
3617 | 4161 | //Save(true); |
---|
3618 | 4162 | Replace(); |
---|
| 4163 | + SetVersionStates(); |
---|
3619 | 4164 | } |
---|
3620 | 4165 | |
---|
3621 | 4166 | private boolean Equal(byte[] compress, byte[] name) |
---|
.. | .. |
---|
3636 | 4181 | |
---|
3637 | 4182 | java.util.Hashtable<java.util.UUID, Object3D> versiontable = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
3638 | 4183 | |
---|
| 4184 | + void DeleteVersion() |
---|
| 4185 | + { |
---|
| 4186 | + for (int i = copy.versionindex; i < copy.versionlist.length-1; i++) |
---|
| 4187 | + { |
---|
| 4188 | + copy.versionlist[i] = copy.versionlist[i+1]; |
---|
| 4189 | + } |
---|
| 4190 | + |
---|
| 4191 | + CopyChanged(); |
---|
| 4192 | + |
---|
| 4193 | + SetVersionStates(); |
---|
| 4194 | + } |
---|
| 4195 | + |
---|
3639 | 4196 | public boolean Save(boolean user) |
---|
3640 | 4197 | { |
---|
3641 | 4198 | System.err.println("Save"); |
---|
| 4199 | + Replace(); |
---|
3642 | 4200 | |
---|
3643 | | - cRadio tab = GetCurrentTab(); |
---|
| 4201 | + //cRadio tab = GetCurrentTab(); |
---|
3644 | 4202 | |
---|
3645 | | - byte[] compress = CompressCopy(); |
---|
| 4203 | + Object3D compress = Duplicate(copy); // Saved version. No need for "Replace"? |
---|
3646 | 4204 | |
---|
3647 | 4205 | boolean thesame = false; |
---|
3648 | 4206 | |
---|
3649 | | - // Quick heuristic using length. Works only when stream is compressed. |
---|
3650 | | - if (copy.versionindex > 0 && copy.versions[copy.versionindex-1] != null && Equal(compress, copy.versions[copy.versionindex-1])) |
---|
3651 | | - { |
---|
3652 | | - thesame = true; |
---|
3653 | | - } |
---|
| 4207 | +// if (copy.versionindex > 0 && copy.versions[copy.versionindex-1] != null && Equal(compress, copy.versions[copy.versionindex-1])) |
---|
| 4208 | +// { |
---|
| 4209 | +// thesame = true; |
---|
| 4210 | +// } |
---|
3654 | 4211 | |
---|
3655 | 4212 | //EditorFrame.m_MainFrame.requestFocusInWindow(); |
---|
3656 | 4213 | if (!thesame) |
---|
3657 | 4214 | { |
---|
| 4215 | + for (int i = copy.versionlist.length; --i > copy.versionindex+1;) |
---|
| 4216 | + { |
---|
| 4217 | + copy.versionlist[i] = copy.versionlist[i-1]; |
---|
| 4218 | + } |
---|
| 4219 | + |
---|
3658 | 4220 | //tab.user[tab.versionindex] = user; |
---|
3659 | 4221 | //boolean increment = true; // tab.graphs[tab.versionindex] == null; |
---|
3660 | 4222 | |
---|
3661 | | - copy.versions[++copy.versionindex] = compress; |
---|
| 4223 | + copy.versionlist[++copy.versionindex] = compress; |
---|
3662 | 4224 | |
---|
3663 | 4225 | // if (increment) |
---|
3664 | 4226 | // tab.versionindex++; |
---|
.. | .. |
---|
3668 | 4230 | |
---|
3669 | 4231 | //assert(hashtable.isEmpty()); |
---|
3670 | 4232 | |
---|
3671 | | - for (int i = copy.versionindex+1; i < copy.versions.length; i++) |
---|
3672 | | - { |
---|
3673 | | - //tab.user[i] = false; |
---|
3674 | | - copy.versions[i] = null; |
---|
3675 | | - } |
---|
| 4233 | +// for (int i = copy.versionindex+1; i < copy.versionlist.length; i++) |
---|
| 4234 | +// { |
---|
| 4235 | +// //tab.user[i] = false; |
---|
| 4236 | +// copy.versionlist[i] = null; |
---|
| 4237 | +// } |
---|
3676 | 4238 | |
---|
3677 | | - SetUndoStates(); |
---|
| 4239 | + SetVersionStates(); |
---|
3678 | 4240 | |
---|
3679 | 4241 | // test save |
---|
3680 | 4242 | if (false) |
---|
.. | .. |
---|
3697 | 4259 | |
---|
3698 | 4260 | return !thesame; |
---|
3699 | 4261 | } |
---|
3700 | | - |
---|
3701 | | - void CopyChanged(Object3D obj) |
---|
| 4262 | + |
---|
| 4263 | + boolean flashIt = true; |
---|
| 4264 | + |
---|
| 4265 | + void RefreshSelection() |
---|
3702 | 4266 | { |
---|
3703 | | - SetUndoStates(); |
---|
| 4267 | + Object3D selection = new Object3D(); |
---|
| 4268 | + |
---|
| 4269 | + for (int i = 0; i < copy.selection.size(); i++) |
---|
| 4270 | + { |
---|
| 4271 | + Object3D elem = copy.selection.elementAt(i); |
---|
| 4272 | + |
---|
| 4273 | + Object3D obj = copy.GetObject(elem.GetUUID()); |
---|
| 4274 | + |
---|
| 4275 | + if (obj == null) |
---|
| 4276 | + { |
---|
| 4277 | + copy.selection.remove(i--); |
---|
| 4278 | + } |
---|
| 4279 | + else |
---|
| 4280 | + { |
---|
| 4281 | + selection.add(obj); |
---|
| 4282 | + copy.selection.setElementAt(obj, i); |
---|
| 4283 | + } |
---|
| 4284 | + } |
---|
| 4285 | + |
---|
| 4286 | + flashIt = false; |
---|
| 4287 | + GetTree().clearSelection(); |
---|
| 4288 | + for (int i = 0; i < selection.size(); i++) |
---|
| 4289 | + GetTree().addSelectionPath(selection.elementAt(i).GetTreePath().GetTreePath()); |
---|
| 4290 | + flashIt = true; |
---|
| 4291 | + |
---|
| 4292 | + //refreshContents(false); |
---|
| 4293 | + } |
---|
| 4294 | + |
---|
| 4295 | + void CopyChanged() |
---|
| 4296 | + { |
---|
| 4297 | + Object3D obj = (Object3D)Grafreed.clone(copy.versionlist[copy.versionindex]); |
---|
| 4298 | + |
---|
| 4299 | + SetVersionStates(); |
---|
3704 | 4300 | |
---|
3705 | 4301 | boolean temp = CameraPane.SWITCH; |
---|
3706 | 4302 | CameraPane.SWITCH = false; |
---|
.. | .. |
---|
3709 | 4305 | |
---|
3710 | 4306 | copy.clear(); |
---|
3711 | 4307 | |
---|
| 4308 | + copy.skyboxname = obj.skyboxname; |
---|
| 4309 | + copy.skyboxext = obj.skyboxext; |
---|
| 4310 | + |
---|
3712 | 4311 | for (int i=0; i<obj.Size(); i++) |
---|
3713 | 4312 | { |
---|
3714 | 4313 | copy.add(obj.get(i)); |
---|
.. | .. |
---|
3718 | 4317 | |
---|
3719 | 4318 | CameraPane.SWITCH = temp; |
---|
3720 | 4319 | |
---|
| 4320 | + RefreshSelection(); |
---|
3721 | 4321 | //assert(hashtable.isEmpty()); |
---|
3722 | 4322 | |
---|
3723 | 4323 | copy.Touch(); |
---|
.. | .. |
---|
3738 | 4338 | } |
---|
3739 | 4339 | } |
---|
3740 | 4340 | |
---|
3741 | | - refreshContents(); |
---|
| 4341 | + refreshContents(true); |
---|
3742 | 4342 | } |
---|
3743 | 4343 | |
---|
3744 | | - cButton undoButton; |
---|
| 4344 | + cButton previousVersionButton; |
---|
3745 | 4345 | cButton restoreButton; |
---|
3746 | 4346 | cButton replaceButton; |
---|
3747 | | - cButton redoButton; |
---|
| 4347 | + cButton nextVersionButton; |
---|
| 4348 | + cButton saveVersionButton; |
---|
| 4349 | + cButton deleteVersionButton; |
---|
3748 | 4350 | |
---|
3749 | 4351 | boolean muteSlider; |
---|
3750 | 4352 | |
---|
.. | .. |
---|
3752 | 4354 | { |
---|
3753 | 4355 | int count = 0; |
---|
3754 | 4356 | |
---|
3755 | | - for (int i = copy.versions.length; --i >= 0;) |
---|
| 4357 | + for (int i = copy.versionlist.length; --i >= 0;) |
---|
3756 | 4358 | { |
---|
3757 | | - if (copy.versions[i] != null) |
---|
| 4359 | + if (copy.versionlist[i] != null) |
---|
3758 | 4360 | count++; |
---|
3759 | 4361 | } |
---|
3760 | 4362 | |
---|
3761 | 4363 | return count; |
---|
3762 | 4364 | } |
---|
3763 | 4365 | |
---|
3764 | | - void SetUndoStates() |
---|
| 4366 | + void SetVersionStates() |
---|
3765 | 4367 | { |
---|
3766 | | - cRadio tab = GetCurrentTab(); |
---|
| 4368 | + //if (true) |
---|
| 4369 | + // return; |
---|
| 4370 | + |
---|
| 4371 | + //cRadio tab = GetCurrentTab(); |
---|
3767 | 4372 | |
---|
3768 | 4373 | restoreButton.setEnabled(copy.versionindex != -1); |
---|
3769 | 4374 | replaceButton.setEnabled(copy.versionindex != -1); |
---|
3770 | 4375 | |
---|
3771 | | - undoButton.setEnabled(copy.versionindex > 0); |
---|
3772 | | - redoButton.setEnabled(copy.versions[copy.versionindex + 1] != null); |
---|
| 4376 | + previousVersionButton.setEnabled(copy.versionindex > 0); |
---|
| 4377 | + nextVersionButton.setEnabled(copy.versionlist[copy.versionindex + 1] != null); |
---|
| 4378 | + |
---|
| 4379 | + deleteVersionButton.setEnabled(//copy.versionindex > 0 && |
---|
| 4380 | + copy.versionlist[copy.versionindex + 1] != null); |
---|
3773 | 4381 | |
---|
3774 | 4382 | muteSlider = true; |
---|
| 4383 | + versionSlider.setMinimum(0); |
---|
3775 | 4384 | versionSlider.setMaximum(VersionCount() - 1); |
---|
3776 | 4385 | versionSlider.setInteger(copy.versionindex); |
---|
| 4386 | + versionSlider.setEnabled(copy.versionindex != -1); |
---|
3777 | 4387 | muteSlider = false; |
---|
3778 | 4388 | } |
---|
3779 | 4389 | |
---|
3780 | | - public boolean Undo() |
---|
| 4390 | + public boolean PreviousVersion() |
---|
3781 | 4391 | { |
---|
3782 | 4392 | // Option? |
---|
3783 | 4393 | Replace(); |
---|
3784 | 4394 | |
---|
3785 | 4395 | System.err.println("Undo"); |
---|
3786 | 4396 | |
---|
3787 | | - cRadio tab = GetCurrentTab(); |
---|
| 4397 | + //cRadio tab = GetCurrentTab(); |
---|
3788 | 4398 | |
---|
3789 | 4399 | if (copy.versionindex == 0) |
---|
3790 | 4400 | { |
---|
.. | .. |
---|
3807 | 4417 | |
---|
3808 | 4418 | copy.versionindex -= 1; |
---|
3809 | 4419 | |
---|
3810 | | - CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
| 4420 | + CopyChanged(); |
---|
3811 | 4421 | |
---|
3812 | 4422 | return true; |
---|
3813 | 4423 | } |
---|
.. | .. |
---|
3816 | 4426 | { |
---|
3817 | 4427 | System.err.println("Restore"); |
---|
3818 | 4428 | |
---|
3819 | | - cRadio tab = GetCurrentTab(); |
---|
| 4429 | + //cRadio tab = GetCurrentTab(); |
---|
3820 | 4430 | |
---|
3821 | | - if (copy.versionindex == -1 || copy.versions[copy.versionindex] == null) |
---|
| 4431 | + if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
3822 | 4432 | { |
---|
3823 | 4433 | java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
3824 | 4434 | return false; |
---|
3825 | 4435 | } |
---|
3826 | 4436 | |
---|
3827 | | - CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
| 4437 | + //CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
| 4438 | + CopyChanged(); |
---|
3828 | 4439 | |
---|
3829 | 4440 | return true; |
---|
3830 | 4441 | } |
---|
.. | .. |
---|
3833 | 4444 | { |
---|
3834 | 4445 | System.err.println("Replace"); |
---|
3835 | 4446 | |
---|
3836 | | - cRadio tab = GetCurrentTab(); |
---|
| 4447 | + //cRadio tab = GetCurrentTab(); |
---|
3837 | 4448 | |
---|
3838 | | - if (copy.versionindex == -1 || copy.versions[copy.versionindex] == null) |
---|
| 4449 | + if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
3839 | 4450 | { |
---|
3840 | 4451 | // No version yet. OK. java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
3841 | 4452 | return false; |
---|
3842 | 4453 | } |
---|
3843 | 4454 | |
---|
3844 | | - copy.versions[copy.versionindex] = CompressCopy(); |
---|
| 4455 | + copy.versionlist[copy.versionindex] = Duplicate(copy); |
---|
3845 | 4456 | |
---|
3846 | 4457 | return true; |
---|
3847 | 4458 | } |
---|
3848 | 4459 | |
---|
3849 | | - public void Redo() |
---|
| 4460 | + public void NextVersion() |
---|
3850 | 4461 | { |
---|
3851 | 4462 | // Option? |
---|
3852 | 4463 | Replace(); |
---|
3853 | 4464 | |
---|
3854 | | - cRadio tab = GetCurrentTab(); |
---|
| 4465 | + //cRadio tab = GetCurrentTab(); |
---|
3855 | 4466 | |
---|
3856 | | - if (copy.versions[copy.versionindex + 1] == null) |
---|
| 4467 | + if (copy.versionlist[copy.versionindex + 1] == null) |
---|
3857 | 4468 | { |
---|
3858 | 4469 | java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
3859 | 4470 | return; |
---|
.. | .. |
---|
3861 | 4472 | |
---|
3862 | 4473 | copy.versionindex += 1; |
---|
3863 | 4474 | |
---|
3864 | | - CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
| 4475 | + CopyChanged(); |
---|
3865 | 4476 | |
---|
3866 | 4477 | //if (!tab.user[tab.versionindex]) |
---|
3867 | 4478 | // tab.graphs[tab.versionindex] = null; |
---|
.. | .. |
---|
4075 | 4686 | //copy.material = new cMaterial(copy.GetMaterial()); |
---|
4076 | 4687 | |
---|
4077 | 4688 | current.color = (float) colorField.getFloat(); |
---|
4078 | | - current.modulation = (float) modulationField.getFloat(); |
---|
| 4689 | + current.modulation = (float) saturationField.getFloat(); |
---|
4079 | 4690 | current.metalness = (float) metalnessField.getFloat(); |
---|
4080 | 4691 | current.diffuse = (float) diffuseField.getFloat(); |
---|
4081 | 4692 | current.specular = (float) specularField.getFloat(); |
---|
.. | .. |
---|
4108 | 4719 | cMaterial mat = copy.material; |
---|
4109 | 4720 | |
---|
4110 | 4721 | colorField.SetToolTipValue((mat.color)); |
---|
4111 | | - modulationField.SetToolTipValue((mat.modulation)); |
---|
| 4722 | + saturationField.SetToolTipValue((mat.modulation)); |
---|
4112 | 4723 | metalnessField.SetToolTipValue((mat.metalness)); |
---|
4113 | 4724 | diffuseField.SetToolTipValue((mat.diffuse)); |
---|
4114 | 4725 | specularField.SetToolTipValue((mat.specular)); |
---|
.. | .. |
---|
4172 | 4783 | |
---|
4173 | 4784 | int version = versionSlider.getInteger(); |
---|
4174 | 4785 | |
---|
4175 | | - if (copy.versions[version] != null) |
---|
| 4786 | + if (version != -1 && copy.versionlist[version] != null) |
---|
4176 | 4787 | { |
---|
4177 | | - CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex = version])); |
---|
| 4788 | + copy.versionindex = version; |
---|
| 4789 | + CopyChanged(); |
---|
4178 | 4790 | } |
---|
4179 | 4791 | |
---|
4180 | 4792 | return; |
---|
.. | .. |
---|
4214 | 4826 | { |
---|
4215 | 4827 | //System.out.println("stateChanged = " + this); |
---|
4216 | 4828 | materialtouched = true; |
---|
| 4829 | + |
---|
| 4830 | + if (Globals.AUTOSATURATE && e.getSource() == colorField && saturationField.getFloat() == 0.001) |
---|
| 4831 | + { |
---|
| 4832 | + saturationField.setFloat(1); |
---|
| 4833 | + } |
---|
| 4834 | + |
---|
4217 | 4835 | applySelf(); |
---|
4218 | 4836 | //System.out.println("this = " + this); |
---|
4219 | 4837 | //System.out.println("PARENT = " + parent); |
---|
.. | .. |
---|
4513 | 5131 | { |
---|
4514 | 5132 | if (GetTree() != null) |
---|
4515 | 5133 | { |
---|
| 5134 | + GetTree().revalidate(); |
---|
4516 | 5135 | GetTree().repaint(); |
---|
4517 | 5136 | } |
---|
4518 | 5137 | |
---|
.. | .. |
---|
4521 | 5140 | ctrlPanel.validate(); // ? new |
---|
4522 | 5141 | ctrlPanel.repaint(); |
---|
4523 | 5142 | } |
---|
| 5143 | + |
---|
| 5144 | + if (previousVersionButton != null && copy.versionlist != null) |
---|
| 5145 | + SetVersionStates(); |
---|
4524 | 5146 | } |
---|
4525 | 5147 | |
---|
4526 | 5148 | static TweenManager tweenManager = new TweenManager(); |
---|
.. | .. |
---|
4769 | 5391 | readobj.ResetDisplayList(); |
---|
4770 | 5392 | } catch (Exception e) |
---|
4771 | 5393 | { |
---|
4772 | | - e.printStackTrace(); |
---|
| 5394 | + if (!e.toString().contains("GZIP")) |
---|
| 5395 | + e.printStackTrace(); |
---|
| 5396 | + |
---|
4773 | 5397 | try |
---|
4774 | 5398 | { |
---|
4775 | 5399 | java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
.. | .. |
---|
4849 | 5473 | { |
---|
4850 | 5474 | //readobj.deepCopySelf(copy); |
---|
4851 | 5475 | copy.clear(); // june 2014 |
---|
| 5476 | + copy.skyboxname = readobj.skyboxname; |
---|
| 5477 | + copy.skyboxext = readobj.skyboxext; |
---|
4852 | 5478 | for (int i = 0; i < readobj.size(); i++) |
---|
4853 | 5479 | { |
---|
4854 | 5480 | Object3D child = readobj.get(i); // reserve(i); |
---|
.. | .. |
---|
4889 | 5515 | } |
---|
4890 | 5516 | } catch (ClassCastException e) |
---|
4891 | 5517 | { |
---|
| 5518 | + e.printStackTrace(); |
---|
4892 | 5519 | assert (false); |
---|
4893 | 5520 | Composite c = (Composite) copy; |
---|
4894 | 5521 | c.children.clear(); |
---|
.. | .. |
---|
4899 | 5526 | c.addChild(csg); |
---|
4900 | 5527 | } |
---|
4901 | 5528 | |
---|
4902 | | - copy.versions = readobj.versions; |
---|
| 5529 | + copy.versionlist = readobj.versionlist; |
---|
4903 | 5530 | copy.versionindex = readobj.versionindex; |
---|
4904 | 5531 | |
---|
4905 | | - if (copy.versions == null) |
---|
| 5532 | + if (copy.versionlist == null) |
---|
4906 | 5533 | { |
---|
4907 | | - copy.versions = new byte[100][]; |
---|
| 5534 | + // Backward compatibility |
---|
| 5535 | + copy.versionlist = new Object3D[100]; |
---|
4908 | 5536 | copy.versionindex = -1; |
---|
| 5537 | + |
---|
| 5538 | + Save(true); |
---|
4909 | 5539 | } |
---|
4910 | 5540 | |
---|
4911 | 5541 | //? SetUndoStates(); |
---|
.. | .. |
---|
4920 | 5550 | { |
---|
4921 | 5551 | if (Grafreed.standAlone) |
---|
4922 | 5552 | { |
---|
4923 | | - FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD); |
---|
| 5553 | + FileDialog browser = new FileDialog(frame, "Open", FileDialog.LOAD); |
---|
4924 | 5554 | browser.show(); |
---|
4925 | 5555 | String filename = browser.getFile(); |
---|
4926 | 5556 | if (filename != null && filename.length() > 0) |
---|
.. | .. |
---|
4997 | 5627 | |
---|
4998 | 5628 | void save() |
---|
4999 | 5629 | { |
---|
| 5630 | + Replace(); |
---|
| 5631 | + |
---|
5000 | 5632 | if (lastname == null) |
---|
5001 | 5633 | { |
---|
5002 | 5634 | return; |
---|
.. | .. |
---|
5239 | 5871 | ButtonGroup buttonGroup; |
---|
5240 | 5872 | |
---|
5241 | 5873 | cGridBag toolboxPanel; |
---|
| 5874 | + cGridBag skyboxPanel; |
---|
5242 | 5875 | cGridBag materialPanel; |
---|
5243 | 5876 | cGridBag ctrlPanel; |
---|
5244 | 5877 | |
---|
.. | .. |
---|
5312 | 5945 | JLabel colorLabel; |
---|
5313 | 5946 | cNumberSlider colorField; |
---|
5314 | 5947 | JLabel modulationLabel; |
---|
5315 | | - cNumberSlider modulationField; |
---|
| 5948 | + cNumberSlider saturationField; |
---|
5316 | 5949 | JLabel metalnessLabel; |
---|
5317 | 5950 | cNumberSlider metalnessField; |
---|
5318 | 5951 | JLabel diffuseLabel; |
---|
.. | .. |
---|
5343 | 5976 | cNumberSlider anisoField; |
---|
5344 | 5977 | JLabel anisoVLabel; |
---|
5345 | 5978 | cNumberSlider anisoVField; |
---|
| 5979 | + |
---|
5346 | 5980 | JLabel cameraLabel; |
---|
5347 | 5981 | cNumberSlider cameraField; |
---|
5348 | 5982 | JLabel selfshadowLabel; |
---|
.. | .. |
---|
5357 | 5991 | cNumberSlider fakedepthField; |
---|
5358 | 5992 | JLabel shadowbiasLabel; |
---|
5359 | 5993 | cNumberSlider shadowbiasField; |
---|
| 5994 | + |
---|
5360 | 5995 | JLabel bumpLabel; |
---|
5361 | 5996 | cNumberSlider bumpField; |
---|
5362 | 5997 | JLabel noiseLabel; |
---|