.. | .. |
---|
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 | { |
---|
.. | .. |
---|
53 | 83 | cButton GetButton(String name, boolean border) |
---|
54 | 84 | { |
---|
55 | 85 | ImageIcon icon = GetIcon(name); |
---|
56 | | - return new cButton(icon, border); |
---|
| 86 | + if (icon != null || name.contains("/")) |
---|
| 87 | + return new cButton(icon, border); |
---|
| 88 | + else |
---|
| 89 | + return new cButton(name, border); |
---|
57 | 90 | } |
---|
58 | 91 | |
---|
59 | 92 | cLabel GetLabel(String name, boolean border) |
---|
.. | .. |
---|
74 | 107 | return new cCheckBox(icon, border); |
---|
75 | 108 | } |
---|
76 | 109 | |
---|
77 | | - ImageIcon GetIcon(String name) |
---|
| 110 | + static java.util.Hashtable<String, javax.swing.ImageIcon> icons = new java.util.Hashtable<String, javax.swing.ImageIcon>(); |
---|
| 111 | + |
---|
| 112 | + static ImageIcon GetIcon(String name) |
---|
78 | 113 | { |
---|
| 114 | + javax.swing.ImageIcon iconCache = icons.get(name); |
---|
| 115 | + if (iconCache != null) |
---|
| 116 | + { |
---|
| 117 | + return iconCache; |
---|
| 118 | + } |
---|
| 119 | + |
---|
79 | 120 | try |
---|
80 | 121 | { |
---|
81 | | - BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name)); |
---|
| 122 | + BufferedImage image = javax.imageio.ImageIO.read(ObjEditor.class.getClassLoader().getResourceAsStream(name)); |
---|
82 | 123 | |
---|
83 | 124 | // if (image.getWidth() > 48 && image.getHeight() > 48) |
---|
84 | 125 | // { |
---|
.. | .. |
---|
93 | 134 | // } |
---|
94 | 135 | |
---|
95 | 136 | javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image); |
---|
| 137 | + |
---|
| 138 | + icons.put(name, icon); |
---|
| 139 | + |
---|
96 | 140 | return icon; |
---|
97 | 141 | } |
---|
98 | 142 | catch (Exception e) |
---|
99 | 143 | { |
---|
| 144 | + //icons.put(name, null); |
---|
100 | 145 | return null; |
---|
101 | 146 | } |
---|
102 | 147 | } |
---|
.. | .. |
---|
296 | 341 | client = inClient; |
---|
297 | 342 | copy = client; |
---|
298 | 343 | |
---|
299 | | - if (copy.versionlist == null) |
---|
300 | | - { |
---|
301 | | - copy.versionlist = new Object3D[100]; |
---|
302 | | - copy.versionindex = -1; |
---|
303 | | - } |
---|
| 344 | +// if (copy.versionlist == null) |
---|
| 345 | +// { |
---|
| 346 | +// copy.versionlist = new Object3D[100]; |
---|
| 347 | +// copy.versionindex = -1; |
---|
| 348 | +// |
---|
| 349 | +// callee.Save(true); |
---|
| 350 | +// } |
---|
304 | 351 | |
---|
305 | 352 | // "this" is not called: SetupUI2(objEditor); |
---|
306 | 353 | } |
---|
.. | .. |
---|
319 | 366 | { |
---|
320 | 367 | copy.versionlist = new Object3D[100]; |
---|
321 | 368 | copy.versionindex = -1; |
---|
| 369 | + |
---|
| 370 | +// Save(true); |
---|
322 | 371 | } |
---|
323 | 372 | |
---|
324 | 373 | SetupUI2(callee.GetEditor()); |
---|
.. | .. |
---|
342 | 391 | //parent = p; |
---|
343 | 392 | |
---|
344 | 393 | GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice(); |
---|
345 | | - System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow()); |
---|
| 394 | + if (Globals.DEBUG) |
---|
| 395 | + System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow()); |
---|
346 | 396 | //gd.setFullScreenWindow(this); |
---|
347 | 397 | //setResizable(false); |
---|
348 | 398 | //if (!isDisplayable()) |
---|
.. | .. |
---|
353 | 403 | copy = localCopy; |
---|
354 | 404 | copy.editWindow = this; |
---|
355 | 405 | |
---|
356 | | - if (copy.versionlist == null) |
---|
357 | | - { |
---|
358 | | -// copy.versions = new byte[100][]; |
---|
| 406 | +// if (copy.versionlist == null) |
---|
| 407 | +// { |
---|
| 408 | +// copy.versionlist = new Object3D[100]; |
---|
359 | 409 | // copy.versionindex = -1; |
---|
360 | | - } |
---|
| 410 | +// |
---|
| 411 | +// Save(true); |
---|
| 412 | +// } |
---|
361 | 413 | |
---|
362 | 414 | SetupMenu(); |
---|
363 | 415 | |
---|
.. | .. |
---|
377 | 429 | |
---|
378 | 430 | static java.util.Vector<Object3D> listUI = new java.util.Vector<Object3D>(); |
---|
379 | 431 | |
---|
| 432 | + // This is to refresh the UI of the material panel. |
---|
| 433 | + boolean patchMaterial; |
---|
| 434 | + |
---|
380 | 435 | void SetupMenu() |
---|
381 | 436 | { |
---|
382 | 437 | frame.setMenuBar(menuBar = new MenuBar()); |
---|
.. | .. |
---|
426 | 481 | |
---|
427 | 482 | ChangeListener changeListener = new ChangeListener() |
---|
428 | 483 | { |
---|
| 484 | + //String name; |
---|
| 485 | + |
---|
429 | 486 | public void stateChanged(ChangeEvent changeEvent) |
---|
430 | 487 | { |
---|
431 | 488 | // if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Material") && !materialFlushed) |
---|
.. | .. |
---|
444 | 501 | // EditSelection(false); |
---|
445 | 502 | // } |
---|
446 | 503 | |
---|
447 | | - refreshContents(false); // To refresh Info tab |
---|
| 504 | +// if (objectPanel.getSelectedIndex() == 4) |
---|
| 505 | +// { |
---|
| 506 | +// name = copy.skyboxname; |
---|
| 507 | +// |
---|
| 508 | +// if (name == null) |
---|
| 509 | +// { |
---|
| 510 | +// name = ""; |
---|
| 511 | +// } |
---|
| 512 | +// |
---|
| 513 | +// copy.skyboxname = "cubemaps/default-skyboxes/rgb"; |
---|
| 514 | +// copy.skyboxext = "jpg"; |
---|
| 515 | +// } |
---|
| 516 | +// else |
---|
| 517 | +// { |
---|
| 518 | +// if (name != null) |
---|
| 519 | +// { |
---|
| 520 | +// if (name.equals("")) |
---|
| 521 | +// { |
---|
| 522 | +// copy.skyboxname = null; |
---|
| 523 | +// copy.skyboxext = null; |
---|
| 524 | +// } |
---|
| 525 | +// else |
---|
| 526 | +// { |
---|
| 527 | +// copy.skyboxname = name; |
---|
| 528 | +// } |
---|
| 529 | +// } |
---|
| 530 | +// } |
---|
| 531 | + cameraView.transformMode = objectPanel.getSelectedIndex() == 4; |
---|
| 532 | + |
---|
| 533 | +// refreshContents(false); // To refresh Info tab |
---|
| 534 | + cameraView.repaint(); |
---|
448 | 535 | } |
---|
449 | 536 | }; |
---|
450 | 537 | objectPanel.addChangeListener(changeListener); |
---|
.. | .. |
---|
466 | 553 | |
---|
467 | 554 | toolboxPanel = new cGridBag().setVertical(true); |
---|
468 | 555 | //toolboxPanel.setName("Toolbox"); |
---|
| 556 | + |
---|
| 557 | + skyboxPanel = new cGridBag().setVertical(true); |
---|
469 | 558 | |
---|
470 | 559 | materialPanel = new cGridBag().setVertical(false); |
---|
471 | 560 | //materialPanel.setName("Material"); |
---|
.. | .. |
---|
751 | 840 | boolean maximized; |
---|
752 | 841 | |
---|
753 | 842 | cButton fullscreenLayout; |
---|
| 843 | + cButton expandedLayout; |
---|
754 | 844 | |
---|
755 | 845 | void Minimize() |
---|
756 | 846 | { |
---|
.. | .. |
---|
790 | 880 | cButton minButton; |
---|
791 | 881 | cButton maxButton; |
---|
792 | 882 | cButton fullButton; |
---|
| 883 | + cButton collapseButton; |
---|
| 884 | + cButton maximize3DButton; |
---|
793 | 885 | |
---|
794 | 886 | void ToggleFullScreen() |
---|
795 | 887 | { |
---|
796 | | -GraphicsDevice device = frame.getGraphicsConfiguration().getDevice(); |
---|
| 888 | + GraphicsDevice device = frame.getGraphicsConfiguration().getDevice(); |
---|
797 | 889 | |
---|
798 | 890 | cameraView.ToggleFullScreen(); |
---|
799 | 891 | |
---|
.. | .. |
---|
814 | 906 | // X frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
815 | 907 | // X framePanel.add(bigThree); |
---|
816 | 908 | // X frame.getContentPane().add(/*"Center",*/framePanel); |
---|
817 | | - framePanel.setDividerLocation(46); |
---|
| 909 | +// framePanel.setDividerLocation(46); // icons are 24x24 |
---|
818 | 910 | |
---|
819 | 911 | //frame.setVisible(true); |
---|
820 | | - radio.layout = keepButton; |
---|
| 912 | +// radio.layout = keepButton; |
---|
821 | 913 | //theFrame = null; |
---|
822 | 914 | keepButton = null; |
---|
823 | | - radio.layout.doClick(); |
---|
| 915 | +// radio.layout.doClick(); |
---|
824 | 916 | |
---|
825 | 917 | } else |
---|
826 | 918 | { |
---|
.. | .. |
---|
841 | 933 | // X frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
842 | 934 | // X framePanel.remove(bigThree); |
---|
843 | 935 | // X frame.getContentPane().add(/*"Center",*/bigThree); |
---|
844 | | - framePanel.setDividerLocation(0); |
---|
| 936 | +// framePanel.setDividerLocation(0); |
---|
845 | 937 | |
---|
846 | | - radio.layout = fullscreenLayout; |
---|
847 | | - radio.layout.doClick(); |
---|
| 938 | +// radio.layout = fullscreenLayout; |
---|
| 939 | +// radio.layout.doClick(); |
---|
848 | 940 | //frame.setVisible(true); |
---|
849 | 941 | } |
---|
850 | 942 | frame.validate(); |
---|
.. | .. |
---|
852 | 944 | cameraView.requestFocusInWindow(); |
---|
853 | 945 | } |
---|
854 | 946 | |
---|
855 | | - private Object3D CompressCopy() |
---|
| 947 | + void CollapseToolbar() |
---|
| 948 | + { |
---|
| 949 | + framePanel.setDividerLocation(0); |
---|
| 950 | + //frame.validate(); |
---|
| 951 | + |
---|
| 952 | + cameraView.requestFocusInWindow(); |
---|
| 953 | + } |
---|
| 954 | + |
---|
| 955 | + private Object3D Duplicate(Object3D object) |
---|
856 | 956 | { |
---|
857 | 957 | boolean temp = CameraPane.SWITCH; |
---|
858 | 958 | CameraPane.SWITCH = false; |
---|
859 | 959 | |
---|
860 | | - copy.ExtractBigData(versiontable); |
---|
| 960 | + if (Grafreed.grafreed.universe.versiontable == null) |
---|
| 961 | + Grafreed.grafreed.universe.versiontable = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
| 962 | + |
---|
| 963 | + object.ExtractBigData(Grafreed.grafreed.universe.versiontable); |
---|
861 | 964 | // if (copy == client) |
---|
862 | 965 | |
---|
863 | | - Object3D versions[] = copy.versionlist; |
---|
864 | | - copy.versionlist = null; |
---|
| 966 | + Object3D versions[] = object.versionlist; |
---|
| 967 | + java.util.Hashtable<java.util.UUID, Object3D> versiontable = object.versiontable; // if Grafreed.grafreed.universe |
---|
| 968 | + object.versionlist = null; |
---|
| 969 | + object.versiontable = null; |
---|
| 970 | + |
---|
| 971 | + Object3D parent = object.parent; |
---|
| 972 | + object.parent = null; |
---|
865 | 973 | |
---|
866 | 974 | //byte[] compress = Compress(copy); |
---|
867 | | - Object3D compress = (Object3D)Grafreed.clone(copy); |
---|
| 975 | + Object3D compress = (Object3D)Grafreed.clone(object); |
---|
868 | 976 | |
---|
869 | | - copy.versionlist = versions; |
---|
| 977 | + object.parent = parent; |
---|
870 | 978 | |
---|
871 | | - copy.RestoreBigData(versiontable); |
---|
| 979 | + object.versionlist = versions; |
---|
| 980 | + object.versiontable = versiontable; // if Grafreed.grafreed.universe |
---|
| 981 | + |
---|
| 982 | + object.RestoreBigData(Grafreed.grafreed.universe.versiontable); |
---|
872 | 983 | |
---|
873 | 984 | CameraPane.SWITCH = temp; |
---|
874 | 985 | |
---|
.. | .. |
---|
1205 | 1316 | |
---|
1206 | 1317 | namePanel = new cGridBag(); |
---|
1207 | 1318 | |
---|
| 1319 | + //if (copy.pinned) |
---|
| 1320 | + { |
---|
| 1321 | + pinButton = GetToggleButton("icons/pin.png", !Globals.NIMBUSLAF); |
---|
| 1322 | + pinButton.setSelected(copy.pinned); |
---|
| 1323 | + cGridBag t = new cGridBag(); |
---|
| 1324 | + t.preferredWidth = 2; |
---|
| 1325 | + t.add(pinButton); |
---|
| 1326 | + namePanel.add(t); |
---|
| 1327 | + |
---|
| 1328 | + pinButton.addItemListener(this); |
---|
| 1329 | + } |
---|
| 1330 | + |
---|
1208 | 1331 | nameField = AddText(namePanel, copy.GetName()); |
---|
1209 | 1332 | namePanel.add(new JScrollPane(nameField, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER)); |
---|
1210 | 1333 | oe.ctrlPanel.add(namePanel); |
---|
.. | .. |
---|
1218 | 1341 | |
---|
1219 | 1342 | liveCB = AddCheckBox(setupPanel, "Live", copy.live); |
---|
1220 | 1343 | liveCB.setToolTipText("Animate object"); |
---|
| 1344 | + markCB = AddCheckBox(setupPanel, "Anim", copy.marked); |
---|
| 1345 | + markCB.setToolTipText("Set target transform"); |
---|
1221 | 1346 | selectableCB = AddCheckBox(setupPanel, "Select", !copy.dontselect); |
---|
1222 | 1347 | selectableCB.setToolTipText("Make object selectable"); |
---|
1223 | 1348 | // Return(); |
---|
1224 | 1349 | |
---|
1225 | 1350 | hideCB = AddCheckBox(setupPanel, "Hide", copy.hide); |
---|
1226 | 1351 | hideCB.setToolTipText("Hide object"); |
---|
1227 | | - markCB = AddCheckBox(setupPanel, "Mark", copy.marked); |
---|
1228 | | - markCB.setToolTipText("As animation target transform"); |
---|
1229 | 1352 | |
---|
1230 | 1353 | ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false); |
---|
1231 | 1354 | |
---|
.. | .. |
---|
1427 | 1550 | |
---|
1428 | 1551 | if (cam == null || !(copy.get(0) instanceof cGroup)) |
---|
1429 | 1552 | { |
---|
| 1553 | + if (Globals.DEBUG) |
---|
1430 | 1554 | System.out.println("CREATE CAMERAS"); |
---|
1431 | 1555 | cams = new cTemplate(); |
---|
1432 | 1556 | cams.name = "Cameras"; |
---|
.. | .. |
---|
1508 | 1632 | //frontView.object = copy; |
---|
1509 | 1633 | //sideView.object = copy; |
---|
1510 | 1634 | |
---|
| 1635 | + transformPanel = new cGridBag().setVertical(true); |
---|
| 1636 | + |
---|
| 1637 | + cGridBag resetTransformPanel = new cGridBag(); |
---|
| 1638 | + |
---|
| 1639 | + resetTransformPanel.preferredHeight = 2; |
---|
| 1640 | + |
---|
| 1641 | + cButton resetTransform = GetButton("Reset all", !Globals.NIMBUSLAF); |
---|
| 1642 | + resetTransform.setToolTipText("Reset Translation, Rotation and Scale"); |
---|
| 1643 | + resetTransform.addMouseListener(new MouseAdapter() |
---|
| 1644 | + { |
---|
| 1645 | + public void mouseClicked(MouseEvent e) |
---|
| 1646 | + { |
---|
| 1647 | + ResetTransform(); |
---|
| 1648 | + } |
---|
| 1649 | + }); |
---|
| 1650 | + resetTransformPanel.add(resetTransform); |
---|
| 1651 | + |
---|
| 1652 | + resetTransform = GetButton("T only", !Globals.NIMBUSLAF); |
---|
| 1653 | + resetTransform.setToolTipText("Reset Translation only"); |
---|
| 1654 | + resetTransform.addMouseListener(new MouseAdapter() |
---|
| 1655 | + { |
---|
| 1656 | + public void mouseClicked(MouseEvent e) |
---|
| 1657 | + { |
---|
| 1658 | + ResetTransform(1); |
---|
| 1659 | + } |
---|
| 1660 | + }); |
---|
| 1661 | + resetTransformPanel.add(resetTransform); |
---|
| 1662 | + |
---|
| 1663 | + resetTransform = GetButton("RS only", !Globals.NIMBUSLAF); |
---|
| 1664 | + resetTransform.setToolTipText("Reset Rotation and Scale only"); |
---|
| 1665 | + resetTransform.addMouseListener(new MouseAdapter() |
---|
| 1666 | + { |
---|
| 1667 | + public void mouseClicked(MouseEvent e) |
---|
| 1668 | + { |
---|
| 1669 | + ResetTransform(2); |
---|
| 1670 | + } |
---|
| 1671 | + }); |
---|
| 1672 | + resetTransformPanel.add(resetTransform); |
---|
| 1673 | + |
---|
1511 | 1674 | XYZPanel = new cGridBag().setVertical(true); |
---|
1512 | 1675 | //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5)); |
---|
1513 | 1676 | |
---|
.. | .. |
---|
1517 | 1680 | XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll); |
---|
1518 | 1681 | //XYZPanel.setName("XYZ"); |
---|
1519 | 1682 | |
---|
| 1683 | + transformPanel.add(resetTransformPanel); |
---|
| 1684 | + transformPanel.add(XYZPanel); |
---|
| 1685 | + |
---|
1520 | 1686 | /* |
---|
1521 | 1687 | gridPanel = new JPanel(); //new BorderLayout()); |
---|
1522 | 1688 | gridPanel.setLayout(new GridLayout(1, 2)); |
---|
.. | .. |
---|
1524 | 1690 | gridPanel.add(cameraView); |
---|
1525 | 1691 | gridPanel.add(XYZPanel); |
---|
1526 | 1692 | */ |
---|
1527 | | - gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, centralPanel, XYZPanel); //new BorderLayout()); |
---|
1528 | | - gridPanel.setContinuousLayout(true); |
---|
1529 | | - gridPanel.setOneTouchExpandable(true); |
---|
1530 | | - gridPanel.setDividerLocation(1.0); |
---|
1531 | | - gridPanel.setDividerSize(9); |
---|
1532 | | - gridPanel.setResizeWeight(0.85); |
---|
| 1693 | +// gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, centralPanel, XYZPanel); //new BorderLayout()); |
---|
| 1694 | +// gridPanel.setContinuousLayout(true); |
---|
| 1695 | +// gridPanel.setOneTouchExpandable(true); |
---|
| 1696 | +// gridPanel.setDividerLocation(1.0); |
---|
| 1697 | +// gridPanel.setDividerSize(9); |
---|
| 1698 | +// gridPanel.setResizeWeight(0.85); |
---|
1533 | 1699 | |
---|
1534 | 1700 | // aConstraints.weighty = 0; |
---|
1535 | 1701 | //System.out.println("THIS = " + this); |
---|
.. | .. |
---|
1552 | 1718 | |
---|
1553 | 1719 | //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); |
---|
1554 | 1720 | //tmp.setName("Edit"); |
---|
1555 | | - objectPanel.add(materialPanel); |
---|
1556 | | - objectPanel.setIconAt(0, GetIcon("icons/material.png")); |
---|
1557 | | - objectPanel.setToolTipTextAt(0, "Material"); |
---|
1558 | | - |
---|
1559 | 1721 | objectPanel.add(toolboxPanel); |
---|
1560 | | - objectPanel.setIconAt(1, GetIcon("icons/primitives.png")); |
---|
1561 | | - objectPanel.setToolTipTextAt(1, "Objects & backgrounds"); |
---|
| 1722 | + objectPanel.setIconAt(0, GetIcon("icons/primitives.png")); |
---|
| 1723 | + objectPanel.setToolTipTextAt(0, "Objects & textures"); |
---|
1562 | 1724 | |
---|
| 1725 | + objectPanel.add(materialPanel); |
---|
| 1726 | + objectPanel.setIconAt(1, GetIcon("icons/material.png")); |
---|
| 1727 | + objectPanel.setToolTipTextAt(1, "Material"); |
---|
| 1728 | + |
---|
| 1729 | + objectPanel.add(skyboxPanel); |
---|
| 1730 | + objectPanel.setIconAt(2, GetIcon("icons/skybox.jpg")); |
---|
| 1731 | + objectPanel.setToolTipTextAt(2, "Backgrounds"); |
---|
| 1732 | + |
---|
1563 | 1733 | // JPanel north = new JPanel(new BorderLayout()); |
---|
1564 | 1734 | // north.setName("Edit"); |
---|
1565 | 1735 | // north.add(ctrlPanel, BorderLayout.NORTH); |
---|
1566 | 1736 | // objectPanel.add(north); |
---|
1567 | 1737 | objectPanel.add(editPanel); |
---|
1568 | | - objectPanel.setIconAt(2, GetIcon("icons/write.png")); |
---|
1569 | | - objectPanel.setToolTipTextAt(2, "Edit controls"); |
---|
| 1738 | + objectPanel.setIconAt(3, GetIcon("icons/write.png")); |
---|
| 1739 | + objectPanel.setToolTipTextAt(3, "Edit controls"); |
---|
1570 | 1740 | |
---|
1571 | | - //if (Globals.ADVANCED) |
---|
1572 | | - objectPanel.add(infoPanel); |
---|
1573 | | - objectPanel.setIconAt(3, GetIcon("icons/info.png")); |
---|
1574 | | - objectPanel.setToolTipTextAt(3, "Information"); |
---|
1575 | | - |
---|
1576 | | - objectPanel.add(XYZPanel); |
---|
| 1741 | + objectPanel.add(transformPanel); |
---|
1577 | 1742 | objectPanel.setIconAt(4, GetIcon("icons/XYZ.png")); |
---|
1578 | | - objectPanel.setToolTipTextAt(4, "XYZ/RGB transform"); |
---|
| 1743 | + objectPanel.setToolTipTextAt(4, "TRS transform"); |
---|
1579 | 1744 | |
---|
| 1745 | + patchMaterial = true; |
---|
| 1746 | + cameraView.patchMaterial = this; |
---|
| 1747 | + objectPanel.setSelectedIndex(1); |
---|
| 1748 | + |
---|
1580 | 1749 | /* |
---|
1581 | 1750 | aConstraints.gridx = 0; |
---|
1582 | 1751 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1596 | 1765 | scrollpane.addMouseWheelListener(this); // Default not fast enough |
---|
1597 | 1766 | |
---|
1598 | 1767 | /*JTabbedPane*/ scenePanel = new cGridBag(); |
---|
1599 | | - scenePanel.preferredWidth = 5; |
---|
| 1768 | + scenePanel.preferredWidth = 6; |
---|
1600 | 1769 | |
---|
1601 | 1770 | JTabbedPane tabbedPane = new JTabbedPane(); |
---|
1602 | 1771 | tabbedPane.add(scrollpane); |
---|
.. | .. |
---|
1607 | 1776 | |
---|
1608 | 1777 | AddOptions(optionsPanel); //, aConstraints); |
---|
1609 | 1778 | |
---|
1610 | | - tabbedPane.add(optionsPanel); |
---|
1611 | | - |
---|
1612 | 1779 | tabbedPane.add(FSPane = new cFileSystemPane(this)); |
---|
1613 | 1780 | |
---|
| 1781 | + tabbedPane.add(optionsPanel); |
---|
| 1782 | + |
---|
1614 | 1783 | scenePanel.add(tabbedPane); |
---|
| 1784 | + |
---|
| 1785 | + cGridBag creditsPanel = new cGridBag().setVertical(true); |
---|
| 1786 | + creditsPanel.setName("Credits"); |
---|
| 1787 | + |
---|
| 1788 | + cLabel ogaLabel = new cLabel(" Most Skyboxes courtesy of OpenGameArt!", !Globals.NIMBUSLAF); |
---|
| 1789 | + creditsPanel.add(ogaLabel); |
---|
| 1790 | + |
---|
| 1791 | + cButton opengameartButton; |
---|
| 1792 | + creditsPanel.add(opengameartButton = GetButton("icons/sara-logo.png", !Globals.NIMBUSLAF)); |
---|
| 1793 | + opengameartButton.setToolTipText("https://opengameart.org"); |
---|
| 1794 | + |
---|
| 1795 | + opengameartButton.addMouseListener(new MouseAdapter() |
---|
| 1796 | + { |
---|
| 1797 | + public void mouseClicked(MouseEvent e) |
---|
| 1798 | + { |
---|
| 1799 | + try |
---|
| 1800 | + { |
---|
| 1801 | + Desktop.getDesktop().browse(new java.net.URI("https://opengameart.org/")); |
---|
| 1802 | + } catch (Exception e1) |
---|
| 1803 | +// } catch (java.io.IOException | java.net.URISyntaxException e1) |
---|
| 1804 | + { |
---|
| 1805 | + e1.printStackTrace(); |
---|
| 1806 | + } |
---|
| 1807 | + } |
---|
| 1808 | + }); |
---|
| 1809 | + |
---|
| 1810 | + for (int i=10; --i>=0;) |
---|
| 1811 | + { |
---|
| 1812 | + creditsPanel.add(new cGridBag()); |
---|
| 1813 | + } |
---|
| 1814 | + |
---|
| 1815 | + tabbedPane.add(creditsPanel); |
---|
| 1816 | + tabbedPane.setToolTipTextAt(3, "Credits"); |
---|
| 1817 | + |
---|
| 1818 | + if (Globals.ADVANCED) |
---|
| 1819 | + { |
---|
| 1820 | + tabbedPane.add(infoPanel); |
---|
| 1821 | + tabbedPane.setIconAt(4, GetIcon("icons/info.png")); |
---|
| 1822 | + tabbedPane.setToolTipTextAt(4, "Information"); |
---|
| 1823 | + } |
---|
1615 | 1824 | |
---|
1616 | 1825 | /* |
---|
1617 | 1826 | cTree jTree = new cTree(null); |
---|
.. | .. |
---|
1633 | 1842 | jtp.add(tree); |
---|
1634 | 1843 | */ |
---|
1635 | 1844 | |
---|
1636 | | - bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, scenePanel, gridPanel); |
---|
1637 | | - bigPanel.setContinuousLayout(true); |
---|
1638 | | - bigPanel.setOneTouchExpandable(true); |
---|
1639 | | - bigPanel.setDividerLocation(0.8); |
---|
1640 | | - bigPanel.setDividerSize(15); |
---|
1641 | | - bigPanel.setResizeWeight(0.15); |
---|
1642 | | - bigPanel.setName("Scene"); |
---|
| 1845 | +// bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, scenePanel, gridPanel); |
---|
| 1846 | +// bigPanel.setContinuousLayout(true); |
---|
| 1847 | +// bigPanel.setOneTouchExpandable(true); |
---|
| 1848 | +// bigPanel.setDividerLocation(0.8); |
---|
| 1849 | +// bigPanel.setDividerSize(15); |
---|
| 1850 | +// bigPanel.setResizeWeight(0.15); |
---|
| 1851 | +// bigPanel.setName("Scene"); |
---|
1643 | 1852 | |
---|
1644 | 1853 | //bigPanel.setLayout(new BorderLayout()); |
---|
1645 | 1854 | //bigPanel.setSize(new Dimension(10,10)); |
---|
.. | .. |
---|
1683 | 1892 | // aConstraints.gridheight = 1; |
---|
1684 | 1893 | |
---|
1685 | 1894 | framePanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, toolbarPanel, bigThree); |
---|
| 1895 | + |
---|
| 1896 | + framePanel.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY, |
---|
| 1897 | + new java.beans.PropertyChangeListener() |
---|
| 1898 | + { |
---|
| 1899 | + public void propertyChange(java.beans.PropertyChangeEvent pce) |
---|
| 1900 | + { |
---|
| 1901 | + if ((Integer)pce.getOldValue() == 1) |
---|
| 1902 | + { |
---|
| 1903 | + if (radio.layout != expandedLayout) |
---|
| 1904 | + { |
---|
| 1905 | + radio.layout = expandedLayout; |
---|
| 1906 | + radio.layout.doClick(); |
---|
| 1907 | + } |
---|
| 1908 | + } |
---|
| 1909 | + } |
---|
| 1910 | + }); |
---|
| 1911 | + |
---|
1686 | 1912 | framePanel.setContinuousLayout(false); |
---|
1687 | 1913 | framePanel.setOneTouchExpandable(false); |
---|
1688 | 1914 | //.setDividerLocation(0.8); |
---|
.. | .. |
---|
1692 | 1918 | |
---|
1693 | 1919 | frame.getContentPane().setLayout(new BorderLayout()); |
---|
1694 | 1920 | /**/ |
---|
1695 | | - JTabbedPane worldPane = new JTabbedPane(); |
---|
| 1921 | + //JTabbedPane worldPane = new JTabbedPane(); |
---|
1696 | 1922 | //worldPane.add(bigPanel); |
---|
1697 | 1923 | //worldPane.add(worldPanel); |
---|
1698 | 1924 | /**/ |
---|
.. | .. |
---|
1706 | 1932 | |
---|
1707 | 1933 | cameraView.requestFocusInWindow(); |
---|
1708 | 1934 | |
---|
1709 | | - gridPanel.setDividerLocation(1.0); |
---|
| 1935 | +// gridPanel.setDividerLocation(1.0); |
---|
1710 | 1936 | |
---|
1711 | 1937 | frame.validate(); |
---|
1712 | 1938 | |
---|
.. | .. |
---|
1741 | 1967 | { |
---|
1742 | 1968 | cGridBag presetpanel = new cGridBag().setVertical(true); |
---|
1743 | 1969 | |
---|
1744 | | - cLabel skin = GetLabel("icons/shadericons/shadericon00000.png", !Grafreed.NIMBUSLAF); |
---|
| 1970 | + cLabel skin = GetLabel("icons/shadericons/shadericon00000.png", !Globals.NIMBUSLAF); |
---|
1745 | 1971 | skin.setToolTipText("Skin"); |
---|
1746 | 1972 | skin.addMouseListener(new MouseAdapter() |
---|
1747 | 1973 | { |
---|
.. | .. |
---|
1752 | 1978 | |
---|
1753 | 1979 | // Skin |
---|
1754 | 1980 | colorField.setFloat(material.color); |
---|
1755 | | - saturationField.setFloat(material.modulation); |
---|
| 1981 | + float saturation = material.modulation; |
---|
| 1982 | + |
---|
| 1983 | + if (!cameraView.Skinshader) |
---|
| 1984 | + { |
---|
| 1985 | + saturation /= 1.5; |
---|
| 1986 | + } |
---|
| 1987 | + |
---|
| 1988 | + saturationField.setFloat(saturation); |
---|
| 1989 | + |
---|
1756 | 1990 | subsurfaceField.setFloat(material.subsurface); |
---|
1757 | 1991 | selfshadowField.setFloat(material.diffuseness); |
---|
1758 | 1992 | diffusenessField.setFloat(material.factor); |
---|
.. | .. |
---|
1771 | 2005 | }); |
---|
1772 | 2006 | presetpanel.add(skin); |
---|
1773 | 2007 | |
---|
1774 | | - cLabel lambert = GetLabel("icons/shadericons/shadericon00002.png", !Grafreed.NIMBUSLAF); |
---|
| 2008 | + cLabel lambert = GetLabel("icons/shadericons/shadericon00002.png", !Globals.NIMBUSLAF); |
---|
1775 | 2009 | lambert.setToolTipText("Diffuse"); |
---|
1776 | 2010 | lambert.addMouseListener(new MouseAdapter() |
---|
1777 | 2011 | { |
---|
.. | .. |
---|
1789 | 2023 | }); |
---|
1790 | 2024 | presetpanel.add(lambert); |
---|
1791 | 2025 | |
---|
1792 | | - cLabel diffuse2 = GetLabel("icons/shadericons/shadericon00003.png", !Grafreed.NIMBUSLAF); |
---|
| 2026 | + cLabel diffuse2 = GetLabel("icons/shadericons/shadericon00003.png", !Globals.NIMBUSLAF); |
---|
1793 | 2027 | diffuse2.setToolTipText("Diffuse2"); |
---|
1794 | 2028 | diffuse2.addMouseListener(new MouseAdapter() |
---|
1795 | 2029 | { |
---|
.. | .. |
---|
1807 | 2041 | }); |
---|
1808 | 2042 | presetpanel.add(diffuse2); |
---|
1809 | 2043 | |
---|
1810 | | - cLabel diffusemoon = GetLabel("icons/shadericons/shadericon00004.png", !Grafreed.NIMBUSLAF); |
---|
| 2044 | + cLabel diffusemoon = GetLabel("icons/shadericons/shadericon00004.png", !Globals.NIMBUSLAF); |
---|
1811 | 2045 | diffusemoon.setToolTipText("Moon"); |
---|
1812 | 2046 | diffusemoon.addMouseListener(new MouseAdapter() |
---|
1813 | 2047 | { |
---|
.. | .. |
---|
1825 | 2059 | }); |
---|
1826 | 2060 | presetpanel.add(diffusemoon); |
---|
1827 | 2061 | |
---|
1828 | | - cLabel diffusemoon2 = GetLabel("icons/shadericons/shadericon00005.png", !Grafreed.NIMBUSLAF); |
---|
| 2062 | + cLabel diffusemoon2 = GetLabel("icons/shadericons/shadericon00005.png", !Globals.NIMBUSLAF); |
---|
1829 | 2063 | diffusemoon2.setToolTipText("Moon2"); |
---|
1830 | 2064 | diffusemoon2.addMouseListener(new MouseAdapter() |
---|
1831 | 2065 | { |
---|
.. | .. |
---|
1843 | 2077 | }); |
---|
1844 | 2078 | presetpanel.add(diffusemoon2); |
---|
1845 | 2079 | |
---|
1846 | | - cLabel diffusemoon3 = GetLabel("icons/shadericons/shadericon00006.png", !Grafreed.NIMBUSLAF); |
---|
| 2080 | + cLabel diffusemoon3 = GetLabel("icons/shadericons/shadericon00006.png", !Globals.NIMBUSLAF); |
---|
1847 | 2081 | diffusemoon3.setToolTipText("Moon3"); |
---|
1848 | 2082 | diffusemoon3.addMouseListener(new MouseAdapter() |
---|
1849 | 2083 | { |
---|
.. | .. |
---|
1861 | 2095 | }); |
---|
1862 | 2096 | presetpanel.add(diffusemoon3); |
---|
1863 | 2097 | |
---|
1864 | | - cLabel diffusesheen = GetLabel("icons/shadericons/shadericon00007.png", !Grafreed.NIMBUSLAF); |
---|
| 2098 | + cLabel diffusesheen = GetLabel("icons/shadericons/shadericon00007.png", !Globals.NIMBUSLAF); |
---|
1865 | 2099 | diffusesheen.setToolTipText("Sheen"); |
---|
1866 | 2100 | diffusesheen.addMouseListener(new MouseAdapter() |
---|
1867 | 2101 | { |
---|
.. | .. |
---|
1878 | 2112 | }); |
---|
1879 | 2113 | presetpanel.add(diffusesheen); |
---|
1880 | 2114 | |
---|
1881 | | - cLabel rough = GetLabel("icons/shadericons/shadericon00001.png", !Grafreed.NIMBUSLAF); |
---|
| 2115 | + cLabel rough = GetLabel("icons/shadericons/shadericon00001.png", !Globals.NIMBUSLAF); |
---|
1882 | 2116 | rough.setToolTipText("Rough metal"); |
---|
1883 | 2117 | rough.addMouseListener(new MouseAdapter() |
---|
1884 | 2118 | { |
---|
.. | .. |
---|
1896 | 2130 | }); |
---|
1897 | 2131 | presetpanel.add(rough); |
---|
1898 | 2132 | |
---|
1899 | | - cLabel rough2 = GetLabel("icons/shadericons/shadericon00013.png", !Grafreed.NIMBUSLAF); |
---|
| 2133 | + cLabel rough2 = GetLabel("icons/shadericons/shadericon00013.png", !Globals.NIMBUSLAF); |
---|
1900 | 2134 | rough2.setToolTipText("Medium metal"); |
---|
1901 | 2135 | rough2.addMouseListener(new MouseAdapter() |
---|
1902 | 2136 | { |
---|
.. | .. |
---|
1914 | 2148 | }); |
---|
1915 | 2149 | presetpanel.add(rough2); |
---|
1916 | 2150 | |
---|
1917 | | - cLabel shini0 = GetLabel("icons/shadericons/shadericon00014.png", !Grafreed.NIMBUSLAF); |
---|
| 2151 | + cLabel shini0 = GetLabel("icons/shadericons/shadericon00014.png", !Globals.NIMBUSLAF); |
---|
1918 | 2152 | shini0.setToolTipText("Shiny"); |
---|
1919 | 2153 | shini0.addMouseListener(new MouseAdapter() |
---|
1920 | 2154 | { |
---|
.. | .. |
---|
1932 | 2166 | }); |
---|
1933 | 2167 | presetpanel.add(shini0); |
---|
1934 | 2168 | |
---|
1935 | | - cLabel shini1 = GetLabel("icons/shadericons/shadericon00011.png", !Grafreed.NIMBUSLAF); |
---|
| 2169 | + cLabel shini1 = GetLabel("icons/shadericons/shadericon00011.png", !Globals.NIMBUSLAF); |
---|
1936 | 2170 | shini1.setToolTipText("Shiny2"); |
---|
1937 | 2171 | shini1.addMouseListener(new MouseAdapter() |
---|
1938 | 2172 | { |
---|
.. | .. |
---|
1950 | 2184 | }); |
---|
1951 | 2185 | presetpanel.add(shini1); |
---|
1952 | 2186 | |
---|
1953 | | - cLabel shini2 = GetLabel("icons/shadericons/shadericon00012.png", !Grafreed.NIMBUSLAF); |
---|
| 2187 | + cLabel shini2 = GetLabel("icons/shadericons/shadericon00012.png", !Globals.NIMBUSLAF); |
---|
1954 | 2188 | shini2.setToolTipText("Shiny3"); |
---|
1955 | 2189 | shini2.addMouseListener(new MouseAdapter() |
---|
1956 | 2190 | { |
---|
.. | .. |
---|
1968 | 2202 | }); |
---|
1969 | 2203 | presetpanel.add(shini2); |
---|
1970 | 2204 | |
---|
1971 | | - cLabel aniso = GetLabel("icons/shadericons/shadericon00008.png", !Grafreed.NIMBUSLAF); |
---|
| 2205 | + cLabel aniso = GetLabel("icons/shadericons/shadericon00008.png", !Globals.NIMBUSLAF); |
---|
1972 | 2206 | aniso.setToolTipText("AnisoU"); |
---|
1973 | 2207 | aniso.addMouseListener(new MouseAdapter() |
---|
1974 | 2208 | { |
---|
.. | .. |
---|
1986 | 2220 | }); |
---|
1987 | 2221 | presetpanel.add(aniso); |
---|
1988 | 2222 | |
---|
1989 | | - cLabel aniso2 = GetLabel("icons/shadericons/shadericon00009.png", !Grafreed.NIMBUSLAF); |
---|
| 2223 | + cLabel aniso2 = GetLabel("icons/shadericons/shadericon00009.png", !Globals.NIMBUSLAF); |
---|
1990 | 2224 | aniso2.setToolTipText("AnisoV"); |
---|
1991 | 2225 | aniso2.addMouseListener(new MouseAdapter() |
---|
1992 | 2226 | { |
---|
.. | .. |
---|
2004 | 2238 | }); |
---|
2005 | 2239 | presetpanel.add(aniso2); |
---|
2006 | 2240 | |
---|
2007 | | - cLabel aniso3 = GetLabel("icons/shadericons/shadericon00010.png", !Grafreed.NIMBUSLAF); |
---|
| 2241 | + cLabel aniso3 = GetLabel("icons/shadericons/shadericon00010.png", !Globals.NIMBUSLAF); |
---|
2008 | 2242 | aniso3.setToolTipText("AnisoUV"); |
---|
2009 | 2243 | aniso3.addMouseListener(new MouseAdapter() |
---|
2010 | 2244 | { |
---|
.. | .. |
---|
2022 | 2256 | }); |
---|
2023 | 2257 | presetpanel.add(aniso3); |
---|
2024 | 2258 | |
---|
2025 | | - cLabel velvet0 = GetLabel("icons/shadericons/shadericon00015.png", !Grafreed.NIMBUSLAF); |
---|
| 2259 | + cLabel velvet0 = GetLabel("icons/shadericons/shadericon00015.png", !Globals.NIMBUSLAF); |
---|
2026 | 2260 | velvet0.setToolTipText("Velvet"); |
---|
2027 | 2261 | velvet0.addMouseListener(new MouseAdapter() |
---|
2028 | 2262 | { |
---|
.. | .. |
---|
2044 | 2278 | }); |
---|
2045 | 2279 | presetpanel.add(velvet0); |
---|
2046 | 2280 | |
---|
2047 | | - cLabel bump0 = GetLabel("icons/shadericons/shadericon00016.png", !Grafreed.NIMBUSLAF); |
---|
| 2281 | + cLabel bump0 = GetLabel("icons/shadericons/shadericon00016.png", !Globals.NIMBUSLAF); |
---|
2048 | 2282 | bump0.setToolTipText("Bump texture"); |
---|
2049 | 2283 | bump0.addMouseListener(new MouseAdapter() |
---|
2050 | 2284 | { |
---|
.. | .. |
---|
2063 | 2297 | }); |
---|
2064 | 2298 | presetpanel.add(bump0); |
---|
2065 | 2299 | |
---|
2066 | | - cLabel halo = GetLabel("icons/shadericons/shadericon00017.png", !Grafreed.NIMBUSLAF); |
---|
| 2300 | + cLabel borderShader = GetLabel("icons/shadericons/borderfade.jpg", !Globals.NIMBUSLAF); |
---|
| 2301 | + borderShader.setToolTipText("Border fade"); |
---|
| 2302 | + borderShader.addMouseListener(new MouseAdapter() |
---|
| 2303 | + { |
---|
| 2304 | + public void mouseClicked(MouseEvent e) |
---|
| 2305 | + { |
---|
| 2306 | + borderfadeField.setFloat(0.5); |
---|
| 2307 | + opacityField.setFloat(0.75); |
---|
| 2308 | + |
---|
| 2309 | + materialtouched = true; |
---|
| 2310 | + applySelf(); |
---|
| 2311 | + } |
---|
| 2312 | + }); |
---|
| 2313 | + presetpanel.add(borderShader); |
---|
| 2314 | + |
---|
| 2315 | + cLabel halo = GetLabel("icons/shadericons/shadericon00017.png", !Globals.NIMBUSLAF); |
---|
2067 | 2316 | halo.setToolTipText("Halo"); |
---|
2068 | 2317 | halo.addMouseListener(new MouseAdapter() |
---|
2069 | 2318 | { |
---|
.. | .. |
---|
2080 | 2329 | }); |
---|
2081 | 2330 | presetpanel.add(halo); |
---|
2082 | 2331 | |
---|
2083 | | - cLabel candle = GetLabel("icons/shadericons/shadericon00018.png", !Grafreed.NIMBUSLAF); |
---|
| 2332 | + cLabel candle = GetLabel("icons/shadericons/shadericon00018.png", !Globals.NIMBUSLAF); |
---|
2084 | 2333 | candle.setToolTipText("Candle"); |
---|
2085 | 2334 | candle.addMouseListener(new MouseAdapter() |
---|
2086 | 2335 | { |
---|
.. | .. |
---|
2102 | 2351 | }); |
---|
2103 | 2352 | presetpanel.add(candle); |
---|
2104 | 2353 | |
---|
| 2354 | + cLabel shadowShader = GetLabel("icons/shadericons/shadow.png", !Globals.NIMBUSLAF); |
---|
| 2355 | + shadowShader.setToolTipText("Shadow"); |
---|
| 2356 | + shadowShader.addMouseListener(new MouseAdapter() |
---|
| 2357 | + { |
---|
| 2358 | + public void mouseClicked(MouseEvent e) |
---|
| 2359 | + { |
---|
| 2360 | + diffuseField.setFloat(0.001); |
---|
| 2361 | + ambientField.setFloat(0.001); |
---|
| 2362 | + cameraField.setFloat(0.001); |
---|
| 2363 | + specularField.setFloat(0.001); |
---|
| 2364 | + fakedepthField.setFloat(0.001); |
---|
| 2365 | + opacityField.setFloat(0.6); |
---|
| 2366 | + |
---|
| 2367 | + materialtouched = true; |
---|
| 2368 | + applySelf(); |
---|
| 2369 | + } |
---|
| 2370 | + }); |
---|
| 2371 | + presetpanel.add(shadowShader); |
---|
| 2372 | + |
---|
2105 | 2373 | cGridBag panel = new cGridBag().setVertical(true); |
---|
2106 | 2374 | |
---|
2107 | 2375 | presetpanel.preferredWidth = 1; |
---|
.. | .. |
---|
2118 | 2386 | |
---|
2119 | 2387 | cGridBag editBar = new cGridBag().setVertical(false); |
---|
2120 | 2388 | |
---|
2121 | | - editBar.add(createMaterialButton = new cButton("Create", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 2389 | + editBar.add(createMaterialButton = new cButton("Create", !Globals.NIMBUSLAF)); // , aConstraints); |
---|
2122 | 2390 | createMaterialButton.setToolTipText("Create material"); |
---|
2123 | 2391 | |
---|
2124 | 2392 | /* |
---|
2125 | 2393 | ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints); |
---|
2126 | 2394 | */ |
---|
2127 | 2395 | |
---|
2128 | | - editBar.add(clearMaterialButton = new cButton("Clear", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 2396 | + editBar.add(clearMaterialButton = new cButton("Clear", !Globals.NIMBUSLAF)); // , aConstraints); |
---|
2129 | 2397 | clearMaterialButton.setToolTipText("Clear material"); |
---|
2130 | 2398 | |
---|
2131 | 2399 | if (Globals.ADVANCED) |
---|
2132 | 2400 | { |
---|
2133 | | - editBar.add(resetSlidersButton = new cButton("Reset", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 2401 | + editBar.add(resetSlidersButton = new cButton("Reset", !Globals.NIMBUSLAF)); // , aConstraints); |
---|
2134 | 2402 | editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints); |
---|
2135 | 2403 | editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints); |
---|
2136 | 2404 | } |
---|
.. | .. |
---|
2151 | 2419 | |
---|
2152 | 2420 | cGridBag huepanel = new cGridBag(); |
---|
2153 | 2421 | cGridBag huelabel = new cGridBag(); |
---|
2154 | | - skin = GetLabel("icons/hue.png", false); |
---|
2155 | | - skin.fit = true; |
---|
2156 | | - huelabel.add(skin); |
---|
| 2422 | + cLabel hue = GetLabel("icons/hue.png", false); |
---|
| 2423 | + hue.fit = true; |
---|
| 2424 | + |
---|
| 2425 | + hue.addMouseListener(new MouseAdapter() |
---|
| 2426 | + { |
---|
| 2427 | + public void mousePressed(MouseEvent e) |
---|
| 2428 | + { |
---|
| 2429 | + int x = e.getX(); |
---|
| 2430 | + |
---|
| 2431 | + colorField.setFloat((double)x / ((cLabel)e.getSource()).getWidth()); |
---|
| 2432 | + } |
---|
| 2433 | + }); |
---|
| 2434 | + |
---|
| 2435 | + huelabel.add(hue); |
---|
2157 | 2436 | huelabel.preferredWidth = 20; |
---|
2158 | 2437 | huepanel.add(new cGridBag()); // Label |
---|
2159 | 2438 | huepanel.add(huelabel); // Field/slider |
---|
.. | .. |
---|
3429 | 3708 | |
---|
3430 | 3709 | if (multiplyToggle != null) |
---|
3431 | 3710 | multiplyToggle.setSelected(mat.multiply); |
---|
3432 | | - |
---|
3433 | | - assert (object.projectedVertices != null); |
---|
3434 | | - |
---|
3435 | | - if (object.projectedVertices.length <= 2) |
---|
3436 | | - { |
---|
3437 | | - // Side effect... |
---|
3438 | | - Object3D.cVector2[] keep = object.projectedVertices; |
---|
3439 | | - object.projectedVertices = new Object3D.cVector2[3]; |
---|
3440 | | - for (int i = 0; i < 3; i++) |
---|
3441 | | - { |
---|
3442 | | - if (i < keep.length) |
---|
3443 | | - { |
---|
3444 | | - object.projectedVertices[i] = keep[i]; |
---|
3445 | | - } else |
---|
3446 | | - { |
---|
3447 | | - object.projectedVertices[i] = new Object3D.cVector2(); |
---|
3448 | | - } |
---|
3449 | | - /* |
---|
3450 | | - if(keep.length == 0) |
---|
3451 | | - object.projectedVertices[0] = new Object3D.cVector2(); |
---|
3452 | | - else |
---|
3453 | | - object.projectedVertices[0] = keep[0]; |
---|
3454 | | - object.projectedVertices[1] = new Object3D.cVector2(); |
---|
3455 | | - */ |
---|
3456 | | - } |
---|
3457 | | - } |
---|
| 3711 | + |
---|
| 3712 | + AllocProjectedVertices(object); |
---|
3458 | 3713 | |
---|
3459 | 3714 | SetMaterial(mat, object.projectedVertices); |
---|
3460 | 3715 | } |
---|
.. | .. |
---|
3574 | 3829 | public void itemStateChanged(ItemEvent event) |
---|
3575 | 3830 | { |
---|
3576 | 3831 | // System.out.println("Propagate = " + propagate); |
---|
| 3832 | + if (event.getSource() == pinButton) |
---|
| 3833 | + { |
---|
| 3834 | + copy.pinned ^= true; |
---|
| 3835 | + if (!copy.pinned && !copy.editWindow.copy.selection.contains(copy)) |
---|
| 3836 | + { |
---|
| 3837 | + ((GroupEditor)copy.editWindow).listUI.remove(copy); |
---|
| 3838 | + copy.CloseUI(); |
---|
| 3839 | + //copy.editWindow.refreshContents(); |
---|
| 3840 | + } |
---|
| 3841 | + } |
---|
| 3842 | + else |
---|
3577 | 3843 | if (event.getSource() == propagateToggle) |
---|
3578 | 3844 | { |
---|
3579 | 3845 | propagate ^= true; |
---|
.. | .. |
---|
3753 | 4019 | //System.out.println("ObjEditor " + event); |
---|
3754 | 4020 | applySelf0(true); |
---|
3755 | 4021 | //parent.applySelf(); |
---|
3756 | | - objEditor.refreshContents(); |
---|
| 4022 | + // conflicts with requestFocus objEditor.refreshContents(); |
---|
3757 | 4023 | } else if (source == resetButton) |
---|
3758 | 4024 | { |
---|
3759 | 4025 | CameraPane.fullreset = true; |
---|
.. | .. |
---|
3933 | 4199 | |
---|
3934 | 4200 | void New() |
---|
3935 | 4201 | { |
---|
3936 | | - while (copy.Size() > 1) |
---|
| 4202 | + while (copy.Size() > 0) |
---|
3937 | 4203 | { |
---|
3938 | | - copy.remove(1); |
---|
| 4204 | + copy.remove(0); |
---|
3939 | 4205 | } |
---|
3940 | 4206 | |
---|
| 4207 | + copy.selection.clear(); |
---|
| 4208 | + |
---|
3941 | 4209 | ResetModel(); |
---|
| 4210 | + SetupViews(); |
---|
3942 | 4211 | objEditor.refreshContents(); |
---|
3943 | 4212 | } |
---|
3944 | 4213 | |
---|
.. | .. |
---|
4046 | 4315 | { |
---|
4047 | 4316 | //Save(true); |
---|
4048 | 4317 | Replace(); |
---|
4049 | | - SetUndoStates(); |
---|
| 4318 | + SetVersionStates(); |
---|
4050 | 4319 | } |
---|
4051 | 4320 | |
---|
4052 | 4321 | private boolean Equal(byte[] compress, byte[] name) |
---|
.. | .. |
---|
4065 | 4334 | return true; |
---|
4066 | 4335 | } |
---|
4067 | 4336 | |
---|
4068 | | - java.util.Hashtable<java.util.UUID, Object3D> versiontable = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
4069 | | - |
---|
4070 | 4337 | void DeleteVersion() |
---|
4071 | 4338 | { |
---|
4072 | 4339 | for (int i = copy.versionindex; i < copy.versionlist.length-1; i++) |
---|
.. | .. |
---|
4074 | 4341 | copy.versionlist[i] = copy.versionlist[i+1]; |
---|
4075 | 4342 | } |
---|
4076 | 4343 | |
---|
4077 | | - CopyChanged(); |
---|
| 4344 | + if (copy.versionlist[copy.versionindex] == null) |
---|
| 4345 | + copy.versionindex -= 1; |
---|
4078 | 4346 | |
---|
4079 | | - SetUndoStates(); |
---|
| 4347 | + if (copy.versionindex != -1) |
---|
| 4348 | + CopyChanged(); |
---|
| 4349 | + |
---|
| 4350 | + SetVersionStates(); |
---|
4080 | 4351 | } |
---|
4081 | 4352 | |
---|
4082 | 4353 | public boolean Save(boolean user) |
---|
4083 | 4354 | { |
---|
4084 | 4355 | System.err.println("Save"); |
---|
4085 | | - //Replace(); |
---|
| 4356 | + Replace(); |
---|
4086 | 4357 | |
---|
4087 | | - cRadio tab = GetCurrentTab(); |
---|
| 4358 | + //cRadio tab = GetCurrentTab(); |
---|
4088 | 4359 | |
---|
4089 | | - Object3D compress = CompressCopy(); // Saved version. No need for "Replace"? |
---|
| 4360 | + Object3D compress = Duplicate(copy); // Saved version. No need for "Replace"? |
---|
4090 | 4361 | |
---|
4091 | 4362 | boolean thesame = false; |
---|
4092 | 4363 | |
---|
.. | .. |
---|
4122 | 4393 | // copy.versionlist[i] = null; |
---|
4123 | 4394 | // } |
---|
4124 | 4395 | |
---|
4125 | | - SetUndoStates(); |
---|
| 4396 | + SetVersionStates(); |
---|
4126 | 4397 | |
---|
4127 | 4398 | // test save |
---|
4128 | 4399 | if (false) |
---|
.. | .. |
---|
4180 | 4451 | |
---|
4181 | 4452 | void CopyChanged() |
---|
4182 | 4453 | { |
---|
4183 | | - Object3D obj = copy.versionlist[copy.versionindex]; |
---|
| 4454 | + Object3D obj = (Object3D)Grafreed.clone(copy.versionlist[copy.versionindex]); |
---|
4184 | 4455 | |
---|
4185 | | - SetUndoStates(); |
---|
| 4456 | + SetVersionStates(); |
---|
4186 | 4457 | |
---|
4187 | 4458 | boolean temp = CameraPane.SWITCH; |
---|
4188 | 4459 | CameraPane.SWITCH = false; |
---|
4189 | 4460 | |
---|
4190 | | - copy.ExtractBigData(versiontable); |
---|
| 4461 | + copy.ExtractBigData(Grafreed.grafreed.universe.versiontable); |
---|
4191 | 4462 | |
---|
4192 | 4463 | copy.clear(); |
---|
4193 | 4464 | |
---|
.. | .. |
---|
4199 | 4470 | copy.add(obj.get(i)); |
---|
4200 | 4471 | } |
---|
4201 | 4472 | |
---|
4202 | | - copy.RestoreBigData(versiontable); |
---|
| 4473 | + copy.RestoreBigData(Grafreed.grafreed.universe.versiontable); |
---|
4203 | 4474 | |
---|
4204 | 4475 | CameraPane.SWITCH = temp; |
---|
4205 | 4476 | |
---|
.. | .. |
---|
4249 | 4520 | return count; |
---|
4250 | 4521 | } |
---|
4251 | 4522 | |
---|
4252 | | - void SetUndoStates() |
---|
| 4523 | + public cGridBag versionSliderPane; |
---|
| 4524 | + |
---|
| 4525 | + void SetVersionStates() |
---|
4253 | 4526 | { |
---|
4254 | | - cRadio tab = GetCurrentTab(); |
---|
| 4527 | + //if (true) |
---|
| 4528 | + // return; |
---|
| 4529 | + |
---|
| 4530 | + //cRadio tab = GetCurrentTab(); |
---|
4255 | 4531 | |
---|
4256 | | - restoreButton.setEnabled(true); // copy.versionindex != -1); |
---|
4257 | | - replaceButton.setEnabled(true); // copy.versionindex != -1); |
---|
4258 | | - |
---|
4259 | | - previousVersionButton.setEnabled(copy.versionindex > 0); |
---|
4260 | | - nextVersionButton.setEnabled(copy.versionlist[copy.versionindex + 1] != null); |
---|
4261 | | - |
---|
4262 | | - deleteVersionButton.setEnabled(//copy.versionindex > 0 && |
---|
4263 | | - copy.versionlist[copy.versionindex + 1] != null); |
---|
4264 | | - |
---|
4265 | | - muteSlider = true; |
---|
4266 | | - versionSlider.setMaximum(VersionCount() - 1); |
---|
4267 | | - versionSlider.setInteger(copy.versionindex); |
---|
4268 | | - muteSlider = false; |
---|
| 4532 | + if (copy.versionlist == null) |
---|
| 4533 | + { |
---|
| 4534 | + saveVersionButton.setEnabled(false); |
---|
| 4535 | + restoreButton.setEnabled(false); |
---|
| 4536 | + replaceButton.setEnabled(false); |
---|
| 4537 | + previousVersionButton.setEnabled(false); |
---|
| 4538 | + nextVersionButton.setEnabled(false); |
---|
| 4539 | + deleteVersionButton.setEnabled(false); |
---|
| 4540 | + versionSliderPane.setVisible(false); |
---|
| 4541 | + } |
---|
| 4542 | + else |
---|
| 4543 | + { |
---|
| 4544 | + restoreButton.setEnabled(copy.versionindex != -1); |
---|
| 4545 | + replaceButton.setEnabled(copy.versionindex != -1); |
---|
| 4546 | + |
---|
| 4547 | + previousVersionButton.setEnabled(copy.versionindex > 0); |
---|
| 4548 | + nextVersionButton.setEnabled(copy.versionlist[copy.versionindex + 1] != null); |
---|
| 4549 | + |
---|
| 4550 | + deleteVersionButton.setEnabled(copy.versionindex != -1); |
---|
| 4551 | + //copy.versionlist[copy.versionindex + 1] != null); |
---|
| 4552 | + |
---|
| 4553 | + muteSlider = true; |
---|
| 4554 | + versionSlider.setMinimum(0); |
---|
| 4555 | + versionSlider.setMaximum(VersionCount() - 1); |
---|
| 4556 | + versionSlider.setInteger(copy.versionindex); |
---|
| 4557 | + versionSlider.setEnabled(copy.versionindex != -1); |
---|
| 4558 | + muteSlider = false; |
---|
| 4559 | + |
---|
| 4560 | + versionSliderPane.setVisible(true); |
---|
| 4561 | + } |
---|
4269 | 4562 | } |
---|
4270 | 4563 | |
---|
4271 | 4564 | public boolean PreviousVersion() |
---|
.. | .. |
---|
4275 | 4568 | |
---|
4276 | 4569 | System.err.println("Undo"); |
---|
4277 | 4570 | |
---|
4278 | | - cRadio tab = GetCurrentTab(); |
---|
| 4571 | + //cRadio tab = GetCurrentTab(); |
---|
4279 | 4572 | |
---|
4280 | 4573 | if (copy.versionindex == 0) |
---|
4281 | 4574 | { |
---|
.. | .. |
---|
4307 | 4600 | { |
---|
4308 | 4601 | System.err.println("Restore"); |
---|
4309 | 4602 | |
---|
4310 | | - cRadio tab = GetCurrentTab(); |
---|
| 4603 | + //cRadio tab = GetCurrentTab(); |
---|
4311 | 4604 | |
---|
4312 | 4605 | if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
4313 | 4606 | { |
---|
.. | .. |
---|
4323 | 4616 | |
---|
4324 | 4617 | public boolean Replace() |
---|
4325 | 4618 | { |
---|
4326 | | - System.err.println("Replace"); |
---|
| 4619 | + //System.err.println("Replace"); |
---|
4327 | 4620 | |
---|
4328 | | - cRadio tab = GetCurrentTab(); |
---|
| 4621 | + //cRadio tab = GetCurrentTab(); |
---|
4329 | 4622 | |
---|
4330 | 4623 | if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
4331 | 4624 | { |
---|
.. | .. |
---|
4333 | 4626 | return false; |
---|
4334 | 4627 | } |
---|
4335 | 4628 | |
---|
4336 | | - copy.versionlist[copy.versionindex] = CompressCopy(); |
---|
| 4629 | + copy.versionlist[copy.versionindex] = Duplicate(copy); |
---|
4337 | 4630 | |
---|
4338 | 4631 | return true; |
---|
4339 | 4632 | } |
---|
.. | .. |
---|
4343 | 4636 | // Option? |
---|
4344 | 4637 | Replace(); |
---|
4345 | 4638 | |
---|
4346 | | - cRadio tab = GetCurrentTab(); |
---|
| 4639 | + //cRadio tab = GetCurrentTab(); |
---|
4347 | 4640 | |
---|
4348 | 4641 | if (copy.versionlist[copy.versionindex + 1] == null) |
---|
4349 | 4642 | { |
---|
.. | .. |
---|
4550 | 4843 | // else |
---|
4551 | 4844 | // applySelf(true); |
---|
4552 | 4845 | // } |
---|
| 4846 | + |
---|
| 4847 | + boolean Equal(double a, double b) |
---|
| 4848 | + { |
---|
| 4849 | + return Math.abs(a - b) < 0.001; |
---|
| 4850 | + } |
---|
| 4851 | + |
---|
4553 | 4852 | void applySelf0(boolean name) |
---|
4554 | 4853 | { |
---|
4555 | 4854 | if (name) |
---|
.. | .. |
---|
4599 | 4898 | { |
---|
4600 | 4899 | cMaterial mat = copy.material; |
---|
4601 | 4900 | |
---|
4602 | | - colorField.SetToolTipValue((mat.color)); |
---|
4603 | | - saturationField.SetToolTipValue((mat.modulation)); |
---|
4604 | | - metalnessField.SetToolTipValue((mat.metalness)); |
---|
4605 | | - diffuseField.SetToolTipValue((mat.diffuse)); |
---|
4606 | | - specularField.SetToolTipValue((mat.specular)); |
---|
4607 | | - shininessField.SetToolTipValue((mat.shininess)); |
---|
4608 | | - shiftField.SetToolTipValue((mat.shift)); |
---|
4609 | | - ambientField.SetToolTipValue((mat.ambient)); |
---|
4610 | | - lightareaField.SetToolTipValue((mat.lightarea)); |
---|
4611 | | - diffusenessField.SetToolTipValue((mat.factor)); |
---|
4612 | | - velvetField.SetToolTipValue((mat.velvet)); |
---|
4613 | | - sheenField.SetToolTipValue((mat.sheen)); |
---|
4614 | | - subsurfaceField.SetToolTipValue((mat.subsurface)); |
---|
4615 | | - backlitField.SetToolTipValue((mat.bump)); |
---|
4616 | | - anisoField.SetToolTipValue((mat.aniso)); |
---|
4617 | | - anisoVField.SetToolTipValue((mat.anisoV)); |
---|
4618 | | - cameraField.SetToolTipValue((mat.cameralight)); |
---|
4619 | | - selfshadowField.SetToolTipValue((mat.diffuseness)); |
---|
4620 | | - shadowField.SetToolTipValue((mat.shadow)); |
---|
4621 | | - textureField.SetToolTipValue((mat.texture)); |
---|
4622 | | - opacityField.SetToolTipValue((mat.opacity)); |
---|
4623 | | - fakedepthField.SetToolTipValue((mat.fakedepth)); |
---|
4624 | | - shadowbiasField.SetToolTipValue((mat.shadowbias)); |
---|
| 4901 | + if (!Equal(colorField.getFloat(), mat.color)) |
---|
| 4902 | + colorField.SetToolTipValue((mat.color)); |
---|
| 4903 | + if (!Equal(saturationField.getFloat(), mat.modulation)) |
---|
| 4904 | + saturationField.SetToolTipValue((mat.modulation)); |
---|
| 4905 | + if (!Equal(metalnessField.getFloat(), mat.metalness)) |
---|
| 4906 | + metalnessField.SetToolTipValue((mat.metalness)); |
---|
| 4907 | + if (!Equal(diffuseField.getFloat(), mat.diffuse)) |
---|
| 4908 | + diffuseField.SetToolTipValue((mat.diffuse)); |
---|
| 4909 | + if (!Equal(specularField.getFloat(), mat.specular)) |
---|
| 4910 | + specularField.SetToolTipValue((mat.specular)); |
---|
| 4911 | + if (!Equal(shininessField.getFloat(), mat.shininess)) |
---|
| 4912 | + shininessField.SetToolTipValue((mat.shininess)); |
---|
| 4913 | + if (!Equal(shiftField.getFloat(), mat.shift)) |
---|
| 4914 | + shiftField.SetToolTipValue((mat.shift)); |
---|
| 4915 | + if (!Equal(ambientField.getFloat(), mat.ambient)) |
---|
| 4916 | + ambientField.SetToolTipValue((mat.ambient)); |
---|
| 4917 | + if (!Equal(lightareaField.getFloat(), mat.lightarea)) |
---|
| 4918 | + lightareaField.SetToolTipValue((mat.lightarea)); |
---|
| 4919 | + if (!Equal(diffusenessField.getFloat(), mat.factor)) |
---|
| 4920 | + diffusenessField.SetToolTipValue((mat.factor)); |
---|
| 4921 | + if (!Equal(velvetField.getFloat(), mat.velvet)) |
---|
| 4922 | + velvetField.SetToolTipValue((mat.velvet)); |
---|
| 4923 | + if (!Equal(sheenField.getFloat(), mat.sheen)) |
---|
| 4924 | + sheenField.SetToolTipValue((mat.sheen)); |
---|
| 4925 | + if (!Equal(subsurfaceField.getFloat(), mat.subsurface)) |
---|
| 4926 | + subsurfaceField.SetToolTipValue((mat.subsurface)); |
---|
| 4927 | + if (!Equal(backlitField.getFloat(), mat.bump)) |
---|
| 4928 | + backlitField.SetToolTipValue((mat.bump)); |
---|
| 4929 | + if (!Equal(anisoField.getFloat(), mat.aniso)) |
---|
| 4930 | + anisoField.SetToolTipValue((mat.aniso)); |
---|
| 4931 | + if (!Equal(anisoVField.getFloat(), mat.anisoV)) |
---|
| 4932 | + anisoVField.SetToolTipValue((mat.anisoV)); |
---|
| 4933 | + if (!Equal(cameraField.getFloat(), mat.cameralight)) |
---|
| 4934 | + cameraField.SetToolTipValue((mat.cameralight)); |
---|
| 4935 | + if (!Equal(selfshadowField.getFloat(), mat.diffuseness)) |
---|
| 4936 | + selfshadowField.SetToolTipValue((mat.diffuseness)); |
---|
| 4937 | + if (!Equal(shadowField.getFloat(), mat.shadow)) |
---|
| 4938 | + shadowField.SetToolTipValue((mat.shadow)); |
---|
| 4939 | + if (!Equal(textureField.getFloat(), mat.texture)) |
---|
| 4940 | + textureField.SetToolTipValue((mat.texture)); |
---|
| 4941 | + if (!Equal(opacityField.getFloat(), mat.opacity)) |
---|
| 4942 | + opacityField.SetToolTipValue((mat.opacity)); |
---|
| 4943 | + if (!Equal(fakedepthField.getFloat(), mat.fakedepth)) |
---|
| 4944 | + fakedepthField.SetToolTipValue((mat.fakedepth)); |
---|
| 4945 | + if (!Equal(shadowbiasField.getFloat(), mat.shadowbias)) |
---|
| 4946 | + shadowbiasField.SetToolTipValue((mat.shadowbias)); |
---|
4625 | 4947 | } |
---|
4626 | 4948 | |
---|
4627 | 4949 | if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null) |
---|
.. | .. |
---|
4656 | 4978 | |
---|
4657 | 4979 | public void stateChanged(ChangeEvent e) |
---|
4658 | 4980 | { |
---|
4659 | | - // assert(false); |
---|
| 4981 | + // assert(false); |
---|
4660 | 4982 | if (e.getSource() == versionSlider) |
---|
4661 | 4983 | { |
---|
4662 | 4984 | if (muteSlider) |
---|
4663 | 4985 | return; |
---|
4664 | 4986 | |
---|
| 4987 | + Replace(); |
---|
| 4988 | + |
---|
4665 | 4989 | int version = versionSlider.getInteger(); |
---|
4666 | 4990 | |
---|
4667 | | - if (copy.versionlist[version] != null) |
---|
| 4991 | + if (version != -1 && copy.versionlist[version] != null) |
---|
4668 | 4992 | { |
---|
4669 | 4993 | copy.versionindex = version; |
---|
4670 | 4994 | CopyChanged(); |
---|
.. | .. |
---|
4708 | 5032 | //System.out.println("stateChanged = " + this); |
---|
4709 | 5033 | materialtouched = true; |
---|
4710 | 5034 | |
---|
4711 | | - if (e.getSource() == colorField && saturationField.getFloat() == 0.001) |
---|
| 5035 | + if (Globals.AUTOSATURATE && e.getSource() == colorField && saturationField.getFloat() == 0.001) |
---|
4712 | 5036 | { |
---|
4713 | 5037 | saturationField.setFloat(1); |
---|
4714 | 5038 | } |
---|
.. | .. |
---|
5023 | 5347 | } |
---|
5024 | 5348 | |
---|
5025 | 5349 | if (previousVersionButton != null && copy.versionlist != null) |
---|
5026 | | - SetUndoStates(); |
---|
| 5350 | + SetVersionStates(); |
---|
| 5351 | + |
---|
| 5352 | + cameraView.requestFocusInWindow(); |
---|
5027 | 5353 | } |
---|
5028 | 5354 | |
---|
5029 | 5355 | static TweenManager tweenManager = new TweenManager(); |
---|
.. | .. |
---|
5055 | 5381 | // group = (Composite) group.get(0); |
---|
5056 | 5382 | // } |
---|
5057 | 5383 | |
---|
5058 | | - System.out.println("makeSomething of " + thing); |
---|
| 5384 | + //System.out.println("makeSomething of " + thing); |
---|
5059 | 5385 | |
---|
5060 | 5386 | /* |
---|
5061 | 5387 | if (deselect && jList != null) |
---|
.. | .. |
---|
5409 | 5735 | |
---|
5410 | 5736 | copy.versionlist = readobj.versionlist; |
---|
5411 | 5737 | copy.versionindex = readobj.versionindex; |
---|
| 5738 | + copy.versiontable = readobj.versiontable; |
---|
5412 | 5739 | |
---|
5413 | 5740 | if (copy.versionlist == null) |
---|
5414 | 5741 | { |
---|
| 5742 | + // Backward compatibility |
---|
5415 | 5743 | copy.versionlist = new Object3D[100]; |
---|
5416 | 5744 | copy.versionindex = -1; |
---|
| 5745 | + |
---|
| 5746 | + //Save(true); |
---|
5417 | 5747 | } |
---|
5418 | 5748 | |
---|
5419 | 5749 | //? SetUndoStates(); |
---|
.. | .. |
---|
5505 | 5835 | |
---|
5506 | 5836 | void save() |
---|
5507 | 5837 | { |
---|
| 5838 | + Replace(); |
---|
| 5839 | + |
---|
5508 | 5840 | if (lastname == null) |
---|
5509 | 5841 | { |
---|
5510 | 5842 | return; |
---|
.. | .. |
---|
5747 | 6079 | ButtonGroup buttonGroup; |
---|
5748 | 6080 | |
---|
5749 | 6081 | cGridBag toolboxPanel; |
---|
| 6082 | + cGridBag skyboxPanel; |
---|
5750 | 6083 | cGridBag materialPanel; |
---|
5751 | 6084 | cGridBag ctrlPanel; |
---|
5752 | 6085 | |
---|
.. | .. |
---|
5758 | 6091 | boolean materialFlushed; |
---|
5759 | 6092 | Object3D latestObject; |
---|
5760 | 6093 | |
---|
| 6094 | + cGridBag transformPanel; |
---|
5761 | 6095 | cGridBag XYZPanel; |
---|
5762 | 6096 | |
---|
5763 | 6097 | JSplitPane gridPanel; |
---|
.. | .. |
---|
5851 | 6185 | cNumberSlider anisoField; |
---|
5852 | 6186 | JLabel anisoVLabel; |
---|
5853 | 6187 | cNumberSlider anisoVField; |
---|
| 6188 | + |
---|
5854 | 6189 | JLabel cameraLabel; |
---|
5855 | 6190 | cNumberSlider cameraField; |
---|
5856 | 6191 | JLabel selfshadowLabel; |
---|
.. | .. |
---|
5865 | 6200 | cNumberSlider fakedepthField; |
---|
5866 | 6201 | JLabel shadowbiasLabel; |
---|
5867 | 6202 | cNumberSlider shadowbiasField; |
---|
| 6203 | + |
---|
5868 | 6204 | JLabel bumpLabel; |
---|
5869 | 6205 | cNumberSlider bumpField; |
---|
5870 | 6206 | JLabel noiseLabel; |
---|