.. | .. |
---|
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 cGridBag GetSeparator() |
---|
| 76 | + { |
---|
| 77 | + cGridBag separator = new cGridBag(); |
---|
| 78 | + separator.add(new JSeparator()); |
---|
| 79 | + separator.preferredHeight = 5; |
---|
| 80 | + return separator; |
---|
| 81 | + } |
---|
44 | 82 | |
---|
45 | 83 | cButton GetButton(String name, boolean border) |
---|
46 | 84 | { |
---|
47 | 85 | ImageIcon icon = GetIcon(name); |
---|
48 | | - return new cButton(icon, border); |
---|
| 86 | + if (icon != null) |
---|
| 87 | + return new cButton(icon, border); |
---|
| 88 | + else |
---|
| 89 | + return new cButton(name, border); |
---|
| 90 | + } |
---|
| 91 | + |
---|
| 92 | + cLabel GetLabel(String name, boolean border) |
---|
| 93 | + { |
---|
| 94 | + //ImageIcon icon = GetIcon(name); |
---|
| 95 | + return new cLabel(GetImage(name), border); |
---|
49 | 96 | } |
---|
50 | 97 | |
---|
51 | 98 | cToggleButton GetToggleButton(String name, boolean border) |
---|
.. | .. |
---|
60 | 107 | return new cCheckBox(icon, border); |
---|
61 | 108 | } |
---|
62 | 109 | |
---|
63 | | - 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) |
---|
64 | 113 | { |
---|
| 114 | + javax.swing.ImageIcon iconCache = icons.get(name); |
---|
| 115 | + if (iconCache != null) |
---|
| 116 | + { |
---|
| 117 | + return iconCache; |
---|
| 118 | + } |
---|
| 119 | + |
---|
65 | 120 | try |
---|
66 | 121 | { |
---|
67 | | - BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name)); |
---|
| 122 | + BufferedImage image = javax.imageio.ImageIO.read(ObjEditor.class.getClassLoader().getResourceAsStream(name)); |
---|
68 | 123 | |
---|
69 | 124 | // if (image.getWidth() > 48 && image.getHeight() > 48) |
---|
70 | 125 | // { |
---|
.. | .. |
---|
79 | 134 | // } |
---|
80 | 135 | |
---|
81 | 136 | javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image); |
---|
| 137 | + |
---|
| 138 | + icons.put(name, icon); |
---|
| 139 | + |
---|
82 | 140 | return icon; |
---|
| 141 | + } |
---|
| 142 | + catch (Exception e) |
---|
| 143 | + { |
---|
| 144 | + //icons.put(name, null); |
---|
| 145 | + return null; |
---|
| 146 | + } |
---|
| 147 | + } |
---|
| 148 | + |
---|
| 149 | + BufferedImage GetImage(String name) |
---|
| 150 | + { |
---|
| 151 | + try |
---|
| 152 | + { |
---|
| 153 | + BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name)); |
---|
| 154 | + |
---|
| 155 | + return image; |
---|
83 | 156 | } |
---|
84 | 157 | catch (Exception e) |
---|
85 | 158 | { |
---|
.. | .. |
---|
268 | 341 | client = inClient; |
---|
269 | 342 | copy = client; |
---|
270 | 343 | |
---|
271 | | - if (copy.versions == null) |
---|
272 | | - { |
---|
273 | | - copy.versions = new byte[100][]; |
---|
274 | | - copy.versionindex = -1; |
---|
275 | | - } |
---|
| 344 | +// if (copy.versionlist == null) |
---|
| 345 | +// { |
---|
| 346 | +// copy.versionlist = new Object3D[100]; |
---|
| 347 | +// copy.versionindex = -1; |
---|
| 348 | +// |
---|
| 349 | +// callee.Save(true); |
---|
| 350 | +// } |
---|
276 | 351 | |
---|
277 | 352 | // "this" is not called: SetupUI2(objEditor); |
---|
278 | 353 | } |
---|
.. | .. |
---|
287 | 362 | client = inClient; |
---|
288 | 363 | copy = client; |
---|
289 | 364 | |
---|
290 | | - if (copy.versions == null) |
---|
| 365 | + if (copy.versionlist == null) |
---|
291 | 366 | { |
---|
292 | | - copy.versions = new byte[100][]; |
---|
| 367 | + copy.versionlist = new Object3D[100]; |
---|
293 | 368 | copy.versionindex = -1; |
---|
| 369 | + |
---|
| 370 | +// Save(true); |
---|
294 | 371 | } |
---|
295 | 372 | |
---|
296 | 373 | SetupUI2(callee.GetEditor()); |
---|
.. | .. |
---|
314 | 391 | //parent = p; |
---|
315 | 392 | |
---|
316 | 393 | GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice(); |
---|
317 | | - System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow()); |
---|
| 394 | + if (Globals.DEBUG) |
---|
| 395 | + System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow()); |
---|
318 | 396 | //gd.setFullScreenWindow(this); |
---|
319 | 397 | //setResizable(false); |
---|
320 | 398 | //if (!isDisplayable()) |
---|
.. | .. |
---|
325 | 403 | copy = localCopy; |
---|
326 | 404 | copy.editWindow = this; |
---|
327 | 405 | |
---|
328 | | - if (copy.versions == null) |
---|
329 | | - { |
---|
330 | | -// copy.versions = new byte[100][]; |
---|
| 406 | +// if (copy.versionlist == null) |
---|
| 407 | +// { |
---|
| 408 | +// copy.versionlist = new Object3D[100]; |
---|
331 | 409 | // copy.versionindex = -1; |
---|
332 | | - } |
---|
| 410 | +// |
---|
| 411 | +// Save(true); |
---|
| 412 | +// } |
---|
333 | 413 | |
---|
334 | 414 | SetupMenu(); |
---|
335 | 415 | |
---|
.. | .. |
---|
349 | 429 | |
---|
350 | 430 | static java.util.Vector<Object3D> listUI = new java.util.Vector<Object3D>(); |
---|
351 | 431 | |
---|
| 432 | + // This is to refresh the UI of the material panel. |
---|
| 433 | + boolean patchMaterial; |
---|
| 434 | + |
---|
352 | 435 | void SetupMenu() |
---|
353 | 436 | { |
---|
354 | 437 | frame.setMenuBar(menuBar = new MenuBar()); |
---|
.. | .. |
---|
398 | 481 | |
---|
399 | 482 | ChangeListener changeListener = new ChangeListener() |
---|
400 | 483 | { |
---|
| 484 | + //String name; |
---|
| 485 | + |
---|
401 | 486 | public void stateChanged(ChangeEvent changeEvent) |
---|
402 | 487 | { |
---|
403 | 488 | // if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Material") && !materialFlushed) |
---|
.. | .. |
---|
416 | 501 | // EditSelection(false); |
---|
417 | 502 | // } |
---|
418 | 503 | |
---|
419 | | - 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(); |
---|
420 | 535 | } |
---|
421 | 536 | }; |
---|
422 | 537 | objectPanel.addChangeListener(changeListener); |
---|
.. | .. |
---|
439 | 554 | toolboxPanel = new cGridBag().setVertical(true); |
---|
440 | 555 | //toolboxPanel.setName("Toolbox"); |
---|
441 | 556 | |
---|
442 | | - materialPanel = new cGridBag().setVertical(true); |
---|
| 557 | + skyboxPanel = new cGridBag().setVertical(true); |
---|
| 558 | + |
---|
| 559 | + materialPanel = new cGridBag().setVertical(false); |
---|
443 | 560 | //materialPanel.setName("Material"); |
---|
444 | 561 | |
---|
445 | 562 | /*JTextPane*/ |
---|
.. | .. |
---|
723 | 840 | boolean maximized; |
---|
724 | 841 | |
---|
725 | 842 | cButton fullscreenLayout; |
---|
| 843 | + cButton expandedLayout; |
---|
726 | 844 | |
---|
727 | 845 | void Minimize() |
---|
728 | 846 | { |
---|
.. | .. |
---|
762 | 880 | cButton minButton; |
---|
763 | 881 | cButton maxButton; |
---|
764 | 882 | cButton fullButton; |
---|
| 883 | + cButton collapseButton; |
---|
| 884 | + cButton maximize3DButton; |
---|
765 | 885 | |
---|
766 | 886 | void ToggleFullScreen() |
---|
767 | 887 | { |
---|
768 | | -GraphicsDevice device = frame.getGraphicsConfiguration().getDevice(); |
---|
| 888 | + GraphicsDevice device = frame.getGraphicsConfiguration().getDevice(); |
---|
769 | 889 | |
---|
770 | 890 | cameraView.ToggleFullScreen(); |
---|
771 | 891 | |
---|
.. | .. |
---|
786 | 906 | // X frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
787 | 907 | // X framePanel.add(bigThree); |
---|
788 | 908 | // X frame.getContentPane().add(/*"Center",*/framePanel); |
---|
789 | | - framePanel.setDividerLocation(46); |
---|
| 909 | +// framePanel.setDividerLocation(46); // icons are 24x24 |
---|
790 | 910 | |
---|
791 | 911 | //frame.setVisible(true); |
---|
792 | | - radio.layout = keepButton; |
---|
| 912 | +// radio.layout = keepButton; |
---|
793 | 913 | //theFrame = null; |
---|
794 | 914 | keepButton = null; |
---|
795 | | - radio.layout.doClick(); |
---|
| 915 | +// radio.layout.doClick(); |
---|
796 | 916 | |
---|
797 | 917 | } else |
---|
798 | 918 | { |
---|
.. | .. |
---|
813 | 933 | // X frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
814 | 934 | // X framePanel.remove(bigThree); |
---|
815 | 935 | // X frame.getContentPane().add(/*"Center",*/bigThree); |
---|
816 | | - framePanel.setDividerLocation(0); |
---|
| 936 | +// framePanel.setDividerLocation(0); |
---|
817 | 937 | |
---|
818 | | - radio.layout = fullscreenLayout; |
---|
819 | | - radio.layout.doClick(); |
---|
| 938 | +// radio.layout = fullscreenLayout; |
---|
| 939 | +// radio.layout.doClick(); |
---|
820 | 940 | //frame.setVisible(true); |
---|
821 | 941 | } |
---|
822 | 942 | frame.validate(); |
---|
| 943 | + |
---|
| 944 | + cameraView.requestFocusInWindow(); |
---|
823 | 945 | } |
---|
824 | 946 | |
---|
825 | | - private byte[] CompressCopy() |
---|
| 947 | + void CollapseToolbar() |
---|
| 948 | + { |
---|
| 949 | + framePanel.setDividerLocation(0); |
---|
| 950 | + //frame.validate(); |
---|
| 951 | + |
---|
| 952 | + cameraView.requestFocusInWindow(); |
---|
| 953 | + } |
---|
| 954 | + |
---|
| 955 | + private Object3D Duplicate(Object3D object) |
---|
826 | 956 | { |
---|
827 | 957 | boolean temp = CameraPane.SWITCH; |
---|
828 | 958 | CameraPane.SWITCH = false; |
---|
829 | 959 | |
---|
830 | | - 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); |
---|
831 | 964 | // if (copy == client) |
---|
832 | 965 | |
---|
833 | | - byte[] versions[] = copy.versions; |
---|
834 | | - copy.versions = 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; |
---|
835 | 970 | |
---|
836 | | - byte[] compress = Compress(copy); |
---|
| 971 | + Object3D parent = object.parent; |
---|
| 972 | + object.parent = null; |
---|
837 | 973 | |
---|
838 | | - copy.versions = versions; |
---|
| 974 | + //byte[] compress = Compress(copy); |
---|
| 975 | + Object3D compress = (Object3D)Grafreed.clone(object); |
---|
839 | 976 | |
---|
840 | | - copy.RestoreBigData(versiontable); |
---|
| 977 | + object.parent = parent; |
---|
| 978 | + |
---|
| 979 | + object.versionlist = versions; |
---|
| 980 | + object.versiontable = versiontable; // if Grafreed.grafreed.universe |
---|
| 981 | + |
---|
| 982 | + object.RestoreBigData(Grafreed.grafreed.universe.versiontable); |
---|
841 | 983 | |
---|
842 | 984 | CameraPane.SWITCH = temp; |
---|
843 | 985 | |
---|
.. | .. |
---|
965 | 1107 | { |
---|
966 | 1108 | SetupMaterial(materialPanel); |
---|
967 | 1109 | } |
---|
| 1110 | + |
---|
968 | 1111 | //SetupName(); |
---|
969 | 1112 | //SetupViews(); |
---|
970 | 1113 | } |
---|
.. | .. |
---|
1173 | 1316 | |
---|
1174 | 1317 | namePanel = new cGridBag(); |
---|
1175 | 1318 | |
---|
| 1319 | + //if (copy.pinned) |
---|
| 1320 | + { |
---|
| 1321 | + pinButton = GetToggleButton("icons/pin.png", !Grafreed.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 | + |
---|
1176 | 1331 | nameField = AddText(namePanel, copy.GetName()); |
---|
1177 | 1332 | namePanel.add(new JScrollPane(nameField, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER)); |
---|
1178 | 1333 | oe.ctrlPanel.add(namePanel); |
---|
.. | .. |
---|
1186 | 1341 | |
---|
1187 | 1342 | liveCB = AddCheckBox(setupPanel, "Live", copy.live); |
---|
1188 | 1343 | liveCB.setToolTipText("Animate object"); |
---|
| 1344 | + markCB = AddCheckBox(setupPanel, "Anim", copy.marked); |
---|
| 1345 | + markCB.setToolTipText("Set target transform"); |
---|
1189 | 1346 | selectableCB = AddCheckBox(setupPanel, "Select", !copy.dontselect); |
---|
1190 | 1347 | selectableCB.setToolTipText("Make object selectable"); |
---|
1191 | 1348 | // Return(); |
---|
1192 | 1349 | |
---|
1193 | 1350 | hideCB = AddCheckBox(setupPanel, "Hide", copy.hide); |
---|
1194 | 1351 | hideCB.setToolTipText("Hide object"); |
---|
1195 | | - markCB = AddCheckBox(setupPanel, "Mark", copy.marked); |
---|
1196 | | - markCB.setToolTipText("As animation target transform"); |
---|
1197 | 1352 | |
---|
1198 | 1353 | ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false); |
---|
1199 | 1354 | |
---|
.. | .. |
---|
1395 | 1550 | |
---|
1396 | 1551 | if (cam == null || !(copy.get(0) instanceof cGroup)) |
---|
1397 | 1552 | { |
---|
| 1553 | + if (Globals.DEBUG) |
---|
1398 | 1554 | System.out.println("CREATE CAMERAS"); |
---|
1399 | 1555 | cams = new cTemplate(); |
---|
1400 | 1556 | cams.name = "Cameras"; |
---|
.. | .. |
---|
1476 | 1632 | //frontView.object = copy; |
---|
1477 | 1633 | //sideView.object = copy; |
---|
1478 | 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", !Grafreed.NIMBUSLAF); |
---|
| 1642 | + resetTransform.addMouseListener(new MouseAdapter() |
---|
| 1643 | + { |
---|
| 1644 | + public void mouseClicked(MouseEvent e) |
---|
| 1645 | + { |
---|
| 1646 | + ResetTransform(); |
---|
| 1647 | + } |
---|
| 1648 | + }); |
---|
| 1649 | + resetTransformPanel.add(resetTransform); |
---|
| 1650 | + |
---|
| 1651 | + resetTransform = GetButton("T only", !Grafreed.NIMBUSLAF); |
---|
| 1652 | + resetTransform.addMouseListener(new MouseAdapter() |
---|
| 1653 | + { |
---|
| 1654 | + public void mouseClicked(MouseEvent e) |
---|
| 1655 | + { |
---|
| 1656 | + ResetTransform(1); |
---|
| 1657 | + } |
---|
| 1658 | + }); |
---|
| 1659 | + resetTransformPanel.add(resetTransform); |
---|
| 1660 | + |
---|
| 1661 | + resetTransform = GetButton("RS only", !Grafreed.NIMBUSLAF); |
---|
| 1662 | + resetTransform.addMouseListener(new MouseAdapter() |
---|
| 1663 | + { |
---|
| 1664 | + public void mouseClicked(MouseEvent e) |
---|
| 1665 | + { |
---|
| 1666 | + ResetTransform(2); |
---|
| 1667 | + } |
---|
| 1668 | + }); |
---|
| 1669 | + resetTransformPanel.add(resetTransform); |
---|
| 1670 | + |
---|
1479 | 1671 | XYZPanel = new cGridBag().setVertical(true); |
---|
1480 | 1672 | //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5)); |
---|
1481 | 1673 | |
---|
.. | .. |
---|
1485 | 1677 | XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll); |
---|
1486 | 1678 | //XYZPanel.setName("XYZ"); |
---|
1487 | 1679 | |
---|
| 1680 | + transformPanel.add(resetTransformPanel); |
---|
| 1681 | + transformPanel.add(XYZPanel); |
---|
| 1682 | + |
---|
1488 | 1683 | /* |
---|
1489 | 1684 | gridPanel = new JPanel(); //new BorderLayout()); |
---|
1490 | 1685 | gridPanel.setLayout(new GridLayout(1, 2)); |
---|
.. | .. |
---|
1492 | 1687 | gridPanel.add(cameraView); |
---|
1493 | 1688 | gridPanel.add(XYZPanel); |
---|
1494 | 1689 | */ |
---|
1495 | | - gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, centralPanel, XYZPanel); //new BorderLayout()); |
---|
1496 | | - gridPanel.setContinuousLayout(true); |
---|
1497 | | - gridPanel.setOneTouchExpandable(true); |
---|
1498 | | - gridPanel.setDividerLocation(1.0); |
---|
1499 | | - gridPanel.setDividerSize(9); |
---|
1500 | | - gridPanel.setResizeWeight(0.85); |
---|
| 1690 | +// gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, centralPanel, XYZPanel); //new BorderLayout()); |
---|
| 1691 | +// gridPanel.setContinuousLayout(true); |
---|
| 1692 | +// gridPanel.setOneTouchExpandable(true); |
---|
| 1693 | +// gridPanel.setDividerLocation(1.0); |
---|
| 1694 | +// gridPanel.setDividerSize(9); |
---|
| 1695 | +// gridPanel.setResizeWeight(0.85); |
---|
1501 | 1696 | |
---|
1502 | 1697 | // aConstraints.weighty = 0; |
---|
1503 | 1698 | //System.out.println("THIS = " + this); |
---|
.. | .. |
---|
1520 | 1715 | |
---|
1521 | 1716 | //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); |
---|
1522 | 1717 | //tmp.setName("Edit"); |
---|
| 1718 | + objectPanel.add(toolboxPanel); |
---|
| 1719 | + objectPanel.setIconAt(0, GetIcon("icons/primitives.png")); |
---|
| 1720 | + objectPanel.setToolTipTextAt(0, "Objects & textures"); |
---|
| 1721 | + |
---|
1523 | 1722 | objectPanel.add(materialPanel); |
---|
1524 | | - objectPanel.setIconAt(0, GetIcon("icons/material.png")); |
---|
| 1723 | + objectPanel.setIconAt(1, GetIcon("icons/material.png")); |
---|
| 1724 | + objectPanel.setToolTipTextAt(1, "Material"); |
---|
| 1725 | + |
---|
| 1726 | + objectPanel.add(skyboxPanel); |
---|
| 1727 | + objectPanel.setIconAt(2, GetIcon("icons/skybox.jpg")); |
---|
| 1728 | + objectPanel.setToolTipTextAt(2, "Backgrounds"); |
---|
| 1729 | + |
---|
1525 | 1730 | // JPanel north = new JPanel(new BorderLayout()); |
---|
1526 | 1731 | // north.setName("Edit"); |
---|
1527 | 1732 | // north.add(ctrlPanel, BorderLayout.NORTH); |
---|
1528 | 1733 | // objectPanel.add(north); |
---|
1529 | 1734 | objectPanel.add(editPanel); |
---|
1530 | | - objectPanel.setIconAt(1, GetIcon("icons/write.png")); |
---|
| 1735 | + objectPanel.setIconAt(3, GetIcon("icons/write.png")); |
---|
| 1736 | + objectPanel.setToolTipTextAt(3, "Edit controls"); |
---|
1531 | 1737 | |
---|
1532 | | - //if (Globals.ADVANCED) |
---|
1533 | | - objectPanel.add(infoPanel); |
---|
1534 | | - objectPanel.setIconAt(2, GetIcon("icons/info.png")); |
---|
| 1738 | + objectPanel.add(transformPanel); |
---|
| 1739 | + objectPanel.setIconAt(4, GetIcon("icons/XYZ.png")); |
---|
| 1740 | + objectPanel.setToolTipTextAt(4, "TRS transform"); |
---|
1535 | 1741 | |
---|
1536 | | - objectPanel.add(XYZPanel); |
---|
1537 | | - objectPanel.setIconAt(3, GetIcon("icons/XYZ.png")); |
---|
1538 | | - |
---|
1539 | | - objectPanel.add(toolboxPanel); |
---|
1540 | | - objectPanel.setIconAt(4, GetIcon("icons/primitives.png")); |
---|
1541 | | - |
---|
| 1742 | + patchMaterial = true; |
---|
| 1743 | + cameraView.patchMaterial = this; |
---|
| 1744 | + objectPanel.setSelectedIndex(1); |
---|
| 1745 | + |
---|
1542 | 1746 | /* |
---|
1543 | 1747 | aConstraints.gridx = 0; |
---|
1544 | 1748 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1558 | 1762 | scrollpane.addMouseWheelListener(this); // Default not fast enough |
---|
1559 | 1763 | |
---|
1560 | 1764 | /*JTabbedPane*/ scenePanel = new cGridBag(); |
---|
1561 | | - scenePanel.preferredWidth = 5; |
---|
| 1765 | + scenePanel.preferredWidth = 6; |
---|
1562 | 1766 | |
---|
1563 | 1767 | JTabbedPane tabbedPane = new JTabbedPane(); |
---|
1564 | 1768 | tabbedPane.add(scrollpane); |
---|
.. | .. |
---|
1575 | 1779 | |
---|
1576 | 1780 | scenePanel.add(tabbedPane); |
---|
1577 | 1781 | |
---|
| 1782 | + //if (Globals.ADVANCED) |
---|
| 1783 | +// tabbedPane.add(infoPanel); |
---|
| 1784 | +// tabbedPane.setIconAt(3, GetIcon("icons/info.png")); |
---|
| 1785 | +// tabbedPane.setToolTipTextAt(3, "Information"); |
---|
| 1786 | + |
---|
1578 | 1787 | /* |
---|
1579 | 1788 | cTree jTree = new cTree(null); |
---|
1580 | 1789 | ToolTipManager.sharedInstance().registerComponent(jTree); |
---|
.. | .. |
---|
1595 | 1804 | jtp.add(tree); |
---|
1596 | 1805 | */ |
---|
1597 | 1806 | |
---|
1598 | | - bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, scenePanel, gridPanel); |
---|
1599 | | - bigPanel.setContinuousLayout(true); |
---|
1600 | | - bigPanel.setOneTouchExpandable(true); |
---|
1601 | | - bigPanel.setDividerLocation(0.8); |
---|
1602 | | - bigPanel.setDividerSize(15); |
---|
1603 | | - bigPanel.setResizeWeight(0.15); |
---|
1604 | | - bigPanel.setName("Scene"); |
---|
| 1807 | +// bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, scenePanel, gridPanel); |
---|
| 1808 | +// bigPanel.setContinuousLayout(true); |
---|
| 1809 | +// bigPanel.setOneTouchExpandable(true); |
---|
| 1810 | +// bigPanel.setDividerLocation(0.8); |
---|
| 1811 | +// bigPanel.setDividerSize(15); |
---|
| 1812 | +// bigPanel.setResizeWeight(0.15); |
---|
| 1813 | +// bigPanel.setName("Scene"); |
---|
1605 | 1814 | |
---|
1606 | 1815 | //bigPanel.setLayout(new BorderLayout()); |
---|
1607 | 1816 | //bigPanel.setSize(new Dimension(10,10)); |
---|
.. | .. |
---|
1634 | 1843 | /**/ |
---|
1635 | 1844 | |
---|
1636 | 1845 | bigThree = new cGridBag(); |
---|
1637 | | - bigThree.addComponent(centralPanel); |
---|
1638 | 1846 | bigThree.addComponent(scenePanel); |
---|
| 1847 | + bigThree.addComponent(centralPanel); |
---|
1639 | 1848 | //bigThree.addComponent(XYZPanel); |
---|
1640 | 1849 | |
---|
1641 | 1850 | // // SIDE EFFECT!!! |
---|
.. | .. |
---|
1645 | 1854 | // aConstraints.gridheight = 1; |
---|
1646 | 1855 | |
---|
1647 | 1856 | framePanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, toolbarPanel, bigThree); |
---|
| 1857 | + |
---|
| 1858 | + framePanel.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY, |
---|
| 1859 | + new java.beans.PropertyChangeListener() |
---|
| 1860 | + { |
---|
| 1861 | + public void propertyChange(java.beans.PropertyChangeEvent pce) |
---|
| 1862 | + { |
---|
| 1863 | + if ((Integer)pce.getOldValue() == 1) |
---|
| 1864 | + { |
---|
| 1865 | + if (radio.layout != expandedLayout) |
---|
| 1866 | + { |
---|
| 1867 | + radio.layout = expandedLayout; |
---|
| 1868 | + radio.layout.doClick(); |
---|
| 1869 | + } |
---|
| 1870 | + } |
---|
| 1871 | + } |
---|
| 1872 | + }); |
---|
| 1873 | + |
---|
1648 | 1874 | framePanel.setContinuousLayout(false); |
---|
1649 | 1875 | framePanel.setOneTouchExpandable(false); |
---|
1650 | 1876 | //.setDividerLocation(0.8); |
---|
.. | .. |
---|
1654 | 1880 | |
---|
1655 | 1881 | frame.getContentPane().setLayout(new BorderLayout()); |
---|
1656 | 1882 | /**/ |
---|
1657 | | - JTabbedPane worldPane = new JTabbedPane(); |
---|
| 1883 | + //JTabbedPane worldPane = new JTabbedPane(); |
---|
1658 | 1884 | //worldPane.add(bigPanel); |
---|
1659 | 1885 | //worldPane.add(worldPanel); |
---|
1660 | 1886 | /**/ |
---|
.. | .. |
---|
1668 | 1894 | |
---|
1669 | 1895 | cameraView.requestFocusInWindow(); |
---|
1670 | 1896 | |
---|
1671 | | - gridPanel.setDividerLocation(1.0); |
---|
| 1897 | +// gridPanel.setDividerLocation(1.0); |
---|
1672 | 1898 | |
---|
1673 | 1899 | frame.validate(); |
---|
1674 | 1900 | |
---|
.. | .. |
---|
1677 | 1903 | frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); |
---|
1678 | 1904 | frame.addWindowListener(new WindowAdapter() |
---|
1679 | 1905 | { |
---|
1680 | | - |
---|
1681 | 1906 | public void windowClosing(WindowEvent e) |
---|
1682 | 1907 | { |
---|
1683 | 1908 | Close(); |
---|
.. | .. |
---|
1700 | 1925 | ctrlPanel.removeAll(); |
---|
1701 | 1926 | } |
---|
1702 | 1927 | |
---|
1703 | | - void SetupMaterial(cGridBag panel) |
---|
| 1928 | + void SetupMaterial(cGridBag materialpanel) |
---|
1704 | 1929 | { |
---|
1705 | | - /* |
---|
| 1930 | + cGridBag presetpanel = new cGridBag().setVertical(true); |
---|
| 1931 | + |
---|
| 1932 | + cLabel skin = GetLabel("icons/shadericons/shadericon00000.png", !Grafreed.NIMBUSLAF); |
---|
| 1933 | + skin.setToolTipText("Skin"); |
---|
| 1934 | + skin.addMouseListener(new MouseAdapter() |
---|
| 1935 | + { |
---|
| 1936 | + public void mouseClicked(MouseEvent e) |
---|
| 1937 | + { |
---|
| 1938 | + Object3D object = Grafreed.materials.versionlist[0].get(0); |
---|
| 1939 | + cMaterial material = object.material; |
---|
| 1940 | + |
---|
| 1941 | + // Skin |
---|
| 1942 | + colorField.setFloat(material.color); |
---|
| 1943 | + float saturation = material.modulation; |
---|
| 1944 | + |
---|
| 1945 | + if (!cameraView.Skinshader) |
---|
| 1946 | + { |
---|
| 1947 | + saturation /= 1.5; |
---|
| 1948 | + } |
---|
| 1949 | + |
---|
| 1950 | + saturationField.setFloat(saturation); |
---|
| 1951 | + |
---|
| 1952 | + subsurfaceField.setFloat(material.subsurface); |
---|
| 1953 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1954 | + diffusenessField.setFloat(material.factor); |
---|
| 1955 | + shininessField.setFloat(material.shininess); |
---|
| 1956 | + shadowbiasField.setFloat(material.shadowbias); |
---|
| 1957 | + diffuseField.setFloat(material.diffuse); |
---|
| 1958 | + specularField.setFloat(material.specular); |
---|
| 1959 | + |
---|
| 1960 | + bumpField.setFloat(object.projectedVertices[0].x / 1000.0); |
---|
| 1961 | + noiseField.setFloat(object.projectedVertices[0].y / 1000.0); |
---|
| 1962 | + powerField.setFloat(object.projectedVertices[2].x / 1000.0); |
---|
| 1963 | + |
---|
| 1964 | + materialtouched = true; |
---|
| 1965 | + applySelf(); |
---|
| 1966 | + } |
---|
| 1967 | + }); |
---|
| 1968 | + presetpanel.add(skin); |
---|
| 1969 | + |
---|
| 1970 | + cLabel lambert = GetLabel("icons/shadericons/shadericon00002.png", !Grafreed.NIMBUSLAF); |
---|
| 1971 | + lambert.setToolTipText("Diffuse"); |
---|
| 1972 | + lambert.addMouseListener(new MouseAdapter() |
---|
| 1973 | + { |
---|
| 1974 | + public void mouseClicked(MouseEvent e) |
---|
| 1975 | + { |
---|
| 1976 | + Object3D object = Grafreed.materials.versionlist[2].get(0); |
---|
| 1977 | + cMaterial material = object.material; |
---|
| 1978 | + |
---|
| 1979 | + diffusenessField.setFloat(material.factor); |
---|
| 1980 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1981 | + |
---|
| 1982 | + materialtouched = true; |
---|
| 1983 | + applySelf(); |
---|
| 1984 | + } |
---|
| 1985 | + }); |
---|
| 1986 | + presetpanel.add(lambert); |
---|
| 1987 | + |
---|
| 1988 | + cLabel diffuse2 = GetLabel("icons/shadericons/shadericon00003.png", !Grafreed.NIMBUSLAF); |
---|
| 1989 | + diffuse2.setToolTipText("Diffuse2"); |
---|
| 1990 | + diffuse2.addMouseListener(new MouseAdapter() |
---|
| 1991 | + { |
---|
| 1992 | + public void mouseClicked(MouseEvent e) |
---|
| 1993 | + { |
---|
| 1994 | + Object3D object = Grafreed.materials.versionlist[3].get(0); |
---|
| 1995 | + cMaterial material = object.material; |
---|
| 1996 | + |
---|
| 1997 | + diffusenessField.setFloat(material.factor); |
---|
| 1998 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1999 | + |
---|
| 2000 | + materialtouched = true; |
---|
| 2001 | + applySelf(); |
---|
| 2002 | + } |
---|
| 2003 | + }); |
---|
| 2004 | + presetpanel.add(diffuse2); |
---|
| 2005 | + |
---|
| 2006 | + cLabel diffusemoon = GetLabel("icons/shadericons/shadericon00004.png", !Grafreed.NIMBUSLAF); |
---|
| 2007 | + diffusemoon.setToolTipText("Moon"); |
---|
| 2008 | + diffusemoon.addMouseListener(new MouseAdapter() |
---|
| 2009 | + { |
---|
| 2010 | + public void mouseClicked(MouseEvent e) |
---|
| 2011 | + { |
---|
| 2012 | + Object3D object = Grafreed.materials.versionlist[4].get(0); |
---|
| 2013 | + cMaterial material = object.material; |
---|
| 2014 | + |
---|
| 2015 | + diffusenessField.setFloat(material.factor); |
---|
| 2016 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 2017 | + |
---|
| 2018 | + materialtouched = true; |
---|
| 2019 | + applySelf(); |
---|
| 2020 | + } |
---|
| 2021 | + }); |
---|
| 2022 | + presetpanel.add(diffusemoon); |
---|
| 2023 | + |
---|
| 2024 | + cLabel diffusemoon2 = GetLabel("icons/shadericons/shadericon00005.png", !Grafreed.NIMBUSLAF); |
---|
| 2025 | + diffusemoon2.setToolTipText("Moon2"); |
---|
| 2026 | + diffusemoon2.addMouseListener(new MouseAdapter() |
---|
| 2027 | + { |
---|
| 2028 | + public void mouseClicked(MouseEvent e) |
---|
| 2029 | + { |
---|
| 2030 | + Object3D object = Grafreed.materials.versionlist[5].get(0); |
---|
| 2031 | + cMaterial material = object.material; |
---|
| 2032 | + |
---|
| 2033 | + diffusenessField.setFloat(material.factor); |
---|
| 2034 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 2035 | + |
---|
| 2036 | + materialtouched = true; |
---|
| 2037 | + applySelf(); |
---|
| 2038 | + } |
---|
| 2039 | + }); |
---|
| 2040 | + presetpanel.add(diffusemoon2); |
---|
| 2041 | + |
---|
| 2042 | + cLabel diffusemoon3 = GetLabel("icons/shadericons/shadericon00006.png", !Grafreed.NIMBUSLAF); |
---|
| 2043 | + diffusemoon3.setToolTipText("Moon3"); |
---|
| 2044 | + diffusemoon3.addMouseListener(new MouseAdapter() |
---|
| 2045 | + { |
---|
| 2046 | + public void mouseClicked(MouseEvent e) |
---|
| 2047 | + { |
---|
| 2048 | + Object3D object = Grafreed.materials.versionlist[6].get(0); |
---|
| 2049 | + cMaterial material = object.material; |
---|
| 2050 | + |
---|
| 2051 | + diffusenessField.setFloat(material.factor); |
---|
| 2052 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 2053 | + |
---|
| 2054 | + materialtouched = true; |
---|
| 2055 | + applySelf(); |
---|
| 2056 | + } |
---|
| 2057 | + }); |
---|
| 2058 | + presetpanel.add(diffusemoon3); |
---|
| 2059 | + |
---|
| 2060 | + cLabel diffusesheen = GetLabel("icons/shadericons/shadericon00007.png", !Grafreed.NIMBUSLAF); |
---|
| 2061 | + diffusesheen.setToolTipText("Sheen"); |
---|
| 2062 | + diffusesheen.addMouseListener(new MouseAdapter() |
---|
| 2063 | + { |
---|
| 2064 | + public void mouseClicked(MouseEvent e) |
---|
| 2065 | + { |
---|
| 2066 | + Object3D object = Grafreed.materials.versionlist[7].get(0); |
---|
| 2067 | + cMaterial material = object.material; |
---|
| 2068 | + |
---|
| 2069 | + sheenField.setFloat(material.sheen); |
---|
| 2070 | + |
---|
| 2071 | + materialtouched = true; |
---|
| 2072 | + applySelf(); |
---|
| 2073 | + } |
---|
| 2074 | + }); |
---|
| 2075 | + presetpanel.add(diffusesheen); |
---|
| 2076 | + |
---|
| 2077 | + cLabel rough = GetLabel("icons/shadericons/shadericon00001.png", !Grafreed.NIMBUSLAF); |
---|
| 2078 | + rough.setToolTipText("Rough metal"); |
---|
| 2079 | + rough.addMouseListener(new MouseAdapter() |
---|
| 2080 | + { |
---|
| 2081 | + public void mouseClicked(MouseEvent e) |
---|
| 2082 | + { |
---|
| 2083 | + Object3D object = Grafreed.materials.versionlist[1].get(0); |
---|
| 2084 | + cMaterial material = object.material; |
---|
| 2085 | + |
---|
| 2086 | + shininessField.setFloat(material.shininess); |
---|
| 2087 | + velvetField.setFloat(material.velvet); |
---|
| 2088 | + |
---|
| 2089 | + materialtouched = true; |
---|
| 2090 | + applySelf(); |
---|
| 2091 | + } |
---|
| 2092 | + }); |
---|
| 2093 | + presetpanel.add(rough); |
---|
| 2094 | + |
---|
| 2095 | + cLabel rough2 = GetLabel("icons/shadericons/shadericon00013.png", !Grafreed.NIMBUSLAF); |
---|
| 2096 | + rough2.setToolTipText("Medium metal"); |
---|
| 2097 | + rough2.addMouseListener(new MouseAdapter() |
---|
| 2098 | + { |
---|
| 2099 | + public void mouseClicked(MouseEvent e) |
---|
| 2100 | + { |
---|
| 2101 | + Object3D object = Grafreed.materials.versionlist[13].get(0); |
---|
| 2102 | + cMaterial material = object.material; |
---|
| 2103 | + |
---|
| 2104 | + shininessField.setFloat(material.shininess); |
---|
| 2105 | + lightareaField.setFloat(material.lightarea); |
---|
| 2106 | + |
---|
| 2107 | + materialtouched = true; |
---|
| 2108 | + applySelf(); |
---|
| 2109 | + } |
---|
| 2110 | + }); |
---|
| 2111 | + presetpanel.add(rough2); |
---|
| 2112 | + |
---|
| 2113 | + cLabel shini0 = GetLabel("icons/shadericons/shadericon00014.png", !Grafreed.NIMBUSLAF); |
---|
| 2114 | + shini0.setToolTipText("Shiny"); |
---|
| 2115 | + shini0.addMouseListener(new MouseAdapter() |
---|
| 2116 | + { |
---|
| 2117 | + public void mouseClicked(MouseEvent e) |
---|
| 2118 | + { |
---|
| 2119 | + Object3D object = Grafreed.materials.versionlist[14].get(0); |
---|
| 2120 | + cMaterial material = object.material; |
---|
| 2121 | + |
---|
| 2122 | + shininessField.setFloat(material.shininess); |
---|
| 2123 | + lightareaField.setFloat(material.lightarea); |
---|
| 2124 | + |
---|
| 2125 | + materialtouched = true; |
---|
| 2126 | + applySelf(); |
---|
| 2127 | + } |
---|
| 2128 | + }); |
---|
| 2129 | + presetpanel.add(shini0); |
---|
| 2130 | + |
---|
| 2131 | + cLabel shini1 = GetLabel("icons/shadericons/shadericon00011.png", !Grafreed.NIMBUSLAF); |
---|
| 2132 | + shini1.setToolTipText("Shiny2"); |
---|
| 2133 | + shini1.addMouseListener(new MouseAdapter() |
---|
| 2134 | + { |
---|
| 2135 | + public void mouseClicked(MouseEvent e) |
---|
| 2136 | + { |
---|
| 2137 | + Object3D object = Grafreed.materials.versionlist[11].get(0); |
---|
| 2138 | + cMaterial material = object.material; |
---|
| 2139 | + |
---|
| 2140 | + shininessField.setFloat(material.shininess); |
---|
| 2141 | + lightareaField.setFloat(material.lightarea); |
---|
| 2142 | + |
---|
| 2143 | + materialtouched = true; |
---|
| 2144 | + applySelf(); |
---|
| 2145 | + } |
---|
| 2146 | + }); |
---|
| 2147 | + presetpanel.add(shini1); |
---|
| 2148 | + |
---|
| 2149 | + cLabel shini2 = GetLabel("icons/shadericons/shadericon00012.png", !Grafreed.NIMBUSLAF); |
---|
| 2150 | + shini2.setToolTipText("Shiny3"); |
---|
| 2151 | + shini2.addMouseListener(new MouseAdapter() |
---|
| 2152 | + { |
---|
| 2153 | + public void mouseClicked(MouseEvent e) |
---|
| 2154 | + { |
---|
| 2155 | + Object3D object = Grafreed.materials.versionlist[12].get(0); |
---|
| 2156 | + cMaterial material = object.material; |
---|
| 2157 | + |
---|
| 2158 | + shininessField.setFloat(material.shininess); |
---|
| 2159 | + lightareaField.setFloat(material.lightarea); |
---|
| 2160 | + |
---|
| 2161 | + materialtouched = true; |
---|
| 2162 | + applySelf(); |
---|
| 2163 | + } |
---|
| 2164 | + }); |
---|
| 2165 | + presetpanel.add(shini2); |
---|
| 2166 | + |
---|
| 2167 | + cLabel aniso = GetLabel("icons/shadericons/shadericon00008.png", !Grafreed.NIMBUSLAF); |
---|
| 2168 | + aniso.setToolTipText("AnisoU"); |
---|
| 2169 | + aniso.addMouseListener(new MouseAdapter() |
---|
| 2170 | + { |
---|
| 2171 | + public void mouseClicked(MouseEvent e) |
---|
| 2172 | + { |
---|
| 2173 | + Object3D object = Grafreed.materials.versionlist[8].get(0); |
---|
| 2174 | + cMaterial material = object.material; |
---|
| 2175 | + |
---|
| 2176 | + anisoField.setFloat(material.aniso); |
---|
| 2177 | + anisoVField.setFloat(material.anisoV); |
---|
| 2178 | + |
---|
| 2179 | + materialtouched = true; |
---|
| 2180 | + applySelf(); |
---|
| 2181 | + } |
---|
| 2182 | + }); |
---|
| 2183 | + presetpanel.add(aniso); |
---|
| 2184 | + |
---|
| 2185 | + cLabel aniso2 = GetLabel("icons/shadericons/shadericon00009.png", !Grafreed.NIMBUSLAF); |
---|
| 2186 | + aniso2.setToolTipText("AnisoV"); |
---|
| 2187 | + aniso2.addMouseListener(new MouseAdapter() |
---|
| 2188 | + { |
---|
| 2189 | + public void mouseClicked(MouseEvent e) |
---|
| 2190 | + { |
---|
| 2191 | + Object3D object = Grafreed.materials.versionlist[9].get(0); |
---|
| 2192 | + cMaterial material = object.material; |
---|
| 2193 | + |
---|
| 2194 | + anisoField.setFloat(material.aniso); |
---|
| 2195 | + anisoVField.setFloat(material.anisoV); |
---|
| 2196 | + |
---|
| 2197 | + materialtouched = true; |
---|
| 2198 | + applySelf(); |
---|
| 2199 | + } |
---|
| 2200 | + }); |
---|
| 2201 | + presetpanel.add(aniso2); |
---|
| 2202 | + |
---|
| 2203 | + cLabel aniso3 = GetLabel("icons/shadericons/shadericon00010.png", !Grafreed.NIMBUSLAF); |
---|
| 2204 | + aniso3.setToolTipText("AnisoUV"); |
---|
| 2205 | + aniso3.addMouseListener(new MouseAdapter() |
---|
| 2206 | + { |
---|
| 2207 | + public void mouseClicked(MouseEvent e) |
---|
| 2208 | + { |
---|
| 2209 | + Object3D object = Grafreed.materials.versionlist[10].get(0); |
---|
| 2210 | + cMaterial material = object.material; |
---|
| 2211 | + |
---|
| 2212 | + anisoField.setFloat(material.aniso); |
---|
| 2213 | + anisoVField.setFloat(material.anisoV); |
---|
| 2214 | + |
---|
| 2215 | + materialtouched = true; |
---|
| 2216 | + applySelf(); |
---|
| 2217 | + } |
---|
| 2218 | + }); |
---|
| 2219 | + presetpanel.add(aniso3); |
---|
| 2220 | + |
---|
| 2221 | + cLabel velvet0 = GetLabel("icons/shadericons/shadericon00015.png", !Grafreed.NIMBUSLAF); |
---|
| 2222 | + velvet0.setToolTipText("Velvet"); |
---|
| 2223 | + velvet0.addMouseListener(new MouseAdapter() |
---|
| 2224 | + { |
---|
| 2225 | + public void mouseClicked(MouseEvent e) |
---|
| 2226 | + { |
---|
| 2227 | + Object3D object = Grafreed.materials.versionlist[15].get(0); |
---|
| 2228 | + cMaterial material = object.material; |
---|
| 2229 | + |
---|
| 2230 | + diffusenessField.setFloat(material.factor); |
---|
| 2231 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 2232 | + sheenField.setFloat(material.sheen); |
---|
| 2233 | + shininessField.setFloat(material.shininess); |
---|
| 2234 | + velvetField.setFloat(material.velvet); |
---|
| 2235 | + shiftField.setFloat(material.shift); |
---|
| 2236 | + |
---|
| 2237 | + materialtouched = true; |
---|
| 2238 | + applySelf(); |
---|
| 2239 | + } |
---|
| 2240 | + }); |
---|
| 2241 | + presetpanel.add(velvet0); |
---|
| 2242 | + |
---|
| 2243 | + cLabel bump0 = GetLabel("icons/shadericons/shadericon00016.png", !Grafreed.NIMBUSLAF); |
---|
| 2244 | + bump0.setToolTipText("Bump texture"); |
---|
| 2245 | + bump0.addMouseListener(new MouseAdapter() |
---|
| 2246 | + { |
---|
| 2247 | + public void mouseClicked(MouseEvent e) |
---|
| 2248 | + { |
---|
| 2249 | + Object3D object = Grafreed.materials.versionlist[16].get(0); |
---|
| 2250 | + cMaterial material = object.material; |
---|
| 2251 | + |
---|
| 2252 | + bumpField.setFloat(object.projectedVertices[0].x / 1000.0); |
---|
| 2253 | + noiseField.setFloat(object.projectedVertices[0].y / 1000.0); |
---|
| 2254 | + powerField.setFloat(object.projectedVertices[2].x / 1000.0); |
---|
| 2255 | + |
---|
| 2256 | + materialtouched = true; |
---|
| 2257 | + applySelf(); |
---|
| 2258 | + } |
---|
| 2259 | + }); |
---|
| 2260 | + presetpanel.add(bump0); |
---|
| 2261 | + |
---|
| 2262 | + cLabel borderShader = GetLabel("icons/shadericons/borderfade.jpg", !Grafreed.NIMBUSLAF); |
---|
| 2263 | + borderShader.setToolTipText("Border fade"); |
---|
| 2264 | + borderShader.addMouseListener(new MouseAdapter() |
---|
| 2265 | + { |
---|
| 2266 | + public void mouseClicked(MouseEvent e) |
---|
| 2267 | + { |
---|
| 2268 | + borderfadeField.setFloat(0.5); |
---|
| 2269 | + opacityField.setFloat(0.75); |
---|
| 2270 | + |
---|
| 2271 | + materialtouched = true; |
---|
| 2272 | + applySelf(); |
---|
| 2273 | + } |
---|
| 2274 | + }); |
---|
| 2275 | + presetpanel.add(borderShader); |
---|
| 2276 | + |
---|
| 2277 | + cLabel halo = GetLabel("icons/shadericons/shadericon00017.png", !Grafreed.NIMBUSLAF); |
---|
| 2278 | + halo.setToolTipText("Halo"); |
---|
| 2279 | + halo.addMouseListener(new MouseAdapter() |
---|
| 2280 | + { |
---|
| 2281 | + public void mouseClicked(MouseEvent e) |
---|
| 2282 | + { |
---|
| 2283 | + Object3D object = Grafreed.materials.versionlist[17].get(0); |
---|
| 2284 | + cMaterial material = object.material; |
---|
| 2285 | + |
---|
| 2286 | + opacityPowerField.setFloat(object.projectedVertices[2].y / 1000.0); |
---|
| 2287 | + |
---|
| 2288 | + materialtouched = true; |
---|
| 2289 | + applySelf(); |
---|
| 2290 | + } |
---|
| 2291 | + }); |
---|
| 2292 | + presetpanel.add(halo); |
---|
| 2293 | + |
---|
| 2294 | + cLabel candle = GetLabel("icons/shadericons/shadericon00018.png", !Grafreed.NIMBUSLAF); |
---|
| 2295 | + candle.setToolTipText("Candle"); |
---|
| 2296 | + candle.addMouseListener(new MouseAdapter() |
---|
| 2297 | + { |
---|
| 2298 | + public void mouseClicked(MouseEvent e) |
---|
| 2299 | + { |
---|
| 2300 | + Object3D object = Grafreed.materials.versionlist[18].get(0); |
---|
| 2301 | + cMaterial material = object.material; |
---|
| 2302 | + |
---|
| 2303 | + subsurfaceField.setFloat(material.subsurface); |
---|
| 2304 | + shadowbiasField.setFloat(material.shadowbias); |
---|
| 2305 | + ambientField.setFloat(material.ambient); |
---|
| 2306 | + specularField.setFloat(material.specular); |
---|
| 2307 | + lightareaField.setFloat(material.lightarea); |
---|
| 2308 | + shininessField.setFloat(material.shininess); |
---|
| 2309 | + |
---|
| 2310 | + materialtouched = true; |
---|
| 2311 | + applySelf(); |
---|
| 2312 | + } |
---|
| 2313 | + }); |
---|
| 2314 | + presetpanel.add(candle); |
---|
| 2315 | + |
---|
| 2316 | + cLabel shadowShader = GetLabel("icons/shadericons/shadow.png", !Grafreed.NIMBUSLAF); |
---|
| 2317 | + shadowShader.setToolTipText("Shadow"); |
---|
| 2318 | + shadowShader.addMouseListener(new MouseAdapter() |
---|
| 2319 | + { |
---|
| 2320 | + public void mouseClicked(MouseEvent e) |
---|
| 2321 | + { |
---|
| 2322 | + diffuseField.setFloat(0.001); |
---|
| 2323 | + ambientField.setFloat(0.001); |
---|
| 2324 | + cameraField.setFloat(0.001); |
---|
| 2325 | + specularField.setFloat(0.001); |
---|
| 2326 | + fakedepthField.setFloat(0.001); |
---|
| 2327 | + opacityField.setFloat(0.6); |
---|
| 2328 | + |
---|
| 2329 | + materialtouched = true; |
---|
| 2330 | + applySelf(); |
---|
| 2331 | + } |
---|
| 2332 | + }); |
---|
| 2333 | + presetpanel.add(shadowShader); |
---|
| 2334 | + |
---|
| 2335 | + cGridBag panel = new cGridBag().setVertical(true); |
---|
| 2336 | + |
---|
| 2337 | + presetpanel.preferredWidth = 1; |
---|
| 2338 | + |
---|
| 2339 | + materialpanel.add(presetpanel); |
---|
| 2340 | + materialpanel.add(panel); |
---|
| 2341 | + |
---|
| 2342 | + panel.preferredWidth = 8; |
---|
| 2343 | + |
---|
| 2344 | + /* |
---|
1706 | 2345 | ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints); |
---|
1707 | 2346 | materialLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1708 | | - */ |
---|
| 2347 | + */ |
---|
1709 | 2348 | |
---|
1710 | 2349 | cGridBag editBar = new cGridBag().setVertical(false); |
---|
1711 | 2350 | |
---|
.. | .. |
---|
1739 | 2378 | //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1740 | 2379 | |
---|
1741 | 2380 | cGridBag colorSection = new cGridBag().setVertical(true); |
---|
| 2381 | + |
---|
| 2382 | + cGridBag huepanel = new cGridBag(); |
---|
| 2383 | + cGridBag huelabel = new cGridBag(); |
---|
| 2384 | + cLabel hue = GetLabel("icons/hue.png", false); |
---|
| 2385 | + hue.fit = true; |
---|
| 2386 | + |
---|
| 2387 | + hue.addMouseListener(new MouseAdapter() |
---|
| 2388 | + { |
---|
| 2389 | + public void mousePressed(MouseEvent e) |
---|
| 2390 | + { |
---|
| 2391 | + int x = e.getX(); |
---|
| 2392 | + |
---|
| 2393 | + colorField.setFloat((double)x / ((cLabel)e.getSource()).getWidth()); |
---|
| 2394 | + } |
---|
| 2395 | + }); |
---|
| 2396 | + |
---|
| 2397 | + huelabel.add(hue); |
---|
| 2398 | + huelabel.preferredWidth = 20; |
---|
| 2399 | + huepanel.add(new cGridBag()); // Label |
---|
| 2400 | + huepanel.add(huelabel); // Field/slider |
---|
| 2401 | + |
---|
| 2402 | + huepanel.preferredHeight = 7; |
---|
| 2403 | + |
---|
| 2404 | + colorSection.add(huepanel); |
---|
1742 | 2405 | |
---|
1743 | 2406 | cGridBag color = new cGridBag(); |
---|
1744 | | - color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints); |
---|
1745 | | - colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1746 | | - color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 2407 | + |
---|
| 2408 | + color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints); |
---|
| 2409 | + colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2410 | + color.add(colorField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
| 2411 | + |
---|
1747 | 2412 | //colorField.preferredWidth = 200; |
---|
1748 | 2413 | colorSection.add(color); |
---|
1749 | 2414 | |
---|
1750 | 2415 | cGridBag modulation = new cGridBag(); |
---|
1751 | 2416 | modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints); |
---|
1752 | 2417 | modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1753 | | - modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 2418 | + modulation.add(saturationField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
1754 | 2419 | colorSection.add(modulation); |
---|
1755 | 2420 | |
---|
| 2421 | + cGridBag opacity = new cGridBag(); |
---|
| 2422 | + opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints); |
---|
| 2423 | + opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2424 | + opacity.add(opacityField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
| 2425 | + colorSection.add(opacity); |
---|
| 2426 | + |
---|
| 2427 | + colorSection.add(GetSeparator()); |
---|
| 2428 | + |
---|
1756 | 2429 | cGridBag texture = new cGridBag(); |
---|
1757 | 2430 | texture.add(textureLabel = new JLabel("Texture")); // , aConstraints); |
---|
1758 | 2431 | textureLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1759 | 2432 | texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1760 | 2433 | colorSection.add(texture); |
---|
1761 | 2434 | |
---|
1762 | | - panel.add(new JSeparator()); |
---|
| 2435 | + panel.add(GetSeparator()); |
---|
1763 | 2436 | |
---|
1764 | 2437 | panel.add(colorSection); |
---|
1765 | 2438 | |
---|
.. | .. |
---|
1815 | 2488 | shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1816 | 2489 | diffuseSection.add(shadowbias); |
---|
1817 | 2490 | |
---|
1818 | | - panel.add(new JSeparator()); |
---|
| 2491 | + panel.add(GetSeparator()); |
---|
1819 | 2492 | |
---|
1820 | 2493 | panel.add(diffuseSection); |
---|
1821 | 2494 | |
---|
.. | .. |
---|
1878 | 2551 | specularSection.add(anisoV); |
---|
1879 | 2552 | |
---|
1880 | 2553 | |
---|
1881 | | - panel.add(new JSeparator()); |
---|
| 2554 | + panel.add(GetSeparator()); |
---|
1882 | 2555 | |
---|
1883 | 2556 | panel.add(specularSection); |
---|
1884 | 2557 | |
---|
.. | .. |
---|
1903 | 2576 | backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1904 | 2577 | backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1905 | 2578 | colorSection.add(backlit); |
---|
1906 | | - |
---|
1907 | | - cGridBag opacity = new cGridBag(); |
---|
1908 | | - opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints); |
---|
1909 | | - opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1910 | | - opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1911 | | - colorSection.add(opacity); |
---|
1912 | 2579 | |
---|
1913 | 2580 | //panel.add(new JSeparator()); |
---|
1914 | 2581 | |
---|
.. | .. |
---|
1954 | 2621 | opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints); |
---|
1955 | 2622 | textureSection.add(opacityPower); |
---|
1956 | 2623 | |
---|
1957 | | - panel.add(new JSeparator()); |
---|
| 2624 | + panel.add(GetSeparator()); |
---|
1958 | 2625 | |
---|
1959 | 2626 | panel.add(textureSection); |
---|
1960 | 2627 | |
---|
.. | .. |
---|
2941 | 3608 | |
---|
2942 | 3609 | freezematerial = true; |
---|
2943 | 3610 | colorField.setFloat(mat.color); |
---|
2944 | | - modulationField.setFloat(mat.modulation); |
---|
| 3611 | + saturationField.setFloat(mat.modulation); |
---|
2945 | 3612 | metalnessField.setFloat(mat.metalness); |
---|
2946 | 3613 | diffuseField.setFloat(mat.diffuse); |
---|
2947 | 3614 | specularField.setFloat(mat.specular); |
---|
.. | .. |
---|
3003 | 3670 | |
---|
3004 | 3671 | if (multiplyToggle != null) |
---|
3005 | 3672 | multiplyToggle.setSelected(mat.multiply); |
---|
3006 | | - |
---|
3007 | | - assert (object.projectedVertices != null); |
---|
3008 | | - |
---|
3009 | | - if (object.projectedVertices.length <= 2) |
---|
3010 | | - { |
---|
3011 | | - // Side effect... |
---|
3012 | | - Object3D.cVector2[] keep = object.projectedVertices; |
---|
3013 | | - object.projectedVertices = new Object3D.cVector2[3]; |
---|
3014 | | - for (int i = 0; i < 3; i++) |
---|
3015 | | - { |
---|
3016 | | - if (i < keep.length) |
---|
3017 | | - { |
---|
3018 | | - object.projectedVertices[i] = keep[i]; |
---|
3019 | | - } else |
---|
3020 | | - { |
---|
3021 | | - object.projectedVertices[i] = new Object3D.cVector2(); |
---|
3022 | | - } |
---|
3023 | | - /* |
---|
3024 | | - if(keep.length == 0) |
---|
3025 | | - object.projectedVertices[0] = new Object3D.cVector2(); |
---|
3026 | | - else |
---|
3027 | | - object.projectedVertices[0] = keep[0]; |
---|
3028 | | - object.projectedVertices[1] = new Object3D.cVector2(); |
---|
3029 | | - */ |
---|
3030 | | - } |
---|
3031 | | - } |
---|
| 3673 | + |
---|
| 3674 | + AllocProjectedVertices(object); |
---|
3032 | 3675 | |
---|
3033 | 3676 | SetMaterial(mat, object.projectedVertices); |
---|
3034 | 3677 | } |
---|
.. | .. |
---|
3148 | 3791 | public void itemStateChanged(ItemEvent event) |
---|
3149 | 3792 | { |
---|
3150 | 3793 | // System.out.println("Propagate = " + propagate); |
---|
| 3794 | + if (event.getSource() == pinButton) |
---|
| 3795 | + { |
---|
| 3796 | + copy.pinned ^= true; |
---|
| 3797 | + if (!copy.pinned && !copy.editWindow.copy.selection.contains(copy)) |
---|
| 3798 | + { |
---|
| 3799 | + ((GroupEditor)copy.editWindow).listUI.remove(copy); |
---|
| 3800 | + copy.CloseUI(); |
---|
| 3801 | + //copy.editWindow.refreshContents(); |
---|
| 3802 | + } |
---|
| 3803 | + } |
---|
| 3804 | + else |
---|
3151 | 3805 | if (event.getSource() == propagateToggle) |
---|
3152 | 3806 | { |
---|
3153 | 3807 | propagate ^= true; |
---|
.. | .. |
---|
3252 | 3906 | } else if (event.getSource() == liveCB) |
---|
3253 | 3907 | { |
---|
3254 | 3908 | copy.live ^= true; |
---|
| 3909 | + objEditor.refreshContents(true); // To show item colors |
---|
3255 | 3910 | return; |
---|
3256 | 3911 | } else if (event.getSource() == selectableCB) |
---|
3257 | 3912 | { |
---|
.. | .. |
---|
3261 | 3916 | { |
---|
3262 | 3917 | copy.hide ^= true; |
---|
3263 | 3918 | copy.Touch(); // display list issue |
---|
3264 | | - objEditor.refreshContents(); |
---|
| 3919 | + objEditor.refreshContents(true); // To show item colors |
---|
3265 | 3920 | return; |
---|
3266 | 3921 | } else if (event.getSource() == link2masterCB) |
---|
3267 | 3922 | { |
---|
.. | .. |
---|
3326 | 3981 | //System.out.println("ObjEditor " + event); |
---|
3327 | 3982 | applySelf0(true); |
---|
3328 | 3983 | //parent.applySelf(); |
---|
3329 | | - objEditor.refreshContents(); |
---|
| 3984 | + // conflicts with requestFocus objEditor.refreshContents(); |
---|
3330 | 3985 | } else if (source == resetButton) |
---|
3331 | 3986 | { |
---|
3332 | 3987 | CameraPane.fullreset = true; |
---|
.. | .. |
---|
3517 | 4172 | |
---|
3518 | 4173 | static public byte[] Compress(Object3D o) |
---|
3519 | 4174 | { |
---|
| 4175 | + // Slower to actually compress. |
---|
3520 | 4176 | try |
---|
3521 | 4177 | { |
---|
3522 | 4178 | ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
---|
.. | .. |
---|
3618 | 4274 | { |
---|
3619 | 4275 | //Save(true); |
---|
3620 | 4276 | Replace(); |
---|
| 4277 | + SetVersionStates(); |
---|
3621 | 4278 | } |
---|
3622 | 4279 | |
---|
3623 | 4280 | private boolean Equal(byte[] compress, byte[] name) |
---|
.. | .. |
---|
3636 | 4293 | return true; |
---|
3637 | 4294 | } |
---|
3638 | 4295 | |
---|
3639 | | - java.util.Hashtable<java.util.UUID, Object3D> versiontable = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
| 4296 | + void DeleteVersion() |
---|
| 4297 | + { |
---|
| 4298 | + for (int i = copy.versionindex; i < copy.versionlist.length-1; i++) |
---|
| 4299 | + { |
---|
| 4300 | + copy.versionlist[i] = copy.versionlist[i+1]; |
---|
| 4301 | + } |
---|
| 4302 | + |
---|
| 4303 | + if (copy.versionlist[copy.versionindex] == null) |
---|
| 4304 | + copy.versionindex -= 1; |
---|
| 4305 | + |
---|
| 4306 | + if (copy.versionindex != -1) |
---|
| 4307 | + CopyChanged(); |
---|
| 4308 | + |
---|
| 4309 | + SetVersionStates(); |
---|
| 4310 | + } |
---|
3640 | 4311 | |
---|
3641 | 4312 | public boolean Save(boolean user) |
---|
3642 | 4313 | { |
---|
3643 | 4314 | System.err.println("Save"); |
---|
| 4315 | + Replace(); |
---|
3644 | 4316 | |
---|
3645 | | - cRadio tab = GetCurrentTab(); |
---|
| 4317 | + //cRadio tab = GetCurrentTab(); |
---|
3646 | 4318 | |
---|
3647 | | - byte[] compress = CompressCopy(); |
---|
| 4319 | + Object3D compress = Duplicate(copy); // Saved version. No need for "Replace"? |
---|
3648 | 4320 | |
---|
3649 | 4321 | boolean thesame = false; |
---|
3650 | 4322 | |
---|
3651 | | - // Quick heuristic using length. Works only when stream is compressed. |
---|
3652 | | - if (copy.versionindex > 0 && copy.versions[copy.versionindex-1] != null && Equal(compress, copy.versions[copy.versionindex-1])) |
---|
3653 | | - { |
---|
3654 | | - thesame = true; |
---|
3655 | | - } |
---|
| 4323 | +// if (copy.versionindex > 0 && copy.versions[copy.versionindex-1] != null && Equal(compress, copy.versions[copy.versionindex-1])) |
---|
| 4324 | +// { |
---|
| 4325 | +// thesame = true; |
---|
| 4326 | +// } |
---|
3656 | 4327 | |
---|
3657 | 4328 | //EditorFrame.m_MainFrame.requestFocusInWindow(); |
---|
3658 | 4329 | if (!thesame) |
---|
3659 | 4330 | { |
---|
| 4331 | + for (int i = copy.versionlist.length; --i > copy.versionindex+1;) |
---|
| 4332 | + { |
---|
| 4333 | + copy.versionlist[i] = copy.versionlist[i-1]; |
---|
| 4334 | + } |
---|
| 4335 | + |
---|
3660 | 4336 | //tab.user[tab.versionindex] = user; |
---|
3661 | 4337 | //boolean increment = true; // tab.graphs[tab.versionindex] == null; |
---|
3662 | 4338 | |
---|
3663 | | - copy.versions[++copy.versionindex] = compress; |
---|
| 4339 | + copy.versionlist[++copy.versionindex] = compress; |
---|
3664 | 4340 | |
---|
3665 | 4341 | // if (increment) |
---|
3666 | 4342 | // tab.versionindex++; |
---|
.. | .. |
---|
3670 | 4346 | |
---|
3671 | 4347 | //assert(hashtable.isEmpty()); |
---|
3672 | 4348 | |
---|
3673 | | - for (int i = copy.versionindex+1; i < copy.versions.length; i++) |
---|
3674 | | - { |
---|
3675 | | - //tab.user[i] = false; |
---|
3676 | | - copy.versions[i] = null; |
---|
3677 | | - } |
---|
| 4349 | +// for (int i = copy.versionindex+1; i < copy.versionlist.length; i++) |
---|
| 4350 | +// { |
---|
| 4351 | +// //tab.user[i] = false; |
---|
| 4352 | +// copy.versionlist[i] = null; |
---|
| 4353 | +// } |
---|
3678 | 4354 | |
---|
3679 | | - SetUndoStates(); |
---|
| 4355 | + SetVersionStates(); |
---|
3680 | 4356 | |
---|
3681 | 4357 | // test save |
---|
3682 | 4358 | if (false) |
---|
.. | .. |
---|
3699 | 4375 | |
---|
3700 | 4376 | return !thesame; |
---|
3701 | 4377 | } |
---|
3702 | | - |
---|
3703 | | - void CopyChanged(Object3D obj) |
---|
| 4378 | + |
---|
| 4379 | + boolean flashIt = true; |
---|
| 4380 | + |
---|
| 4381 | + void RefreshSelection() |
---|
3704 | 4382 | { |
---|
3705 | | - SetUndoStates(); |
---|
| 4383 | + Object3D selection = new Object3D(); |
---|
| 4384 | + |
---|
| 4385 | + for (int i = 0; i < copy.selection.size(); i++) |
---|
| 4386 | + { |
---|
| 4387 | + Object3D elem = copy.selection.elementAt(i); |
---|
| 4388 | + |
---|
| 4389 | + Object3D obj = copy.GetObject(elem.GetUUID()); |
---|
| 4390 | + |
---|
| 4391 | + if (obj == null) |
---|
| 4392 | + { |
---|
| 4393 | + copy.selection.remove(i--); |
---|
| 4394 | + } |
---|
| 4395 | + else |
---|
| 4396 | + { |
---|
| 4397 | + selection.add(obj); |
---|
| 4398 | + copy.selection.setElementAt(obj, i); |
---|
| 4399 | + } |
---|
| 4400 | + } |
---|
| 4401 | + |
---|
| 4402 | + flashIt = false; |
---|
| 4403 | + GetTree().clearSelection(); |
---|
| 4404 | + for (int i = 0; i < selection.size(); i++) |
---|
| 4405 | + GetTree().addSelectionPath(selection.elementAt(i).GetTreePath().GetTreePath()); |
---|
| 4406 | + flashIt = true; |
---|
| 4407 | + |
---|
| 4408 | + //refreshContents(false); |
---|
| 4409 | + } |
---|
| 4410 | + |
---|
| 4411 | + void CopyChanged() |
---|
| 4412 | + { |
---|
| 4413 | + Object3D obj = (Object3D)Grafreed.clone(copy.versionlist[copy.versionindex]); |
---|
| 4414 | + |
---|
| 4415 | + SetVersionStates(); |
---|
3706 | 4416 | |
---|
3707 | 4417 | boolean temp = CameraPane.SWITCH; |
---|
3708 | 4418 | CameraPane.SWITCH = false; |
---|
3709 | 4419 | |
---|
3710 | | - copy.ExtractBigData(versiontable); |
---|
| 4420 | + copy.ExtractBigData(Grafreed.grafreed.universe.versiontable); |
---|
3711 | 4421 | |
---|
3712 | 4422 | copy.clear(); |
---|
3713 | 4423 | |
---|
| 4424 | + copy.skyboxname = obj.skyboxname; |
---|
| 4425 | + copy.skyboxext = obj.skyboxext; |
---|
| 4426 | + |
---|
3714 | 4427 | for (int i=0; i<obj.Size(); i++) |
---|
3715 | 4428 | { |
---|
3716 | 4429 | copy.add(obj.get(i)); |
---|
3717 | 4430 | } |
---|
3718 | 4431 | |
---|
3719 | | - copy.RestoreBigData(versiontable); |
---|
| 4432 | + copy.RestoreBigData(Grafreed.grafreed.universe.versiontable); |
---|
3720 | 4433 | |
---|
3721 | 4434 | CameraPane.SWITCH = temp; |
---|
3722 | 4435 | |
---|
| 4436 | + RefreshSelection(); |
---|
3723 | 4437 | //assert(hashtable.isEmpty()); |
---|
3724 | 4438 | |
---|
3725 | 4439 | copy.Touch(); |
---|
.. | .. |
---|
3740 | 4454 | } |
---|
3741 | 4455 | } |
---|
3742 | 4456 | |
---|
3743 | | - refreshContents(); |
---|
| 4457 | + refreshContents(true); |
---|
3744 | 4458 | } |
---|
3745 | 4459 | |
---|
3746 | | - cButton undoButton; |
---|
| 4460 | + cButton previousVersionButton; |
---|
3747 | 4461 | cButton restoreButton; |
---|
3748 | 4462 | cButton replaceButton; |
---|
3749 | | - cButton redoButton; |
---|
| 4463 | + cButton nextVersionButton; |
---|
| 4464 | + cButton saveVersionButton; |
---|
| 4465 | + cButton deleteVersionButton; |
---|
3750 | 4466 | |
---|
3751 | 4467 | boolean muteSlider; |
---|
3752 | 4468 | |
---|
.. | .. |
---|
3754 | 4470 | { |
---|
3755 | 4471 | int count = 0; |
---|
3756 | 4472 | |
---|
3757 | | - for (int i = copy.versions.length; --i >= 0;) |
---|
| 4473 | + for (int i = copy.versionlist.length; --i >= 0;) |
---|
3758 | 4474 | { |
---|
3759 | | - if (copy.versions[i] != null) |
---|
| 4475 | + if (copy.versionlist[i] != null) |
---|
3760 | 4476 | count++; |
---|
3761 | 4477 | } |
---|
3762 | 4478 | |
---|
3763 | 4479 | return count; |
---|
3764 | 4480 | } |
---|
3765 | 4481 | |
---|
3766 | | - void SetUndoStates() |
---|
| 4482 | + public cGridBag versionSliderPane; |
---|
| 4483 | + |
---|
| 4484 | + void SetVersionStates() |
---|
3767 | 4485 | { |
---|
3768 | | - cRadio tab = GetCurrentTab(); |
---|
| 4486 | + //if (true) |
---|
| 4487 | + // return; |
---|
| 4488 | + |
---|
| 4489 | + //cRadio tab = GetCurrentTab(); |
---|
3769 | 4490 | |
---|
3770 | | - restoreButton.setEnabled(copy.versionindex != -1); |
---|
3771 | | - replaceButton.setEnabled(copy.versionindex != -1); |
---|
3772 | | - |
---|
3773 | | - undoButton.setEnabled(copy.versionindex > 0); |
---|
3774 | | - redoButton.setEnabled(copy.versions[copy.versionindex + 1] != null); |
---|
3775 | | - |
---|
3776 | | - muteSlider = true; |
---|
3777 | | - versionSlider.setMaximum(VersionCount() - 1); |
---|
3778 | | - versionSlider.setInteger(copy.versionindex); |
---|
3779 | | - muteSlider = false; |
---|
| 4491 | + if (copy.versionlist == null) |
---|
| 4492 | + { |
---|
| 4493 | + saveVersionButton.setEnabled(false); |
---|
| 4494 | + restoreButton.setEnabled(false); |
---|
| 4495 | + replaceButton.setEnabled(false); |
---|
| 4496 | + previousVersionButton.setEnabled(false); |
---|
| 4497 | + nextVersionButton.setEnabled(false); |
---|
| 4498 | + deleteVersionButton.setEnabled(false); |
---|
| 4499 | + versionSliderPane.setVisible(false); |
---|
| 4500 | + } |
---|
| 4501 | + else |
---|
| 4502 | + { |
---|
| 4503 | + restoreButton.setEnabled(copy.versionindex != -1); |
---|
| 4504 | + replaceButton.setEnabled(copy.versionindex != -1); |
---|
| 4505 | + |
---|
| 4506 | + previousVersionButton.setEnabled(copy.versionindex > 0); |
---|
| 4507 | + nextVersionButton.setEnabled(copy.versionlist[copy.versionindex + 1] != null); |
---|
| 4508 | + |
---|
| 4509 | + deleteVersionButton.setEnabled(copy.versionindex != -1); |
---|
| 4510 | + //copy.versionlist[copy.versionindex + 1] != null); |
---|
| 4511 | + |
---|
| 4512 | + muteSlider = true; |
---|
| 4513 | + versionSlider.setMinimum(0); |
---|
| 4514 | + versionSlider.setMaximum(VersionCount() - 1); |
---|
| 4515 | + versionSlider.setInteger(copy.versionindex); |
---|
| 4516 | + versionSlider.setEnabled(copy.versionindex != -1); |
---|
| 4517 | + muteSlider = false; |
---|
| 4518 | + |
---|
| 4519 | + versionSliderPane.setVisible(true); |
---|
| 4520 | + } |
---|
3780 | 4521 | } |
---|
3781 | 4522 | |
---|
3782 | | - public boolean Undo() |
---|
| 4523 | + public boolean PreviousVersion() |
---|
3783 | 4524 | { |
---|
3784 | 4525 | // Option? |
---|
3785 | 4526 | Replace(); |
---|
3786 | 4527 | |
---|
3787 | 4528 | System.err.println("Undo"); |
---|
3788 | 4529 | |
---|
3789 | | - cRadio tab = GetCurrentTab(); |
---|
| 4530 | + //cRadio tab = GetCurrentTab(); |
---|
3790 | 4531 | |
---|
3791 | 4532 | if (copy.versionindex == 0) |
---|
3792 | 4533 | { |
---|
.. | .. |
---|
3809 | 4550 | |
---|
3810 | 4551 | copy.versionindex -= 1; |
---|
3811 | 4552 | |
---|
3812 | | - CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
| 4553 | + CopyChanged(); |
---|
3813 | 4554 | |
---|
3814 | 4555 | return true; |
---|
3815 | 4556 | } |
---|
.. | .. |
---|
3818 | 4559 | { |
---|
3819 | 4560 | System.err.println("Restore"); |
---|
3820 | 4561 | |
---|
3821 | | - cRadio tab = GetCurrentTab(); |
---|
| 4562 | + //cRadio tab = GetCurrentTab(); |
---|
3822 | 4563 | |
---|
3823 | | - if (copy.versionindex == -1 || copy.versions[copy.versionindex] == null) |
---|
| 4564 | + if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
3824 | 4565 | { |
---|
3825 | 4566 | java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
3826 | 4567 | return false; |
---|
3827 | 4568 | } |
---|
3828 | 4569 | |
---|
3829 | | - CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
| 4570 | + //CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
| 4571 | + CopyChanged(); |
---|
3830 | 4572 | |
---|
3831 | 4573 | return true; |
---|
3832 | 4574 | } |
---|
3833 | 4575 | |
---|
3834 | 4576 | public boolean Replace() |
---|
3835 | 4577 | { |
---|
3836 | | - System.err.println("Replace"); |
---|
| 4578 | + //System.err.println("Replace"); |
---|
3837 | 4579 | |
---|
3838 | | - cRadio tab = GetCurrentTab(); |
---|
| 4580 | + //cRadio tab = GetCurrentTab(); |
---|
3839 | 4581 | |
---|
3840 | | - if (copy.versionindex == -1 || copy.versions[copy.versionindex] == null) |
---|
| 4582 | + if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
3841 | 4583 | { |
---|
3842 | 4584 | // No version yet. OK. java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
3843 | 4585 | return false; |
---|
3844 | 4586 | } |
---|
3845 | 4587 | |
---|
3846 | | - copy.versions[copy.versionindex] = CompressCopy(); |
---|
| 4588 | + copy.versionlist[copy.versionindex] = Duplicate(copy); |
---|
3847 | 4589 | |
---|
3848 | 4590 | return true; |
---|
3849 | 4591 | } |
---|
3850 | 4592 | |
---|
3851 | | - public void Redo() |
---|
| 4593 | + public void NextVersion() |
---|
3852 | 4594 | { |
---|
3853 | 4595 | // Option? |
---|
3854 | 4596 | Replace(); |
---|
3855 | 4597 | |
---|
3856 | | - cRadio tab = GetCurrentTab(); |
---|
| 4598 | + //cRadio tab = GetCurrentTab(); |
---|
3857 | 4599 | |
---|
3858 | | - if (copy.versions[copy.versionindex + 1] == null) |
---|
| 4600 | + if (copy.versionlist[copy.versionindex + 1] == null) |
---|
3859 | 4601 | { |
---|
3860 | 4602 | java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
3861 | 4603 | return; |
---|
.. | .. |
---|
3863 | 4605 | |
---|
3864 | 4606 | copy.versionindex += 1; |
---|
3865 | 4607 | |
---|
3866 | | - CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
| 4608 | + CopyChanged(); |
---|
3867 | 4609 | |
---|
3868 | 4610 | //if (!tab.user[tab.versionindex]) |
---|
3869 | 4611 | // tab.graphs[tab.versionindex] = null; |
---|
.. | .. |
---|
4060 | 4802 | // else |
---|
4061 | 4803 | // applySelf(true); |
---|
4062 | 4804 | // } |
---|
| 4805 | + |
---|
| 4806 | + boolean Equal(double a, double b) |
---|
| 4807 | + { |
---|
| 4808 | + return Math.abs(a - b) < 0.001; |
---|
| 4809 | + } |
---|
| 4810 | + |
---|
4063 | 4811 | void applySelf0(boolean name) |
---|
4064 | 4812 | { |
---|
4065 | 4813 | if (name) |
---|
.. | .. |
---|
4077 | 4825 | //copy.material = new cMaterial(copy.GetMaterial()); |
---|
4078 | 4826 | |
---|
4079 | 4827 | current.color = (float) colorField.getFloat(); |
---|
4080 | | - current.modulation = (float) modulationField.getFloat(); |
---|
| 4828 | + current.modulation = (float) saturationField.getFloat(); |
---|
4081 | 4829 | current.metalness = (float) metalnessField.getFloat(); |
---|
4082 | 4830 | current.diffuse = (float) diffuseField.getFloat(); |
---|
4083 | 4831 | current.specular = (float) specularField.getFloat(); |
---|
.. | .. |
---|
4109 | 4857 | { |
---|
4110 | 4858 | cMaterial mat = copy.material; |
---|
4111 | 4859 | |
---|
4112 | | - colorField.SetToolTipValue((mat.color)); |
---|
4113 | | - modulationField.SetToolTipValue((mat.modulation)); |
---|
4114 | | - metalnessField.SetToolTipValue((mat.metalness)); |
---|
4115 | | - diffuseField.SetToolTipValue((mat.diffuse)); |
---|
4116 | | - specularField.SetToolTipValue((mat.specular)); |
---|
4117 | | - shininessField.SetToolTipValue((mat.shininess)); |
---|
4118 | | - shiftField.SetToolTipValue((mat.shift)); |
---|
4119 | | - ambientField.SetToolTipValue((mat.ambient)); |
---|
4120 | | - lightareaField.SetToolTipValue((mat.lightarea)); |
---|
4121 | | - diffusenessField.SetToolTipValue((mat.factor)); |
---|
4122 | | - velvetField.SetToolTipValue((mat.velvet)); |
---|
4123 | | - sheenField.SetToolTipValue((mat.sheen)); |
---|
4124 | | - subsurfaceField.SetToolTipValue((mat.subsurface)); |
---|
4125 | | - backlitField.SetToolTipValue((mat.bump)); |
---|
4126 | | - anisoField.SetToolTipValue((mat.aniso)); |
---|
4127 | | - anisoVField.SetToolTipValue((mat.anisoV)); |
---|
4128 | | - cameraField.SetToolTipValue((mat.cameralight)); |
---|
4129 | | - selfshadowField.SetToolTipValue((mat.diffuseness)); |
---|
4130 | | - shadowField.SetToolTipValue((mat.shadow)); |
---|
4131 | | - textureField.SetToolTipValue((mat.texture)); |
---|
4132 | | - opacityField.SetToolTipValue((mat.opacity)); |
---|
4133 | | - fakedepthField.SetToolTipValue((mat.fakedepth)); |
---|
4134 | | - shadowbiasField.SetToolTipValue((mat.shadowbias)); |
---|
| 4860 | + if (!Equal(colorField.getFloat(), mat.color)) |
---|
| 4861 | + colorField.SetToolTipValue((mat.color)); |
---|
| 4862 | + if (!Equal(saturationField.getFloat(), mat.modulation)) |
---|
| 4863 | + saturationField.SetToolTipValue((mat.modulation)); |
---|
| 4864 | + if (!Equal(metalnessField.getFloat(), mat.metalness)) |
---|
| 4865 | + metalnessField.SetToolTipValue((mat.metalness)); |
---|
| 4866 | + if (!Equal(diffuseField.getFloat(), mat.diffuse)) |
---|
| 4867 | + diffuseField.SetToolTipValue((mat.diffuse)); |
---|
| 4868 | + if (!Equal(specularField.getFloat(), mat.specular)) |
---|
| 4869 | + specularField.SetToolTipValue((mat.specular)); |
---|
| 4870 | + if (!Equal(shininessField.getFloat(), mat.shininess)) |
---|
| 4871 | + shininessField.SetToolTipValue((mat.shininess)); |
---|
| 4872 | + if (!Equal(shiftField.getFloat(), mat.shift)) |
---|
| 4873 | + shiftField.SetToolTipValue((mat.shift)); |
---|
| 4874 | + if (!Equal(ambientField.getFloat(), mat.ambient)) |
---|
| 4875 | + ambientField.SetToolTipValue((mat.ambient)); |
---|
| 4876 | + if (!Equal(lightareaField.getFloat(), mat.lightarea)) |
---|
| 4877 | + lightareaField.SetToolTipValue((mat.lightarea)); |
---|
| 4878 | + if (!Equal(diffusenessField.getFloat(), mat.factor)) |
---|
| 4879 | + diffusenessField.SetToolTipValue((mat.factor)); |
---|
| 4880 | + if (!Equal(velvetField.getFloat(), mat.velvet)) |
---|
| 4881 | + velvetField.SetToolTipValue((mat.velvet)); |
---|
| 4882 | + if (!Equal(sheenField.getFloat(), mat.sheen)) |
---|
| 4883 | + sheenField.SetToolTipValue((mat.sheen)); |
---|
| 4884 | + if (!Equal(subsurfaceField.getFloat(), mat.subsurface)) |
---|
| 4885 | + subsurfaceField.SetToolTipValue((mat.subsurface)); |
---|
| 4886 | + if (!Equal(backlitField.getFloat(), mat.bump)) |
---|
| 4887 | + backlitField.SetToolTipValue((mat.bump)); |
---|
| 4888 | + if (!Equal(anisoField.getFloat(), mat.aniso)) |
---|
| 4889 | + anisoField.SetToolTipValue((mat.aniso)); |
---|
| 4890 | + if (!Equal(anisoVField.getFloat(), mat.anisoV)) |
---|
| 4891 | + anisoVField.SetToolTipValue((mat.anisoV)); |
---|
| 4892 | + if (!Equal(cameraField.getFloat(), mat.cameralight)) |
---|
| 4893 | + cameraField.SetToolTipValue((mat.cameralight)); |
---|
| 4894 | + if (!Equal(selfshadowField.getFloat(), mat.diffuseness)) |
---|
| 4895 | + selfshadowField.SetToolTipValue((mat.diffuseness)); |
---|
| 4896 | + if (!Equal(shadowField.getFloat(), mat.shadow)) |
---|
| 4897 | + shadowField.SetToolTipValue((mat.shadow)); |
---|
| 4898 | + if (!Equal(textureField.getFloat(), mat.texture)) |
---|
| 4899 | + textureField.SetToolTipValue((mat.texture)); |
---|
| 4900 | + if (!Equal(opacityField.getFloat(), mat.opacity)) |
---|
| 4901 | + opacityField.SetToolTipValue((mat.opacity)); |
---|
| 4902 | + if (!Equal(fakedepthField.getFloat(), mat.fakedepth)) |
---|
| 4903 | + fakedepthField.SetToolTipValue((mat.fakedepth)); |
---|
| 4904 | + if (!Equal(shadowbiasField.getFloat(), mat.shadowbias)) |
---|
| 4905 | + shadowbiasField.SetToolTipValue((mat.shadowbias)); |
---|
4135 | 4906 | } |
---|
4136 | 4907 | |
---|
4137 | 4908 | if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null) |
---|
.. | .. |
---|
4166 | 4937 | |
---|
4167 | 4938 | public void stateChanged(ChangeEvent e) |
---|
4168 | 4939 | { |
---|
4169 | | - // assert(false); |
---|
| 4940 | + // assert(false); |
---|
4170 | 4941 | if (e.getSource() == versionSlider) |
---|
4171 | 4942 | { |
---|
4172 | 4943 | if (muteSlider) |
---|
4173 | 4944 | return; |
---|
4174 | 4945 | |
---|
| 4946 | + Replace(); |
---|
| 4947 | + |
---|
4175 | 4948 | int version = versionSlider.getInteger(); |
---|
4176 | 4949 | |
---|
4177 | | - if (copy.versions[version] != null) |
---|
| 4950 | + if (version != -1 && copy.versionlist[version] != null) |
---|
4178 | 4951 | { |
---|
4179 | | - CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex = version])); |
---|
| 4952 | + copy.versionindex = version; |
---|
| 4953 | + CopyChanged(); |
---|
4180 | 4954 | } |
---|
4181 | 4955 | |
---|
4182 | 4956 | return; |
---|
.. | .. |
---|
4216 | 4990 | { |
---|
4217 | 4991 | //System.out.println("stateChanged = " + this); |
---|
4218 | 4992 | materialtouched = true; |
---|
| 4993 | + |
---|
| 4994 | + if (Globals.AUTOSATURATE && e.getSource() == colorField && saturationField.getFloat() == 0.001) |
---|
| 4995 | + { |
---|
| 4996 | + saturationField.setFloat(1); |
---|
| 4997 | + } |
---|
| 4998 | + |
---|
4219 | 4999 | applySelf(); |
---|
4220 | 5000 | //System.out.println("this = " + this); |
---|
4221 | 5001 | //System.out.println("PARENT = " + parent); |
---|
.. | .. |
---|
4515 | 5295 | { |
---|
4516 | 5296 | if (GetTree() != null) |
---|
4517 | 5297 | { |
---|
| 5298 | + GetTree().revalidate(); |
---|
4518 | 5299 | GetTree().repaint(); |
---|
4519 | 5300 | } |
---|
4520 | 5301 | |
---|
.. | .. |
---|
4523 | 5304 | ctrlPanel.validate(); // ? new |
---|
4524 | 5305 | ctrlPanel.repaint(); |
---|
4525 | 5306 | } |
---|
| 5307 | + |
---|
| 5308 | + if (previousVersionButton != null && copy.versionlist != null) |
---|
| 5309 | + SetVersionStates(); |
---|
| 5310 | + |
---|
| 5311 | + cameraView.requestFocusInWindow(); |
---|
4526 | 5312 | } |
---|
4527 | 5313 | |
---|
4528 | 5314 | static TweenManager tweenManager = new TweenManager(); |
---|
.. | .. |
---|
4554 | 5340 | // group = (Composite) group.get(0); |
---|
4555 | 5341 | // } |
---|
4556 | 5342 | |
---|
4557 | | - System.out.println("makeSomething of " + thing); |
---|
| 5343 | + //System.out.println("makeSomething of " + thing); |
---|
4558 | 5344 | |
---|
4559 | 5345 | /* |
---|
4560 | 5346 | if (deselect && jList != null) |
---|
.. | .. |
---|
4853 | 5639 | { |
---|
4854 | 5640 | //readobj.deepCopySelf(copy); |
---|
4855 | 5641 | copy.clear(); // june 2014 |
---|
| 5642 | + copy.skyboxname = readobj.skyboxname; |
---|
| 5643 | + copy.skyboxext = readobj.skyboxext; |
---|
4856 | 5644 | for (int i = 0; i < readobj.size(); i++) |
---|
4857 | 5645 | { |
---|
4858 | 5646 | Object3D child = readobj.get(i); // reserve(i); |
---|
.. | .. |
---|
4904 | 5692 | c.addChild(csg); |
---|
4905 | 5693 | } |
---|
4906 | 5694 | |
---|
4907 | | - copy.versions = readobj.versions; |
---|
| 5695 | + copy.versionlist = readobj.versionlist; |
---|
4908 | 5696 | copy.versionindex = readobj.versionindex; |
---|
| 5697 | + copy.versiontable = readobj.versiontable; |
---|
4909 | 5698 | |
---|
4910 | | - if (copy.versions == null) |
---|
| 5699 | + if (copy.versionlist == null) |
---|
4911 | 5700 | { |
---|
4912 | | - copy.versions = new byte[100][]; |
---|
| 5701 | + // Backward compatibility |
---|
| 5702 | + copy.versionlist = new Object3D[100]; |
---|
4913 | 5703 | copy.versionindex = -1; |
---|
| 5704 | + |
---|
| 5705 | + //Save(true); |
---|
4914 | 5706 | } |
---|
4915 | 5707 | |
---|
4916 | 5708 | //? SetUndoStates(); |
---|
.. | .. |
---|
4925 | 5717 | { |
---|
4926 | 5718 | if (Grafreed.standAlone) |
---|
4927 | 5719 | { |
---|
4928 | | - FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD); |
---|
| 5720 | + FileDialog browser = new FileDialog(frame, "Open", FileDialog.LOAD); |
---|
4929 | 5721 | browser.show(); |
---|
4930 | 5722 | String filename = browser.getFile(); |
---|
4931 | 5723 | if (filename != null && filename.length() > 0) |
---|
.. | .. |
---|
5002 | 5794 | |
---|
5003 | 5795 | void save() |
---|
5004 | 5796 | { |
---|
| 5797 | + Replace(); |
---|
| 5798 | + |
---|
5005 | 5799 | if (lastname == null) |
---|
5006 | 5800 | { |
---|
5007 | 5801 | return; |
---|
.. | .. |
---|
5244 | 6038 | ButtonGroup buttonGroup; |
---|
5245 | 6039 | |
---|
5246 | 6040 | cGridBag toolboxPanel; |
---|
| 6041 | + cGridBag skyboxPanel; |
---|
5247 | 6042 | cGridBag materialPanel; |
---|
5248 | 6043 | cGridBag ctrlPanel; |
---|
5249 | 6044 | |
---|
.. | .. |
---|
5255 | 6050 | boolean materialFlushed; |
---|
5256 | 6051 | Object3D latestObject; |
---|
5257 | 6052 | |
---|
| 6053 | + cGridBag transformPanel; |
---|
5258 | 6054 | cGridBag XYZPanel; |
---|
5259 | 6055 | |
---|
5260 | 6056 | JSplitPane gridPanel; |
---|
.. | .. |
---|
5317 | 6113 | JLabel colorLabel; |
---|
5318 | 6114 | cNumberSlider colorField; |
---|
5319 | 6115 | JLabel modulationLabel; |
---|
5320 | | - cNumberSlider modulationField; |
---|
| 6116 | + cNumberSlider saturationField; |
---|
5321 | 6117 | JLabel metalnessLabel; |
---|
5322 | 6118 | cNumberSlider metalnessField; |
---|
5323 | 6119 | JLabel diffuseLabel; |
---|
.. | .. |
---|
5348 | 6144 | cNumberSlider anisoField; |
---|
5349 | 6145 | JLabel anisoVLabel; |
---|
5350 | 6146 | cNumberSlider anisoVField; |
---|
| 6147 | + |
---|
5351 | 6148 | JLabel cameraLabel; |
---|
5352 | 6149 | cNumberSlider cameraField; |
---|
5353 | 6150 | JLabel selfshadowLabel; |
---|
.. | .. |
---|
5362 | 6159 | cNumberSlider fakedepthField; |
---|
5363 | 6160 | JLabel shadowbiasLabel; |
---|
5364 | 6161 | cNumberSlider shadowbiasField; |
---|
| 6162 | + |
---|
5365 | 6163 | JLabel bumpLabel; |
---|
5366 | 6164 | cNumberSlider bumpField; |
---|
5367 | 6165 | JLabel noiseLabel; |
---|