.. | .. |
---|
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 | + } |
---|
44 | 74 | |
---|
45 | 75 | public cGridBag GetSeparator() |
---|
46 | 76 | { |
---|
.. | .. |
---|
74 | 104 | return new cCheckBox(icon, border); |
---|
75 | 105 | } |
---|
76 | 106 | |
---|
| 107 | + static java.util.Hashtable<String, javax.swing.ImageIcon> icons = new java.util.Hashtable<String, javax.swing.ImageIcon>(); |
---|
| 108 | + |
---|
77 | 109 | ImageIcon GetIcon(String name) |
---|
78 | 110 | { |
---|
| 111 | + javax.swing.ImageIcon iconCache = icons.get(name); |
---|
| 112 | + if (iconCache != null) |
---|
| 113 | + { |
---|
| 114 | + return iconCache; |
---|
| 115 | + } |
---|
| 116 | + |
---|
79 | 117 | try |
---|
80 | 118 | { |
---|
81 | 119 | BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name)); |
---|
.. | .. |
---|
93 | 131 | // } |
---|
94 | 132 | |
---|
95 | 133 | javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image); |
---|
| 134 | + |
---|
| 135 | + icons.put(name, icon); |
---|
| 136 | + |
---|
96 | 137 | return icon; |
---|
97 | 138 | } |
---|
98 | 139 | catch (Exception e) |
---|
99 | 140 | { |
---|
| 141 | + //icons.put(name, null); |
---|
100 | 142 | return null; |
---|
101 | 143 | } |
---|
102 | 144 | } |
---|
.. | .. |
---|
296 | 338 | client = inClient; |
---|
297 | 339 | copy = client; |
---|
298 | 340 | |
---|
299 | | - if (copy.versionlist == null) |
---|
300 | | - { |
---|
301 | | - copy.versionlist = new Object3D[100]; |
---|
302 | | - copy.versionindex = -1; |
---|
303 | | - } |
---|
| 341 | +// if (copy.versionlist == null) |
---|
| 342 | +// { |
---|
| 343 | +// copy.versionlist = new Object3D[100]; |
---|
| 344 | +// copy.versionindex = -1; |
---|
| 345 | +// |
---|
| 346 | +// callee.Save(true); |
---|
| 347 | +// } |
---|
304 | 348 | |
---|
305 | 349 | // "this" is not called: SetupUI2(objEditor); |
---|
306 | 350 | } |
---|
.. | .. |
---|
319 | 363 | { |
---|
320 | 364 | copy.versionlist = new Object3D[100]; |
---|
321 | 365 | copy.versionindex = -1; |
---|
| 366 | + |
---|
| 367 | +// Save(true); |
---|
322 | 368 | } |
---|
323 | 369 | |
---|
324 | 370 | SetupUI2(callee.GetEditor()); |
---|
.. | .. |
---|
342 | 388 | //parent = p; |
---|
343 | 389 | |
---|
344 | 390 | GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice(); |
---|
345 | | - System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow()); |
---|
| 391 | + if (Globals.DEBUG) |
---|
| 392 | + System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow()); |
---|
346 | 393 | //gd.setFullScreenWindow(this); |
---|
347 | 394 | //setResizable(false); |
---|
348 | 395 | //if (!isDisplayable()) |
---|
.. | .. |
---|
353 | 400 | copy = localCopy; |
---|
354 | 401 | copy.editWindow = this; |
---|
355 | 402 | |
---|
356 | | - if (copy.versionlist == null) |
---|
357 | | - { |
---|
358 | | -// copy.versions = new byte[100][]; |
---|
| 403 | +// if (copy.versionlist == null) |
---|
| 404 | +// { |
---|
| 405 | +// copy.versionlist = new Object3D[100]; |
---|
359 | 406 | // copy.versionindex = -1; |
---|
360 | | - } |
---|
| 407 | +// |
---|
| 408 | +// Save(true); |
---|
| 409 | +// } |
---|
361 | 410 | |
---|
362 | 411 | SetupMenu(); |
---|
363 | 412 | |
---|
.. | .. |
---|
426 | 475 | |
---|
427 | 476 | ChangeListener changeListener = new ChangeListener() |
---|
428 | 477 | { |
---|
| 478 | + //String name; |
---|
| 479 | + |
---|
429 | 480 | public void stateChanged(ChangeEvent changeEvent) |
---|
430 | 481 | { |
---|
431 | 482 | // if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Material") && !materialFlushed) |
---|
.. | .. |
---|
444 | 495 | // EditSelection(false); |
---|
445 | 496 | // } |
---|
446 | 497 | |
---|
447 | | - refreshContents(false); // To refresh Info tab |
---|
| 498 | +// if (objectPanel.getSelectedIndex() == 4) |
---|
| 499 | +// { |
---|
| 500 | +// name = copy.skyboxname; |
---|
| 501 | +// |
---|
| 502 | +// if (name == null) |
---|
| 503 | +// { |
---|
| 504 | +// name = ""; |
---|
| 505 | +// } |
---|
| 506 | +// |
---|
| 507 | +// copy.skyboxname = "cubemaps/default-skyboxes/rgb"; |
---|
| 508 | +// copy.skyboxext = "jpg"; |
---|
| 509 | +// } |
---|
| 510 | +// else |
---|
| 511 | +// { |
---|
| 512 | +// if (name != null) |
---|
| 513 | +// { |
---|
| 514 | +// if (name.equals("")) |
---|
| 515 | +// { |
---|
| 516 | +// copy.skyboxname = null; |
---|
| 517 | +// copy.skyboxext = null; |
---|
| 518 | +// } |
---|
| 519 | +// else |
---|
| 520 | +// { |
---|
| 521 | +// copy.skyboxname = name; |
---|
| 522 | +// } |
---|
| 523 | +// } |
---|
| 524 | +// } |
---|
| 525 | + cameraView.transformMode = objectPanel.getSelectedIndex() == 4; |
---|
| 526 | + |
---|
| 527 | +// refreshContents(false); // To refresh Info tab |
---|
| 528 | + cameraView.repaint(); |
---|
448 | 529 | } |
---|
449 | 530 | }; |
---|
450 | 531 | objectPanel.addChangeListener(changeListener); |
---|
.. | .. |
---|
466 | 547 | |
---|
467 | 548 | toolboxPanel = new cGridBag().setVertical(true); |
---|
468 | 549 | //toolboxPanel.setName("Toolbox"); |
---|
| 550 | + |
---|
| 551 | + skyboxPanel = new cGridBag().setVertical(true); |
---|
469 | 552 | |
---|
470 | 553 | materialPanel = new cGridBag().setVertical(false); |
---|
471 | 554 | //materialPanel.setName("Material"); |
---|
.. | .. |
---|
751 | 834 | boolean maximized; |
---|
752 | 835 | |
---|
753 | 836 | cButton fullscreenLayout; |
---|
| 837 | + cButton expandedLayout; |
---|
754 | 838 | |
---|
755 | 839 | void Minimize() |
---|
756 | 840 | { |
---|
.. | .. |
---|
790 | 874 | cButton minButton; |
---|
791 | 875 | cButton maxButton; |
---|
792 | 876 | cButton fullButton; |
---|
| 877 | + cButton collapseButton; |
---|
| 878 | + cButton maximize3DButton; |
---|
793 | 879 | |
---|
794 | 880 | void ToggleFullScreen() |
---|
795 | 881 | { |
---|
796 | | -GraphicsDevice device = frame.getGraphicsConfiguration().getDevice(); |
---|
| 882 | + GraphicsDevice device = frame.getGraphicsConfiguration().getDevice(); |
---|
797 | 883 | |
---|
798 | 884 | cameraView.ToggleFullScreen(); |
---|
799 | 885 | |
---|
.. | .. |
---|
814 | 900 | // X frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
815 | 901 | // X framePanel.add(bigThree); |
---|
816 | 902 | // X frame.getContentPane().add(/*"Center",*/framePanel); |
---|
817 | | - framePanel.setDividerLocation(46); |
---|
| 903 | +// framePanel.setDividerLocation(46); // icons are 24x24 |
---|
818 | 904 | |
---|
819 | 905 | //frame.setVisible(true); |
---|
820 | | - radio.layout = keepButton; |
---|
| 906 | +// radio.layout = keepButton; |
---|
821 | 907 | //theFrame = null; |
---|
822 | 908 | keepButton = null; |
---|
823 | | - radio.layout.doClick(); |
---|
| 909 | +// radio.layout.doClick(); |
---|
824 | 910 | |
---|
825 | 911 | } else |
---|
826 | 912 | { |
---|
.. | .. |
---|
841 | 927 | // X frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
842 | 928 | // X framePanel.remove(bigThree); |
---|
843 | 929 | // X frame.getContentPane().add(/*"Center",*/bigThree); |
---|
844 | | - framePanel.setDividerLocation(0); |
---|
| 930 | +// framePanel.setDividerLocation(0); |
---|
845 | 931 | |
---|
846 | | - radio.layout = fullscreenLayout; |
---|
847 | | - radio.layout.doClick(); |
---|
| 932 | +// radio.layout = fullscreenLayout; |
---|
| 933 | +// radio.layout.doClick(); |
---|
848 | 934 | //frame.setVisible(true); |
---|
849 | 935 | } |
---|
850 | 936 | frame.validate(); |
---|
| 937 | + |
---|
| 938 | + cameraView.requestFocusInWindow(); |
---|
851 | 939 | } |
---|
852 | 940 | |
---|
853 | | - private Object3D CompressCopy() |
---|
| 941 | + void CollapseToolbar() |
---|
| 942 | + { |
---|
| 943 | + framePanel.setDividerLocation(0); |
---|
| 944 | + //frame.validate(); |
---|
| 945 | + |
---|
| 946 | + cameraView.requestFocusInWindow(); |
---|
| 947 | + } |
---|
| 948 | + |
---|
| 949 | + private Object3D Duplicate(Object3D object) |
---|
854 | 950 | { |
---|
855 | 951 | boolean temp = CameraPane.SWITCH; |
---|
856 | 952 | CameraPane.SWITCH = false; |
---|
857 | 953 | |
---|
858 | | - copy.ExtractBigData(versiontable); |
---|
| 954 | + if (Grafreed.grafreed.universe.versiontable == null) |
---|
| 955 | + Grafreed.grafreed.universe.versiontable = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
| 956 | + |
---|
| 957 | + object.ExtractBigData(Grafreed.grafreed.universe.versiontable); |
---|
859 | 958 | // if (copy == client) |
---|
860 | 959 | |
---|
861 | | - Object3D versions[] = copy.versionlist; |
---|
862 | | - copy.versionlist = null; |
---|
| 960 | + Object3D versions[] = object.versionlist; |
---|
| 961 | + java.util.Hashtable<java.util.UUID, Object3D> versiontable = object.versiontable; // if Grafreed.grafreed.universe |
---|
| 962 | + object.versionlist = null; |
---|
| 963 | + object.versiontable = null; |
---|
863 | 964 | |
---|
864 | 965 | //byte[] compress = Compress(copy); |
---|
865 | | - Object3D compress = (Object3D)Grafreed.clone(copy); |
---|
| 966 | + Object3D compress = (Object3D)Grafreed.clone(object); |
---|
866 | 967 | |
---|
867 | | - copy.versionlist = versions; |
---|
| 968 | + object.versionlist = versions; |
---|
| 969 | + object.versiontable = versiontable; // if Grafreed.grafreed.universe |
---|
868 | 970 | |
---|
869 | | - copy.RestoreBigData(versiontable); |
---|
| 971 | + object.RestoreBigData(Grafreed.grafreed.universe.versiontable); |
---|
870 | 972 | |
---|
871 | 973 | CameraPane.SWITCH = temp; |
---|
872 | 974 | |
---|
.. | .. |
---|
1203 | 1305 | |
---|
1204 | 1306 | namePanel = new cGridBag(); |
---|
1205 | 1307 | |
---|
| 1308 | + //if (copy.pinned) |
---|
| 1309 | + { |
---|
| 1310 | + pinButton = GetToggleButton("icons/pin.png", !Grafreed.NIMBUSLAF); |
---|
| 1311 | + pinButton.setSelected(copy.pinned); |
---|
| 1312 | + cGridBag t = new cGridBag(); |
---|
| 1313 | + t.preferredWidth = 2; |
---|
| 1314 | + t.add(pinButton); |
---|
| 1315 | + namePanel.add(t); |
---|
| 1316 | + |
---|
| 1317 | + pinButton.addItemListener(this); |
---|
| 1318 | + } |
---|
| 1319 | + |
---|
1206 | 1320 | nameField = AddText(namePanel, copy.GetName()); |
---|
1207 | 1321 | namePanel.add(new JScrollPane(nameField, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER)); |
---|
1208 | 1322 | oe.ctrlPanel.add(namePanel); |
---|
.. | .. |
---|
1216 | 1330 | |
---|
1217 | 1331 | liveCB = AddCheckBox(setupPanel, "Live", copy.live); |
---|
1218 | 1332 | liveCB.setToolTipText("Animate object"); |
---|
| 1333 | + markCB = AddCheckBox(setupPanel, "Anim", copy.marked); |
---|
| 1334 | + markCB.setToolTipText("Set target transform"); |
---|
1219 | 1335 | selectableCB = AddCheckBox(setupPanel, "Select", !copy.dontselect); |
---|
1220 | 1336 | selectableCB.setToolTipText("Make object selectable"); |
---|
1221 | 1337 | // Return(); |
---|
1222 | 1338 | |
---|
1223 | 1339 | hideCB = AddCheckBox(setupPanel, "Hide", copy.hide); |
---|
1224 | 1340 | hideCB.setToolTipText("Hide object"); |
---|
1225 | | - markCB = AddCheckBox(setupPanel, "Mark", copy.marked); |
---|
1226 | | - markCB.setToolTipText("As animation target transform"); |
---|
1227 | 1341 | |
---|
1228 | 1342 | ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false); |
---|
1229 | 1343 | |
---|
.. | .. |
---|
1425 | 1539 | |
---|
1426 | 1540 | if (cam == null || !(copy.get(0) instanceof cGroup)) |
---|
1427 | 1541 | { |
---|
| 1542 | + if (Globals.DEBUG) |
---|
1428 | 1543 | System.out.println("CREATE CAMERAS"); |
---|
1429 | 1544 | cams = new cTemplate(); |
---|
1430 | 1545 | cams.name = "Cameras"; |
---|
.. | .. |
---|
1550 | 1665 | |
---|
1551 | 1666 | //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); |
---|
1552 | 1667 | //tmp.setName("Edit"); |
---|
| 1668 | + objectPanel.add(toolboxPanel); |
---|
| 1669 | + objectPanel.setIconAt(0, GetIcon("icons/primitives.png")); |
---|
| 1670 | + objectPanel.setToolTipTextAt(0, "Objects & textures"); |
---|
| 1671 | + |
---|
1553 | 1672 | objectPanel.add(materialPanel); |
---|
1554 | | - objectPanel.setIconAt(0, GetIcon("icons/material.png")); |
---|
1555 | | - objectPanel.setToolTipTextAt(0, "Material"); |
---|
| 1673 | + objectPanel.setIconAt(1, GetIcon("icons/material.png")); |
---|
| 1674 | + objectPanel.setToolTipTextAt(1, "Material"); |
---|
1556 | 1675 | |
---|
| 1676 | + objectPanel.add(skyboxPanel); |
---|
| 1677 | + objectPanel.setIconAt(2, GetIcon("icons/skybox.jpg")); |
---|
| 1678 | + objectPanel.setToolTipTextAt(2, "Backgrounds"); |
---|
| 1679 | + |
---|
1557 | 1680 | // JPanel north = new JPanel(new BorderLayout()); |
---|
1558 | 1681 | // north.setName("Edit"); |
---|
1559 | 1682 | // north.add(ctrlPanel, BorderLayout.NORTH); |
---|
1560 | 1683 | // objectPanel.add(north); |
---|
1561 | 1684 | objectPanel.add(editPanel); |
---|
1562 | | - objectPanel.setIconAt(1, GetIcon("icons/write.png")); |
---|
1563 | | - objectPanel.setToolTipTextAt(1, "Edit controls"); |
---|
1564 | | - |
---|
1565 | | - //if (Globals.ADVANCED) |
---|
1566 | | - objectPanel.add(infoPanel); |
---|
1567 | | - objectPanel.setIconAt(2, GetIcon("icons/info.png")); |
---|
1568 | | - objectPanel.setToolTipTextAt(2, "Information"); |
---|
| 1685 | + objectPanel.setIconAt(3, GetIcon("icons/write.png")); |
---|
| 1686 | + objectPanel.setToolTipTextAt(3, "Edit controls"); |
---|
1569 | 1687 | |
---|
1570 | 1688 | objectPanel.add(XYZPanel); |
---|
1571 | | - objectPanel.setIconAt(3, GetIcon("icons/XYZ.png")); |
---|
1572 | | - objectPanel.setToolTipTextAt(3, "XYZ/RGB transform"); |
---|
| 1689 | + objectPanel.setIconAt(4, GetIcon("icons/XYZ.png")); |
---|
| 1690 | + objectPanel.setToolTipTextAt(4, "XYZ/RGB transform"); |
---|
1573 | 1691 | |
---|
1574 | | - objectPanel.add(toolboxPanel); |
---|
1575 | | - objectPanel.setIconAt(4, GetIcon("icons/primitives.png")); |
---|
1576 | | - objectPanel.setToolTipTextAt(4, "Objects & backgrounds"); |
---|
1577 | | - |
---|
1578 | 1692 | /* |
---|
1579 | 1693 | aConstraints.gridx = 0; |
---|
1580 | 1694 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1611 | 1725 | |
---|
1612 | 1726 | scenePanel.add(tabbedPane); |
---|
1613 | 1727 | |
---|
| 1728 | + //if (Globals.ADVANCED) |
---|
| 1729 | +// tabbedPane.add(infoPanel); |
---|
| 1730 | +// tabbedPane.setIconAt(3, GetIcon("icons/info.png")); |
---|
| 1731 | +// tabbedPane.setToolTipTextAt(3, "Information"); |
---|
| 1732 | + |
---|
1614 | 1733 | /* |
---|
1615 | 1734 | cTree jTree = new cTree(null); |
---|
1616 | 1735 | ToolTipManager.sharedInstance().registerComponent(jTree); |
---|
.. | .. |
---|
1681 | 1800 | // aConstraints.gridheight = 1; |
---|
1682 | 1801 | |
---|
1683 | 1802 | framePanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, toolbarPanel, bigThree); |
---|
| 1803 | + |
---|
| 1804 | + framePanel.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY, |
---|
| 1805 | + new java.beans.PropertyChangeListener() |
---|
| 1806 | + { |
---|
| 1807 | + public void propertyChange(java.beans.PropertyChangeEvent pce) |
---|
| 1808 | + { |
---|
| 1809 | + if ((Integer)pce.getOldValue() == 1) |
---|
| 1810 | + { |
---|
| 1811 | + if (radio.layout != expandedLayout) |
---|
| 1812 | + { |
---|
| 1813 | + radio.layout = expandedLayout; |
---|
| 1814 | + radio.layout.doClick(); |
---|
| 1815 | + } |
---|
| 1816 | + } |
---|
| 1817 | + } |
---|
| 1818 | + }); |
---|
| 1819 | + |
---|
1684 | 1820 | framePanel.setContinuousLayout(false); |
---|
1685 | 1821 | framePanel.setOneTouchExpandable(false); |
---|
1686 | 1822 | //.setDividerLocation(0.8); |
---|
.. | .. |
---|
1690 | 1826 | |
---|
1691 | 1827 | frame.getContentPane().setLayout(new BorderLayout()); |
---|
1692 | 1828 | /**/ |
---|
1693 | | - JTabbedPane worldPane = new JTabbedPane(); |
---|
| 1829 | + //JTabbedPane worldPane = new JTabbedPane(); |
---|
1694 | 1830 | //worldPane.add(bigPanel); |
---|
1695 | 1831 | //worldPane.add(worldPanel); |
---|
1696 | 1832 | /**/ |
---|
.. | .. |
---|
1738 | 1874 | void SetupMaterial(cGridBag materialpanel) |
---|
1739 | 1875 | { |
---|
1740 | 1876 | cGridBag presetpanel = new cGridBag().setVertical(true); |
---|
1741 | | - cLabel label = GetLabel("icons/shadericons/shadericon00000.png", !Grafreed.NIMBUSLAF); |
---|
1742 | | - label.addMouseListener(new MouseAdapter() |
---|
| 1877 | + |
---|
| 1878 | + cLabel skin = GetLabel("icons/shadericons/shadericon00000.png", !Grafreed.NIMBUSLAF); |
---|
| 1879 | + skin.setToolTipText("Skin"); |
---|
| 1880 | + skin.addMouseListener(new MouseAdapter() |
---|
1743 | 1881 | { |
---|
1744 | 1882 | public void mouseClicked(MouseEvent e) |
---|
1745 | 1883 | { |
---|
1746 | | - colorField.setFloat(0); |
---|
1747 | | - saturationField.setFloat(1); |
---|
| 1884 | + Object3D object = Grafreed.materials.versionlist[0].get(0); |
---|
| 1885 | + cMaterial material = object.material; |
---|
| 1886 | + |
---|
| 1887 | + // Skin |
---|
| 1888 | + colorField.setFloat(material.color); |
---|
| 1889 | + saturationField.setFloat(material.modulation); |
---|
| 1890 | + subsurfaceField.setFloat(material.subsurface); |
---|
| 1891 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1892 | + diffusenessField.setFloat(material.factor); |
---|
| 1893 | + shininessField.setFloat(material.shininess); |
---|
| 1894 | + shadowbiasField.setFloat(material.shadowbias); |
---|
| 1895 | + diffuseField.setFloat(material.diffuse); |
---|
| 1896 | + specularField.setFloat(material.specular); |
---|
| 1897 | + |
---|
| 1898 | + bumpField.setFloat(object.projectedVertices[0].x / 1000.0); |
---|
| 1899 | + noiseField.setFloat(object.projectedVertices[0].y / 1000.0); |
---|
| 1900 | + powerField.setFloat(object.projectedVertices[2].x / 1000.0); |
---|
| 1901 | + |
---|
1748 | 1902 | materialtouched = true; |
---|
1749 | 1903 | applySelf(); |
---|
1750 | 1904 | } |
---|
1751 | 1905 | }); |
---|
1752 | | - presetpanel.add(label); |
---|
| 1906 | + presetpanel.add(skin); |
---|
1753 | 1907 | |
---|
1754 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00001.png", !Grafreed.NIMBUSLAF)); |
---|
1755 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00002.png", !Grafreed.NIMBUSLAF)); |
---|
1756 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00003.png", !Grafreed.NIMBUSLAF)); |
---|
1757 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00004.png", !Grafreed.NIMBUSLAF)); |
---|
1758 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00005.png", !Grafreed.NIMBUSLAF)); |
---|
1759 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00006.png", !Grafreed.NIMBUSLAF)); |
---|
1760 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00007.png", !Grafreed.NIMBUSLAF)); |
---|
1761 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00008.png", !Grafreed.NIMBUSLAF)); |
---|
1762 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00009.png", !Grafreed.NIMBUSLAF)); |
---|
1763 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00010.png", !Grafreed.NIMBUSLAF)); |
---|
1764 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00011.png", !Grafreed.NIMBUSLAF)); |
---|
1765 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00012.png", !Grafreed.NIMBUSLAF)); |
---|
1766 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00013.png", !Grafreed.NIMBUSLAF)); |
---|
1767 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00014.png", !Grafreed.NIMBUSLAF)); |
---|
1768 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00015.png", !Grafreed.NIMBUSLAF)); |
---|
1769 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00016.png", !Grafreed.NIMBUSLAF)); |
---|
1770 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00017.png", !Grafreed.NIMBUSLAF)); |
---|
1771 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00018.png", !Grafreed.NIMBUSLAF)); |
---|
1772 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00019.png", !Grafreed.NIMBUSLAF)); |
---|
1773 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00020.png", !Grafreed.NIMBUSLAF)); |
---|
| 1908 | + cLabel lambert = GetLabel("icons/shadericons/shadericon00002.png", !Grafreed.NIMBUSLAF); |
---|
| 1909 | + lambert.setToolTipText("Diffuse"); |
---|
| 1910 | + lambert.addMouseListener(new MouseAdapter() |
---|
| 1911 | + { |
---|
| 1912 | + public void mouseClicked(MouseEvent e) |
---|
| 1913 | + { |
---|
| 1914 | + Object3D object = Grafreed.materials.versionlist[2].get(0); |
---|
| 1915 | + cMaterial material = object.material; |
---|
| 1916 | + |
---|
| 1917 | + diffusenessField.setFloat(material.factor); |
---|
| 1918 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1919 | + |
---|
| 1920 | + materialtouched = true; |
---|
| 1921 | + applySelf(); |
---|
| 1922 | + } |
---|
| 1923 | + }); |
---|
| 1924 | + presetpanel.add(lambert); |
---|
| 1925 | + |
---|
| 1926 | + cLabel diffuse2 = GetLabel("icons/shadericons/shadericon00003.png", !Grafreed.NIMBUSLAF); |
---|
| 1927 | + diffuse2.setToolTipText("Diffuse2"); |
---|
| 1928 | + diffuse2.addMouseListener(new MouseAdapter() |
---|
| 1929 | + { |
---|
| 1930 | + public void mouseClicked(MouseEvent e) |
---|
| 1931 | + { |
---|
| 1932 | + Object3D object = Grafreed.materials.versionlist[3].get(0); |
---|
| 1933 | + cMaterial material = object.material; |
---|
| 1934 | + |
---|
| 1935 | + diffusenessField.setFloat(material.factor); |
---|
| 1936 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1937 | + |
---|
| 1938 | + materialtouched = true; |
---|
| 1939 | + applySelf(); |
---|
| 1940 | + } |
---|
| 1941 | + }); |
---|
| 1942 | + presetpanel.add(diffuse2); |
---|
| 1943 | + |
---|
| 1944 | + cLabel diffusemoon = GetLabel("icons/shadericons/shadericon00004.png", !Grafreed.NIMBUSLAF); |
---|
| 1945 | + diffusemoon.setToolTipText("Moon"); |
---|
| 1946 | + diffusemoon.addMouseListener(new MouseAdapter() |
---|
| 1947 | + { |
---|
| 1948 | + public void mouseClicked(MouseEvent e) |
---|
| 1949 | + { |
---|
| 1950 | + Object3D object = Grafreed.materials.versionlist[4].get(0); |
---|
| 1951 | + cMaterial material = object.material; |
---|
| 1952 | + |
---|
| 1953 | + diffusenessField.setFloat(material.factor); |
---|
| 1954 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1955 | + |
---|
| 1956 | + materialtouched = true; |
---|
| 1957 | + applySelf(); |
---|
| 1958 | + } |
---|
| 1959 | + }); |
---|
| 1960 | + presetpanel.add(diffusemoon); |
---|
| 1961 | + |
---|
| 1962 | + cLabel diffusemoon2 = GetLabel("icons/shadericons/shadericon00005.png", !Grafreed.NIMBUSLAF); |
---|
| 1963 | + diffusemoon2.setToolTipText("Moon2"); |
---|
| 1964 | + diffusemoon2.addMouseListener(new MouseAdapter() |
---|
| 1965 | + { |
---|
| 1966 | + public void mouseClicked(MouseEvent e) |
---|
| 1967 | + { |
---|
| 1968 | + Object3D object = Grafreed.materials.versionlist[5].get(0); |
---|
| 1969 | + cMaterial material = object.material; |
---|
| 1970 | + |
---|
| 1971 | + diffusenessField.setFloat(material.factor); |
---|
| 1972 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1973 | + |
---|
| 1974 | + materialtouched = true; |
---|
| 1975 | + applySelf(); |
---|
| 1976 | + } |
---|
| 1977 | + }); |
---|
| 1978 | + presetpanel.add(diffusemoon2); |
---|
| 1979 | + |
---|
| 1980 | + cLabel diffusemoon3 = GetLabel("icons/shadericons/shadericon00006.png", !Grafreed.NIMBUSLAF); |
---|
| 1981 | + diffusemoon3.setToolTipText("Moon3"); |
---|
| 1982 | + diffusemoon3.addMouseListener(new MouseAdapter() |
---|
| 1983 | + { |
---|
| 1984 | + public void mouseClicked(MouseEvent e) |
---|
| 1985 | + { |
---|
| 1986 | + Object3D object = Grafreed.materials.versionlist[6].get(0); |
---|
| 1987 | + cMaterial material = object.material; |
---|
| 1988 | + |
---|
| 1989 | + diffusenessField.setFloat(material.factor); |
---|
| 1990 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1991 | + |
---|
| 1992 | + materialtouched = true; |
---|
| 1993 | + applySelf(); |
---|
| 1994 | + } |
---|
| 1995 | + }); |
---|
| 1996 | + presetpanel.add(diffusemoon3); |
---|
| 1997 | + |
---|
| 1998 | + cLabel diffusesheen = GetLabel("icons/shadericons/shadericon00007.png", !Grafreed.NIMBUSLAF); |
---|
| 1999 | + diffusesheen.setToolTipText("Sheen"); |
---|
| 2000 | + diffusesheen.addMouseListener(new MouseAdapter() |
---|
| 2001 | + { |
---|
| 2002 | + public void mouseClicked(MouseEvent e) |
---|
| 2003 | + { |
---|
| 2004 | + Object3D object = Grafreed.materials.versionlist[7].get(0); |
---|
| 2005 | + cMaterial material = object.material; |
---|
| 2006 | + |
---|
| 2007 | + sheenField.setFloat(material.sheen); |
---|
| 2008 | + |
---|
| 2009 | + materialtouched = true; |
---|
| 2010 | + applySelf(); |
---|
| 2011 | + } |
---|
| 2012 | + }); |
---|
| 2013 | + presetpanel.add(diffusesheen); |
---|
| 2014 | + |
---|
| 2015 | + cLabel rough = GetLabel("icons/shadericons/shadericon00001.png", !Grafreed.NIMBUSLAF); |
---|
| 2016 | + rough.setToolTipText("Rough metal"); |
---|
| 2017 | + rough.addMouseListener(new MouseAdapter() |
---|
| 2018 | + { |
---|
| 2019 | + public void mouseClicked(MouseEvent e) |
---|
| 2020 | + { |
---|
| 2021 | + Object3D object = Grafreed.materials.versionlist[1].get(0); |
---|
| 2022 | + cMaterial material = object.material; |
---|
| 2023 | + |
---|
| 2024 | + shininessField.setFloat(material.shininess); |
---|
| 2025 | + velvetField.setFloat(material.velvet); |
---|
| 2026 | + |
---|
| 2027 | + materialtouched = true; |
---|
| 2028 | + applySelf(); |
---|
| 2029 | + } |
---|
| 2030 | + }); |
---|
| 2031 | + presetpanel.add(rough); |
---|
| 2032 | + |
---|
| 2033 | + cLabel rough2 = GetLabel("icons/shadericons/shadericon00013.png", !Grafreed.NIMBUSLAF); |
---|
| 2034 | + rough2.setToolTipText("Medium metal"); |
---|
| 2035 | + rough2.addMouseListener(new MouseAdapter() |
---|
| 2036 | + { |
---|
| 2037 | + public void mouseClicked(MouseEvent e) |
---|
| 2038 | + { |
---|
| 2039 | + Object3D object = Grafreed.materials.versionlist[13].get(0); |
---|
| 2040 | + cMaterial material = object.material; |
---|
| 2041 | + |
---|
| 2042 | + shininessField.setFloat(material.shininess); |
---|
| 2043 | + lightareaField.setFloat(material.lightarea); |
---|
| 2044 | + |
---|
| 2045 | + materialtouched = true; |
---|
| 2046 | + applySelf(); |
---|
| 2047 | + } |
---|
| 2048 | + }); |
---|
| 2049 | + presetpanel.add(rough2); |
---|
| 2050 | + |
---|
| 2051 | + cLabel shini0 = GetLabel("icons/shadericons/shadericon00014.png", !Grafreed.NIMBUSLAF); |
---|
| 2052 | + shini0.setToolTipText("Shiny"); |
---|
| 2053 | + shini0.addMouseListener(new MouseAdapter() |
---|
| 2054 | + { |
---|
| 2055 | + public void mouseClicked(MouseEvent e) |
---|
| 2056 | + { |
---|
| 2057 | + Object3D object = Grafreed.materials.versionlist[14].get(0); |
---|
| 2058 | + cMaterial material = object.material; |
---|
| 2059 | + |
---|
| 2060 | + shininessField.setFloat(material.shininess); |
---|
| 2061 | + lightareaField.setFloat(material.lightarea); |
---|
| 2062 | + |
---|
| 2063 | + materialtouched = true; |
---|
| 2064 | + applySelf(); |
---|
| 2065 | + } |
---|
| 2066 | + }); |
---|
| 2067 | + presetpanel.add(shini0); |
---|
| 2068 | + |
---|
| 2069 | + cLabel shini1 = GetLabel("icons/shadericons/shadericon00011.png", !Grafreed.NIMBUSLAF); |
---|
| 2070 | + shini1.setToolTipText("Shiny2"); |
---|
| 2071 | + shini1.addMouseListener(new MouseAdapter() |
---|
| 2072 | + { |
---|
| 2073 | + public void mouseClicked(MouseEvent e) |
---|
| 2074 | + { |
---|
| 2075 | + Object3D object = Grafreed.materials.versionlist[11].get(0); |
---|
| 2076 | + cMaterial material = object.material; |
---|
| 2077 | + |
---|
| 2078 | + shininessField.setFloat(material.shininess); |
---|
| 2079 | + lightareaField.setFloat(material.lightarea); |
---|
| 2080 | + |
---|
| 2081 | + materialtouched = true; |
---|
| 2082 | + applySelf(); |
---|
| 2083 | + } |
---|
| 2084 | + }); |
---|
| 2085 | + presetpanel.add(shini1); |
---|
| 2086 | + |
---|
| 2087 | + cLabel shini2 = GetLabel("icons/shadericons/shadericon00012.png", !Grafreed.NIMBUSLAF); |
---|
| 2088 | + shini2.setToolTipText("Shiny3"); |
---|
| 2089 | + shini2.addMouseListener(new MouseAdapter() |
---|
| 2090 | + { |
---|
| 2091 | + public void mouseClicked(MouseEvent e) |
---|
| 2092 | + { |
---|
| 2093 | + Object3D object = Grafreed.materials.versionlist[12].get(0); |
---|
| 2094 | + cMaterial material = object.material; |
---|
| 2095 | + |
---|
| 2096 | + shininessField.setFloat(material.shininess); |
---|
| 2097 | + lightareaField.setFloat(material.lightarea); |
---|
| 2098 | + |
---|
| 2099 | + materialtouched = true; |
---|
| 2100 | + applySelf(); |
---|
| 2101 | + } |
---|
| 2102 | + }); |
---|
| 2103 | + presetpanel.add(shini2); |
---|
| 2104 | + |
---|
| 2105 | + cLabel aniso = GetLabel("icons/shadericons/shadericon00008.png", !Grafreed.NIMBUSLAF); |
---|
| 2106 | + aniso.setToolTipText("AnisoU"); |
---|
| 2107 | + aniso.addMouseListener(new MouseAdapter() |
---|
| 2108 | + { |
---|
| 2109 | + public void mouseClicked(MouseEvent e) |
---|
| 2110 | + { |
---|
| 2111 | + Object3D object = Grafreed.materials.versionlist[8].get(0); |
---|
| 2112 | + cMaterial material = object.material; |
---|
| 2113 | + |
---|
| 2114 | + anisoField.setFloat(material.aniso); |
---|
| 2115 | + anisoVField.setFloat(material.anisoV); |
---|
| 2116 | + |
---|
| 2117 | + materialtouched = true; |
---|
| 2118 | + applySelf(); |
---|
| 2119 | + } |
---|
| 2120 | + }); |
---|
| 2121 | + presetpanel.add(aniso); |
---|
| 2122 | + |
---|
| 2123 | + cLabel aniso2 = GetLabel("icons/shadericons/shadericon00009.png", !Grafreed.NIMBUSLAF); |
---|
| 2124 | + aniso2.setToolTipText("AnisoV"); |
---|
| 2125 | + aniso2.addMouseListener(new MouseAdapter() |
---|
| 2126 | + { |
---|
| 2127 | + public void mouseClicked(MouseEvent e) |
---|
| 2128 | + { |
---|
| 2129 | + Object3D object = Grafreed.materials.versionlist[9].get(0); |
---|
| 2130 | + cMaterial material = object.material; |
---|
| 2131 | + |
---|
| 2132 | + anisoField.setFloat(material.aniso); |
---|
| 2133 | + anisoVField.setFloat(material.anisoV); |
---|
| 2134 | + |
---|
| 2135 | + materialtouched = true; |
---|
| 2136 | + applySelf(); |
---|
| 2137 | + } |
---|
| 2138 | + }); |
---|
| 2139 | + presetpanel.add(aniso2); |
---|
| 2140 | + |
---|
| 2141 | + cLabel aniso3 = GetLabel("icons/shadericons/shadericon00010.png", !Grafreed.NIMBUSLAF); |
---|
| 2142 | + aniso3.setToolTipText("AnisoUV"); |
---|
| 2143 | + aniso3.addMouseListener(new MouseAdapter() |
---|
| 2144 | + { |
---|
| 2145 | + public void mouseClicked(MouseEvent e) |
---|
| 2146 | + { |
---|
| 2147 | + Object3D object = Grafreed.materials.versionlist[10].get(0); |
---|
| 2148 | + cMaterial material = object.material; |
---|
| 2149 | + |
---|
| 2150 | + anisoField.setFloat(material.aniso); |
---|
| 2151 | + anisoVField.setFloat(material.anisoV); |
---|
| 2152 | + |
---|
| 2153 | + materialtouched = true; |
---|
| 2154 | + applySelf(); |
---|
| 2155 | + } |
---|
| 2156 | + }); |
---|
| 2157 | + presetpanel.add(aniso3); |
---|
| 2158 | + |
---|
| 2159 | + cLabel velvet0 = GetLabel("icons/shadericons/shadericon00015.png", !Grafreed.NIMBUSLAF); |
---|
| 2160 | + velvet0.setToolTipText("Velvet"); |
---|
| 2161 | + velvet0.addMouseListener(new MouseAdapter() |
---|
| 2162 | + { |
---|
| 2163 | + public void mouseClicked(MouseEvent e) |
---|
| 2164 | + { |
---|
| 2165 | + Object3D object = Grafreed.materials.versionlist[15].get(0); |
---|
| 2166 | + cMaterial material = object.material; |
---|
| 2167 | + |
---|
| 2168 | + diffusenessField.setFloat(material.factor); |
---|
| 2169 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 2170 | + sheenField.setFloat(material.sheen); |
---|
| 2171 | + shininessField.setFloat(material.shininess); |
---|
| 2172 | + velvetField.setFloat(material.velvet); |
---|
| 2173 | + shiftField.setFloat(material.shift); |
---|
| 2174 | + |
---|
| 2175 | + materialtouched = true; |
---|
| 2176 | + applySelf(); |
---|
| 2177 | + } |
---|
| 2178 | + }); |
---|
| 2179 | + presetpanel.add(velvet0); |
---|
| 2180 | + |
---|
| 2181 | + cLabel bump0 = GetLabel("icons/shadericons/shadericon00016.png", !Grafreed.NIMBUSLAF); |
---|
| 2182 | + bump0.setToolTipText("Bump texture"); |
---|
| 2183 | + bump0.addMouseListener(new MouseAdapter() |
---|
| 2184 | + { |
---|
| 2185 | + public void mouseClicked(MouseEvent e) |
---|
| 2186 | + { |
---|
| 2187 | + Object3D object = Grafreed.materials.versionlist[16].get(0); |
---|
| 2188 | + cMaterial material = object.material; |
---|
| 2189 | + |
---|
| 2190 | + bumpField.setFloat(object.projectedVertices[0].x / 1000.0); |
---|
| 2191 | + noiseField.setFloat(object.projectedVertices[0].y / 1000.0); |
---|
| 2192 | + powerField.setFloat(object.projectedVertices[2].x / 1000.0); |
---|
| 2193 | + |
---|
| 2194 | + materialtouched = true; |
---|
| 2195 | + applySelf(); |
---|
| 2196 | + } |
---|
| 2197 | + }); |
---|
| 2198 | + presetpanel.add(bump0); |
---|
| 2199 | + |
---|
| 2200 | + cLabel borderShader = GetLabel("icons/shadericons/borderfade.jpg", !Grafreed.NIMBUSLAF); |
---|
| 2201 | + borderShader.setToolTipText("Border fade"); |
---|
| 2202 | + borderShader.addMouseListener(new MouseAdapter() |
---|
| 2203 | + { |
---|
| 2204 | + public void mouseClicked(MouseEvent e) |
---|
| 2205 | + { |
---|
| 2206 | + borderfadeField.setFloat(0.5); |
---|
| 2207 | + opacityField.setFloat(0.75); |
---|
| 2208 | + |
---|
| 2209 | + materialtouched = true; |
---|
| 2210 | + applySelf(); |
---|
| 2211 | + } |
---|
| 2212 | + }); |
---|
| 2213 | + presetpanel.add(borderShader); |
---|
| 2214 | + |
---|
| 2215 | + cLabel halo = GetLabel("icons/shadericons/shadericon00017.png", !Grafreed.NIMBUSLAF); |
---|
| 2216 | + halo.setToolTipText("Halo"); |
---|
| 2217 | + halo.addMouseListener(new MouseAdapter() |
---|
| 2218 | + { |
---|
| 2219 | + public void mouseClicked(MouseEvent e) |
---|
| 2220 | + { |
---|
| 2221 | + Object3D object = Grafreed.materials.versionlist[17].get(0); |
---|
| 2222 | + cMaterial material = object.material; |
---|
| 2223 | + |
---|
| 2224 | + opacityPowerField.setFloat(object.projectedVertices[2].y / 1000.0); |
---|
| 2225 | + |
---|
| 2226 | + materialtouched = true; |
---|
| 2227 | + applySelf(); |
---|
| 2228 | + } |
---|
| 2229 | + }); |
---|
| 2230 | + presetpanel.add(halo); |
---|
| 2231 | + |
---|
| 2232 | + cLabel candle = GetLabel("icons/shadericons/shadericon00018.png", !Grafreed.NIMBUSLAF); |
---|
| 2233 | + candle.setToolTipText("Candle"); |
---|
| 2234 | + candle.addMouseListener(new MouseAdapter() |
---|
| 2235 | + { |
---|
| 2236 | + public void mouseClicked(MouseEvent e) |
---|
| 2237 | + { |
---|
| 2238 | + Object3D object = Grafreed.materials.versionlist[18].get(0); |
---|
| 2239 | + cMaterial material = object.material; |
---|
| 2240 | + |
---|
| 2241 | + subsurfaceField.setFloat(material.subsurface); |
---|
| 2242 | + shadowbiasField.setFloat(material.shadowbias); |
---|
| 2243 | + ambientField.setFloat(material.ambient); |
---|
| 2244 | + specularField.setFloat(material.specular); |
---|
| 2245 | + lightareaField.setFloat(material.lightarea); |
---|
| 2246 | + shininessField.setFloat(material.shininess); |
---|
| 2247 | + |
---|
| 2248 | + materialtouched = true; |
---|
| 2249 | + applySelf(); |
---|
| 2250 | + } |
---|
| 2251 | + }); |
---|
| 2252 | + presetpanel.add(candle); |
---|
| 2253 | + |
---|
| 2254 | + cLabel shadowShader = GetLabel("icons/shadericons/shadow.png", !Grafreed.NIMBUSLAF); |
---|
| 2255 | + shadowShader.setToolTipText("Shadow"); |
---|
| 2256 | + shadowShader.addMouseListener(new MouseAdapter() |
---|
| 2257 | + { |
---|
| 2258 | + public void mouseClicked(MouseEvent e) |
---|
| 2259 | + { |
---|
| 2260 | + diffuseField.setFloat(0.001); |
---|
| 2261 | + ambientField.setFloat(0.001); |
---|
| 2262 | + cameraField.setFloat(0.001); |
---|
| 2263 | + specularField.setFloat(0.001); |
---|
| 2264 | + fakedepthField.setFloat(0.001); |
---|
| 2265 | + opacityField.setFloat(0.6); |
---|
| 2266 | + |
---|
| 2267 | + materialtouched = true; |
---|
| 2268 | + applySelf(); |
---|
| 2269 | + } |
---|
| 2270 | + }); |
---|
| 2271 | + presetpanel.add(shadowShader); |
---|
1774 | 2272 | |
---|
1775 | 2273 | cGridBag panel = new cGridBag().setVertical(true); |
---|
1776 | 2274 | |
---|
1777 | 2275 | presetpanel.preferredWidth = 1; |
---|
1778 | 2276 | |
---|
1779 | | - materialpanel.add(panel); |
---|
1780 | 2277 | materialpanel.add(presetpanel); |
---|
| 2278 | + materialpanel.add(panel); |
---|
1781 | 2279 | |
---|
1782 | 2280 | panel.preferredWidth = 8; |
---|
1783 | 2281 | |
---|
.. | .. |
---|
1821 | 2319 | |
---|
1822 | 2320 | cGridBag huepanel = new cGridBag(); |
---|
1823 | 2321 | cGridBag huelabel = new cGridBag(); |
---|
1824 | | - label = GetLabel("icons/hue.png", false); |
---|
1825 | | - label.fit = true; |
---|
1826 | | - huelabel.add(label); |
---|
| 2322 | + cLabel hue = GetLabel("icons/hue.png", false); |
---|
| 2323 | + hue.fit = true; |
---|
| 2324 | + |
---|
| 2325 | + hue.addMouseListener(new MouseAdapter() |
---|
| 2326 | + { |
---|
| 2327 | + public void mousePressed(MouseEvent e) |
---|
| 2328 | + { |
---|
| 2329 | + int x = e.getX(); |
---|
| 2330 | + |
---|
| 2331 | + colorField.setFloat((double)x / ((cLabel)e.getSource()).getWidth()); |
---|
| 2332 | + } |
---|
| 2333 | + }); |
---|
| 2334 | + |
---|
| 2335 | + huelabel.add(hue); |
---|
1827 | 2336 | huelabel.preferredWidth = 20; |
---|
1828 | 2337 | huepanel.add(new cGridBag()); // Label |
---|
1829 | 2338 | huepanel.add(huelabel); // Field/slider |
---|
.. | .. |
---|
3099 | 3608 | |
---|
3100 | 3609 | if (multiplyToggle != null) |
---|
3101 | 3610 | multiplyToggle.setSelected(mat.multiply); |
---|
3102 | | - |
---|
3103 | | - assert (object.projectedVertices != null); |
---|
3104 | | - |
---|
3105 | | - if (object.projectedVertices.length <= 2) |
---|
3106 | | - { |
---|
3107 | | - // Side effect... |
---|
3108 | | - Object3D.cVector2[] keep = object.projectedVertices; |
---|
3109 | | - object.projectedVertices = new Object3D.cVector2[3]; |
---|
3110 | | - for (int i = 0; i < 3; i++) |
---|
3111 | | - { |
---|
3112 | | - if (i < keep.length) |
---|
3113 | | - { |
---|
3114 | | - object.projectedVertices[i] = keep[i]; |
---|
3115 | | - } else |
---|
3116 | | - { |
---|
3117 | | - object.projectedVertices[i] = new Object3D.cVector2(); |
---|
3118 | | - } |
---|
3119 | | - /* |
---|
3120 | | - if(keep.length == 0) |
---|
3121 | | - object.projectedVertices[0] = new Object3D.cVector2(); |
---|
3122 | | - else |
---|
3123 | | - object.projectedVertices[0] = keep[0]; |
---|
3124 | | - object.projectedVertices[1] = new Object3D.cVector2(); |
---|
3125 | | - */ |
---|
3126 | | - } |
---|
3127 | | - } |
---|
| 3611 | + |
---|
| 3612 | + AllocProjectedVertices(object); |
---|
3128 | 3613 | |
---|
3129 | 3614 | SetMaterial(mat, object.projectedVertices); |
---|
3130 | 3615 | } |
---|
.. | .. |
---|
3244 | 3729 | public void itemStateChanged(ItemEvent event) |
---|
3245 | 3730 | { |
---|
3246 | 3731 | // System.out.println("Propagate = " + propagate); |
---|
| 3732 | + if (event.getSource() == pinButton) |
---|
| 3733 | + { |
---|
| 3734 | + copy.pinned ^= true; |
---|
| 3735 | + if (!copy.pinned && !copy.editWindow.copy.selection.contains(copy)) |
---|
| 3736 | + { |
---|
| 3737 | + ((GroupEditor)copy.editWindow).listUI.remove(copy); |
---|
| 3738 | + copy.CloseUI(); |
---|
| 3739 | + //copy.editWindow.refreshContents(); |
---|
| 3740 | + } |
---|
| 3741 | + } |
---|
| 3742 | + else |
---|
3247 | 3743 | if (event.getSource() == propagateToggle) |
---|
3248 | 3744 | { |
---|
3249 | 3745 | propagate ^= true; |
---|
.. | .. |
---|
3423 | 3919 | //System.out.println("ObjEditor " + event); |
---|
3424 | 3920 | applySelf0(true); |
---|
3425 | 3921 | //parent.applySelf(); |
---|
3426 | | - objEditor.refreshContents(); |
---|
| 3922 | + // conflicts with requestFocus objEditor.refreshContents(); |
---|
3427 | 3923 | } else if (source == resetButton) |
---|
3428 | 3924 | { |
---|
3429 | 3925 | CameraPane.fullreset = true; |
---|
.. | .. |
---|
3716 | 4212 | { |
---|
3717 | 4213 | //Save(true); |
---|
3718 | 4214 | Replace(); |
---|
3719 | | - SetUndoStates(); |
---|
| 4215 | + SetVersionStates(); |
---|
3720 | 4216 | } |
---|
3721 | 4217 | |
---|
3722 | 4218 | private boolean Equal(byte[] compress, byte[] name) |
---|
.. | .. |
---|
3735 | 4231 | return true; |
---|
3736 | 4232 | } |
---|
3737 | 4233 | |
---|
3738 | | - java.util.Hashtable<java.util.UUID, Object3D> versiontable = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
| 4234 | + void DeleteVersion() |
---|
| 4235 | + { |
---|
| 4236 | + for (int i = copy.versionindex; i < copy.versionlist.length-1; i++) |
---|
| 4237 | + { |
---|
| 4238 | + copy.versionlist[i] = copy.versionlist[i+1]; |
---|
| 4239 | + } |
---|
| 4240 | + |
---|
| 4241 | + if (copy.versionlist[copy.versionindex] == null) |
---|
| 4242 | + copy.versionindex -= 1; |
---|
| 4243 | + |
---|
| 4244 | + if (copy.versionindex != -1) |
---|
| 4245 | + CopyChanged(); |
---|
| 4246 | + |
---|
| 4247 | + SetVersionStates(); |
---|
| 4248 | + } |
---|
3739 | 4249 | |
---|
3740 | 4250 | public boolean Save(boolean user) |
---|
3741 | 4251 | { |
---|
3742 | 4252 | System.err.println("Save"); |
---|
3743 | 4253 | Replace(); |
---|
3744 | 4254 | |
---|
3745 | | - cRadio tab = GetCurrentTab(); |
---|
| 4255 | + //cRadio tab = GetCurrentTab(); |
---|
3746 | 4256 | |
---|
3747 | | - Object3D compress = CompressCopy(); // Saved version. No need for "Replace". |
---|
| 4257 | + Object3D compress = Duplicate(copy); // Saved version. No need for "Replace"? |
---|
3748 | 4258 | |
---|
3749 | 4259 | boolean thesame = false; |
---|
3750 | 4260 | |
---|
.. | .. |
---|
3756 | 4266 | //EditorFrame.m_MainFrame.requestFocusInWindow(); |
---|
3757 | 4267 | if (!thesame) |
---|
3758 | 4268 | { |
---|
| 4269 | + for (int i = copy.versionlist.length; --i > copy.versionindex+1;) |
---|
| 4270 | + { |
---|
| 4271 | + copy.versionlist[i] = copy.versionlist[i-1]; |
---|
| 4272 | + } |
---|
| 4273 | + |
---|
3759 | 4274 | //tab.user[tab.versionindex] = user; |
---|
3760 | 4275 | //boolean increment = true; // tab.graphs[tab.versionindex] == null; |
---|
3761 | 4276 | |
---|
.. | .. |
---|
3769 | 4284 | |
---|
3770 | 4285 | //assert(hashtable.isEmpty()); |
---|
3771 | 4286 | |
---|
3772 | | - for (int i = copy.versionindex+1; i < copy.versionlist.length; i++) |
---|
3773 | | - { |
---|
3774 | | - //tab.user[i] = false; |
---|
3775 | | - copy.versionlist[i] = null; |
---|
3776 | | - } |
---|
| 4287 | +// for (int i = copy.versionindex+1; i < copy.versionlist.length; i++) |
---|
| 4288 | +// { |
---|
| 4289 | +// //tab.user[i] = false; |
---|
| 4290 | +// copy.versionlist[i] = null; |
---|
| 4291 | +// } |
---|
3777 | 4292 | |
---|
3778 | | - SetUndoStates(); |
---|
| 4293 | + SetVersionStates(); |
---|
3779 | 4294 | |
---|
3780 | 4295 | // test save |
---|
3781 | 4296 | if (false) |
---|
.. | .. |
---|
3828 | 4343 | GetTree().addSelectionPath(selection.elementAt(i).GetTreePath().GetTreePath()); |
---|
3829 | 4344 | flashIt = true; |
---|
3830 | 4345 | |
---|
3831 | | - refreshContents(false); |
---|
| 4346 | + //refreshContents(false); |
---|
3832 | 4347 | } |
---|
3833 | 4348 | |
---|
3834 | | - void CopyChanged(Object3D obj) |
---|
| 4349 | + void CopyChanged() |
---|
3835 | 4350 | { |
---|
3836 | | - SetUndoStates(); |
---|
| 4351 | + Object3D obj = (Object3D)Grafreed.clone(copy.versionlist[copy.versionindex]); |
---|
| 4352 | + |
---|
| 4353 | + SetVersionStates(); |
---|
3837 | 4354 | |
---|
3838 | 4355 | boolean temp = CameraPane.SWITCH; |
---|
3839 | 4356 | CameraPane.SWITCH = false; |
---|
3840 | 4357 | |
---|
3841 | | - copy.ExtractBigData(versiontable); |
---|
| 4358 | + copy.ExtractBigData(Grafreed.grafreed.universe.versiontable); |
---|
3842 | 4359 | |
---|
3843 | 4360 | copy.clear(); |
---|
3844 | 4361 | |
---|
.. | .. |
---|
3850 | 4367 | copy.add(obj.get(i)); |
---|
3851 | 4368 | } |
---|
3852 | 4369 | |
---|
3853 | | - copy.RestoreBigData(versiontable); |
---|
| 4370 | + copy.RestoreBigData(Grafreed.grafreed.universe.versiontable); |
---|
3854 | 4371 | |
---|
3855 | 4372 | CameraPane.SWITCH = temp; |
---|
3856 | 4373 | |
---|
.. | .. |
---|
3875 | 4392 | } |
---|
3876 | 4393 | } |
---|
3877 | 4394 | |
---|
3878 | | - refreshContents(); |
---|
| 4395 | + refreshContents(true); |
---|
3879 | 4396 | } |
---|
3880 | 4397 | |
---|
3881 | | - cButton undoButton; |
---|
| 4398 | + cButton previousVersionButton; |
---|
3882 | 4399 | cButton restoreButton; |
---|
3883 | 4400 | cButton replaceButton; |
---|
3884 | | - cButton redoButton; |
---|
| 4401 | + cButton nextVersionButton; |
---|
| 4402 | + cButton saveVersionButton; |
---|
| 4403 | + cButton deleteVersionButton; |
---|
3885 | 4404 | |
---|
3886 | 4405 | boolean muteSlider; |
---|
3887 | 4406 | |
---|
.. | .. |
---|
3898 | 4417 | return count; |
---|
3899 | 4418 | } |
---|
3900 | 4419 | |
---|
3901 | | - void SetUndoStates() |
---|
| 4420 | + void SetVersionStates() |
---|
3902 | 4421 | { |
---|
3903 | | - cRadio tab = GetCurrentTab(); |
---|
| 4422 | + //if (true) |
---|
| 4423 | + // return; |
---|
| 4424 | + |
---|
| 4425 | + //cRadio tab = GetCurrentTab(); |
---|
3904 | 4426 | |
---|
3905 | 4427 | restoreButton.setEnabled(copy.versionindex != -1); |
---|
3906 | 4428 | replaceButton.setEnabled(copy.versionindex != -1); |
---|
3907 | 4429 | |
---|
3908 | | - undoButton.setEnabled(copy.versionindex > 0); |
---|
3909 | | - redoButton.setEnabled(copy.versionlist[copy.versionindex + 1] != null); |
---|
| 4430 | + previousVersionButton.setEnabled(copy.versionindex > 0); |
---|
| 4431 | + nextVersionButton.setEnabled(copy.versionlist[copy.versionindex + 1] != null); |
---|
| 4432 | + |
---|
| 4433 | + deleteVersionButton.setEnabled(copy.versionindex != -1); |
---|
| 4434 | + //copy.versionlist[copy.versionindex + 1] != null); |
---|
3910 | 4435 | |
---|
3911 | 4436 | muteSlider = true; |
---|
| 4437 | + versionSlider.setMinimum(0); |
---|
3912 | 4438 | versionSlider.setMaximum(VersionCount() - 1); |
---|
3913 | 4439 | versionSlider.setInteger(copy.versionindex); |
---|
| 4440 | + versionSlider.setEnabled(copy.versionindex != -1); |
---|
3914 | 4441 | muteSlider = false; |
---|
3915 | 4442 | } |
---|
3916 | 4443 | |
---|
3917 | | - public boolean Undo() |
---|
| 4444 | + public boolean PreviousVersion() |
---|
3918 | 4445 | { |
---|
3919 | 4446 | // Option? |
---|
3920 | 4447 | Replace(); |
---|
3921 | 4448 | |
---|
3922 | 4449 | System.err.println("Undo"); |
---|
3923 | 4450 | |
---|
3924 | | - cRadio tab = GetCurrentTab(); |
---|
| 4451 | + //cRadio tab = GetCurrentTab(); |
---|
3925 | 4452 | |
---|
3926 | 4453 | if (copy.versionindex == 0) |
---|
3927 | 4454 | { |
---|
.. | .. |
---|
3944 | 4471 | |
---|
3945 | 4472 | copy.versionindex -= 1; |
---|
3946 | 4473 | |
---|
3947 | | - CopyChanged((Object3D)copy.versionlist[copy.versionindex]); |
---|
| 4474 | + CopyChanged(); |
---|
3948 | 4475 | |
---|
3949 | 4476 | return true; |
---|
3950 | 4477 | } |
---|
.. | .. |
---|
3953 | 4480 | { |
---|
3954 | 4481 | System.err.println("Restore"); |
---|
3955 | 4482 | |
---|
3956 | | - cRadio tab = GetCurrentTab(); |
---|
| 4483 | + //cRadio tab = GetCurrentTab(); |
---|
3957 | 4484 | |
---|
3958 | 4485 | if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
3959 | 4486 | { |
---|
.. | .. |
---|
3962 | 4489 | } |
---|
3963 | 4490 | |
---|
3964 | 4491 | //CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
3965 | | - CopyChanged(copy.versionlist[copy.versionindex]); |
---|
| 4492 | + CopyChanged(); |
---|
3966 | 4493 | |
---|
3967 | 4494 | return true; |
---|
3968 | 4495 | } |
---|
3969 | 4496 | |
---|
3970 | 4497 | public boolean Replace() |
---|
3971 | 4498 | { |
---|
3972 | | - System.err.println("Replace"); |
---|
| 4499 | + //System.err.println("Replace"); |
---|
3973 | 4500 | |
---|
3974 | | - cRadio tab = GetCurrentTab(); |
---|
| 4501 | + //cRadio tab = GetCurrentTab(); |
---|
3975 | 4502 | |
---|
3976 | 4503 | if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
3977 | 4504 | { |
---|
.. | .. |
---|
3979 | 4506 | return false; |
---|
3980 | 4507 | } |
---|
3981 | 4508 | |
---|
3982 | | - copy.versionlist[copy.versionindex] = CompressCopy(); |
---|
| 4509 | + copy.versionlist[copy.versionindex] = Duplicate(copy); |
---|
3983 | 4510 | |
---|
3984 | 4511 | return true; |
---|
3985 | 4512 | } |
---|
3986 | 4513 | |
---|
3987 | | - public void Redo() |
---|
| 4514 | + public void NextVersion() |
---|
3988 | 4515 | { |
---|
3989 | 4516 | // Option? |
---|
3990 | 4517 | Replace(); |
---|
3991 | 4518 | |
---|
3992 | | - cRadio tab = GetCurrentTab(); |
---|
| 4519 | + //cRadio tab = GetCurrentTab(); |
---|
3993 | 4520 | |
---|
3994 | 4521 | if (copy.versionlist[copy.versionindex + 1] == null) |
---|
3995 | 4522 | { |
---|
.. | .. |
---|
3999 | 4526 | |
---|
4000 | 4527 | copy.versionindex += 1; |
---|
4001 | 4528 | |
---|
4002 | | - CopyChanged(copy.versionlist[copy.versionindex]); |
---|
| 4529 | + CopyChanged(); |
---|
4003 | 4530 | |
---|
4004 | 4531 | //if (!tab.user[tab.versionindex]) |
---|
4005 | 4532 | // tab.graphs[tab.versionindex] = null; |
---|
.. | .. |
---|
4308 | 4835 | if (muteSlider) |
---|
4309 | 4836 | return; |
---|
4310 | 4837 | |
---|
| 4838 | + Replace(); |
---|
| 4839 | + |
---|
4311 | 4840 | int version = versionSlider.getInteger(); |
---|
4312 | 4841 | |
---|
4313 | | - if (copy.versionlist[version] != null) |
---|
| 4842 | + if (version != -1 && copy.versionlist[version] != null) |
---|
4314 | 4843 | { |
---|
4315 | | - CopyChanged(copy.versionlist[copy.versionindex = version]); |
---|
| 4844 | + copy.versionindex = version; |
---|
| 4845 | + CopyChanged(); |
---|
4316 | 4846 | } |
---|
4317 | 4847 | |
---|
4318 | 4848 | return; |
---|
.. | .. |
---|
4353 | 4883 | //System.out.println("stateChanged = " + this); |
---|
4354 | 4884 | materialtouched = true; |
---|
4355 | 4885 | |
---|
4356 | | - if (e.getSource() == colorField && saturationField.getFloat() == 0.001) |
---|
| 4886 | + if (Globals.AUTOSATURATE && e.getSource() == colorField && saturationField.getFloat() == 0.001) |
---|
4357 | 4887 | { |
---|
4358 | 4888 | saturationField.setFloat(1); |
---|
4359 | 4889 | } |
---|
.. | .. |
---|
4666 | 5196 | ctrlPanel.validate(); // ? new |
---|
4667 | 5197 | ctrlPanel.repaint(); |
---|
4668 | 5198 | } |
---|
| 5199 | + |
---|
| 5200 | + if (previousVersionButton != null && copy.versionlist != null) |
---|
| 5201 | + SetVersionStates(); |
---|
| 5202 | + |
---|
| 5203 | + cameraView.requestFocusInWindow(); |
---|
4669 | 5204 | } |
---|
4670 | 5205 | |
---|
4671 | 5206 | static TweenManager tweenManager = new TweenManager(); |
---|
.. | .. |
---|
4697 | 5232 | // group = (Composite) group.get(0); |
---|
4698 | 5233 | // } |
---|
4699 | 5234 | |
---|
4700 | | - System.out.println("makeSomething of " + thing); |
---|
| 5235 | + //System.out.println("makeSomething of " + thing); |
---|
4701 | 5236 | |
---|
4702 | 5237 | /* |
---|
4703 | 5238 | if (deselect && jList != null) |
---|
.. | .. |
---|
5051 | 5586 | |
---|
5052 | 5587 | copy.versionlist = readobj.versionlist; |
---|
5053 | 5588 | copy.versionindex = readobj.versionindex; |
---|
| 5589 | + copy.versiontable = readobj.versiontable; |
---|
5054 | 5590 | |
---|
5055 | 5591 | if (copy.versionlist == null) |
---|
5056 | 5592 | { |
---|
| 5593 | + // Backward compatibility |
---|
5057 | 5594 | copy.versionlist = new Object3D[100]; |
---|
5058 | 5595 | copy.versionindex = -1; |
---|
| 5596 | + |
---|
| 5597 | + //Save(true); |
---|
5059 | 5598 | } |
---|
5060 | 5599 | |
---|
5061 | 5600 | //? SetUndoStates(); |
---|
.. | .. |
---|
5070 | 5609 | { |
---|
5071 | 5610 | if (Grafreed.standAlone) |
---|
5072 | 5611 | { |
---|
5073 | | - FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD); |
---|
| 5612 | + FileDialog browser = new FileDialog(frame, "Open", FileDialog.LOAD); |
---|
5074 | 5613 | browser.show(); |
---|
5075 | 5614 | String filename = browser.getFile(); |
---|
5076 | 5615 | if (filename != null && filename.length() > 0) |
---|
.. | .. |
---|
5147 | 5686 | |
---|
5148 | 5687 | void save() |
---|
5149 | 5688 | { |
---|
| 5689 | + Replace(); |
---|
| 5690 | + |
---|
5150 | 5691 | if (lastname == null) |
---|
5151 | 5692 | { |
---|
5152 | 5693 | return; |
---|
.. | .. |
---|
5389 | 5930 | ButtonGroup buttonGroup; |
---|
5390 | 5931 | |
---|
5391 | 5932 | cGridBag toolboxPanel; |
---|
| 5933 | + cGridBag skyboxPanel; |
---|
5392 | 5934 | cGridBag materialPanel; |
---|
5393 | 5935 | cGridBag ctrlPanel; |
---|
5394 | 5936 | |
---|
.. | .. |
---|
5493 | 6035 | cNumberSlider anisoField; |
---|
5494 | 6036 | JLabel anisoVLabel; |
---|
5495 | 6037 | cNumberSlider anisoVField; |
---|
| 6038 | + |
---|
5496 | 6039 | JLabel cameraLabel; |
---|
5497 | 6040 | cNumberSlider cameraField; |
---|
5498 | 6041 | JLabel selfshadowLabel; |
---|
.. | .. |
---|
5507 | 6050 | cNumberSlider fakedepthField; |
---|
5508 | 6051 | JLabel shadowbiasLabel; |
---|
5509 | 6052 | cNumberSlider shadowbiasField; |
---|
| 6053 | + |
---|
5510 | 6054 | JLabel bumpLabel; |
---|
5511 | 6055 | cNumberSlider bumpField; |
---|
5512 | 6056 | JLabel noiseLabel; |
---|