.. | .. |
---|
34 | 34 | iSendInfo |
---|
35 | 35 | //KeyListener |
---|
36 | 36 | { |
---|
| 37 | + public cToggleButton pinButton; |
---|
37 | 38 | boolean timeline; |
---|
38 | 39 | boolean wasFullScreen; |
---|
39 | 40 | |
---|
.. | .. |
---|
41 | 42 | JFrame frame; |
---|
42 | 43 | |
---|
43 | 44 | static ObjEditor theFrame; |
---|
| 45 | + |
---|
| 46 | + public void AllocProjectedVertices(Object3D object) |
---|
| 47 | + { |
---|
| 48 | + assert (object.projectedVertices != null); |
---|
| 49 | + |
---|
| 50 | + if (object.projectedVertices.length <= 2) |
---|
| 51 | + { |
---|
| 52 | + // Side effect... |
---|
| 53 | + Object3D.cVector2[] keep = object.projectedVertices; |
---|
| 54 | + object.projectedVertices = new Object3D.cVector2[3]; |
---|
| 55 | + for (int i = 0; i < 3; i++) |
---|
| 56 | + { |
---|
| 57 | + if (i < keep.length) |
---|
| 58 | + { |
---|
| 59 | + object.projectedVertices[i] = keep[i]; |
---|
| 60 | + } else |
---|
| 61 | + { |
---|
| 62 | + object.projectedVertices[i] = new Object3D.cVector2(); |
---|
| 63 | + } |
---|
| 64 | + /* |
---|
| 65 | + if(keep.length == 0) |
---|
| 66 | + object.projectedVertices[0] = new Object3D.cVector2(); |
---|
| 67 | + else |
---|
| 68 | + object.projectedVertices[0] = keep[0]; |
---|
| 69 | + object.projectedVertices[1] = new Object3D.cVector2(); |
---|
| 70 | + */ |
---|
| 71 | + } |
---|
| 72 | + } |
---|
| 73 | + } |
---|
| 74 | + |
---|
| 75 | + public Composite CreateCameras() |
---|
| 76 | + { |
---|
| 77 | + Composite cams = new cTemplate(); |
---|
| 78 | + cams.name = "Cameras"; |
---|
| 79 | + copy.insertElementAt(cams, 0); |
---|
| 80 | + |
---|
| 81 | + cams.addChild(new Camera()); |
---|
| 82 | + cams.addChild(new Camera(1)); |
---|
| 83 | + cams.addChild(new Camera(2)); |
---|
| 84 | + cams.addChild(new Camera(3)); |
---|
| 85 | + cams.addChild(new Camera(4)); |
---|
| 86 | + |
---|
| 87 | + return cams; |
---|
| 88 | + } |
---|
44 | 89 | |
---|
45 | 90 | public cGridBag GetSeparator() |
---|
46 | 91 | { |
---|
.. | .. |
---|
53 | 98 | cButton GetButton(String name, boolean border) |
---|
54 | 99 | { |
---|
55 | 100 | ImageIcon icon = GetIcon(name); |
---|
56 | | - return new cButton(icon, border); |
---|
| 101 | + if (icon != null || name.contains("/")) |
---|
| 102 | + return new cButton(icon, border); |
---|
| 103 | + else |
---|
| 104 | + return new cButton(name, border); |
---|
57 | 105 | } |
---|
58 | 106 | |
---|
59 | 107 | cLabel GetLabel(String name, boolean border) |
---|
.. | .. |
---|
74 | 122 | return new cCheckBox(icon, border); |
---|
75 | 123 | } |
---|
76 | 124 | |
---|
77 | | - ImageIcon GetIcon(String name) |
---|
| 125 | + static java.util.Hashtable<String, javax.swing.ImageIcon> icons = new java.util.Hashtable<String, javax.swing.ImageIcon>(); |
---|
| 126 | + |
---|
| 127 | + static ImageIcon GetIcon(String name) |
---|
78 | 128 | { |
---|
| 129 | + javax.swing.ImageIcon iconCache = icons.get(name); |
---|
| 130 | + if (iconCache != null) |
---|
| 131 | + { |
---|
| 132 | + return iconCache; |
---|
| 133 | + } |
---|
| 134 | + |
---|
79 | 135 | try |
---|
80 | 136 | { |
---|
81 | | - BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name)); |
---|
| 137 | + BufferedImage image = javax.imageio.ImageIO.read(ObjEditor.class.getClassLoader().getResourceAsStream(name)); |
---|
82 | 138 | |
---|
83 | 139 | // if (image.getWidth() > 48 && image.getHeight() > 48) |
---|
84 | 140 | // { |
---|
.. | .. |
---|
93 | 149 | // } |
---|
94 | 150 | |
---|
95 | 151 | javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image); |
---|
| 152 | + |
---|
| 153 | + icons.put(name, icon); |
---|
| 154 | + |
---|
96 | 155 | return icon; |
---|
97 | 156 | } |
---|
98 | 157 | catch (Exception e) |
---|
99 | 158 | { |
---|
| 159 | + //icons.put(name, null); |
---|
100 | 160 | return null; |
---|
101 | 161 | } |
---|
102 | 162 | } |
---|
.. | .. |
---|
296 | 356 | client = inClient; |
---|
297 | 357 | copy = client; |
---|
298 | 358 | |
---|
299 | | - if (copy.versionlist == null) |
---|
300 | | - { |
---|
301 | | - copy.versionlist = new Object3D[100]; |
---|
302 | | - copy.versionindex = -1; |
---|
303 | | - } |
---|
| 359 | +// if (copy.versionlist == null) |
---|
| 360 | +// { |
---|
| 361 | +// copy.versionlist = new Object3D[100]; |
---|
| 362 | +// copy.versionindex = -1; |
---|
| 363 | +// |
---|
| 364 | +// callee.Save(true); |
---|
| 365 | +// } |
---|
304 | 366 | |
---|
305 | 367 | // "this" is not called: SetupUI2(objEditor); |
---|
306 | 368 | } |
---|
.. | .. |
---|
319 | 381 | { |
---|
320 | 382 | copy.versionlist = new Object3D[100]; |
---|
321 | 383 | copy.versionindex = -1; |
---|
| 384 | + |
---|
| 385 | +// Save(true); |
---|
322 | 386 | } |
---|
323 | 387 | |
---|
324 | 388 | SetupUI2(callee.GetEditor()); |
---|
.. | .. |
---|
342 | 406 | //parent = p; |
---|
343 | 407 | |
---|
344 | 408 | GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice(); |
---|
345 | | - System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow()); |
---|
| 409 | + if (Globals.DEBUG) |
---|
| 410 | + System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow()); |
---|
346 | 411 | //gd.setFullScreenWindow(this); |
---|
347 | 412 | //setResizable(false); |
---|
348 | 413 | //if (!isDisplayable()) |
---|
.. | .. |
---|
353 | 418 | copy = localCopy; |
---|
354 | 419 | copy.editWindow = this; |
---|
355 | 420 | |
---|
356 | | - if (copy.versionlist == null) |
---|
357 | | - { |
---|
358 | | -// copy.versions = new byte[100][]; |
---|
| 421 | +// if (copy.versionlist == null) |
---|
| 422 | +// { |
---|
| 423 | +// copy.versionlist = new Object3D[100]; |
---|
359 | 424 | // copy.versionindex = -1; |
---|
360 | | - } |
---|
| 425 | +// |
---|
| 426 | +// Save(true); |
---|
| 427 | +// } |
---|
361 | 428 | |
---|
362 | 429 | SetupMenu(); |
---|
363 | 430 | |
---|
.. | .. |
---|
377 | 444 | |
---|
378 | 445 | static java.util.Vector<Object3D> listUI = new java.util.Vector<Object3D>(); |
---|
379 | 446 | |
---|
| 447 | + // This is to refresh the UI of the material panel. |
---|
| 448 | + boolean patchMaterial; |
---|
| 449 | + |
---|
380 | 450 | void SetupMenu() |
---|
381 | 451 | { |
---|
382 | 452 | frame.setMenuBar(menuBar = new MenuBar()); |
---|
.. | .. |
---|
426 | 496 | |
---|
427 | 497 | ChangeListener changeListener = new ChangeListener() |
---|
428 | 498 | { |
---|
| 499 | + //String name; |
---|
| 500 | + |
---|
429 | 501 | public void stateChanged(ChangeEvent changeEvent) |
---|
430 | 502 | { |
---|
431 | 503 | // if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Material") && !materialFlushed) |
---|
.. | .. |
---|
444 | 516 | // EditSelection(false); |
---|
445 | 517 | // } |
---|
446 | 518 | |
---|
447 | | - refreshContents(false); // To refresh Info tab |
---|
| 519 | +// if (objectPanel.getSelectedIndex() == 4) |
---|
| 520 | +// { |
---|
| 521 | +// name = copy.skyboxname; |
---|
| 522 | +// |
---|
| 523 | +// if (name == null) |
---|
| 524 | +// { |
---|
| 525 | +// name = ""; |
---|
| 526 | +// } |
---|
| 527 | +// |
---|
| 528 | +// copy.skyboxname = "cubemaps/default-skyboxes/rgb"; |
---|
| 529 | +// copy.skyboxext = "jpg"; |
---|
| 530 | +// } |
---|
| 531 | +// else |
---|
| 532 | +// { |
---|
| 533 | +// if (name != null) |
---|
| 534 | +// { |
---|
| 535 | +// if (name.equals("")) |
---|
| 536 | +// { |
---|
| 537 | +// copy.skyboxname = null; |
---|
| 538 | +// copy.skyboxext = null; |
---|
| 539 | +// } |
---|
| 540 | +// else |
---|
| 541 | +// { |
---|
| 542 | +// copy.skyboxname = name; |
---|
| 543 | +// } |
---|
| 544 | +// } |
---|
| 545 | +// } |
---|
| 546 | + cameraView.transformMode = objectPanel.getSelectedIndex() == 4; |
---|
| 547 | + |
---|
| 548 | +// refreshContents(false); // To refresh Info tab |
---|
| 549 | + cameraView.repaint(); |
---|
448 | 550 | } |
---|
449 | 551 | }; |
---|
450 | 552 | objectPanel.addChangeListener(changeListener); |
---|
.. | .. |
---|
466 | 568 | |
---|
467 | 569 | toolboxPanel = new cGridBag().setVertical(true); |
---|
468 | 570 | //toolboxPanel.setName("Toolbox"); |
---|
| 571 | + |
---|
| 572 | + skyboxPanel = new cGridBag().setVertical(true); |
---|
469 | 573 | |
---|
470 | 574 | materialPanel = new cGridBag().setVertical(false); |
---|
471 | 575 | //materialPanel.setName("Material"); |
---|
.. | .. |
---|
751 | 855 | boolean maximized; |
---|
752 | 856 | |
---|
753 | 857 | cButton fullscreenLayout; |
---|
| 858 | + cButton expandedLayout; |
---|
754 | 859 | |
---|
755 | 860 | void Minimize() |
---|
756 | 861 | { |
---|
.. | .. |
---|
790 | 895 | cButton minButton; |
---|
791 | 896 | cButton maxButton; |
---|
792 | 897 | cButton fullButton; |
---|
| 898 | + cButton collapseButton; |
---|
| 899 | + cButton maximize3DButton; |
---|
793 | 900 | |
---|
794 | 901 | void ToggleFullScreen() |
---|
795 | 902 | { |
---|
796 | | -GraphicsDevice device = frame.getGraphicsConfiguration().getDevice(); |
---|
| 903 | + GraphicsDevice device = frame.getGraphicsConfiguration().getDevice(); |
---|
797 | 904 | |
---|
798 | 905 | cameraView.ToggleFullScreen(); |
---|
799 | 906 | |
---|
.. | .. |
---|
814 | 921 | // X frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
815 | 922 | // X framePanel.add(bigThree); |
---|
816 | 923 | // X frame.getContentPane().add(/*"Center",*/framePanel); |
---|
817 | | - framePanel.setDividerLocation(46); |
---|
| 924 | +// framePanel.setDividerLocation(46); // icons are 24x24 |
---|
818 | 925 | |
---|
819 | 926 | //frame.setVisible(true); |
---|
820 | | - radio.layout = keepButton; |
---|
| 927 | +// radio.layout = keepButton; |
---|
821 | 928 | //theFrame = null; |
---|
822 | 929 | keepButton = null; |
---|
823 | | - radio.layout.doClick(); |
---|
| 930 | +// radio.layout.doClick(); |
---|
824 | 931 | |
---|
825 | 932 | } else |
---|
826 | 933 | { |
---|
.. | .. |
---|
841 | 948 | // X frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
842 | 949 | // X framePanel.remove(bigThree); |
---|
843 | 950 | // X frame.getContentPane().add(/*"Center",*/bigThree); |
---|
844 | | - framePanel.setDividerLocation(0); |
---|
| 951 | +// framePanel.setDividerLocation(0); |
---|
845 | 952 | |
---|
846 | | - radio.layout = fullscreenLayout; |
---|
847 | | - radio.layout.doClick(); |
---|
| 953 | +// radio.layout = fullscreenLayout; |
---|
| 954 | +// radio.layout.doClick(); |
---|
848 | 955 | //frame.setVisible(true); |
---|
849 | 956 | } |
---|
850 | 957 | frame.validate(); |
---|
.. | .. |
---|
852 | 959 | cameraView.requestFocusInWindow(); |
---|
853 | 960 | } |
---|
854 | 961 | |
---|
855 | | - private Object3D CompressCopy() |
---|
| 962 | + void CollapseToolbar() |
---|
| 963 | + { |
---|
| 964 | + framePanel.setDividerLocation(0); |
---|
| 965 | + //frame.validate(); |
---|
| 966 | + |
---|
| 967 | + cameraView.requestFocusInWindow(); |
---|
| 968 | + } |
---|
| 969 | + |
---|
| 970 | + private Object3D Duplicate(Object3D object) |
---|
856 | 971 | { |
---|
857 | 972 | boolean temp = CameraPane.SWITCH; |
---|
858 | 973 | CameraPane.SWITCH = false; |
---|
859 | 974 | |
---|
860 | | - copy.ExtractBigData(versiontable); |
---|
| 975 | + if (Grafreed.grafreed.universe.versiontable == null) |
---|
| 976 | + Grafreed.grafreed.universe.versiontable = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
| 977 | + |
---|
| 978 | + object.ExtractBigData(Grafreed.grafreed.universe.versiontable); |
---|
861 | 979 | // if (copy == client) |
---|
862 | 980 | |
---|
863 | | - Object3D versions[] = copy.versionlist; |
---|
864 | | - copy.versionlist = null; |
---|
| 981 | + Object3D versions[] = object.versionlist; |
---|
| 982 | + java.util.Hashtable<java.util.UUID, Object3D> versiontable = object.versiontable; // if Grafreed.grafreed.universe |
---|
| 983 | + object.versionlist = null; |
---|
| 984 | + object.versiontable = null; |
---|
| 985 | + |
---|
| 986 | + Object3D parent = object.parent; |
---|
| 987 | + object.parent = null; |
---|
865 | 988 | |
---|
866 | 989 | //byte[] compress = Compress(copy); |
---|
867 | | - Object3D compress = (Object3D)Grafreed.clone(copy); |
---|
| 990 | + Object3D compress = (Object3D)Grafreed.clone(object); |
---|
868 | 991 | |
---|
869 | | - copy.versionlist = versions; |
---|
| 992 | + object.parent = parent; |
---|
870 | 993 | |
---|
871 | | - copy.RestoreBigData(versiontable); |
---|
| 994 | + object.versionlist = versions; |
---|
| 995 | + object.versiontable = versiontable; // if Grafreed.grafreed.universe |
---|
| 996 | + |
---|
| 997 | + object.RestoreBigData(Grafreed.grafreed.universe.versiontable); |
---|
872 | 998 | |
---|
873 | 999 | CameraPane.SWITCH = temp; |
---|
874 | 1000 | |
---|
.. | .. |
---|
1205 | 1331 | |
---|
1206 | 1332 | namePanel = new cGridBag(); |
---|
1207 | 1333 | |
---|
| 1334 | + //if (copy.pinned) |
---|
| 1335 | + { |
---|
| 1336 | + pinButton = GetToggleButton("icons/pin.png", !Globals.NIMBUSLAF); |
---|
| 1337 | + pinButton.setSelected(copy.pinned); |
---|
| 1338 | + cGridBag t = new cGridBag(); |
---|
| 1339 | + t.preferredWidth = 2; |
---|
| 1340 | + t.add(pinButton); |
---|
| 1341 | + namePanel.add(t); |
---|
| 1342 | + |
---|
| 1343 | + pinButton.addItemListener(this); |
---|
| 1344 | + } |
---|
| 1345 | + |
---|
1208 | 1346 | nameField = AddText(namePanel, copy.GetName()); |
---|
1209 | 1347 | namePanel.add(new JScrollPane(nameField, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER)); |
---|
1210 | 1348 | oe.ctrlPanel.add(namePanel); |
---|
.. | .. |
---|
1218 | 1356 | |
---|
1219 | 1357 | liveCB = AddCheckBox(setupPanel, "Live", copy.live); |
---|
1220 | 1358 | liveCB.setToolTipText("Animate object"); |
---|
| 1359 | + markCB = AddCheckBox(setupPanel, "Anim", copy.marked); |
---|
| 1360 | + markCB.setToolTipText("Set target transform"); |
---|
1221 | 1361 | selectableCB = AddCheckBox(setupPanel, "Select", !copy.dontselect); |
---|
1222 | 1362 | selectableCB.setToolTipText("Make object selectable"); |
---|
1223 | 1363 | // Return(); |
---|
1224 | 1364 | |
---|
1225 | 1365 | hideCB = AddCheckBox(setupPanel, "Hide", copy.hide); |
---|
1226 | 1366 | hideCB.setToolTipText("Hide object"); |
---|
1227 | | - markCB = AddCheckBox(setupPanel, "Mark", copy.marked); |
---|
1228 | | - markCB.setToolTipText("As animation target transform"); |
---|
1229 | 1367 | |
---|
1230 | 1368 | ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false); |
---|
1231 | 1369 | |
---|
.. | .. |
---|
1427 | 1565 | |
---|
1428 | 1566 | if (cam == null || !(copy.get(0) instanceof cGroup)) |
---|
1429 | 1567 | { |
---|
1430 | | - System.out.println("CREATE CAMERAS"); |
---|
1431 | | - cams = new cTemplate(); |
---|
1432 | | - cams.name = "Cameras"; |
---|
1433 | | - copy.insertElementAt(cams, 0); |
---|
1434 | | - //cams.parent = copy; |
---|
1435 | | - |
---|
1436 | | - cam = new Camera(); // LA.newVector(3, 2, 1)); |
---|
1437 | | - cams.addChild(cam); |
---|
1438 | | - cam = new Camera(1); |
---|
1439 | | - cams.addChild(cam); |
---|
1440 | | - cam = new Camera(2); |
---|
1441 | | - cams.addChild(cam); |
---|
1442 | | - cam = new Camera(3); |
---|
1443 | | - cams.addChild(cam); |
---|
1444 | | - cam = new Camera(4); // Light |
---|
1445 | | - cams.addChild(cam); |
---|
| 1568 | + if (Globals.DEBUG) |
---|
| 1569 | + System.out.println("CREATE CAMERAS"); |
---|
| 1570 | + cams = CreateCameras(); |
---|
1446 | 1571 | } else |
---|
1447 | 1572 | { |
---|
1448 | 1573 | cams = (cGroup) copy.get(0); |
---|
.. | .. |
---|
1508 | 1633 | //frontView.object = copy; |
---|
1509 | 1634 | //sideView.object = copy; |
---|
1510 | 1635 | |
---|
| 1636 | + transformPanel = new cGridBag().setVertical(true); |
---|
| 1637 | + |
---|
| 1638 | + cGridBag resetTransformPanel = new cGridBag(); |
---|
| 1639 | + |
---|
| 1640 | + resetTransformPanel.preferredHeight = 2; |
---|
| 1641 | + |
---|
| 1642 | + cButton resetTransform = GetButton("Reset all", !Globals.NIMBUSLAF); |
---|
| 1643 | + resetTransform.setToolTipText("Reset Translation, Rotation and Scale"); |
---|
| 1644 | + resetTransform.addMouseListener(new MouseAdapter() |
---|
| 1645 | + { |
---|
| 1646 | + public void mouseClicked(MouseEvent e) |
---|
| 1647 | + { |
---|
| 1648 | + ResetTransform(); |
---|
| 1649 | + } |
---|
| 1650 | + }); |
---|
| 1651 | + resetTransformPanel.add(resetTransform); |
---|
| 1652 | + |
---|
| 1653 | + resetTransform = GetButton("T only", !Globals.NIMBUSLAF); |
---|
| 1654 | + resetTransform.setToolTipText("Reset Translation only"); |
---|
| 1655 | + resetTransform.addMouseListener(new MouseAdapter() |
---|
| 1656 | + { |
---|
| 1657 | + public void mouseClicked(MouseEvent e) |
---|
| 1658 | + { |
---|
| 1659 | + ResetTransform(1); |
---|
| 1660 | + } |
---|
| 1661 | + }); |
---|
| 1662 | + resetTransformPanel.add(resetTransform); |
---|
| 1663 | + |
---|
| 1664 | + resetTransform = GetButton("RS only", !Globals.NIMBUSLAF); |
---|
| 1665 | + resetTransform.setToolTipText("Reset Rotation and Scale only"); |
---|
| 1666 | + resetTransform.addMouseListener(new MouseAdapter() |
---|
| 1667 | + { |
---|
| 1668 | + public void mouseClicked(MouseEvent e) |
---|
| 1669 | + { |
---|
| 1670 | + ResetTransform(2); |
---|
| 1671 | + } |
---|
| 1672 | + }); |
---|
| 1673 | + resetTransformPanel.add(resetTransform); |
---|
| 1674 | + |
---|
1511 | 1675 | XYZPanel = new cGridBag().setVertical(true); |
---|
1512 | 1676 | //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5)); |
---|
1513 | 1677 | |
---|
.. | .. |
---|
1517 | 1681 | XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll); |
---|
1518 | 1682 | //XYZPanel.setName("XYZ"); |
---|
1519 | 1683 | |
---|
| 1684 | + transformPanel.add(resetTransformPanel); |
---|
| 1685 | + transformPanel.add(XYZPanel); |
---|
| 1686 | + |
---|
1520 | 1687 | /* |
---|
1521 | 1688 | gridPanel = new JPanel(); //new BorderLayout()); |
---|
1522 | 1689 | gridPanel.setLayout(new GridLayout(1, 2)); |
---|
.. | .. |
---|
1524 | 1691 | gridPanel.add(cameraView); |
---|
1525 | 1692 | gridPanel.add(XYZPanel); |
---|
1526 | 1693 | */ |
---|
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); |
---|
| 1694 | +// gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, centralPanel, XYZPanel); //new BorderLayout()); |
---|
| 1695 | +// gridPanel.setContinuousLayout(true); |
---|
| 1696 | +// gridPanel.setOneTouchExpandable(true); |
---|
| 1697 | +// gridPanel.setDividerLocation(1.0); |
---|
| 1698 | +// gridPanel.setDividerSize(9); |
---|
| 1699 | +// gridPanel.setResizeWeight(0.85); |
---|
1533 | 1700 | |
---|
1534 | 1701 | // aConstraints.weighty = 0; |
---|
1535 | 1702 | //System.out.println("THIS = " + this); |
---|
.. | .. |
---|
1552 | 1719 | |
---|
1553 | 1720 | //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); |
---|
1554 | 1721 | //tmp.setName("Edit"); |
---|
| 1722 | + objectPanel.add(skyboxPanel); |
---|
| 1723 | + objectPanel.setIconAt(0, GetIcon("icons/skybox.jpg")); |
---|
| 1724 | + objectPanel.setToolTipTextAt(0, "Backgrounds"); |
---|
| 1725 | + |
---|
| 1726 | + objectPanel.add(toolboxPanel); |
---|
| 1727 | + objectPanel.setIconAt(1, GetIcon("icons/primitives.png")); |
---|
| 1728 | + objectPanel.setToolTipTextAt(1, "Objects & textures"); |
---|
| 1729 | + |
---|
1555 | 1730 | objectPanel.add(materialPanel); |
---|
1556 | | - objectPanel.setIconAt(0, GetIcon("icons/material.png")); |
---|
1557 | | - objectPanel.setToolTipTextAt(0, "Material"); |
---|
| 1731 | + objectPanel.setIconAt(2, GetIcon("icons/material.png")); |
---|
| 1732 | + objectPanel.setToolTipTextAt(2, "Material"); |
---|
1558 | 1733 | |
---|
1559 | 1734 | // JPanel north = new JPanel(new BorderLayout()); |
---|
1560 | 1735 | // north.setName("Edit"); |
---|
1561 | 1736 | // north.add(ctrlPanel, BorderLayout.NORTH); |
---|
1562 | 1737 | // objectPanel.add(north); |
---|
1563 | 1738 | objectPanel.add(editPanel); |
---|
1564 | | - objectPanel.setIconAt(1, GetIcon("icons/write.png")); |
---|
1565 | | - objectPanel.setToolTipTextAt(1, "Edit controls"); |
---|
| 1739 | + objectPanel.setIconAt(3, GetIcon("icons/writewhite.png")); |
---|
| 1740 | + objectPanel.setToolTipTextAt(3, "Edit controls"); |
---|
1566 | 1741 | |
---|
1567 | | - //if (Globals.ADVANCED) |
---|
1568 | | - objectPanel.add(infoPanel); |
---|
1569 | | - objectPanel.setIconAt(2, GetIcon("icons/info.png")); |
---|
1570 | | - objectPanel.setToolTipTextAt(2, "Information"); |
---|
| 1742 | + objectPanel.add(transformPanel); |
---|
| 1743 | + objectPanel.setIconAt(4, GetIcon("icons/XYZ.png")); |
---|
| 1744 | + objectPanel.setToolTipTextAt(4, "TRS transform"); |
---|
1571 | 1745 | |
---|
1572 | | - objectPanel.add(XYZPanel); |
---|
1573 | | - objectPanel.setIconAt(3, GetIcon("icons/XYZ.png")); |
---|
1574 | | - objectPanel.setToolTipTextAt(3, "XYZ/RGB transform"); |
---|
1575 | | - |
---|
1576 | | - objectPanel.add(toolboxPanel); |
---|
1577 | | - objectPanel.setIconAt(4, GetIcon("icons/primitives.png")); |
---|
1578 | | - objectPanel.setToolTipTextAt(4, "Objects & backgrounds"); |
---|
1579 | | - |
---|
| 1746 | + patchMaterial = true; |
---|
| 1747 | + cameraView.patchMaterial = this; |
---|
| 1748 | + objectPanel.setSelectedIndex(2); |
---|
| 1749 | + |
---|
1580 | 1750 | /* |
---|
1581 | 1751 | aConstraints.gridx = 0; |
---|
1582 | 1752 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1596 | 1766 | scrollpane.addMouseWheelListener(this); // Default not fast enough |
---|
1597 | 1767 | |
---|
1598 | 1768 | /*JTabbedPane*/ scenePanel = new cGridBag(); |
---|
1599 | | - scenePanel.preferredWidth = 5; |
---|
| 1769 | + scenePanel.preferredWidth = 6; |
---|
1600 | 1770 | |
---|
1601 | 1771 | JTabbedPane tabbedPane = new JTabbedPane(); |
---|
1602 | 1772 | tabbedPane.add(scrollpane); |
---|
.. | .. |
---|
1607 | 1777 | |
---|
1608 | 1778 | AddOptions(optionsPanel); //, aConstraints); |
---|
1609 | 1779 | |
---|
1610 | | - tabbedPane.add(optionsPanel); |
---|
1611 | | - |
---|
1612 | 1780 | tabbedPane.add(FSPane = new cFileSystemPane(this)); |
---|
1613 | 1781 | |
---|
| 1782 | + tabbedPane.add(optionsPanel); |
---|
| 1783 | + |
---|
1614 | 1784 | scenePanel.add(tabbedPane); |
---|
| 1785 | + |
---|
| 1786 | + cGridBag creditsPanel = new cGridBag().setVertical(true); |
---|
| 1787 | + creditsPanel.setName("Credits"); |
---|
| 1788 | + |
---|
| 1789 | + cLabel ogaLabel = new cLabel(" Most Skyboxes courtesy of OpenGameArt!", !Globals.NIMBUSLAF); |
---|
| 1790 | + creditsPanel.add(ogaLabel); |
---|
| 1791 | + |
---|
| 1792 | + cButton opengameartButton; |
---|
| 1793 | + creditsPanel.add(opengameartButton = GetButton("icons/sara-logo.png", !Globals.NIMBUSLAF)); |
---|
| 1794 | + opengameartButton.setToolTipText("https://opengameart.org"); |
---|
| 1795 | + |
---|
| 1796 | + opengameartButton.addMouseListener(new MouseAdapter() |
---|
| 1797 | + { |
---|
| 1798 | + public void mouseClicked(MouseEvent e) |
---|
| 1799 | + { |
---|
| 1800 | + try |
---|
| 1801 | + { |
---|
| 1802 | + Desktop.getDesktop().browse(new java.net.URI("https://opengameart.org/")); |
---|
| 1803 | + } catch (Exception e1) |
---|
| 1804 | +// } catch (java.io.IOException | java.net.URISyntaxException e1) |
---|
| 1805 | + { |
---|
| 1806 | + e1.printStackTrace(); |
---|
| 1807 | + } |
---|
| 1808 | + } |
---|
| 1809 | + }); |
---|
| 1810 | + |
---|
| 1811 | + for (int i=10; --i>=0;) |
---|
| 1812 | + { |
---|
| 1813 | + creditsPanel.add(new cGridBag()); |
---|
| 1814 | + } |
---|
| 1815 | + |
---|
| 1816 | + tabbedPane.add(creditsPanel); |
---|
| 1817 | + tabbedPane.setToolTipTextAt(3, "Credits"); |
---|
| 1818 | + |
---|
| 1819 | + if (Globals.ADVANCED) |
---|
| 1820 | + { |
---|
| 1821 | + tabbedPane.add(infoPanel); |
---|
| 1822 | + tabbedPane.setIconAt(4, GetIcon("icons/info.png")); |
---|
| 1823 | + tabbedPane.setToolTipTextAt(4, "Information"); |
---|
| 1824 | + } |
---|
1615 | 1825 | |
---|
1616 | 1826 | /* |
---|
1617 | 1827 | cTree jTree = new cTree(null); |
---|
.. | .. |
---|
1633 | 1843 | jtp.add(tree); |
---|
1634 | 1844 | */ |
---|
1635 | 1845 | |
---|
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"); |
---|
| 1846 | +// bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, scenePanel, gridPanel); |
---|
| 1847 | +// bigPanel.setContinuousLayout(true); |
---|
| 1848 | +// bigPanel.setOneTouchExpandable(true); |
---|
| 1849 | +// bigPanel.setDividerLocation(0.8); |
---|
| 1850 | +// bigPanel.setDividerSize(15); |
---|
| 1851 | +// bigPanel.setResizeWeight(0.15); |
---|
| 1852 | +// bigPanel.setName("Scene"); |
---|
1643 | 1853 | |
---|
1644 | 1854 | //bigPanel.setLayout(new BorderLayout()); |
---|
1645 | 1855 | //bigPanel.setSize(new Dimension(10,10)); |
---|
.. | .. |
---|
1683 | 1893 | // aConstraints.gridheight = 1; |
---|
1684 | 1894 | |
---|
1685 | 1895 | framePanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, toolbarPanel, bigThree); |
---|
| 1896 | + |
---|
| 1897 | + framePanel.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY, |
---|
| 1898 | + new java.beans.PropertyChangeListener() |
---|
| 1899 | + { |
---|
| 1900 | + public void propertyChange(java.beans.PropertyChangeEvent pce) |
---|
| 1901 | + { |
---|
| 1902 | + if ((Integer)pce.getOldValue() == 1) |
---|
| 1903 | + { |
---|
| 1904 | + if (radio.layout != expandedLayout) |
---|
| 1905 | + { |
---|
| 1906 | + radio.layout = expandedLayout; |
---|
| 1907 | + radio.layout.doClick(); |
---|
| 1908 | + } |
---|
| 1909 | + } |
---|
| 1910 | + } |
---|
| 1911 | + }); |
---|
| 1912 | + |
---|
1686 | 1913 | framePanel.setContinuousLayout(false); |
---|
1687 | 1914 | framePanel.setOneTouchExpandable(false); |
---|
1688 | 1915 | //.setDividerLocation(0.8); |
---|
.. | .. |
---|
1692 | 1919 | |
---|
1693 | 1920 | frame.getContentPane().setLayout(new BorderLayout()); |
---|
1694 | 1921 | /**/ |
---|
1695 | | - JTabbedPane worldPane = new JTabbedPane(); |
---|
| 1922 | + //JTabbedPane worldPane = new JTabbedPane(); |
---|
1696 | 1923 | //worldPane.add(bigPanel); |
---|
1697 | 1924 | //worldPane.add(worldPanel); |
---|
1698 | 1925 | /**/ |
---|
.. | .. |
---|
1706 | 1933 | |
---|
1707 | 1934 | cameraView.requestFocusInWindow(); |
---|
1708 | 1935 | |
---|
1709 | | - gridPanel.setDividerLocation(1.0); |
---|
| 1936 | +// gridPanel.setDividerLocation(1.0); |
---|
1710 | 1937 | |
---|
1711 | 1938 | frame.validate(); |
---|
1712 | 1939 | |
---|
.. | .. |
---|
1741 | 1968 | { |
---|
1742 | 1969 | cGridBag presetpanel = new cGridBag().setVertical(true); |
---|
1743 | 1970 | |
---|
1744 | | - cLabel skin = GetLabel("icons/shadericons/shadericon00000.png", !Grafreed.NIMBUSLAF); |
---|
| 1971 | + cLabel skin = GetLabel("icons/shadericons/shadericon00000.png", !Globals.NIMBUSLAF); |
---|
1745 | 1972 | skin.setToolTipText("Skin"); |
---|
1746 | 1973 | skin.addMouseListener(new MouseAdapter() |
---|
1747 | 1974 | { |
---|
.. | .. |
---|
1752 | 1979 | |
---|
1753 | 1980 | // Skin |
---|
1754 | 1981 | colorField.setFloat(material.color); |
---|
1755 | | - saturationField.setFloat(material.modulation); |
---|
| 1982 | + float saturation = material.modulation; |
---|
| 1983 | + |
---|
| 1984 | + if (!cameraView.Skinshader) |
---|
| 1985 | + { |
---|
| 1986 | + saturation /= 1.5; |
---|
| 1987 | + } |
---|
| 1988 | + |
---|
| 1989 | + saturationField.setFloat(saturation); |
---|
| 1990 | + |
---|
1756 | 1991 | subsurfaceField.setFloat(material.subsurface); |
---|
1757 | 1992 | selfshadowField.setFloat(material.diffuseness); |
---|
1758 | 1993 | diffusenessField.setFloat(material.factor); |
---|
.. | .. |
---|
1771 | 2006 | }); |
---|
1772 | 2007 | presetpanel.add(skin); |
---|
1773 | 2008 | |
---|
1774 | | - cLabel lambert = GetLabel("icons/shadericons/shadericon00002.png", !Grafreed.NIMBUSLAF); |
---|
| 2009 | + cLabel lambert = GetLabel("icons/shadericons/shadericon00002.png", !Globals.NIMBUSLAF); |
---|
1775 | 2010 | lambert.setToolTipText("Diffuse"); |
---|
1776 | 2011 | lambert.addMouseListener(new MouseAdapter() |
---|
1777 | 2012 | { |
---|
.. | .. |
---|
1789 | 2024 | }); |
---|
1790 | 2025 | presetpanel.add(lambert); |
---|
1791 | 2026 | |
---|
1792 | | - cLabel diffuse2 = GetLabel("icons/shadericons/shadericon00003.png", !Grafreed.NIMBUSLAF); |
---|
| 2027 | + cLabel diffuse2 = GetLabel("icons/shadericons/shadericon00003.png", !Globals.NIMBUSLAF); |
---|
1793 | 2028 | diffuse2.setToolTipText("Diffuse2"); |
---|
1794 | 2029 | diffuse2.addMouseListener(new MouseAdapter() |
---|
1795 | 2030 | { |
---|
.. | .. |
---|
1807 | 2042 | }); |
---|
1808 | 2043 | presetpanel.add(diffuse2); |
---|
1809 | 2044 | |
---|
1810 | | - cLabel diffusemoon = GetLabel("icons/shadericons/shadericon00004.png", !Grafreed.NIMBUSLAF); |
---|
| 2045 | + cLabel diffusemoon = GetLabel("icons/shadericons/shadericon00004.png", !Globals.NIMBUSLAF); |
---|
1811 | 2046 | diffusemoon.setToolTipText("Moon"); |
---|
1812 | 2047 | diffusemoon.addMouseListener(new MouseAdapter() |
---|
1813 | 2048 | { |
---|
.. | .. |
---|
1825 | 2060 | }); |
---|
1826 | 2061 | presetpanel.add(diffusemoon); |
---|
1827 | 2062 | |
---|
1828 | | - cLabel diffusemoon2 = GetLabel("icons/shadericons/shadericon00005.png", !Grafreed.NIMBUSLAF); |
---|
| 2063 | + cLabel diffusemoon2 = GetLabel("icons/shadericons/shadericon00005.png", !Globals.NIMBUSLAF); |
---|
1829 | 2064 | diffusemoon2.setToolTipText("Moon2"); |
---|
1830 | 2065 | diffusemoon2.addMouseListener(new MouseAdapter() |
---|
1831 | 2066 | { |
---|
.. | .. |
---|
1843 | 2078 | }); |
---|
1844 | 2079 | presetpanel.add(diffusemoon2); |
---|
1845 | 2080 | |
---|
1846 | | - cLabel diffusemoon3 = GetLabel("icons/shadericons/shadericon00006.png", !Grafreed.NIMBUSLAF); |
---|
| 2081 | + cLabel diffusemoon3 = GetLabel("icons/shadericons/shadericon00006.png", !Globals.NIMBUSLAF); |
---|
1847 | 2082 | diffusemoon3.setToolTipText("Moon3"); |
---|
1848 | 2083 | diffusemoon3.addMouseListener(new MouseAdapter() |
---|
1849 | 2084 | { |
---|
.. | .. |
---|
1861 | 2096 | }); |
---|
1862 | 2097 | presetpanel.add(diffusemoon3); |
---|
1863 | 2098 | |
---|
1864 | | - cLabel diffusesheen = GetLabel("icons/shadericons/shadericon00007.png", !Grafreed.NIMBUSLAF); |
---|
| 2099 | + cLabel diffusesheen = GetLabel("icons/shadericons/shadericon00007.png", !Globals.NIMBUSLAF); |
---|
1865 | 2100 | diffusesheen.setToolTipText("Sheen"); |
---|
1866 | 2101 | diffusesheen.addMouseListener(new MouseAdapter() |
---|
1867 | 2102 | { |
---|
.. | .. |
---|
1878 | 2113 | }); |
---|
1879 | 2114 | presetpanel.add(diffusesheen); |
---|
1880 | 2115 | |
---|
1881 | | - cLabel rough = GetLabel("icons/shadericons/shadericon00001.png", !Grafreed.NIMBUSLAF); |
---|
| 2116 | + cLabel rough = GetLabel("icons/shadericons/shadericon00001.png", !Globals.NIMBUSLAF); |
---|
1882 | 2117 | rough.setToolTipText("Rough metal"); |
---|
1883 | 2118 | rough.addMouseListener(new MouseAdapter() |
---|
1884 | 2119 | { |
---|
.. | .. |
---|
1896 | 2131 | }); |
---|
1897 | 2132 | presetpanel.add(rough); |
---|
1898 | 2133 | |
---|
1899 | | - cLabel rough2 = GetLabel("icons/shadericons/shadericon00013.png", !Grafreed.NIMBUSLAF); |
---|
| 2134 | + cLabel rough2 = GetLabel("icons/shadericons/shadericon00013.png", !Globals.NIMBUSLAF); |
---|
1900 | 2135 | rough2.setToolTipText("Medium metal"); |
---|
1901 | 2136 | rough2.addMouseListener(new MouseAdapter() |
---|
1902 | 2137 | { |
---|
.. | .. |
---|
1914 | 2149 | }); |
---|
1915 | 2150 | presetpanel.add(rough2); |
---|
1916 | 2151 | |
---|
1917 | | - cLabel shini0 = GetLabel("icons/shadericons/shadericon00014.png", !Grafreed.NIMBUSLAF); |
---|
| 2152 | + cLabel shini0 = GetLabel("icons/shadericons/shadericon00014.png", !Globals.NIMBUSLAF); |
---|
1918 | 2153 | shini0.setToolTipText("Shiny"); |
---|
1919 | 2154 | shini0.addMouseListener(new MouseAdapter() |
---|
1920 | 2155 | { |
---|
.. | .. |
---|
1932 | 2167 | }); |
---|
1933 | 2168 | presetpanel.add(shini0); |
---|
1934 | 2169 | |
---|
1935 | | - cLabel shini1 = GetLabel("icons/shadericons/shadericon00011.png", !Grafreed.NIMBUSLAF); |
---|
| 2170 | + cLabel shini1 = GetLabel("icons/shadericons/shadericon00011.png", !Globals.NIMBUSLAF); |
---|
1936 | 2171 | shini1.setToolTipText("Shiny2"); |
---|
1937 | 2172 | shini1.addMouseListener(new MouseAdapter() |
---|
1938 | 2173 | { |
---|
.. | .. |
---|
1950 | 2185 | }); |
---|
1951 | 2186 | presetpanel.add(shini1); |
---|
1952 | 2187 | |
---|
1953 | | - cLabel shini2 = GetLabel("icons/shadericons/shadericon00012.png", !Grafreed.NIMBUSLAF); |
---|
| 2188 | + cLabel shini2 = GetLabel("icons/shadericons/shadericon00012.png", !Globals.NIMBUSLAF); |
---|
1954 | 2189 | shini2.setToolTipText("Shiny3"); |
---|
1955 | 2190 | shini2.addMouseListener(new MouseAdapter() |
---|
1956 | 2191 | { |
---|
.. | .. |
---|
1968 | 2203 | }); |
---|
1969 | 2204 | presetpanel.add(shini2); |
---|
1970 | 2205 | |
---|
1971 | | - cLabel aniso = GetLabel("icons/shadericons/shadericon00008.png", !Grafreed.NIMBUSLAF); |
---|
| 2206 | + cLabel aniso = GetLabel("icons/shadericons/shadericon00008.png", !Globals.NIMBUSLAF); |
---|
1972 | 2207 | aniso.setToolTipText("AnisoU"); |
---|
1973 | 2208 | aniso.addMouseListener(new MouseAdapter() |
---|
1974 | 2209 | { |
---|
.. | .. |
---|
1986 | 2221 | }); |
---|
1987 | 2222 | presetpanel.add(aniso); |
---|
1988 | 2223 | |
---|
1989 | | - cLabel aniso2 = GetLabel("icons/shadericons/shadericon00009.png", !Grafreed.NIMBUSLAF); |
---|
| 2224 | + cLabel aniso2 = GetLabel("icons/shadericons/shadericon00009.png", !Globals.NIMBUSLAF); |
---|
1990 | 2225 | aniso2.setToolTipText("AnisoV"); |
---|
1991 | 2226 | aniso2.addMouseListener(new MouseAdapter() |
---|
1992 | 2227 | { |
---|
.. | .. |
---|
2004 | 2239 | }); |
---|
2005 | 2240 | presetpanel.add(aniso2); |
---|
2006 | 2241 | |
---|
2007 | | - cLabel aniso3 = GetLabel("icons/shadericons/shadericon00010.png", !Grafreed.NIMBUSLAF); |
---|
| 2242 | + cLabel aniso3 = GetLabel("icons/shadericons/shadericon00010.png", !Globals.NIMBUSLAF); |
---|
2008 | 2243 | aniso3.setToolTipText("AnisoUV"); |
---|
2009 | 2244 | aniso3.addMouseListener(new MouseAdapter() |
---|
2010 | 2245 | { |
---|
.. | .. |
---|
2022 | 2257 | }); |
---|
2023 | 2258 | presetpanel.add(aniso3); |
---|
2024 | 2259 | |
---|
2025 | | - cLabel velvet0 = GetLabel("icons/shadericons/shadericon00015.png", !Grafreed.NIMBUSLAF); |
---|
| 2260 | + cLabel velvet0 = GetLabel("icons/shadericons/shadericon00015.png", !Globals.NIMBUSLAF); |
---|
2026 | 2261 | velvet0.setToolTipText("Velvet"); |
---|
2027 | 2262 | velvet0.addMouseListener(new MouseAdapter() |
---|
2028 | 2263 | { |
---|
.. | .. |
---|
2044 | 2279 | }); |
---|
2045 | 2280 | presetpanel.add(velvet0); |
---|
2046 | 2281 | |
---|
2047 | | - cLabel bump0 = GetLabel("icons/shadericons/shadericon00016.png", !Grafreed.NIMBUSLAF); |
---|
| 2282 | + cLabel bump0 = GetLabel("icons/shadericons/shadericon00016.png", !Globals.NIMBUSLAF); |
---|
2048 | 2283 | bump0.setToolTipText("Bump texture"); |
---|
2049 | 2284 | bump0.addMouseListener(new MouseAdapter() |
---|
2050 | 2285 | { |
---|
.. | .. |
---|
2063 | 2298 | }); |
---|
2064 | 2299 | presetpanel.add(bump0); |
---|
2065 | 2300 | |
---|
2066 | | - cLabel halo = GetLabel("icons/shadericons/shadericon00017.png", !Grafreed.NIMBUSLAF); |
---|
| 2301 | + cLabel borderShader = GetLabel("icons/shadericons/borderfade.jpg", !Globals.NIMBUSLAF); |
---|
| 2302 | + borderShader.setToolTipText("Border fade"); |
---|
| 2303 | + borderShader.addMouseListener(new MouseAdapter() |
---|
| 2304 | + { |
---|
| 2305 | + public void mouseClicked(MouseEvent e) |
---|
| 2306 | + { |
---|
| 2307 | + borderfadeField.setFloat(0.5); |
---|
| 2308 | + opacityField.setFloat(0.75); |
---|
| 2309 | + |
---|
| 2310 | + materialtouched = true; |
---|
| 2311 | + applySelf(); |
---|
| 2312 | + } |
---|
| 2313 | + }); |
---|
| 2314 | + presetpanel.add(borderShader); |
---|
| 2315 | + |
---|
| 2316 | + cLabel halo = GetLabel("icons/shadericons/shadericon00017.png", !Globals.NIMBUSLAF); |
---|
2067 | 2317 | halo.setToolTipText("Halo"); |
---|
2068 | 2318 | halo.addMouseListener(new MouseAdapter() |
---|
2069 | 2319 | { |
---|
.. | .. |
---|
2080 | 2330 | }); |
---|
2081 | 2331 | presetpanel.add(halo); |
---|
2082 | 2332 | |
---|
2083 | | - cLabel candle = GetLabel("icons/shadericons/shadericon00018.png", !Grafreed.NIMBUSLAF); |
---|
| 2333 | + cLabel candle = GetLabel("icons/shadericons/shadericon00018.png", !Globals.NIMBUSLAF); |
---|
2084 | 2334 | candle.setToolTipText("Candle"); |
---|
2085 | 2335 | candle.addMouseListener(new MouseAdapter() |
---|
2086 | 2336 | { |
---|
.. | .. |
---|
2102 | 2352 | }); |
---|
2103 | 2353 | presetpanel.add(candle); |
---|
2104 | 2354 | |
---|
| 2355 | + cLabel shadowShader = GetLabel("icons/shadericons/shadow.png", !Globals.NIMBUSLAF); |
---|
| 2356 | + shadowShader.setToolTipText("Shadow"); |
---|
| 2357 | + shadowShader.addMouseListener(new MouseAdapter() |
---|
| 2358 | + { |
---|
| 2359 | + public void mouseClicked(MouseEvent e) |
---|
| 2360 | + { |
---|
| 2361 | + diffuseField.setFloat(0.001); |
---|
| 2362 | + ambientField.setFloat(0.001); |
---|
| 2363 | + cameraField.setFloat(0.001); |
---|
| 2364 | + specularField.setFloat(0.001); |
---|
| 2365 | + fakedepthField.setFloat(0.001); |
---|
| 2366 | + opacityField.setFloat(0.6); |
---|
| 2367 | + |
---|
| 2368 | + materialtouched = true; |
---|
| 2369 | + applySelf(); |
---|
| 2370 | + } |
---|
| 2371 | + }); |
---|
| 2372 | + presetpanel.add(shadowShader); |
---|
| 2373 | + |
---|
2105 | 2374 | cGridBag panel = new cGridBag().setVertical(true); |
---|
2106 | 2375 | |
---|
2107 | 2376 | presetpanel.preferredWidth = 1; |
---|
.. | .. |
---|
2118 | 2387 | |
---|
2119 | 2388 | cGridBag editBar = new cGridBag().setVertical(false); |
---|
2120 | 2389 | |
---|
2121 | | - editBar.add(createMaterialButton = new cButton("Create", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 2390 | + editBar.add(createMaterialButton = new cButton("Create", !Globals.NIMBUSLAF)); // , aConstraints); |
---|
2122 | 2391 | createMaterialButton.setToolTipText("Create material"); |
---|
2123 | 2392 | |
---|
2124 | 2393 | /* |
---|
2125 | 2394 | ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints); |
---|
2126 | 2395 | */ |
---|
2127 | 2396 | |
---|
2128 | | - editBar.add(clearMaterialButton = new cButton("Clear", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 2397 | + editBar.add(clearMaterialButton = new cButton("Clear", !Globals.NIMBUSLAF)); // , aConstraints); |
---|
2129 | 2398 | clearMaterialButton.setToolTipText("Clear material"); |
---|
2130 | 2399 | |
---|
2131 | 2400 | if (Globals.ADVANCED) |
---|
2132 | 2401 | { |
---|
2133 | | - editBar.add(resetSlidersButton = new cButton("Reset", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 2402 | + editBar.add(resetSlidersButton = new cButton("Reset", !Globals.NIMBUSLAF)); // , aConstraints); |
---|
2134 | 2403 | editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints); |
---|
2135 | 2404 | editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints); |
---|
2136 | 2405 | } |
---|
.. | .. |
---|
2151 | 2420 | |
---|
2152 | 2421 | cGridBag huepanel = new cGridBag(); |
---|
2153 | 2422 | cGridBag huelabel = new cGridBag(); |
---|
2154 | | - skin = GetLabel("icons/hue.png", false); |
---|
2155 | | - skin.fit = true; |
---|
2156 | | - huelabel.add(skin); |
---|
| 2423 | + cLabel hue = GetLabel("icons/hue.png", false); |
---|
| 2424 | + hue.fit = true; |
---|
| 2425 | + |
---|
| 2426 | + hue.addMouseListener(new MouseAdapter() |
---|
| 2427 | + { |
---|
| 2428 | + public void mousePressed(MouseEvent e) |
---|
| 2429 | + { |
---|
| 2430 | + int x = e.getX(); |
---|
| 2431 | + |
---|
| 2432 | + colorField.setFloat((double)x / ((cLabel)e.getSource()).getWidth()); |
---|
| 2433 | + } |
---|
| 2434 | + }); |
---|
| 2435 | + |
---|
| 2436 | + huelabel.add(hue); |
---|
2157 | 2437 | huelabel.preferredWidth = 20; |
---|
2158 | 2438 | huepanel.add(new cGridBag()); // Label |
---|
2159 | 2439 | huepanel.add(huelabel); // Field/slider |
---|
.. | .. |
---|
3429 | 3709 | |
---|
3430 | 3710 | if (multiplyToggle != null) |
---|
3431 | 3711 | 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 | | - } |
---|
| 3712 | + |
---|
| 3713 | + AllocProjectedVertices(object); |
---|
3458 | 3714 | |
---|
3459 | 3715 | SetMaterial(mat, object.projectedVertices); |
---|
3460 | 3716 | } |
---|
.. | .. |
---|
3574 | 3830 | public void itemStateChanged(ItemEvent event) |
---|
3575 | 3831 | { |
---|
3576 | 3832 | // System.out.println("Propagate = " + propagate); |
---|
| 3833 | + if (event.getSource() == pinButton) |
---|
| 3834 | + { |
---|
| 3835 | + copy.pinned ^= true; |
---|
| 3836 | + if (!copy.pinned && !copy.editWindow.copy.selection.contains(copy)) |
---|
| 3837 | + { |
---|
| 3838 | + ((GroupEditor)copy.editWindow).listUI.remove(copy); |
---|
| 3839 | + copy.CloseUI(); |
---|
| 3840 | + //copy.editWindow.refreshContents(); |
---|
| 3841 | + } |
---|
| 3842 | + } |
---|
| 3843 | + else |
---|
3577 | 3844 | if (event.getSource() == propagateToggle) |
---|
3578 | 3845 | { |
---|
3579 | 3846 | propagate ^= true; |
---|
.. | .. |
---|
3753 | 4020 | //System.out.println("ObjEditor " + event); |
---|
3754 | 4021 | applySelf0(true); |
---|
3755 | 4022 | //parent.applySelf(); |
---|
3756 | | - objEditor.refreshContents(); |
---|
| 4023 | + // conflicts with requestFocus objEditor.refreshContents(); |
---|
3757 | 4024 | } else if (source == resetButton) |
---|
3758 | 4025 | { |
---|
3759 | 4026 | CameraPane.fullreset = true; |
---|
.. | .. |
---|
3933 | 4200 | |
---|
3934 | 4201 | void New() |
---|
3935 | 4202 | { |
---|
3936 | | - while (copy.Size() > 1) |
---|
| 4203 | + while (copy.Size() > 0) |
---|
3937 | 4204 | { |
---|
3938 | | - copy.remove(1); |
---|
| 4205 | + copy.remove(0); |
---|
3939 | 4206 | } |
---|
3940 | 4207 | |
---|
| 4208 | + copy.selection.clear(); |
---|
| 4209 | + |
---|
| 4210 | + if (copy == Grafreed.grafreed.universe) |
---|
| 4211 | + { |
---|
| 4212 | + CreateCameras(); |
---|
| 4213 | + cameraView.SetCamera(GetCamera(copy, 0)); |
---|
| 4214 | + } |
---|
3941 | 4215 | ResetModel(); |
---|
3942 | 4216 | objEditor.refreshContents(); |
---|
3943 | 4217 | } |
---|
.. | .. |
---|
4046 | 4320 | { |
---|
4047 | 4321 | //Save(true); |
---|
4048 | 4322 | Replace(); |
---|
4049 | | - SetUndoStates(); |
---|
| 4323 | + SetVersionStates(); |
---|
4050 | 4324 | } |
---|
4051 | 4325 | |
---|
4052 | 4326 | private boolean Equal(byte[] compress, byte[] name) |
---|
.. | .. |
---|
4065 | 4339 | return true; |
---|
4066 | 4340 | } |
---|
4067 | 4341 | |
---|
4068 | | - java.util.Hashtable<java.util.UUID, Object3D> versiontable = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
4069 | | - |
---|
4070 | 4342 | void DeleteVersion() |
---|
4071 | 4343 | { |
---|
4072 | 4344 | for (int i = copy.versionindex; i < copy.versionlist.length-1; i++) |
---|
.. | .. |
---|
4074 | 4346 | copy.versionlist[i] = copy.versionlist[i+1]; |
---|
4075 | 4347 | } |
---|
4076 | 4348 | |
---|
4077 | | - CopyChanged(); |
---|
| 4349 | + if (copy.versionlist[copy.versionindex] == null) |
---|
| 4350 | + copy.versionindex -= 1; |
---|
4078 | 4351 | |
---|
4079 | | - SetUndoStates(); |
---|
| 4352 | + if (copy.versionindex != -1) |
---|
| 4353 | + CopyChanged(); |
---|
| 4354 | + |
---|
| 4355 | + SetVersionStates(); |
---|
4080 | 4356 | } |
---|
4081 | 4357 | |
---|
4082 | 4358 | public boolean Save(boolean user) |
---|
4083 | 4359 | { |
---|
4084 | 4360 | System.err.println("Save"); |
---|
4085 | | - //Replace(); |
---|
| 4361 | + Replace(); |
---|
4086 | 4362 | |
---|
4087 | | - cRadio tab = GetCurrentTab(); |
---|
| 4363 | + //cRadio tab = GetCurrentTab(); |
---|
4088 | 4364 | |
---|
4089 | | - Object3D compress = CompressCopy(); // Saved version. No need for "Replace"? |
---|
| 4365 | + Object3D compress = Duplicate(copy); // Saved version. No need for "Replace"? |
---|
4090 | 4366 | |
---|
4091 | 4367 | boolean thesame = false; |
---|
4092 | 4368 | |
---|
.. | .. |
---|
4122 | 4398 | // copy.versionlist[i] = null; |
---|
4123 | 4399 | // } |
---|
4124 | 4400 | |
---|
4125 | | - SetUndoStates(); |
---|
| 4401 | + SetVersionStates(); |
---|
4126 | 4402 | |
---|
4127 | 4403 | // test save |
---|
4128 | 4404 | if (false) |
---|
.. | .. |
---|
4180 | 4456 | |
---|
4181 | 4457 | void CopyChanged() |
---|
4182 | 4458 | { |
---|
4183 | | - Object3D obj = copy.versionlist[copy.versionindex]; |
---|
| 4459 | + Object3D obj = (Object3D)Grafreed.clone(copy.versionlist[copy.versionindex]); |
---|
4184 | 4460 | |
---|
4185 | | - SetUndoStates(); |
---|
| 4461 | + SetVersionStates(); |
---|
4186 | 4462 | |
---|
4187 | 4463 | boolean temp = CameraPane.SWITCH; |
---|
4188 | 4464 | CameraPane.SWITCH = false; |
---|
4189 | 4465 | |
---|
4190 | | - copy.ExtractBigData(versiontable); |
---|
| 4466 | + copy.ExtractBigData(Grafreed.grafreed.universe.versiontable); |
---|
4191 | 4467 | |
---|
4192 | 4468 | copy.clear(); |
---|
4193 | 4469 | |
---|
.. | .. |
---|
4199 | 4475 | copy.add(obj.get(i)); |
---|
4200 | 4476 | } |
---|
4201 | 4477 | |
---|
4202 | | - copy.RestoreBigData(versiontable); |
---|
| 4478 | + copy.RestoreBigData(Grafreed.grafreed.universe.versiontable); |
---|
4203 | 4479 | |
---|
4204 | 4480 | CameraPane.SWITCH = temp; |
---|
4205 | 4481 | |
---|
.. | .. |
---|
4249 | 4525 | return count; |
---|
4250 | 4526 | } |
---|
4251 | 4527 | |
---|
4252 | | - void SetUndoStates() |
---|
| 4528 | + public cGridBag versionSliderPane; |
---|
| 4529 | + |
---|
| 4530 | + void SetVersionStates() |
---|
4253 | 4531 | { |
---|
4254 | | - cRadio tab = GetCurrentTab(); |
---|
| 4532 | + //if (true) |
---|
| 4533 | + // return; |
---|
| 4534 | + |
---|
| 4535 | + //cRadio tab = GetCurrentTab(); |
---|
4255 | 4536 | |
---|
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; |
---|
| 4537 | + if (copy.versionlist == null) |
---|
| 4538 | + { |
---|
| 4539 | + saveVersionButton.setEnabled(false); |
---|
| 4540 | + restoreButton.setEnabled(false); |
---|
| 4541 | + replaceButton.setEnabled(false); |
---|
| 4542 | + previousVersionButton.setEnabled(false); |
---|
| 4543 | + nextVersionButton.setEnabled(false); |
---|
| 4544 | + deleteVersionButton.setEnabled(false); |
---|
| 4545 | + versionSliderPane.setVisible(false); |
---|
| 4546 | + } |
---|
| 4547 | + else |
---|
| 4548 | + { |
---|
| 4549 | + restoreButton.setEnabled(copy.versionindex != -1); |
---|
| 4550 | + replaceButton.setEnabled(copy.versionindex != -1); |
---|
| 4551 | + |
---|
| 4552 | + previousVersionButton.setEnabled(copy.versionindex > 0); |
---|
| 4553 | + nextVersionButton.setEnabled(copy.versionlist[copy.versionindex + 1] != null); |
---|
| 4554 | + |
---|
| 4555 | + deleteVersionButton.setEnabled(copy.versionindex != -1); |
---|
| 4556 | + //copy.versionlist[copy.versionindex + 1] != null); |
---|
| 4557 | + |
---|
| 4558 | + muteSlider = true; |
---|
| 4559 | + versionSlider.setMinimum(0); |
---|
| 4560 | + versionSlider.setMaximum(VersionCount() - 1); |
---|
| 4561 | + versionSlider.setInteger(copy.versionindex); |
---|
| 4562 | + versionSlider.setEnabled(copy.versionindex != -1); |
---|
| 4563 | + muteSlider = false; |
---|
| 4564 | + |
---|
| 4565 | + versionSliderPane.setVisible(true); |
---|
| 4566 | + } |
---|
4269 | 4567 | } |
---|
4270 | 4568 | |
---|
4271 | 4569 | public boolean PreviousVersion() |
---|
.. | .. |
---|
4275 | 4573 | |
---|
4276 | 4574 | System.err.println("Undo"); |
---|
4277 | 4575 | |
---|
4278 | | - cRadio tab = GetCurrentTab(); |
---|
| 4576 | + //cRadio tab = GetCurrentTab(); |
---|
4279 | 4577 | |
---|
4280 | 4578 | if (copy.versionindex == 0) |
---|
4281 | 4579 | { |
---|
.. | .. |
---|
4307 | 4605 | { |
---|
4308 | 4606 | System.err.println("Restore"); |
---|
4309 | 4607 | |
---|
4310 | | - cRadio tab = GetCurrentTab(); |
---|
| 4608 | + //cRadio tab = GetCurrentTab(); |
---|
4311 | 4609 | |
---|
4312 | 4610 | if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
4313 | 4611 | { |
---|
.. | .. |
---|
4323 | 4621 | |
---|
4324 | 4622 | public boolean Replace() |
---|
4325 | 4623 | { |
---|
4326 | | - System.err.println("Replace"); |
---|
| 4624 | + //System.err.println("Replace"); |
---|
4327 | 4625 | |
---|
4328 | | - cRadio tab = GetCurrentTab(); |
---|
| 4626 | + //cRadio tab = GetCurrentTab(); |
---|
4329 | 4627 | |
---|
4330 | 4628 | if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
4331 | 4629 | { |
---|
.. | .. |
---|
4333 | 4631 | return false; |
---|
4334 | 4632 | } |
---|
4335 | 4633 | |
---|
4336 | | - copy.versionlist[copy.versionindex] = CompressCopy(); |
---|
| 4634 | + copy.versionlist[copy.versionindex] = Duplicate(copy); |
---|
4337 | 4635 | |
---|
4338 | 4636 | return true; |
---|
4339 | 4637 | } |
---|
.. | .. |
---|
4343 | 4641 | // Option? |
---|
4344 | 4642 | Replace(); |
---|
4345 | 4643 | |
---|
4346 | | - cRadio tab = GetCurrentTab(); |
---|
| 4644 | + //cRadio tab = GetCurrentTab(); |
---|
4347 | 4645 | |
---|
4348 | 4646 | if (copy.versionlist[copy.versionindex + 1] == null) |
---|
4349 | 4647 | { |
---|
.. | .. |
---|
4550 | 4848 | // else |
---|
4551 | 4849 | // applySelf(true); |
---|
4552 | 4850 | // } |
---|
| 4851 | + |
---|
| 4852 | + boolean Equal(double a, double b) |
---|
| 4853 | + { |
---|
| 4854 | + return Math.abs(a - b) < 0.001; |
---|
| 4855 | + } |
---|
| 4856 | + |
---|
4553 | 4857 | void applySelf0(boolean name) |
---|
4554 | 4858 | { |
---|
4555 | 4859 | if (name) |
---|
.. | .. |
---|
4599 | 4903 | { |
---|
4600 | 4904 | cMaterial mat = copy.material; |
---|
4601 | 4905 | |
---|
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)); |
---|
| 4906 | + if (!Equal(colorField.getFloat(), mat.color)) |
---|
| 4907 | + colorField.SetToolTipValue((mat.color)); |
---|
| 4908 | + if (!Equal(saturationField.getFloat(), mat.modulation)) |
---|
| 4909 | + saturationField.SetToolTipValue((mat.modulation)); |
---|
| 4910 | + if (!Equal(metalnessField.getFloat(), mat.metalness)) |
---|
| 4911 | + metalnessField.SetToolTipValue((mat.metalness)); |
---|
| 4912 | + if (!Equal(diffuseField.getFloat(), mat.diffuse)) |
---|
| 4913 | + diffuseField.SetToolTipValue((mat.diffuse)); |
---|
| 4914 | + if (!Equal(specularField.getFloat(), mat.specular)) |
---|
| 4915 | + specularField.SetToolTipValue((mat.specular)); |
---|
| 4916 | + if (!Equal(shininessField.getFloat(), mat.shininess)) |
---|
| 4917 | + shininessField.SetToolTipValue((mat.shininess)); |
---|
| 4918 | + if (!Equal(shiftField.getFloat(), mat.shift)) |
---|
| 4919 | + shiftField.SetToolTipValue((mat.shift)); |
---|
| 4920 | + if (!Equal(ambientField.getFloat(), mat.ambient)) |
---|
| 4921 | + ambientField.SetToolTipValue((mat.ambient)); |
---|
| 4922 | + if (!Equal(lightareaField.getFloat(), mat.lightarea)) |
---|
| 4923 | + lightareaField.SetToolTipValue((mat.lightarea)); |
---|
| 4924 | + if (!Equal(diffusenessField.getFloat(), mat.factor)) |
---|
| 4925 | + diffusenessField.SetToolTipValue((mat.factor)); |
---|
| 4926 | + if (!Equal(velvetField.getFloat(), mat.velvet)) |
---|
| 4927 | + velvetField.SetToolTipValue((mat.velvet)); |
---|
| 4928 | + if (!Equal(sheenField.getFloat(), mat.sheen)) |
---|
| 4929 | + sheenField.SetToolTipValue((mat.sheen)); |
---|
| 4930 | + if (!Equal(subsurfaceField.getFloat(), mat.subsurface)) |
---|
| 4931 | + subsurfaceField.SetToolTipValue((mat.subsurface)); |
---|
| 4932 | + if (!Equal(backlitField.getFloat(), mat.bump)) |
---|
| 4933 | + backlitField.SetToolTipValue((mat.bump)); |
---|
| 4934 | + if (!Equal(anisoField.getFloat(), mat.aniso)) |
---|
| 4935 | + anisoField.SetToolTipValue((mat.aniso)); |
---|
| 4936 | + if (!Equal(anisoVField.getFloat(), mat.anisoV)) |
---|
| 4937 | + anisoVField.SetToolTipValue((mat.anisoV)); |
---|
| 4938 | + if (!Equal(cameraField.getFloat(), mat.cameralight)) |
---|
| 4939 | + cameraField.SetToolTipValue((mat.cameralight)); |
---|
| 4940 | + if (!Equal(selfshadowField.getFloat(), mat.diffuseness)) |
---|
| 4941 | + selfshadowField.SetToolTipValue((mat.diffuseness)); |
---|
| 4942 | + if (!Equal(shadowField.getFloat(), mat.shadow)) |
---|
| 4943 | + shadowField.SetToolTipValue((mat.shadow)); |
---|
| 4944 | + if (!Equal(textureField.getFloat(), mat.texture)) |
---|
| 4945 | + textureField.SetToolTipValue((mat.texture)); |
---|
| 4946 | + if (!Equal(opacityField.getFloat(), mat.opacity)) |
---|
| 4947 | + opacityField.SetToolTipValue((mat.opacity)); |
---|
| 4948 | + if (!Equal(fakedepthField.getFloat(), mat.fakedepth)) |
---|
| 4949 | + fakedepthField.SetToolTipValue((mat.fakedepth)); |
---|
| 4950 | + if (!Equal(shadowbiasField.getFloat(), mat.shadowbias)) |
---|
| 4951 | + shadowbiasField.SetToolTipValue((mat.shadowbias)); |
---|
4625 | 4952 | } |
---|
4626 | 4953 | |
---|
4627 | 4954 | if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null) |
---|
.. | .. |
---|
4656 | 4983 | |
---|
4657 | 4984 | public void stateChanged(ChangeEvent e) |
---|
4658 | 4985 | { |
---|
4659 | | - // assert(false); |
---|
| 4986 | + // assert(false); |
---|
4660 | 4987 | if (e.getSource() == versionSlider) |
---|
4661 | 4988 | { |
---|
4662 | 4989 | if (muteSlider) |
---|
4663 | 4990 | return; |
---|
4664 | 4991 | |
---|
| 4992 | + Replace(); |
---|
| 4993 | + |
---|
4665 | 4994 | int version = versionSlider.getInteger(); |
---|
4666 | 4995 | |
---|
4667 | | - if (copy.versionlist[version] != null) |
---|
| 4996 | + if (version != -1 && copy.versionlist[version] != null) |
---|
4668 | 4997 | { |
---|
4669 | 4998 | copy.versionindex = version; |
---|
4670 | 4999 | CopyChanged(); |
---|
.. | .. |
---|
4708 | 5037 | //System.out.println("stateChanged = " + this); |
---|
4709 | 5038 | materialtouched = true; |
---|
4710 | 5039 | |
---|
4711 | | - if (e.getSource() == colorField && saturationField.getFloat() == 0.001) |
---|
| 5040 | + if (Globals.AUTOSATURATE && e.getSource() == colorField && saturationField.getFloat() == 0.001) |
---|
4712 | 5041 | { |
---|
4713 | 5042 | saturationField.setFloat(1); |
---|
4714 | 5043 | } |
---|
.. | .. |
---|
5023 | 5352 | } |
---|
5024 | 5353 | |
---|
5025 | 5354 | if (previousVersionButton != null && copy.versionlist != null) |
---|
5026 | | - SetUndoStates(); |
---|
| 5355 | + SetVersionStates(); |
---|
| 5356 | + |
---|
| 5357 | + cameraView.requestFocusInWindow(); |
---|
5027 | 5358 | } |
---|
5028 | 5359 | |
---|
5029 | 5360 | static TweenManager tweenManager = new TweenManager(); |
---|
.. | .. |
---|
5055 | 5386 | // group = (Composite) group.get(0); |
---|
5056 | 5387 | // } |
---|
5057 | 5388 | |
---|
5058 | | - System.out.println("makeSomething of " + thing); |
---|
| 5389 | + //System.out.println("makeSomething of " + thing); |
---|
5059 | 5390 | |
---|
5060 | 5391 | /* |
---|
5061 | 5392 | if (deselect && jList != null) |
---|
.. | .. |
---|
5409 | 5740 | |
---|
5410 | 5741 | copy.versionlist = readobj.versionlist; |
---|
5411 | 5742 | copy.versionindex = readobj.versionindex; |
---|
| 5743 | + copy.versiontable = readobj.versiontable; |
---|
5412 | 5744 | |
---|
5413 | 5745 | if (copy.versionlist == null) |
---|
5414 | 5746 | { |
---|
| 5747 | + // Backward compatibility |
---|
5415 | 5748 | copy.versionlist = new Object3D[100]; |
---|
5416 | 5749 | copy.versionindex = -1; |
---|
| 5750 | + |
---|
| 5751 | + //Save(true); |
---|
5417 | 5752 | } |
---|
5418 | 5753 | |
---|
5419 | 5754 | //? SetUndoStates(); |
---|
.. | .. |
---|
5505 | 5840 | |
---|
5506 | 5841 | void save() |
---|
5507 | 5842 | { |
---|
| 5843 | + Replace(); |
---|
| 5844 | + |
---|
5508 | 5845 | if (lastname == null) |
---|
5509 | 5846 | { |
---|
5510 | 5847 | return; |
---|
.. | .. |
---|
5747 | 6084 | ButtonGroup buttonGroup; |
---|
5748 | 6085 | |
---|
5749 | 6086 | cGridBag toolboxPanel; |
---|
| 6087 | + cGridBag skyboxPanel; |
---|
5750 | 6088 | cGridBag materialPanel; |
---|
5751 | 6089 | cGridBag ctrlPanel; |
---|
5752 | 6090 | |
---|
.. | .. |
---|
5758 | 6096 | boolean materialFlushed; |
---|
5759 | 6097 | Object3D latestObject; |
---|
5760 | 6098 | |
---|
| 6099 | + cGridBag transformPanel; |
---|
5761 | 6100 | cGridBag XYZPanel; |
---|
5762 | 6101 | |
---|
5763 | 6102 | JSplitPane gridPanel; |
---|
.. | .. |
---|
5851 | 6190 | cNumberSlider anisoField; |
---|
5852 | 6191 | JLabel anisoVLabel; |
---|
5853 | 6192 | cNumberSlider anisoVField; |
---|
| 6193 | + |
---|
5854 | 6194 | JLabel cameraLabel; |
---|
5855 | 6195 | cNumberSlider cameraField; |
---|
5856 | 6196 | JLabel selfshadowLabel; |
---|
.. | .. |
---|
5865 | 6205 | cNumberSlider fakedepthField; |
---|
5866 | 6206 | JLabel shadowbiasLabel; |
---|
5867 | 6207 | cNumberSlider shadowbiasField; |
---|
| 6208 | + |
---|
5868 | 6209 | JLabel bumpLabel; |
---|
5869 | 6210 | cNumberSlider bumpField; |
---|
5870 | 6211 | JLabel noiseLabel; |
---|