.. | .. |
---|
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 | |
---|
.. | .. |
---|
377 | 426 | |
---|
378 | 427 | static java.util.Vector<Object3D> listUI = new java.util.Vector<Object3D>(); |
---|
379 | 428 | |
---|
| 429 | + // This is to refresh the UI of the material panel. |
---|
| 430 | + boolean patchMaterial; |
---|
| 431 | + |
---|
380 | 432 | void SetupMenu() |
---|
381 | 433 | { |
---|
382 | 434 | frame.setMenuBar(menuBar = new MenuBar()); |
---|
.. | .. |
---|
426 | 478 | |
---|
427 | 479 | ChangeListener changeListener = new ChangeListener() |
---|
428 | 480 | { |
---|
| 481 | + //String name; |
---|
| 482 | + |
---|
429 | 483 | public void stateChanged(ChangeEvent changeEvent) |
---|
430 | 484 | { |
---|
431 | 485 | // if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Material") && !materialFlushed) |
---|
.. | .. |
---|
444 | 498 | // EditSelection(false); |
---|
445 | 499 | // } |
---|
446 | 500 | |
---|
447 | | - refreshContents(false); // To refresh Info tab |
---|
| 501 | +// if (objectPanel.getSelectedIndex() == 4) |
---|
| 502 | +// { |
---|
| 503 | +// name = copy.skyboxname; |
---|
| 504 | +// |
---|
| 505 | +// if (name == null) |
---|
| 506 | +// { |
---|
| 507 | +// name = ""; |
---|
| 508 | +// } |
---|
| 509 | +// |
---|
| 510 | +// copy.skyboxname = "cubemaps/default-skyboxes/rgb"; |
---|
| 511 | +// copy.skyboxext = "jpg"; |
---|
| 512 | +// } |
---|
| 513 | +// else |
---|
| 514 | +// { |
---|
| 515 | +// if (name != null) |
---|
| 516 | +// { |
---|
| 517 | +// if (name.equals("")) |
---|
| 518 | +// { |
---|
| 519 | +// copy.skyboxname = null; |
---|
| 520 | +// copy.skyboxext = null; |
---|
| 521 | +// } |
---|
| 522 | +// else |
---|
| 523 | +// { |
---|
| 524 | +// copy.skyboxname = name; |
---|
| 525 | +// } |
---|
| 526 | +// } |
---|
| 527 | +// } |
---|
| 528 | + cameraView.transformMode = objectPanel.getSelectedIndex() == 4; |
---|
| 529 | + |
---|
| 530 | +// refreshContents(false); // To refresh Info tab |
---|
| 531 | + cameraView.repaint(); |
---|
448 | 532 | } |
---|
449 | 533 | }; |
---|
450 | 534 | objectPanel.addChangeListener(changeListener); |
---|
.. | .. |
---|
466 | 550 | |
---|
467 | 551 | toolboxPanel = new cGridBag().setVertical(true); |
---|
468 | 552 | //toolboxPanel.setName("Toolbox"); |
---|
| 553 | + |
---|
| 554 | + skyboxPanel = new cGridBag().setVertical(true); |
---|
469 | 555 | |
---|
470 | 556 | materialPanel = new cGridBag().setVertical(false); |
---|
471 | 557 | //materialPanel.setName("Material"); |
---|
.. | .. |
---|
751 | 837 | boolean maximized; |
---|
752 | 838 | |
---|
753 | 839 | cButton fullscreenLayout; |
---|
| 840 | + cButton expandedLayout; |
---|
754 | 841 | |
---|
755 | 842 | void Minimize() |
---|
756 | 843 | { |
---|
.. | .. |
---|
790 | 877 | cButton minButton; |
---|
791 | 878 | cButton maxButton; |
---|
792 | 879 | cButton fullButton; |
---|
| 880 | + cButton collapseButton; |
---|
| 881 | + cButton maximize3DButton; |
---|
793 | 882 | |
---|
794 | 883 | void ToggleFullScreen() |
---|
795 | 884 | { |
---|
796 | | -GraphicsDevice device = frame.getGraphicsConfiguration().getDevice(); |
---|
| 885 | + GraphicsDevice device = frame.getGraphicsConfiguration().getDevice(); |
---|
797 | 886 | |
---|
798 | 887 | cameraView.ToggleFullScreen(); |
---|
799 | 888 | |
---|
.. | .. |
---|
814 | 903 | // X frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
815 | 904 | // X framePanel.add(bigThree); |
---|
816 | 905 | // X frame.getContentPane().add(/*"Center",*/framePanel); |
---|
817 | | - framePanel.setDividerLocation(46); |
---|
| 906 | +// framePanel.setDividerLocation(46); // icons are 24x24 |
---|
818 | 907 | |
---|
819 | 908 | //frame.setVisible(true); |
---|
820 | | - radio.layout = keepButton; |
---|
| 909 | +// radio.layout = keepButton; |
---|
821 | 910 | //theFrame = null; |
---|
822 | 911 | keepButton = null; |
---|
823 | | - radio.layout.doClick(); |
---|
| 912 | +// radio.layout.doClick(); |
---|
824 | 913 | |
---|
825 | 914 | } else |
---|
826 | 915 | { |
---|
.. | .. |
---|
841 | 930 | // X frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
842 | 931 | // X framePanel.remove(bigThree); |
---|
843 | 932 | // X frame.getContentPane().add(/*"Center",*/bigThree); |
---|
844 | | - framePanel.setDividerLocation(0); |
---|
| 933 | +// framePanel.setDividerLocation(0); |
---|
845 | 934 | |
---|
846 | | - radio.layout = fullscreenLayout; |
---|
847 | | - radio.layout.doClick(); |
---|
| 935 | +// radio.layout = fullscreenLayout; |
---|
| 936 | +// radio.layout.doClick(); |
---|
848 | 937 | //frame.setVisible(true); |
---|
849 | 938 | } |
---|
850 | 939 | frame.validate(); |
---|
.. | .. |
---|
852 | 941 | cameraView.requestFocusInWindow(); |
---|
853 | 942 | } |
---|
854 | 943 | |
---|
855 | | - private Object3D CompressCopy() |
---|
| 944 | + void CollapseToolbar() |
---|
| 945 | + { |
---|
| 946 | + framePanel.setDividerLocation(0); |
---|
| 947 | + //frame.validate(); |
---|
| 948 | + |
---|
| 949 | + cameraView.requestFocusInWindow(); |
---|
| 950 | + } |
---|
| 951 | + |
---|
| 952 | + private Object3D Duplicate(Object3D object) |
---|
856 | 953 | { |
---|
857 | 954 | boolean temp = CameraPane.SWITCH; |
---|
858 | 955 | CameraPane.SWITCH = false; |
---|
859 | 956 | |
---|
860 | | - copy.ExtractBigData(versiontable); |
---|
| 957 | + if (Grafreed.grafreed.universe.versiontable == null) |
---|
| 958 | + Grafreed.grafreed.universe.versiontable = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
| 959 | + |
---|
| 960 | + object.ExtractBigData(Grafreed.grafreed.universe.versiontable); |
---|
861 | 961 | // if (copy == client) |
---|
862 | 962 | |
---|
863 | | - Object3D versions[] = copy.versionlist; |
---|
864 | | - copy.versionlist = null; |
---|
| 963 | + Object3D versions[] = object.versionlist; |
---|
| 964 | + java.util.Hashtable<java.util.UUID, Object3D> versiontable = object.versiontable; // if Grafreed.grafreed.universe |
---|
| 965 | + object.versionlist = null; |
---|
| 966 | + object.versiontable = null; |
---|
865 | 967 | |
---|
866 | 968 | //byte[] compress = Compress(copy); |
---|
867 | | - Object3D compress = (Object3D)Grafreed.clone(copy); |
---|
| 969 | + Object3D compress = (Object3D)Grafreed.clone(object); |
---|
868 | 970 | |
---|
869 | | - copy.versionlist = versions; |
---|
| 971 | + object.versionlist = versions; |
---|
| 972 | + object.versiontable = versiontable; // if Grafreed.grafreed.universe |
---|
870 | 973 | |
---|
871 | | - copy.RestoreBigData(versiontable); |
---|
| 974 | + object.RestoreBigData(Grafreed.grafreed.universe.versiontable); |
---|
872 | 975 | |
---|
873 | 976 | CameraPane.SWITCH = temp; |
---|
874 | 977 | |
---|
.. | .. |
---|
1205 | 1308 | |
---|
1206 | 1309 | namePanel = new cGridBag(); |
---|
1207 | 1310 | |
---|
| 1311 | + //if (copy.pinned) |
---|
| 1312 | + { |
---|
| 1313 | + pinButton = GetToggleButton("icons/pin.png", !Grafreed.NIMBUSLAF); |
---|
| 1314 | + pinButton.setSelected(copy.pinned); |
---|
| 1315 | + cGridBag t = new cGridBag(); |
---|
| 1316 | + t.preferredWidth = 2; |
---|
| 1317 | + t.add(pinButton); |
---|
| 1318 | + namePanel.add(t); |
---|
| 1319 | + |
---|
| 1320 | + pinButton.addItemListener(this); |
---|
| 1321 | + } |
---|
| 1322 | + |
---|
1208 | 1323 | nameField = AddText(namePanel, copy.GetName()); |
---|
1209 | 1324 | namePanel.add(new JScrollPane(nameField, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER)); |
---|
1210 | 1325 | oe.ctrlPanel.add(namePanel); |
---|
.. | .. |
---|
1218 | 1333 | |
---|
1219 | 1334 | liveCB = AddCheckBox(setupPanel, "Live", copy.live); |
---|
1220 | 1335 | liveCB.setToolTipText("Animate object"); |
---|
| 1336 | + markCB = AddCheckBox(setupPanel, "Anim", copy.marked); |
---|
| 1337 | + markCB.setToolTipText("Set target transform"); |
---|
1221 | 1338 | selectableCB = AddCheckBox(setupPanel, "Select", !copy.dontselect); |
---|
1222 | 1339 | selectableCB.setToolTipText("Make object selectable"); |
---|
1223 | 1340 | // Return(); |
---|
1224 | 1341 | |
---|
1225 | 1342 | hideCB = AddCheckBox(setupPanel, "Hide", copy.hide); |
---|
1226 | 1343 | hideCB.setToolTipText("Hide object"); |
---|
1227 | | - markCB = AddCheckBox(setupPanel, "Mark", copy.marked); |
---|
1228 | | - markCB.setToolTipText("As animation target transform"); |
---|
1229 | 1344 | |
---|
1230 | 1345 | ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false); |
---|
1231 | 1346 | |
---|
.. | .. |
---|
1427 | 1542 | |
---|
1428 | 1543 | if (cam == null || !(copy.get(0) instanceof cGroup)) |
---|
1429 | 1544 | { |
---|
| 1545 | + if (Globals.DEBUG) |
---|
1430 | 1546 | System.out.println("CREATE CAMERAS"); |
---|
1431 | 1547 | cams = new cTemplate(); |
---|
1432 | 1548 | cams.name = "Cameras"; |
---|
.. | .. |
---|
1552 | 1668 | |
---|
1553 | 1669 | //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); |
---|
1554 | 1670 | //tmp.setName("Edit"); |
---|
| 1671 | + objectPanel.add(toolboxPanel); |
---|
| 1672 | + objectPanel.setIconAt(0, GetIcon("icons/primitives.png")); |
---|
| 1673 | + objectPanel.setToolTipTextAt(0, "Objects & textures"); |
---|
| 1674 | + |
---|
1555 | 1675 | objectPanel.add(materialPanel); |
---|
1556 | | - objectPanel.setIconAt(0, GetIcon("icons/material.png")); |
---|
1557 | | - objectPanel.setToolTipTextAt(0, "Material"); |
---|
| 1676 | + objectPanel.setIconAt(1, GetIcon("icons/material.png")); |
---|
| 1677 | + objectPanel.setToolTipTextAt(1, "Material"); |
---|
1558 | 1678 | |
---|
| 1679 | + objectPanel.add(skyboxPanel); |
---|
| 1680 | + objectPanel.setIconAt(2, GetIcon("icons/skybox.jpg")); |
---|
| 1681 | + objectPanel.setToolTipTextAt(2, "Backgrounds"); |
---|
| 1682 | + |
---|
1559 | 1683 | // JPanel north = new JPanel(new BorderLayout()); |
---|
1560 | 1684 | // north.setName("Edit"); |
---|
1561 | 1685 | // north.add(ctrlPanel, BorderLayout.NORTH); |
---|
1562 | 1686 | // objectPanel.add(north); |
---|
1563 | 1687 | objectPanel.add(editPanel); |
---|
1564 | | - objectPanel.setIconAt(1, GetIcon("icons/write.png")); |
---|
1565 | | - objectPanel.setToolTipTextAt(1, "Edit controls"); |
---|
1566 | | - |
---|
1567 | | - //if (Globals.ADVANCED) |
---|
1568 | | - objectPanel.add(infoPanel); |
---|
1569 | | - objectPanel.setIconAt(2, GetIcon("icons/info.png")); |
---|
1570 | | - objectPanel.setToolTipTextAt(2, "Information"); |
---|
| 1688 | + objectPanel.setIconAt(3, GetIcon("icons/write.png")); |
---|
| 1689 | + objectPanel.setToolTipTextAt(3, "Edit controls"); |
---|
1571 | 1690 | |
---|
1572 | 1691 | objectPanel.add(XYZPanel); |
---|
1573 | | - objectPanel.setIconAt(3, GetIcon("icons/XYZ.png")); |
---|
1574 | | - objectPanel.setToolTipTextAt(3, "XYZ/RGB transform"); |
---|
| 1692 | + objectPanel.setIconAt(4, GetIcon("icons/XYZ.png")); |
---|
| 1693 | + objectPanel.setToolTipTextAt(4, "XYZ/RGB transform"); |
---|
1575 | 1694 | |
---|
1576 | | - objectPanel.add(toolboxPanel); |
---|
1577 | | - objectPanel.setIconAt(4, GetIcon("icons/primitives.png")); |
---|
1578 | | - objectPanel.setToolTipTextAt(4, "Objects & backgrounds"); |
---|
1579 | | - |
---|
| 1695 | + patchMaterial = true; |
---|
| 1696 | + cameraView.patchMaterial = this; |
---|
| 1697 | + objectPanel.setSelectedIndex(1); |
---|
| 1698 | + |
---|
1580 | 1699 | /* |
---|
1581 | 1700 | aConstraints.gridx = 0; |
---|
1582 | 1701 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1613 | 1732 | |
---|
1614 | 1733 | scenePanel.add(tabbedPane); |
---|
1615 | 1734 | |
---|
| 1735 | + //if (Globals.ADVANCED) |
---|
| 1736 | +// tabbedPane.add(infoPanel); |
---|
| 1737 | +// tabbedPane.setIconAt(3, GetIcon("icons/info.png")); |
---|
| 1738 | +// tabbedPane.setToolTipTextAt(3, "Information"); |
---|
| 1739 | + |
---|
1616 | 1740 | /* |
---|
1617 | 1741 | cTree jTree = new cTree(null); |
---|
1618 | 1742 | ToolTipManager.sharedInstance().registerComponent(jTree); |
---|
.. | .. |
---|
1683 | 1807 | // aConstraints.gridheight = 1; |
---|
1684 | 1808 | |
---|
1685 | 1809 | framePanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, toolbarPanel, bigThree); |
---|
| 1810 | + |
---|
| 1811 | + framePanel.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY, |
---|
| 1812 | + new java.beans.PropertyChangeListener() |
---|
| 1813 | + { |
---|
| 1814 | + public void propertyChange(java.beans.PropertyChangeEvent pce) |
---|
| 1815 | + { |
---|
| 1816 | + if ((Integer)pce.getOldValue() == 1) |
---|
| 1817 | + { |
---|
| 1818 | + if (radio.layout != expandedLayout) |
---|
| 1819 | + { |
---|
| 1820 | + radio.layout = expandedLayout; |
---|
| 1821 | + radio.layout.doClick(); |
---|
| 1822 | + } |
---|
| 1823 | + } |
---|
| 1824 | + } |
---|
| 1825 | + }); |
---|
| 1826 | + |
---|
1686 | 1827 | framePanel.setContinuousLayout(false); |
---|
1687 | 1828 | framePanel.setOneTouchExpandable(false); |
---|
1688 | 1829 | //.setDividerLocation(0.8); |
---|
.. | .. |
---|
1692 | 1833 | |
---|
1693 | 1834 | frame.getContentPane().setLayout(new BorderLayout()); |
---|
1694 | 1835 | /**/ |
---|
1695 | | - JTabbedPane worldPane = new JTabbedPane(); |
---|
| 1836 | + //JTabbedPane worldPane = new JTabbedPane(); |
---|
1696 | 1837 | //worldPane.add(bigPanel); |
---|
1697 | 1838 | //worldPane.add(worldPanel); |
---|
1698 | 1839 | /**/ |
---|
.. | .. |
---|
1740 | 1881 | void SetupMaterial(cGridBag materialpanel) |
---|
1741 | 1882 | { |
---|
1742 | 1883 | cGridBag presetpanel = new cGridBag().setVertical(true); |
---|
| 1884 | + |
---|
1743 | 1885 | cLabel skin = GetLabel("icons/shadericons/shadericon00000.png", !Grafreed.NIMBUSLAF); |
---|
| 1886 | + skin.setToolTipText("Skin"); |
---|
1744 | 1887 | skin.addMouseListener(new MouseAdapter() |
---|
1745 | 1888 | { |
---|
1746 | 1889 | public void mouseClicked(MouseEvent e) |
---|
.. | .. |
---|
1750 | 1893 | |
---|
1751 | 1894 | // Skin |
---|
1752 | 1895 | colorField.setFloat(material.color); |
---|
1753 | | - saturationField.setFloat(material.modulation); |
---|
| 1896 | + float saturation = material.modulation; |
---|
| 1897 | + |
---|
| 1898 | + if (!cameraView.Skinshader) |
---|
| 1899 | + { |
---|
| 1900 | + saturation /= 1.5; |
---|
| 1901 | + } |
---|
| 1902 | + |
---|
| 1903 | + saturationField.setFloat(saturation); |
---|
| 1904 | + |
---|
1754 | 1905 | subsurfaceField.setFloat(material.subsurface); |
---|
1755 | 1906 | selfshadowField.setFloat(material.diffuseness); |
---|
1756 | 1907 | diffusenessField.setFloat(material.factor); |
---|
.. | .. |
---|
1769 | 1920 | }); |
---|
1770 | 1921 | presetpanel.add(skin); |
---|
1771 | 1922 | |
---|
1772 | | - cLabel rough2 = GetLabel("icons/shadericons/shadericon00001.png", !Grafreed.NIMBUSLAF); |
---|
1773 | | - rough2.addMouseListener(new MouseAdapter() |
---|
| 1923 | + cLabel lambert = GetLabel("icons/shadericons/shadericon00002.png", !Grafreed.NIMBUSLAF); |
---|
| 1924 | + lambert.setToolTipText("Diffuse"); |
---|
| 1925 | + lambert.addMouseListener(new MouseAdapter() |
---|
| 1926 | + { |
---|
| 1927 | + public void mouseClicked(MouseEvent e) |
---|
| 1928 | + { |
---|
| 1929 | + Object3D object = Grafreed.materials.versionlist[2].get(0); |
---|
| 1930 | + cMaterial material = object.material; |
---|
| 1931 | + |
---|
| 1932 | + diffusenessField.setFloat(material.factor); |
---|
| 1933 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1934 | + |
---|
| 1935 | + materialtouched = true; |
---|
| 1936 | + applySelf(); |
---|
| 1937 | + } |
---|
| 1938 | + }); |
---|
| 1939 | + presetpanel.add(lambert); |
---|
| 1940 | + |
---|
| 1941 | + cLabel diffuse2 = GetLabel("icons/shadericons/shadericon00003.png", !Grafreed.NIMBUSLAF); |
---|
| 1942 | + diffuse2.setToolTipText("Diffuse2"); |
---|
| 1943 | + diffuse2.addMouseListener(new MouseAdapter() |
---|
| 1944 | + { |
---|
| 1945 | + public void mouseClicked(MouseEvent e) |
---|
| 1946 | + { |
---|
| 1947 | + Object3D object = Grafreed.materials.versionlist[3].get(0); |
---|
| 1948 | + cMaterial material = object.material; |
---|
| 1949 | + |
---|
| 1950 | + diffusenessField.setFloat(material.factor); |
---|
| 1951 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1952 | + |
---|
| 1953 | + materialtouched = true; |
---|
| 1954 | + applySelf(); |
---|
| 1955 | + } |
---|
| 1956 | + }); |
---|
| 1957 | + presetpanel.add(diffuse2); |
---|
| 1958 | + |
---|
| 1959 | + cLabel diffusemoon = GetLabel("icons/shadericons/shadericon00004.png", !Grafreed.NIMBUSLAF); |
---|
| 1960 | + diffusemoon.setToolTipText("Moon"); |
---|
| 1961 | + diffusemoon.addMouseListener(new MouseAdapter() |
---|
| 1962 | + { |
---|
| 1963 | + public void mouseClicked(MouseEvent e) |
---|
| 1964 | + { |
---|
| 1965 | + Object3D object = Grafreed.materials.versionlist[4].get(0); |
---|
| 1966 | + cMaterial material = object.material; |
---|
| 1967 | + |
---|
| 1968 | + diffusenessField.setFloat(material.factor); |
---|
| 1969 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1970 | + |
---|
| 1971 | + materialtouched = true; |
---|
| 1972 | + applySelf(); |
---|
| 1973 | + } |
---|
| 1974 | + }); |
---|
| 1975 | + presetpanel.add(diffusemoon); |
---|
| 1976 | + |
---|
| 1977 | + cLabel diffusemoon2 = GetLabel("icons/shadericons/shadericon00005.png", !Grafreed.NIMBUSLAF); |
---|
| 1978 | + diffusemoon2.setToolTipText("Moon2"); |
---|
| 1979 | + diffusemoon2.addMouseListener(new MouseAdapter() |
---|
| 1980 | + { |
---|
| 1981 | + public void mouseClicked(MouseEvent e) |
---|
| 1982 | + { |
---|
| 1983 | + Object3D object = Grafreed.materials.versionlist[5].get(0); |
---|
| 1984 | + cMaterial material = object.material; |
---|
| 1985 | + |
---|
| 1986 | + diffusenessField.setFloat(material.factor); |
---|
| 1987 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1988 | + |
---|
| 1989 | + materialtouched = true; |
---|
| 1990 | + applySelf(); |
---|
| 1991 | + } |
---|
| 1992 | + }); |
---|
| 1993 | + presetpanel.add(diffusemoon2); |
---|
| 1994 | + |
---|
| 1995 | + cLabel diffusemoon3 = GetLabel("icons/shadericons/shadericon00006.png", !Grafreed.NIMBUSLAF); |
---|
| 1996 | + diffusemoon3.setToolTipText("Moon3"); |
---|
| 1997 | + diffusemoon3.addMouseListener(new MouseAdapter() |
---|
| 1998 | + { |
---|
| 1999 | + public void mouseClicked(MouseEvent e) |
---|
| 2000 | + { |
---|
| 2001 | + Object3D object = Grafreed.materials.versionlist[6].get(0); |
---|
| 2002 | + cMaterial material = object.material; |
---|
| 2003 | + |
---|
| 2004 | + diffusenessField.setFloat(material.factor); |
---|
| 2005 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 2006 | + |
---|
| 2007 | + materialtouched = true; |
---|
| 2008 | + applySelf(); |
---|
| 2009 | + } |
---|
| 2010 | + }); |
---|
| 2011 | + presetpanel.add(diffusemoon3); |
---|
| 2012 | + |
---|
| 2013 | + cLabel diffusesheen = GetLabel("icons/shadericons/shadericon00007.png", !Grafreed.NIMBUSLAF); |
---|
| 2014 | + diffusesheen.setToolTipText("Sheen"); |
---|
| 2015 | + diffusesheen.addMouseListener(new MouseAdapter() |
---|
| 2016 | + { |
---|
| 2017 | + public void mouseClicked(MouseEvent e) |
---|
| 2018 | + { |
---|
| 2019 | + Object3D object = Grafreed.materials.versionlist[7].get(0); |
---|
| 2020 | + cMaterial material = object.material; |
---|
| 2021 | + |
---|
| 2022 | + sheenField.setFloat(material.sheen); |
---|
| 2023 | + |
---|
| 2024 | + materialtouched = true; |
---|
| 2025 | + applySelf(); |
---|
| 2026 | + } |
---|
| 2027 | + }); |
---|
| 2028 | + presetpanel.add(diffusesheen); |
---|
| 2029 | + |
---|
| 2030 | + cLabel rough = GetLabel("icons/shadericons/shadericon00001.png", !Grafreed.NIMBUSLAF); |
---|
| 2031 | + rough.setToolTipText("Rough metal"); |
---|
| 2032 | + rough.addMouseListener(new MouseAdapter() |
---|
1774 | 2033 | { |
---|
1775 | 2034 | public void mouseClicked(MouseEvent e) |
---|
1776 | 2035 | { |
---|
.. | .. |
---|
1784 | 2043 | applySelf(); |
---|
1785 | 2044 | } |
---|
1786 | 2045 | }); |
---|
| 2046 | + presetpanel.add(rough); |
---|
| 2047 | + |
---|
| 2048 | + cLabel rough2 = GetLabel("icons/shadericons/shadericon00013.png", !Grafreed.NIMBUSLAF); |
---|
| 2049 | + rough2.setToolTipText("Medium metal"); |
---|
| 2050 | + rough2.addMouseListener(new MouseAdapter() |
---|
| 2051 | + { |
---|
| 2052 | + public void mouseClicked(MouseEvent e) |
---|
| 2053 | + { |
---|
| 2054 | + Object3D object = Grafreed.materials.versionlist[13].get(0); |
---|
| 2055 | + cMaterial material = object.material; |
---|
| 2056 | + |
---|
| 2057 | + shininessField.setFloat(material.shininess); |
---|
| 2058 | + lightareaField.setFloat(material.lightarea); |
---|
| 2059 | + |
---|
| 2060 | + materialtouched = true; |
---|
| 2061 | + applySelf(); |
---|
| 2062 | + } |
---|
| 2063 | + }); |
---|
1787 | 2064 | presetpanel.add(rough2); |
---|
1788 | 2065 | |
---|
1789 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00002.png", !Grafreed.NIMBUSLAF)); |
---|
1790 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00003.png", !Grafreed.NIMBUSLAF)); |
---|
1791 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00004.png", !Grafreed.NIMBUSLAF)); |
---|
1792 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00005.png", !Grafreed.NIMBUSLAF)); |
---|
1793 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00006.png", !Grafreed.NIMBUSLAF)); |
---|
1794 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00007.png", !Grafreed.NIMBUSLAF)); |
---|
1795 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00008.png", !Grafreed.NIMBUSLAF)); |
---|
1796 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00009.png", !Grafreed.NIMBUSLAF)); |
---|
1797 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00010.png", !Grafreed.NIMBUSLAF)); |
---|
1798 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00011.png", !Grafreed.NIMBUSLAF)); |
---|
1799 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00012.png", !Grafreed.NIMBUSLAF)); |
---|
1800 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00013.png", !Grafreed.NIMBUSLAF)); |
---|
1801 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00014.png", !Grafreed.NIMBUSLAF)); |
---|
1802 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00015.png", !Grafreed.NIMBUSLAF)); |
---|
1803 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00016.png", !Grafreed.NIMBUSLAF)); |
---|
1804 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00017.png", !Grafreed.NIMBUSLAF)); |
---|
| 2066 | + cLabel shini0 = GetLabel("icons/shadericons/shadericon00014.png", !Grafreed.NIMBUSLAF); |
---|
| 2067 | + shini0.setToolTipText("Shiny"); |
---|
| 2068 | + shini0.addMouseListener(new MouseAdapter() |
---|
| 2069 | + { |
---|
| 2070 | + public void mouseClicked(MouseEvent e) |
---|
| 2071 | + { |
---|
| 2072 | + Object3D object = Grafreed.materials.versionlist[14].get(0); |
---|
| 2073 | + cMaterial material = object.material; |
---|
| 2074 | + |
---|
| 2075 | + shininessField.setFloat(material.shininess); |
---|
| 2076 | + lightareaField.setFloat(material.lightarea); |
---|
| 2077 | + |
---|
| 2078 | + materialtouched = true; |
---|
| 2079 | + applySelf(); |
---|
| 2080 | + } |
---|
| 2081 | + }); |
---|
| 2082 | + presetpanel.add(shini0); |
---|
| 2083 | + |
---|
| 2084 | + cLabel shini1 = GetLabel("icons/shadericons/shadericon00011.png", !Grafreed.NIMBUSLAF); |
---|
| 2085 | + shini1.setToolTipText("Shiny2"); |
---|
| 2086 | + shini1.addMouseListener(new MouseAdapter() |
---|
| 2087 | + { |
---|
| 2088 | + public void mouseClicked(MouseEvent e) |
---|
| 2089 | + { |
---|
| 2090 | + Object3D object = Grafreed.materials.versionlist[11].get(0); |
---|
| 2091 | + cMaterial material = object.material; |
---|
| 2092 | + |
---|
| 2093 | + shininessField.setFloat(material.shininess); |
---|
| 2094 | + lightareaField.setFloat(material.lightarea); |
---|
| 2095 | + |
---|
| 2096 | + materialtouched = true; |
---|
| 2097 | + applySelf(); |
---|
| 2098 | + } |
---|
| 2099 | + }); |
---|
| 2100 | + presetpanel.add(shini1); |
---|
| 2101 | + |
---|
| 2102 | + cLabel shini2 = GetLabel("icons/shadericons/shadericon00012.png", !Grafreed.NIMBUSLAF); |
---|
| 2103 | + shini2.setToolTipText("Shiny3"); |
---|
| 2104 | + shini2.addMouseListener(new MouseAdapter() |
---|
| 2105 | + { |
---|
| 2106 | + public void mouseClicked(MouseEvent e) |
---|
| 2107 | + { |
---|
| 2108 | + Object3D object = Grafreed.materials.versionlist[12].get(0); |
---|
| 2109 | + cMaterial material = object.material; |
---|
| 2110 | + |
---|
| 2111 | + shininessField.setFloat(material.shininess); |
---|
| 2112 | + lightareaField.setFloat(material.lightarea); |
---|
| 2113 | + |
---|
| 2114 | + materialtouched = true; |
---|
| 2115 | + applySelf(); |
---|
| 2116 | + } |
---|
| 2117 | + }); |
---|
| 2118 | + presetpanel.add(shini2); |
---|
| 2119 | + |
---|
| 2120 | + cLabel aniso = GetLabel("icons/shadericons/shadericon00008.png", !Grafreed.NIMBUSLAF); |
---|
| 2121 | + aniso.setToolTipText("AnisoU"); |
---|
| 2122 | + aniso.addMouseListener(new MouseAdapter() |
---|
| 2123 | + { |
---|
| 2124 | + public void mouseClicked(MouseEvent e) |
---|
| 2125 | + { |
---|
| 2126 | + Object3D object = Grafreed.materials.versionlist[8].get(0); |
---|
| 2127 | + cMaterial material = object.material; |
---|
| 2128 | + |
---|
| 2129 | + anisoField.setFloat(material.aniso); |
---|
| 2130 | + anisoVField.setFloat(material.anisoV); |
---|
| 2131 | + |
---|
| 2132 | + materialtouched = true; |
---|
| 2133 | + applySelf(); |
---|
| 2134 | + } |
---|
| 2135 | + }); |
---|
| 2136 | + presetpanel.add(aniso); |
---|
| 2137 | + |
---|
| 2138 | + cLabel aniso2 = GetLabel("icons/shadericons/shadericon00009.png", !Grafreed.NIMBUSLAF); |
---|
| 2139 | + aniso2.setToolTipText("AnisoV"); |
---|
| 2140 | + aniso2.addMouseListener(new MouseAdapter() |
---|
| 2141 | + { |
---|
| 2142 | + public void mouseClicked(MouseEvent e) |
---|
| 2143 | + { |
---|
| 2144 | + Object3D object = Grafreed.materials.versionlist[9].get(0); |
---|
| 2145 | + cMaterial material = object.material; |
---|
| 2146 | + |
---|
| 2147 | + anisoField.setFloat(material.aniso); |
---|
| 2148 | + anisoVField.setFloat(material.anisoV); |
---|
| 2149 | + |
---|
| 2150 | + materialtouched = true; |
---|
| 2151 | + applySelf(); |
---|
| 2152 | + } |
---|
| 2153 | + }); |
---|
| 2154 | + presetpanel.add(aniso2); |
---|
| 2155 | + |
---|
| 2156 | + cLabel aniso3 = GetLabel("icons/shadericons/shadericon00010.png", !Grafreed.NIMBUSLAF); |
---|
| 2157 | + aniso3.setToolTipText("AnisoUV"); |
---|
| 2158 | + aniso3.addMouseListener(new MouseAdapter() |
---|
| 2159 | + { |
---|
| 2160 | + public void mouseClicked(MouseEvent e) |
---|
| 2161 | + { |
---|
| 2162 | + Object3D object = Grafreed.materials.versionlist[10].get(0); |
---|
| 2163 | + cMaterial material = object.material; |
---|
| 2164 | + |
---|
| 2165 | + anisoField.setFloat(material.aniso); |
---|
| 2166 | + anisoVField.setFloat(material.anisoV); |
---|
| 2167 | + |
---|
| 2168 | + materialtouched = true; |
---|
| 2169 | + applySelf(); |
---|
| 2170 | + } |
---|
| 2171 | + }); |
---|
| 2172 | + presetpanel.add(aniso3); |
---|
| 2173 | + |
---|
| 2174 | + cLabel velvet0 = GetLabel("icons/shadericons/shadericon00015.png", !Grafreed.NIMBUSLAF); |
---|
| 2175 | + velvet0.setToolTipText("Velvet"); |
---|
| 2176 | + velvet0.addMouseListener(new MouseAdapter() |
---|
| 2177 | + { |
---|
| 2178 | + public void mouseClicked(MouseEvent e) |
---|
| 2179 | + { |
---|
| 2180 | + Object3D object = Grafreed.materials.versionlist[15].get(0); |
---|
| 2181 | + cMaterial material = object.material; |
---|
| 2182 | + |
---|
| 2183 | + diffusenessField.setFloat(material.factor); |
---|
| 2184 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 2185 | + sheenField.setFloat(material.sheen); |
---|
| 2186 | + shininessField.setFloat(material.shininess); |
---|
| 2187 | + velvetField.setFloat(material.velvet); |
---|
| 2188 | + shiftField.setFloat(material.shift); |
---|
| 2189 | + |
---|
| 2190 | + materialtouched = true; |
---|
| 2191 | + applySelf(); |
---|
| 2192 | + } |
---|
| 2193 | + }); |
---|
| 2194 | + presetpanel.add(velvet0); |
---|
| 2195 | + |
---|
| 2196 | + cLabel bump0 = GetLabel("icons/shadericons/shadericon00016.png", !Grafreed.NIMBUSLAF); |
---|
| 2197 | + bump0.setToolTipText("Bump texture"); |
---|
| 2198 | + bump0.addMouseListener(new MouseAdapter() |
---|
| 2199 | + { |
---|
| 2200 | + public void mouseClicked(MouseEvent e) |
---|
| 2201 | + { |
---|
| 2202 | + Object3D object = Grafreed.materials.versionlist[16].get(0); |
---|
| 2203 | + cMaterial material = object.material; |
---|
| 2204 | + |
---|
| 2205 | + bumpField.setFloat(object.projectedVertices[0].x / 1000.0); |
---|
| 2206 | + noiseField.setFloat(object.projectedVertices[0].y / 1000.0); |
---|
| 2207 | + powerField.setFloat(object.projectedVertices[2].x / 1000.0); |
---|
| 2208 | + |
---|
| 2209 | + materialtouched = true; |
---|
| 2210 | + applySelf(); |
---|
| 2211 | + } |
---|
| 2212 | + }); |
---|
| 2213 | + presetpanel.add(bump0); |
---|
| 2214 | + |
---|
| 2215 | + cLabel borderShader = GetLabel("icons/shadericons/borderfade.jpg", !Grafreed.NIMBUSLAF); |
---|
| 2216 | + borderShader.setToolTipText("Border fade"); |
---|
| 2217 | + borderShader.addMouseListener(new MouseAdapter() |
---|
| 2218 | + { |
---|
| 2219 | + public void mouseClicked(MouseEvent e) |
---|
| 2220 | + { |
---|
| 2221 | + borderfadeField.setFloat(0.5); |
---|
| 2222 | + opacityField.setFloat(0.75); |
---|
| 2223 | + |
---|
| 2224 | + materialtouched = true; |
---|
| 2225 | + applySelf(); |
---|
| 2226 | + } |
---|
| 2227 | + }); |
---|
| 2228 | + presetpanel.add(borderShader); |
---|
| 2229 | + |
---|
| 2230 | + cLabel halo = GetLabel("icons/shadericons/shadericon00017.png", !Grafreed.NIMBUSLAF); |
---|
| 2231 | + halo.setToolTipText("Halo"); |
---|
| 2232 | + halo.addMouseListener(new MouseAdapter() |
---|
| 2233 | + { |
---|
| 2234 | + public void mouseClicked(MouseEvent e) |
---|
| 2235 | + { |
---|
| 2236 | + Object3D object = Grafreed.materials.versionlist[17].get(0); |
---|
| 2237 | + cMaterial material = object.material; |
---|
| 2238 | + |
---|
| 2239 | + opacityPowerField.setFloat(object.projectedVertices[2].y / 1000.0); |
---|
| 2240 | + |
---|
| 2241 | + materialtouched = true; |
---|
| 2242 | + applySelf(); |
---|
| 2243 | + } |
---|
| 2244 | + }); |
---|
| 2245 | + presetpanel.add(halo); |
---|
| 2246 | + |
---|
| 2247 | + cLabel candle = GetLabel("icons/shadericons/shadericon00018.png", !Grafreed.NIMBUSLAF); |
---|
| 2248 | + candle.setToolTipText("Candle"); |
---|
| 2249 | + candle.addMouseListener(new MouseAdapter() |
---|
| 2250 | + { |
---|
| 2251 | + public void mouseClicked(MouseEvent e) |
---|
| 2252 | + { |
---|
| 2253 | + Object3D object = Grafreed.materials.versionlist[18].get(0); |
---|
| 2254 | + cMaterial material = object.material; |
---|
| 2255 | + |
---|
| 2256 | + subsurfaceField.setFloat(material.subsurface); |
---|
| 2257 | + shadowbiasField.setFloat(material.shadowbias); |
---|
| 2258 | + ambientField.setFloat(material.ambient); |
---|
| 2259 | + specularField.setFloat(material.specular); |
---|
| 2260 | + lightareaField.setFloat(material.lightarea); |
---|
| 2261 | + shininessField.setFloat(material.shininess); |
---|
| 2262 | + |
---|
| 2263 | + materialtouched = true; |
---|
| 2264 | + applySelf(); |
---|
| 2265 | + } |
---|
| 2266 | + }); |
---|
| 2267 | + presetpanel.add(candle); |
---|
| 2268 | + |
---|
| 2269 | + cLabel shadowShader = GetLabel("icons/shadericons/shadow.png", !Grafreed.NIMBUSLAF); |
---|
| 2270 | + shadowShader.setToolTipText("Shadow"); |
---|
| 2271 | + shadowShader.addMouseListener(new MouseAdapter() |
---|
| 2272 | + { |
---|
| 2273 | + public void mouseClicked(MouseEvent e) |
---|
| 2274 | + { |
---|
| 2275 | + diffuseField.setFloat(0.001); |
---|
| 2276 | + ambientField.setFloat(0.001); |
---|
| 2277 | + cameraField.setFloat(0.001); |
---|
| 2278 | + specularField.setFloat(0.001); |
---|
| 2279 | + fakedepthField.setFloat(0.001); |
---|
| 2280 | + opacityField.setFloat(0.6); |
---|
| 2281 | + |
---|
| 2282 | + materialtouched = true; |
---|
| 2283 | + applySelf(); |
---|
| 2284 | + } |
---|
| 2285 | + }); |
---|
| 2286 | + presetpanel.add(shadowShader); |
---|
1805 | 2287 | |
---|
1806 | 2288 | cGridBag panel = new cGridBag().setVertical(true); |
---|
1807 | 2289 | |
---|
1808 | 2290 | presetpanel.preferredWidth = 1; |
---|
1809 | 2291 | |
---|
1810 | | - materialpanel.add(panel); |
---|
1811 | 2292 | materialpanel.add(presetpanel); |
---|
| 2293 | + materialpanel.add(panel); |
---|
1812 | 2294 | |
---|
1813 | 2295 | panel.preferredWidth = 8; |
---|
1814 | 2296 | |
---|
.. | .. |
---|
1852 | 2334 | |
---|
1853 | 2335 | cGridBag huepanel = new cGridBag(); |
---|
1854 | 2336 | cGridBag huelabel = new cGridBag(); |
---|
1855 | | - skin = GetLabel("icons/hue.png", false); |
---|
1856 | | - skin.fit = true; |
---|
1857 | | - huelabel.add(skin); |
---|
| 2337 | + cLabel hue = GetLabel("icons/hue.png", false); |
---|
| 2338 | + hue.fit = true; |
---|
| 2339 | + |
---|
| 2340 | + hue.addMouseListener(new MouseAdapter() |
---|
| 2341 | + { |
---|
| 2342 | + public void mousePressed(MouseEvent e) |
---|
| 2343 | + { |
---|
| 2344 | + int x = e.getX(); |
---|
| 2345 | + |
---|
| 2346 | + colorField.setFloat((double)x / ((cLabel)e.getSource()).getWidth()); |
---|
| 2347 | + } |
---|
| 2348 | + }); |
---|
| 2349 | + |
---|
| 2350 | + huelabel.add(hue); |
---|
1858 | 2351 | huelabel.preferredWidth = 20; |
---|
1859 | 2352 | huepanel.add(new cGridBag()); // Label |
---|
1860 | 2353 | huepanel.add(huelabel); // Field/slider |
---|
.. | .. |
---|
3130 | 3623 | |
---|
3131 | 3624 | if (multiplyToggle != null) |
---|
3132 | 3625 | multiplyToggle.setSelected(mat.multiply); |
---|
3133 | | - |
---|
3134 | | - assert (object.projectedVertices != null); |
---|
3135 | | - |
---|
3136 | | - if (object.projectedVertices.length <= 2) |
---|
3137 | | - { |
---|
3138 | | - // Side effect... |
---|
3139 | | - Object3D.cVector2[] keep = object.projectedVertices; |
---|
3140 | | - object.projectedVertices = new Object3D.cVector2[3]; |
---|
3141 | | - for (int i = 0; i < 3; i++) |
---|
3142 | | - { |
---|
3143 | | - if (i < keep.length) |
---|
3144 | | - { |
---|
3145 | | - object.projectedVertices[i] = keep[i]; |
---|
3146 | | - } else |
---|
3147 | | - { |
---|
3148 | | - object.projectedVertices[i] = new Object3D.cVector2(); |
---|
3149 | | - } |
---|
3150 | | - /* |
---|
3151 | | - if(keep.length == 0) |
---|
3152 | | - object.projectedVertices[0] = new Object3D.cVector2(); |
---|
3153 | | - else |
---|
3154 | | - object.projectedVertices[0] = keep[0]; |
---|
3155 | | - object.projectedVertices[1] = new Object3D.cVector2(); |
---|
3156 | | - */ |
---|
3157 | | - } |
---|
3158 | | - } |
---|
| 3626 | + |
---|
| 3627 | + AllocProjectedVertices(object); |
---|
3159 | 3628 | |
---|
3160 | 3629 | SetMaterial(mat, object.projectedVertices); |
---|
3161 | 3630 | } |
---|
.. | .. |
---|
3275 | 3744 | public void itemStateChanged(ItemEvent event) |
---|
3276 | 3745 | { |
---|
3277 | 3746 | // System.out.println("Propagate = " + propagate); |
---|
| 3747 | + if (event.getSource() == pinButton) |
---|
| 3748 | + { |
---|
| 3749 | + copy.pinned ^= true; |
---|
| 3750 | + if (!copy.pinned && !copy.editWindow.copy.selection.contains(copy)) |
---|
| 3751 | + { |
---|
| 3752 | + ((GroupEditor)copy.editWindow).listUI.remove(copy); |
---|
| 3753 | + copy.CloseUI(); |
---|
| 3754 | + //copy.editWindow.refreshContents(); |
---|
| 3755 | + } |
---|
| 3756 | + } |
---|
| 3757 | + else |
---|
3278 | 3758 | if (event.getSource() == propagateToggle) |
---|
3279 | 3759 | { |
---|
3280 | 3760 | propagate ^= true; |
---|
.. | .. |
---|
3454 | 3934 | //System.out.println("ObjEditor " + event); |
---|
3455 | 3935 | applySelf0(true); |
---|
3456 | 3936 | //parent.applySelf(); |
---|
3457 | | - objEditor.refreshContents(); |
---|
| 3937 | + // conflicts with requestFocus objEditor.refreshContents(); |
---|
3458 | 3938 | } else if (source == resetButton) |
---|
3459 | 3939 | { |
---|
3460 | 3940 | CameraPane.fullreset = true; |
---|
.. | .. |
---|
3747 | 4227 | { |
---|
3748 | 4228 | //Save(true); |
---|
3749 | 4229 | Replace(); |
---|
3750 | | - SetUndoStates(); |
---|
| 4230 | + SetVersionStates(); |
---|
3751 | 4231 | } |
---|
3752 | 4232 | |
---|
3753 | 4233 | private boolean Equal(byte[] compress, byte[] name) |
---|
.. | .. |
---|
3766 | 4246 | return true; |
---|
3767 | 4247 | } |
---|
3768 | 4248 | |
---|
3769 | | - java.util.Hashtable<java.util.UUID, Object3D> versiontable = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
3770 | | - |
---|
3771 | 4249 | void DeleteVersion() |
---|
3772 | 4250 | { |
---|
3773 | 4251 | for (int i = copy.versionindex; i < copy.versionlist.length-1; i++) |
---|
.. | .. |
---|
3775 | 4253 | copy.versionlist[i] = copy.versionlist[i+1]; |
---|
3776 | 4254 | } |
---|
3777 | 4255 | |
---|
3778 | | - CopyChanged(); |
---|
| 4256 | + if (copy.versionlist[copy.versionindex] == null) |
---|
| 4257 | + copy.versionindex -= 1; |
---|
3779 | 4258 | |
---|
3780 | | - SetUndoStates(); |
---|
| 4259 | + if (copy.versionindex != -1) |
---|
| 4260 | + CopyChanged(); |
---|
| 4261 | + |
---|
| 4262 | + SetVersionStates(); |
---|
3781 | 4263 | } |
---|
3782 | 4264 | |
---|
3783 | 4265 | public boolean Save(boolean user) |
---|
3784 | 4266 | { |
---|
3785 | 4267 | System.err.println("Save"); |
---|
3786 | | - //Replace(); |
---|
| 4268 | + Replace(); |
---|
3787 | 4269 | |
---|
3788 | | - cRadio tab = GetCurrentTab(); |
---|
| 4270 | + //cRadio tab = GetCurrentTab(); |
---|
3789 | 4271 | |
---|
3790 | | - Object3D compress = CompressCopy(); // Saved version. No need for "Replace"? |
---|
| 4272 | + Object3D compress = Duplicate(copy); // Saved version. No need for "Replace"? |
---|
3791 | 4273 | |
---|
3792 | 4274 | boolean thesame = false; |
---|
3793 | 4275 | |
---|
.. | .. |
---|
3823 | 4305 | // copy.versionlist[i] = null; |
---|
3824 | 4306 | // } |
---|
3825 | 4307 | |
---|
3826 | | - SetUndoStates(); |
---|
| 4308 | + SetVersionStates(); |
---|
3827 | 4309 | |
---|
3828 | 4310 | // test save |
---|
3829 | 4311 | if (false) |
---|
.. | .. |
---|
3881 | 4363 | |
---|
3882 | 4364 | void CopyChanged() |
---|
3883 | 4365 | { |
---|
3884 | | - Object3D obj = copy.versionlist[copy.versionindex]; |
---|
| 4366 | + Object3D obj = (Object3D)Grafreed.clone(copy.versionlist[copy.versionindex]); |
---|
3885 | 4367 | |
---|
3886 | | - SetUndoStates(); |
---|
| 4368 | + SetVersionStates(); |
---|
3887 | 4369 | |
---|
3888 | 4370 | boolean temp = CameraPane.SWITCH; |
---|
3889 | 4371 | CameraPane.SWITCH = false; |
---|
3890 | 4372 | |
---|
3891 | | - copy.ExtractBigData(versiontable); |
---|
| 4373 | + copy.ExtractBigData(Grafreed.grafreed.universe.versiontable); |
---|
3892 | 4374 | |
---|
3893 | 4375 | copy.clear(); |
---|
3894 | 4376 | |
---|
.. | .. |
---|
3900 | 4382 | copy.add(obj.get(i)); |
---|
3901 | 4383 | } |
---|
3902 | 4384 | |
---|
3903 | | - copy.RestoreBigData(versiontable); |
---|
| 4385 | + copy.RestoreBigData(Grafreed.grafreed.universe.versiontable); |
---|
3904 | 4386 | |
---|
3905 | 4387 | CameraPane.SWITCH = temp; |
---|
3906 | 4388 | |
---|
.. | .. |
---|
3950 | 4432 | return count; |
---|
3951 | 4433 | } |
---|
3952 | 4434 | |
---|
3953 | | - void SetUndoStates() |
---|
| 4435 | + void SetVersionStates() |
---|
3954 | 4436 | { |
---|
3955 | | - cRadio tab = GetCurrentTab(); |
---|
| 4437 | + //if (true) |
---|
| 4438 | + // return; |
---|
| 4439 | + |
---|
| 4440 | + //cRadio tab = GetCurrentTab(); |
---|
3956 | 4441 | |
---|
3957 | | - restoreButton.setEnabled(true); // copy.versionindex != -1); |
---|
3958 | | - replaceButton.setEnabled(true); // copy.versionindex != -1); |
---|
| 4442 | + restoreButton.setEnabled(copy.versionindex != -1); |
---|
| 4443 | + replaceButton.setEnabled(copy.versionindex != -1); |
---|
3959 | 4444 | |
---|
3960 | 4445 | previousVersionButton.setEnabled(copy.versionindex > 0); |
---|
3961 | 4446 | nextVersionButton.setEnabled(copy.versionlist[copy.versionindex + 1] != null); |
---|
3962 | 4447 | |
---|
3963 | | - deleteVersionButton.setEnabled(//copy.versionindex > 0 && |
---|
3964 | | - copy.versionlist[copy.versionindex + 1] != null); |
---|
| 4448 | + deleteVersionButton.setEnabled(copy.versionindex != -1); |
---|
| 4449 | + //copy.versionlist[copy.versionindex + 1] != null); |
---|
3965 | 4450 | |
---|
3966 | 4451 | muteSlider = true; |
---|
| 4452 | + versionSlider.setMinimum(0); |
---|
3967 | 4453 | versionSlider.setMaximum(VersionCount() - 1); |
---|
3968 | 4454 | versionSlider.setInteger(copy.versionindex); |
---|
| 4455 | + versionSlider.setEnabled(copy.versionindex != -1); |
---|
3969 | 4456 | muteSlider = false; |
---|
3970 | 4457 | } |
---|
3971 | 4458 | |
---|
.. | .. |
---|
3976 | 4463 | |
---|
3977 | 4464 | System.err.println("Undo"); |
---|
3978 | 4465 | |
---|
3979 | | - cRadio tab = GetCurrentTab(); |
---|
| 4466 | + //cRadio tab = GetCurrentTab(); |
---|
3980 | 4467 | |
---|
3981 | 4468 | if (copy.versionindex == 0) |
---|
3982 | 4469 | { |
---|
.. | .. |
---|
4008 | 4495 | { |
---|
4009 | 4496 | System.err.println("Restore"); |
---|
4010 | 4497 | |
---|
4011 | | - cRadio tab = GetCurrentTab(); |
---|
| 4498 | + //cRadio tab = GetCurrentTab(); |
---|
4012 | 4499 | |
---|
4013 | 4500 | if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
4014 | 4501 | { |
---|
.. | .. |
---|
4024 | 4511 | |
---|
4025 | 4512 | public boolean Replace() |
---|
4026 | 4513 | { |
---|
4027 | | - System.err.println("Replace"); |
---|
| 4514 | + //System.err.println("Replace"); |
---|
4028 | 4515 | |
---|
4029 | | - cRadio tab = GetCurrentTab(); |
---|
| 4516 | + //cRadio tab = GetCurrentTab(); |
---|
4030 | 4517 | |
---|
4031 | 4518 | if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
4032 | 4519 | { |
---|
.. | .. |
---|
4034 | 4521 | return false; |
---|
4035 | 4522 | } |
---|
4036 | 4523 | |
---|
4037 | | - copy.versionlist[copy.versionindex] = CompressCopy(); |
---|
| 4524 | + copy.versionlist[copy.versionindex] = Duplicate(copy); |
---|
4038 | 4525 | |
---|
4039 | 4526 | return true; |
---|
4040 | 4527 | } |
---|
.. | .. |
---|
4044 | 4531 | // Option? |
---|
4045 | 4532 | Replace(); |
---|
4046 | 4533 | |
---|
4047 | | - cRadio tab = GetCurrentTab(); |
---|
| 4534 | + //cRadio tab = GetCurrentTab(); |
---|
4048 | 4535 | |
---|
4049 | 4536 | if (copy.versionlist[copy.versionindex + 1] == null) |
---|
4050 | 4537 | { |
---|
.. | .. |
---|
4363 | 4850 | if (muteSlider) |
---|
4364 | 4851 | return; |
---|
4365 | 4852 | |
---|
| 4853 | + Replace(); |
---|
| 4854 | + |
---|
4366 | 4855 | int version = versionSlider.getInteger(); |
---|
4367 | 4856 | |
---|
4368 | | - if (copy.versionlist[version] != null) |
---|
| 4857 | + if (version != -1 && copy.versionlist[version] != null) |
---|
4369 | 4858 | { |
---|
4370 | 4859 | copy.versionindex = version; |
---|
4371 | 4860 | CopyChanged(); |
---|
.. | .. |
---|
4409 | 4898 | //System.out.println("stateChanged = " + this); |
---|
4410 | 4899 | materialtouched = true; |
---|
4411 | 4900 | |
---|
4412 | | - if (e.getSource() == colorField && saturationField.getFloat() == 0.001) |
---|
| 4901 | + if (Globals.AUTOSATURATE && e.getSource() == colorField && saturationField.getFloat() == 0.001) |
---|
4413 | 4902 | { |
---|
4414 | 4903 | saturationField.setFloat(1); |
---|
4415 | 4904 | } |
---|
.. | .. |
---|
4724 | 5213 | } |
---|
4725 | 5214 | |
---|
4726 | 5215 | if (previousVersionButton != null && copy.versionlist != null) |
---|
4727 | | - SetUndoStates(); |
---|
| 5216 | + SetVersionStates(); |
---|
| 5217 | + |
---|
| 5218 | + cameraView.requestFocusInWindow(); |
---|
4728 | 5219 | } |
---|
4729 | 5220 | |
---|
4730 | 5221 | static TweenManager tweenManager = new TweenManager(); |
---|
.. | .. |
---|
4756 | 5247 | // group = (Composite) group.get(0); |
---|
4757 | 5248 | // } |
---|
4758 | 5249 | |
---|
4759 | | - System.out.println("makeSomething of " + thing); |
---|
| 5250 | + //System.out.println("makeSomething of " + thing); |
---|
4760 | 5251 | |
---|
4761 | 5252 | /* |
---|
4762 | 5253 | if (deselect && jList != null) |
---|
.. | .. |
---|
5110 | 5601 | |
---|
5111 | 5602 | copy.versionlist = readobj.versionlist; |
---|
5112 | 5603 | copy.versionindex = readobj.versionindex; |
---|
| 5604 | + copy.versiontable = readobj.versiontable; |
---|
5113 | 5605 | |
---|
5114 | 5606 | if (copy.versionlist == null) |
---|
5115 | 5607 | { |
---|
| 5608 | + // Backward compatibility |
---|
5116 | 5609 | copy.versionlist = new Object3D[100]; |
---|
5117 | 5610 | copy.versionindex = -1; |
---|
| 5611 | + |
---|
| 5612 | + //Save(true); |
---|
5118 | 5613 | } |
---|
5119 | 5614 | |
---|
5120 | 5615 | //? SetUndoStates(); |
---|
.. | .. |
---|
5206 | 5701 | |
---|
5207 | 5702 | void save() |
---|
5208 | 5703 | { |
---|
| 5704 | + Replace(); |
---|
| 5705 | + |
---|
5209 | 5706 | if (lastname == null) |
---|
5210 | 5707 | { |
---|
5211 | 5708 | return; |
---|
.. | .. |
---|
5448 | 5945 | ButtonGroup buttonGroup; |
---|
5449 | 5946 | |
---|
5450 | 5947 | cGridBag toolboxPanel; |
---|
| 5948 | + cGridBag skyboxPanel; |
---|
5451 | 5949 | cGridBag materialPanel; |
---|
5452 | 5950 | cGridBag ctrlPanel; |
---|
5453 | 5951 | |
---|
.. | .. |
---|
5552 | 6050 | cNumberSlider anisoField; |
---|
5553 | 6051 | JLabel anisoVLabel; |
---|
5554 | 6052 | cNumberSlider anisoVField; |
---|
| 6053 | + |
---|
5555 | 6054 | JLabel cameraLabel; |
---|
5556 | 6055 | cNumberSlider cameraField; |
---|
5557 | 6056 | JLabel selfshadowLabel; |
---|
.. | .. |
---|
5566 | 6065 | cNumberSlider fakedepthField; |
---|
5567 | 6066 | JLabel shadowbiasLabel; |
---|
5568 | 6067 | cNumberSlider shadowbiasField; |
---|
| 6068 | + |
---|
5569 | 6069 | JLabel bumpLabel; |
---|
5570 | 6070 | cNumberSlider bumpField; |
---|
5571 | 6071 | JLabel noiseLabel; |
---|