.. | .. |
---|
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)); |
---|
82 | | - |
---|
| 137 | + BufferedImage image; |
---|
| 138 | + |
---|
| 139 | + if (name.endsWith("jpg")) |
---|
| 140 | + // Much faster! |
---|
| 141 | + image = new sun.awt.image.codec.JPEGImageDecoderImpl(ObjEditor.class.getClassLoader().getResourceAsStream(name)).decodeAsBufferedImage(); |
---|
| 142 | + else |
---|
| 143 | + image = javax.imageio.ImageIO.read(ObjEditor.class.getClassLoader().getResourceAsStream(name)); |
---|
| 144 | + |
---|
83 | 145 | // if (image.getWidth() > 48 && image.getHeight() > 48) |
---|
84 | 146 | // { |
---|
85 | 147 | // BufferedImage resized = new BufferedImage(48, 48, image.getType()); |
---|
.. | .. |
---|
93 | 155 | // } |
---|
94 | 156 | |
---|
95 | 157 | javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image); |
---|
| 158 | + |
---|
| 159 | + icons.put(name, icon); |
---|
| 160 | + |
---|
96 | 161 | return icon; |
---|
97 | 162 | } |
---|
98 | 163 | catch (Exception e) |
---|
99 | 164 | { |
---|
| 165 | + //icons.put(name, null); |
---|
100 | 166 | return null; |
---|
101 | 167 | } |
---|
102 | 168 | } |
---|
.. | .. |
---|
296 | 362 | client = inClient; |
---|
297 | 363 | copy = client; |
---|
298 | 364 | |
---|
299 | | - if (copy.versionlist == null) |
---|
300 | | - { |
---|
301 | | - copy.versionlist = new Object3D[100]; |
---|
302 | | - copy.versionindex = -1; |
---|
303 | | - } |
---|
| 365 | +// if (copy.versionlist == null) |
---|
| 366 | +// { |
---|
| 367 | +// copy.versionlist = new Object3D[100]; |
---|
| 368 | +// copy.versionindex = -1; |
---|
| 369 | +// |
---|
| 370 | +// callee.Save(true); |
---|
| 371 | +// } |
---|
304 | 372 | |
---|
305 | 373 | // "this" is not called: SetupUI2(objEditor); |
---|
306 | 374 | } |
---|
.. | .. |
---|
319 | 387 | { |
---|
320 | 388 | copy.versionlist = new Object3D[100]; |
---|
321 | 389 | copy.versionindex = -1; |
---|
| 390 | + |
---|
| 391 | +// Save(true); |
---|
322 | 392 | } |
---|
323 | 393 | |
---|
324 | 394 | SetupUI2(callee.GetEditor()); |
---|
.. | .. |
---|
342 | 412 | //parent = p; |
---|
343 | 413 | |
---|
344 | 414 | GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice(); |
---|
345 | | - System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow()); |
---|
| 415 | + if (Globals.DEBUG) |
---|
| 416 | + System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow()); |
---|
346 | 417 | //gd.setFullScreenWindow(this); |
---|
347 | 418 | //setResizable(false); |
---|
348 | 419 | //if (!isDisplayable()) |
---|
.. | .. |
---|
353 | 424 | copy = localCopy; |
---|
354 | 425 | copy.editWindow = this; |
---|
355 | 426 | |
---|
356 | | - if (copy.versionlist == null) |
---|
357 | | - { |
---|
358 | | -// copy.versions = new byte[100][]; |
---|
| 427 | +// if (copy.versionlist == null) |
---|
| 428 | +// { |
---|
| 429 | +// copy.versionlist = new Object3D[100]; |
---|
359 | 430 | // copy.versionindex = -1; |
---|
360 | | - } |
---|
| 431 | +// |
---|
| 432 | +// Save(true); |
---|
| 433 | +// } |
---|
361 | 434 | |
---|
362 | 435 | SetupMenu(); |
---|
363 | 436 | |
---|
.. | .. |
---|
377 | 450 | |
---|
378 | 451 | static java.util.Vector<Object3D> listUI = new java.util.Vector<Object3D>(); |
---|
379 | 452 | |
---|
| 453 | + // This is to refresh the UI of the material panel. |
---|
| 454 | + boolean patchMaterial; |
---|
| 455 | + |
---|
380 | 456 | void SetupMenu() |
---|
381 | 457 | { |
---|
382 | 458 | frame.setMenuBar(menuBar = new MenuBar()); |
---|
.. | .. |
---|
390 | 466 | importOBJItem.addActionListener(this); |
---|
391 | 467 | import3DSItem = menu.add(new MenuItem("3DS file...")); |
---|
392 | 468 | import3DSItem.addActionListener(this); |
---|
| 469 | + if (Globals.ADVANCED) |
---|
| 470 | + { |
---|
393 | 471 | importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file...")); |
---|
394 | 472 | importVRMLX3DItem.addActionListener(this); |
---|
| 473 | + } |
---|
395 | 474 | menu.add("-"); |
---|
396 | 475 | importGFDItem = menu.add(new MenuItem("Grafreed file...")); |
---|
397 | 476 | importGFDItem.addActionListener(this); |
---|
.. | .. |
---|
426 | 505 | |
---|
427 | 506 | ChangeListener changeListener = new ChangeListener() |
---|
428 | 507 | { |
---|
| 508 | + //String name; |
---|
| 509 | + |
---|
429 | 510 | public void stateChanged(ChangeEvent changeEvent) |
---|
430 | 511 | { |
---|
431 | 512 | // if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Material") && !materialFlushed) |
---|
.. | .. |
---|
444 | 525 | // EditSelection(false); |
---|
445 | 526 | // } |
---|
446 | 527 | |
---|
447 | | - refreshContents(false); // To refresh Info tab |
---|
| 528 | +// if (objectPanel.getSelectedIndex() == 4) |
---|
| 529 | +// { |
---|
| 530 | +// name = copy.skyboxname; |
---|
| 531 | +// |
---|
| 532 | +// if (name == null) |
---|
| 533 | +// { |
---|
| 534 | +// name = ""; |
---|
| 535 | +// } |
---|
| 536 | +// |
---|
| 537 | +// copy.skyboxname = "cubemaps/default-skyboxes/rgb"; |
---|
| 538 | +// copy.skyboxext = "jpg"; |
---|
| 539 | +// } |
---|
| 540 | +// else |
---|
| 541 | +// { |
---|
| 542 | +// if (name != null) |
---|
| 543 | +// { |
---|
| 544 | +// if (name.equals("")) |
---|
| 545 | +// { |
---|
| 546 | +// copy.skyboxname = null; |
---|
| 547 | +// copy.skyboxext = null; |
---|
| 548 | +// } |
---|
| 549 | +// else |
---|
| 550 | +// { |
---|
| 551 | +// copy.skyboxname = name; |
---|
| 552 | +// } |
---|
| 553 | +// } |
---|
| 554 | +// } |
---|
| 555 | + cameraView.transformMode = objectPanel.getSelectedIndex() == 4; |
---|
| 556 | + |
---|
| 557 | +// refreshContents(false); // To refresh Info tab |
---|
| 558 | + cameraView.repaint(); |
---|
448 | 559 | } |
---|
449 | 560 | }; |
---|
450 | 561 | objectPanel.addChangeListener(changeListener); |
---|
.. | .. |
---|
466 | 577 | |
---|
467 | 578 | toolboxPanel = new cGridBag().setVertical(true); |
---|
468 | 579 | //toolboxPanel.setName("Toolbox"); |
---|
| 580 | + |
---|
| 581 | + skyboxPanel = new cGridBag().setVertical(true); |
---|
469 | 582 | |
---|
470 | 583 | materialPanel = new cGridBag().setVertical(false); |
---|
471 | 584 | //materialPanel.setName("Material"); |
---|
.. | .. |
---|
751 | 864 | boolean maximized; |
---|
752 | 865 | |
---|
753 | 866 | cButton fullscreenLayout; |
---|
| 867 | + cButton expandedLayout; |
---|
754 | 868 | |
---|
755 | 869 | void Minimize() |
---|
756 | 870 | { |
---|
.. | .. |
---|
790 | 904 | cButton minButton; |
---|
791 | 905 | cButton maxButton; |
---|
792 | 906 | cButton fullButton; |
---|
| 907 | + cButton collapseButton; |
---|
| 908 | + cButton maximize3DButton; |
---|
793 | 909 | |
---|
794 | 910 | void ToggleFullScreen() |
---|
795 | 911 | { |
---|
796 | | -GraphicsDevice device = frame.getGraphicsConfiguration().getDevice(); |
---|
| 912 | + GraphicsDevice device = frame.getGraphicsConfiguration().getDevice(); |
---|
797 | 913 | |
---|
798 | 914 | cameraView.ToggleFullScreen(); |
---|
799 | 915 | |
---|
.. | .. |
---|
814 | 930 | // X frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
815 | 931 | // X framePanel.add(bigThree); |
---|
816 | 932 | // X frame.getContentPane().add(/*"Center",*/framePanel); |
---|
817 | | - framePanel.setDividerLocation(46); |
---|
| 933 | +// framePanel.setDividerLocation(46); // icons are 24x24 |
---|
818 | 934 | |
---|
819 | 935 | //frame.setVisible(true); |
---|
820 | | - radio.layout = keepButton; |
---|
| 936 | +// radio.layout = keepButton; |
---|
821 | 937 | //theFrame = null; |
---|
822 | 938 | keepButton = null; |
---|
823 | | - radio.layout.doClick(); |
---|
| 939 | +// radio.layout.doClick(); |
---|
824 | 940 | |
---|
825 | 941 | } else |
---|
826 | 942 | { |
---|
.. | .. |
---|
841 | 957 | // X frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
842 | 958 | // X framePanel.remove(bigThree); |
---|
843 | 959 | // X frame.getContentPane().add(/*"Center",*/bigThree); |
---|
844 | | - framePanel.setDividerLocation(0); |
---|
| 960 | +// framePanel.setDividerLocation(0); |
---|
845 | 961 | |
---|
846 | | - radio.layout = fullscreenLayout; |
---|
847 | | - radio.layout.doClick(); |
---|
| 962 | +// radio.layout = fullscreenLayout; |
---|
| 963 | +// radio.layout.doClick(); |
---|
848 | 964 | //frame.setVisible(true); |
---|
849 | 965 | } |
---|
850 | 966 | frame.validate(); |
---|
| 967 | + |
---|
| 968 | + cameraView.requestFocusInWindow(); |
---|
851 | 969 | } |
---|
852 | 970 | |
---|
853 | | - private Object3D CompressCopy() |
---|
| 971 | + void CollapseToolbar() |
---|
| 972 | + { |
---|
| 973 | + framePanel.setDividerLocation(0); |
---|
| 974 | + //frame.validate(); |
---|
| 975 | + |
---|
| 976 | + cameraView.requestFocusInWindow(); |
---|
| 977 | + } |
---|
| 978 | + |
---|
| 979 | + private Object3D Duplicate(Object3D object) |
---|
854 | 980 | { |
---|
855 | 981 | boolean temp = CameraPane.SWITCH; |
---|
856 | 982 | CameraPane.SWITCH = false; |
---|
857 | 983 | |
---|
858 | | - copy.ExtractBigData(versiontable); |
---|
| 984 | + if (Grafreed.grafreed.universe.versiontable == null) |
---|
| 985 | + Grafreed.grafreed.universe.versiontable = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
| 986 | + |
---|
| 987 | + object.ExtractBigData(Grafreed.grafreed.universe.versiontable); |
---|
859 | 988 | // if (copy == client) |
---|
860 | 989 | |
---|
861 | | - Object3D versions[] = copy.versionlist; |
---|
862 | | - copy.versionlist = null; |
---|
| 990 | + Object3D versions[] = object.versionlist; |
---|
| 991 | + java.util.Hashtable<java.util.UUID, Object3D> versiontable = object.versiontable; // if Grafreed.grafreed.universe |
---|
| 992 | + object.versionlist = null; |
---|
| 993 | + object.versiontable = null; |
---|
| 994 | + |
---|
| 995 | + Object3D parent = object.parent; |
---|
| 996 | + object.parent = null; |
---|
863 | 997 | |
---|
864 | 998 | //byte[] compress = Compress(copy); |
---|
865 | | - Object3D compress = (Object3D)Grafreed.clone(copy); |
---|
| 999 | + Object3D compress = (Object3D)Grafreed.clone(object); |
---|
866 | 1000 | |
---|
867 | | - copy.versionlist = versions; |
---|
| 1001 | + object.parent = parent; |
---|
868 | 1002 | |
---|
869 | | - copy.RestoreBigData(versiontable); |
---|
| 1003 | + object.versionlist = versions; |
---|
| 1004 | + object.versiontable = versiontable; // if Grafreed.grafreed.universe |
---|
| 1005 | + |
---|
| 1006 | + object.RestoreBigData(Grafreed.grafreed.universe.versiontable); |
---|
870 | 1007 | |
---|
871 | 1008 | CameraPane.SWITCH = temp; |
---|
872 | 1009 | |
---|
.. | .. |
---|
1203 | 1340 | |
---|
1204 | 1341 | namePanel = new cGridBag(); |
---|
1205 | 1342 | |
---|
| 1343 | + //if (copy.pinned) |
---|
| 1344 | + { |
---|
| 1345 | + pinButton = GetToggleButton("icons/pin.png", !Globals.NIMBUSLAF); |
---|
| 1346 | + pinButton.setSelected(copy.pinned); |
---|
| 1347 | + cGridBag t = new cGridBag(); |
---|
| 1348 | + t.preferredWidth = 2; |
---|
| 1349 | + t.add(pinButton); |
---|
| 1350 | + namePanel.add(t); |
---|
| 1351 | + |
---|
| 1352 | + pinButton.addItemListener(this); |
---|
| 1353 | + } |
---|
| 1354 | + |
---|
1206 | 1355 | nameField = AddText(namePanel, copy.GetName()); |
---|
1207 | 1356 | namePanel.add(new JScrollPane(nameField, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER)); |
---|
1208 | 1357 | oe.ctrlPanel.add(namePanel); |
---|
.. | .. |
---|
1216 | 1365 | |
---|
1217 | 1366 | liveCB = AddCheckBox(setupPanel, "Live", copy.live); |
---|
1218 | 1367 | liveCB.setToolTipText("Animate object"); |
---|
| 1368 | + markCB = AddCheckBox(setupPanel, "Anim", copy.marked); |
---|
| 1369 | + markCB.setToolTipText("Set target transform"); |
---|
1219 | 1370 | selectableCB = AddCheckBox(setupPanel, "Select", !copy.dontselect); |
---|
1220 | 1371 | selectableCB.setToolTipText("Make object selectable"); |
---|
1221 | 1372 | // Return(); |
---|
1222 | 1373 | |
---|
1223 | 1374 | hideCB = AddCheckBox(setupPanel, "Hide", copy.hide); |
---|
1224 | 1375 | hideCB.setToolTipText("Hide object"); |
---|
1225 | | - markCB = AddCheckBox(setupPanel, "Mark", copy.marked); |
---|
1226 | | - markCB.setToolTipText("As animation target transform"); |
---|
1227 | 1376 | |
---|
1228 | 1377 | ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false); |
---|
1229 | 1378 | |
---|
.. | .. |
---|
1425 | 1574 | |
---|
1426 | 1575 | if (cam == null || !(copy.get(0) instanceof cGroup)) |
---|
1427 | 1576 | { |
---|
1428 | | - System.out.println("CREATE CAMERAS"); |
---|
1429 | | - cams = new cTemplate(); |
---|
1430 | | - cams.name = "Cameras"; |
---|
1431 | | - copy.insertElementAt(cams, 0); |
---|
1432 | | - //cams.parent = copy; |
---|
1433 | | - |
---|
1434 | | - cam = new Camera(); // LA.newVector(3, 2, 1)); |
---|
1435 | | - cams.addChild(cam); |
---|
1436 | | - cam = new Camera(1); |
---|
1437 | | - cams.addChild(cam); |
---|
1438 | | - cam = new Camera(2); |
---|
1439 | | - cams.addChild(cam); |
---|
1440 | | - cam = new Camera(3); |
---|
1441 | | - cams.addChild(cam); |
---|
1442 | | - cam = new Camera(4); // Light |
---|
1443 | | - cams.addChild(cam); |
---|
| 1577 | + if (Globals.DEBUG) |
---|
| 1578 | + System.out.println("CREATE CAMERAS"); |
---|
| 1579 | + cams = CreateCameras(); |
---|
1444 | 1580 | } else |
---|
1445 | 1581 | { |
---|
1446 | 1582 | cams = (cGroup) copy.get(0); |
---|
.. | .. |
---|
1506 | 1642 | //frontView.object = copy; |
---|
1507 | 1643 | //sideView.object = copy; |
---|
1508 | 1644 | |
---|
| 1645 | + transformPanel = new cGridBag().setVertical(true); |
---|
| 1646 | + |
---|
| 1647 | + cGridBag resetTransformPanel = new cGridBag(); |
---|
| 1648 | + |
---|
| 1649 | + resetTransformPanel.preferredHeight = 2; |
---|
| 1650 | + |
---|
| 1651 | + cButton resetTransform = GetButton("Reset all", !Globals.NIMBUSLAF); |
---|
| 1652 | + resetTransform.setToolTipText("Reset Translation, Rotation and Scale"); |
---|
| 1653 | + resetTransform.addMouseListener(new MouseAdapter() |
---|
| 1654 | + { |
---|
| 1655 | + public void mouseClicked(MouseEvent e) |
---|
| 1656 | + { |
---|
| 1657 | + ResetTransform(); |
---|
| 1658 | + } |
---|
| 1659 | + }); |
---|
| 1660 | + resetTransformPanel.add(resetTransform); |
---|
| 1661 | + |
---|
| 1662 | + resetTransform = GetButton("T only", !Globals.NIMBUSLAF); |
---|
| 1663 | + resetTransform.setToolTipText("Reset Translation only"); |
---|
| 1664 | + resetTransform.addMouseListener(new MouseAdapter() |
---|
| 1665 | + { |
---|
| 1666 | + public void mouseClicked(MouseEvent e) |
---|
| 1667 | + { |
---|
| 1668 | + ResetTransform(1); |
---|
| 1669 | + } |
---|
| 1670 | + }); |
---|
| 1671 | + resetTransformPanel.add(resetTransform); |
---|
| 1672 | + |
---|
| 1673 | + resetTransform = GetButton("RS only", !Globals.NIMBUSLAF); |
---|
| 1674 | + resetTransform.setToolTipText("Reset Rotation and Scale only"); |
---|
| 1675 | + resetTransform.addMouseListener(new MouseAdapter() |
---|
| 1676 | + { |
---|
| 1677 | + public void mouseClicked(MouseEvent e) |
---|
| 1678 | + { |
---|
| 1679 | + ResetTransform(2); |
---|
| 1680 | + } |
---|
| 1681 | + }); |
---|
| 1682 | + resetTransformPanel.add(resetTransform); |
---|
| 1683 | + |
---|
1509 | 1684 | XYZPanel = new cGridBag().setVertical(true); |
---|
1510 | 1685 | //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5)); |
---|
1511 | 1686 | |
---|
.. | .. |
---|
1515 | 1690 | XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll); |
---|
1516 | 1691 | //XYZPanel.setName("XYZ"); |
---|
1517 | 1692 | |
---|
| 1693 | + transformPanel.add(resetTransformPanel); |
---|
| 1694 | + transformPanel.add(XYZPanel); |
---|
| 1695 | + |
---|
1518 | 1696 | /* |
---|
1519 | 1697 | gridPanel = new JPanel(); //new BorderLayout()); |
---|
1520 | 1698 | gridPanel.setLayout(new GridLayout(1, 2)); |
---|
.. | .. |
---|
1522 | 1700 | gridPanel.add(cameraView); |
---|
1523 | 1701 | gridPanel.add(XYZPanel); |
---|
1524 | 1702 | */ |
---|
1525 | | - gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, centralPanel, XYZPanel); //new BorderLayout()); |
---|
1526 | | - gridPanel.setContinuousLayout(true); |
---|
1527 | | - gridPanel.setOneTouchExpandable(true); |
---|
1528 | | - gridPanel.setDividerLocation(1.0); |
---|
1529 | | - gridPanel.setDividerSize(9); |
---|
1530 | | - gridPanel.setResizeWeight(0.85); |
---|
| 1703 | +// gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, centralPanel, XYZPanel); //new BorderLayout()); |
---|
| 1704 | +// gridPanel.setContinuousLayout(true); |
---|
| 1705 | +// gridPanel.setOneTouchExpandable(true); |
---|
| 1706 | +// gridPanel.setDividerLocation(1.0); |
---|
| 1707 | +// gridPanel.setDividerSize(9); |
---|
| 1708 | +// gridPanel.setResizeWeight(0.85); |
---|
1531 | 1709 | |
---|
1532 | 1710 | // aConstraints.weighty = 0; |
---|
1533 | 1711 | //System.out.println("THIS = " + this); |
---|
.. | .. |
---|
1550 | 1728 | |
---|
1551 | 1729 | //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); |
---|
1552 | 1730 | //tmp.setName("Edit"); |
---|
| 1731 | + objectPanel.add(skyboxPanel); |
---|
| 1732 | + objectPanel.setIconAt(0, GetIcon("icons/skybox.jpg")); |
---|
| 1733 | + objectPanel.setToolTipTextAt(0, "Backgrounds"); |
---|
| 1734 | + |
---|
| 1735 | + objectPanel.add(toolboxPanel); |
---|
| 1736 | + objectPanel.setIconAt(1, GetIcon("icons/primitives.png")); |
---|
| 1737 | + objectPanel.setToolTipTextAt(1, "Objects & textures"); |
---|
| 1738 | + |
---|
1553 | 1739 | objectPanel.add(materialPanel); |
---|
1554 | | - objectPanel.setIconAt(0, GetIcon("icons/material.png")); |
---|
1555 | | - objectPanel.setToolTipTextAt(0, "Material"); |
---|
| 1740 | + objectPanel.setIconAt(2, GetIcon("icons/material.png")); |
---|
| 1741 | + objectPanel.setToolTipTextAt(2, "Material"); |
---|
1556 | 1742 | |
---|
1557 | 1743 | // JPanel north = new JPanel(new BorderLayout()); |
---|
1558 | 1744 | // north.setName("Edit"); |
---|
1559 | 1745 | // north.add(ctrlPanel, BorderLayout.NORTH); |
---|
1560 | 1746 | // objectPanel.add(north); |
---|
1561 | 1747 | objectPanel.add(editPanel); |
---|
1562 | | - objectPanel.setIconAt(1, GetIcon("icons/write.png")); |
---|
1563 | | - objectPanel.setToolTipTextAt(1, "Edit controls"); |
---|
| 1748 | + objectPanel.setIconAt(3, GetIcon("icons/writewhite.png")); |
---|
| 1749 | + objectPanel.setToolTipTextAt(3, "Edit controls"); |
---|
1564 | 1750 | |
---|
1565 | | - //if (Globals.ADVANCED) |
---|
1566 | | - objectPanel.add(infoPanel); |
---|
1567 | | - objectPanel.setIconAt(2, GetIcon("icons/info.png")); |
---|
1568 | | - objectPanel.setToolTipTextAt(2, "Information"); |
---|
| 1751 | + objectPanel.add(transformPanel); |
---|
| 1752 | + objectPanel.setIconAt(4, GetIcon("icons/XYZ.png")); |
---|
| 1753 | + objectPanel.setToolTipTextAt(4, "TRS transform"); |
---|
1569 | 1754 | |
---|
1570 | | - objectPanel.add(XYZPanel); |
---|
1571 | | - objectPanel.setIconAt(3, GetIcon("icons/XYZ.png")); |
---|
1572 | | - objectPanel.setToolTipTextAt(3, "XYZ/RGB transform"); |
---|
1573 | | - |
---|
1574 | | - objectPanel.add(toolboxPanel); |
---|
1575 | | - objectPanel.setIconAt(4, GetIcon("icons/primitives.png")); |
---|
1576 | | - objectPanel.setToolTipTextAt(4, "Objects & backgrounds"); |
---|
1577 | | - |
---|
| 1755 | + patchMaterial = true; |
---|
| 1756 | + cameraView.patchMaterial = this; |
---|
| 1757 | + objectPanel.setSelectedIndex(2); |
---|
| 1758 | + |
---|
1578 | 1759 | /* |
---|
1579 | 1760 | aConstraints.gridx = 0; |
---|
1580 | 1761 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1594 | 1775 | scrollpane.addMouseWheelListener(this); // Default not fast enough |
---|
1595 | 1776 | |
---|
1596 | 1777 | /*JTabbedPane*/ scenePanel = new cGridBag(); |
---|
1597 | | - scenePanel.preferredWidth = 5; |
---|
| 1778 | + scenePanel.preferredWidth = 6; |
---|
1598 | 1779 | |
---|
1599 | 1780 | JTabbedPane tabbedPane = new JTabbedPane(); |
---|
1600 | 1781 | tabbedPane.add(scrollpane); |
---|
.. | .. |
---|
1605 | 1786 | |
---|
1606 | 1787 | AddOptions(optionsPanel); //, aConstraints); |
---|
1607 | 1788 | |
---|
1608 | | - tabbedPane.add(optionsPanel); |
---|
1609 | | - |
---|
1610 | 1789 | tabbedPane.add(FSPane = new cFileSystemPane(this)); |
---|
1611 | 1790 | |
---|
| 1791 | + tabbedPane.add(optionsPanel); |
---|
| 1792 | + |
---|
1612 | 1793 | scenePanel.add(tabbedPane); |
---|
| 1794 | + |
---|
| 1795 | + cGridBag creditsPanel = new cGridBag().setVertical(true); |
---|
| 1796 | + creditsPanel.setName("Credits"); |
---|
| 1797 | + |
---|
| 1798 | + cLabel ogaLabel = new cLabel(" Skyboxes courtesy of OpenGameArt!", !Globals.NIMBUSLAF); |
---|
| 1799 | + creditsPanel.add(ogaLabel); |
---|
| 1800 | + |
---|
| 1801 | + cButton creditButton; |
---|
| 1802 | + creditsPanel.add(creditButton = GetButton("icons/sara-logo.png", !Globals.NIMBUSLAF)); |
---|
| 1803 | + creditButton.setToolTipText("https://opengameart.org"); |
---|
| 1804 | + |
---|
| 1805 | + creditButton.addMouseListener(new MouseAdapter() |
---|
| 1806 | + { |
---|
| 1807 | + public void mouseClicked(MouseEvent e) |
---|
| 1808 | + { |
---|
| 1809 | + try |
---|
| 1810 | + { |
---|
| 1811 | + Desktop.getDesktop().browse(new java.net.URI("https://opengameart.org/")); |
---|
| 1812 | + } catch (Exception e1) |
---|
| 1813 | +// } catch (java.io.IOException | java.net.URISyntaxException e1) |
---|
| 1814 | + { |
---|
| 1815 | + e1.printStackTrace(); |
---|
| 1816 | + } |
---|
| 1817 | + } |
---|
| 1818 | + }); |
---|
| 1819 | + |
---|
| 1820 | + ogaLabel = new cLabel(" Download 3D models! (.3ds and .obj only)", !Globals.NIMBUSLAF); |
---|
| 1821 | + creditsPanel.add(ogaLabel); |
---|
| 1822 | + |
---|
| 1823 | + creditsPanel.add(creditButton = GetButton("icons/3delicious.png", !Globals.NIMBUSLAF)); |
---|
| 1824 | + creditButton.setToolTipText("https://3delicious.net"); |
---|
| 1825 | + |
---|
| 1826 | + creditButton.addMouseListener(new MouseAdapter() |
---|
| 1827 | + { |
---|
| 1828 | + public void mouseClicked(MouseEvent e) |
---|
| 1829 | + { |
---|
| 1830 | + try |
---|
| 1831 | + { |
---|
| 1832 | + Desktop.getDesktop().browse(new java.net.URI("https://3delicious.net")); |
---|
| 1833 | + } catch (Exception e1) |
---|
| 1834 | +// } catch (java.io.IOException | java.net.URISyntaxException e1) |
---|
| 1835 | + { |
---|
| 1836 | + e1.printStackTrace(); |
---|
| 1837 | + } |
---|
| 1838 | + } |
---|
| 1839 | + }); |
---|
| 1840 | + |
---|
| 1841 | + creditsPanel.add(creditButton = GetButton("icons/archive3d.png", !Globals.NIMBUSLAF)); |
---|
| 1842 | + creditButton.setToolTipText("https://archive3d.net"); |
---|
| 1843 | + |
---|
| 1844 | + creditButton.addMouseListener(new MouseAdapter() |
---|
| 1845 | + { |
---|
| 1846 | + public void mouseClicked(MouseEvent e) |
---|
| 1847 | + { |
---|
| 1848 | + try |
---|
| 1849 | + { |
---|
| 1850 | + Desktop.getDesktop().browse(new java.net.URI("https://archive3d.net")); |
---|
| 1851 | + } catch (Exception e1) |
---|
| 1852 | +// } catch (java.io.IOException | java.net.URISyntaxException e1) |
---|
| 1853 | + { |
---|
| 1854 | + e1.printStackTrace(); |
---|
| 1855 | + } |
---|
| 1856 | + } |
---|
| 1857 | + }); |
---|
| 1858 | + |
---|
| 1859 | + creditsPanel.add(creditButton = GetButton("icons/turbosquid.png", !Globals.NIMBUSLAF)); |
---|
| 1860 | + creditButton.setToolTipText("https://turbosquid.com"); |
---|
| 1861 | + |
---|
| 1862 | + creditButton.addMouseListener(new MouseAdapter() |
---|
| 1863 | + { |
---|
| 1864 | + public void mouseClicked(MouseEvent e) |
---|
| 1865 | + { |
---|
| 1866 | + try |
---|
| 1867 | + { |
---|
| 1868 | + Desktop.getDesktop().browse(new java.net.URI("https://www.turbosquid.com/Search/3D-Models/free")); |
---|
| 1869 | + } catch (Exception e1) |
---|
| 1870 | +// } catch (java.io.IOException | java.net.URISyntaxException e1) |
---|
| 1871 | + { |
---|
| 1872 | + e1.printStackTrace(); |
---|
| 1873 | + } |
---|
| 1874 | + } |
---|
| 1875 | + }); |
---|
| 1876 | + |
---|
| 1877 | + for (int i=6; --i>=0;) |
---|
| 1878 | + { |
---|
| 1879 | + creditsPanel.add(new cGridBag()); |
---|
| 1880 | + } |
---|
| 1881 | + |
---|
| 1882 | + tabbedPane.add(creditsPanel); |
---|
| 1883 | + tabbedPane.setToolTipTextAt(3, "Credits"); |
---|
| 1884 | + |
---|
| 1885 | + if (Globals.ADVANCED) |
---|
| 1886 | + { |
---|
| 1887 | + tabbedPane.add(infoPanel); |
---|
| 1888 | + tabbedPane.setIconAt(4, GetIcon("icons/info.png")); |
---|
| 1889 | + tabbedPane.setToolTipTextAt(4, "Information"); |
---|
| 1890 | + } |
---|
1613 | 1891 | |
---|
1614 | 1892 | /* |
---|
1615 | 1893 | cTree jTree = new cTree(null); |
---|
.. | .. |
---|
1631 | 1909 | jtp.add(tree); |
---|
1632 | 1910 | */ |
---|
1633 | 1911 | |
---|
1634 | | - bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, scenePanel, gridPanel); |
---|
1635 | | - bigPanel.setContinuousLayout(true); |
---|
1636 | | - bigPanel.setOneTouchExpandable(true); |
---|
1637 | | - bigPanel.setDividerLocation(0.8); |
---|
1638 | | - bigPanel.setDividerSize(15); |
---|
1639 | | - bigPanel.setResizeWeight(0.15); |
---|
1640 | | - bigPanel.setName("Scene"); |
---|
| 1912 | +// bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, scenePanel, gridPanel); |
---|
| 1913 | +// bigPanel.setContinuousLayout(true); |
---|
| 1914 | +// bigPanel.setOneTouchExpandable(true); |
---|
| 1915 | +// bigPanel.setDividerLocation(0.8); |
---|
| 1916 | +// bigPanel.setDividerSize(15); |
---|
| 1917 | +// bigPanel.setResizeWeight(0.15); |
---|
| 1918 | +// bigPanel.setName("Scene"); |
---|
1641 | 1919 | |
---|
1642 | 1920 | //bigPanel.setLayout(new BorderLayout()); |
---|
1643 | 1921 | //bigPanel.setSize(new Dimension(10,10)); |
---|
.. | .. |
---|
1681 | 1959 | // aConstraints.gridheight = 1; |
---|
1682 | 1960 | |
---|
1683 | 1961 | framePanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, toolbarPanel, bigThree); |
---|
| 1962 | + |
---|
| 1963 | + framePanel.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY, |
---|
| 1964 | + new java.beans.PropertyChangeListener() |
---|
| 1965 | + { |
---|
| 1966 | + public void propertyChange(java.beans.PropertyChangeEvent pce) |
---|
| 1967 | + { |
---|
| 1968 | + if ((Integer)pce.getOldValue() == 1) |
---|
| 1969 | + { |
---|
| 1970 | + if (radio.layout != expandedLayout) |
---|
| 1971 | + { |
---|
| 1972 | + radio.layout = expandedLayout; |
---|
| 1973 | + radio.layout.doClick(); |
---|
| 1974 | + } |
---|
| 1975 | + } |
---|
| 1976 | + } |
---|
| 1977 | + }); |
---|
| 1978 | + |
---|
1684 | 1979 | framePanel.setContinuousLayout(false); |
---|
1685 | 1980 | framePanel.setOneTouchExpandable(false); |
---|
1686 | 1981 | //.setDividerLocation(0.8); |
---|
.. | .. |
---|
1690 | 1985 | |
---|
1691 | 1986 | frame.getContentPane().setLayout(new BorderLayout()); |
---|
1692 | 1987 | /**/ |
---|
1693 | | - JTabbedPane worldPane = new JTabbedPane(); |
---|
| 1988 | + //JTabbedPane worldPane = new JTabbedPane(); |
---|
1694 | 1989 | //worldPane.add(bigPanel); |
---|
1695 | 1990 | //worldPane.add(worldPanel); |
---|
1696 | 1991 | /**/ |
---|
.. | .. |
---|
1704 | 1999 | |
---|
1705 | 2000 | cameraView.requestFocusInWindow(); |
---|
1706 | 2001 | |
---|
1707 | | - gridPanel.setDividerLocation(1.0); |
---|
| 2002 | +// gridPanel.setDividerLocation(1.0); |
---|
1708 | 2003 | |
---|
1709 | 2004 | frame.validate(); |
---|
1710 | 2005 | |
---|
.. | .. |
---|
1738 | 2033 | void SetupMaterial(cGridBag materialpanel) |
---|
1739 | 2034 | { |
---|
1740 | 2035 | cGridBag presetpanel = new cGridBag().setVertical(true); |
---|
1741 | | - cLabel label = GetLabel("icons/shadericons/shadericon00000.png", !Grafreed.NIMBUSLAF); |
---|
1742 | | - label.addMouseListener(new MouseAdapter() |
---|
| 2036 | + |
---|
| 2037 | + cLabel skin = GetLabel("icons/shadericons/shadericon00000.png", !Globals.NIMBUSLAF); |
---|
| 2038 | + skin.setToolTipText("Skin"); |
---|
| 2039 | + skin.addMouseListener(new MouseAdapter() |
---|
1743 | 2040 | { |
---|
1744 | 2041 | public void mouseClicked(MouseEvent e) |
---|
1745 | 2042 | { |
---|
1746 | | - colorField.setFloat(0); |
---|
1747 | | - saturationField.setFloat(1); |
---|
| 2043 | + Object3D object = Grafreed.materials.versionlist[0].get(0); |
---|
| 2044 | + cMaterial material = object.material; |
---|
| 2045 | + |
---|
| 2046 | + // Skin |
---|
| 2047 | + colorField.setFloat(material.color); |
---|
| 2048 | + float saturation = material.modulation; |
---|
| 2049 | + |
---|
| 2050 | + if (!cameraView.Skinshader) |
---|
| 2051 | + { |
---|
| 2052 | + saturation /= 1.5; |
---|
| 2053 | + } |
---|
| 2054 | + |
---|
| 2055 | + saturationField.setFloat(saturation); |
---|
| 2056 | + |
---|
| 2057 | + subsurfaceField.setFloat(material.subsurface); |
---|
| 2058 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 2059 | + diffusenessField.setFloat(material.factor); |
---|
| 2060 | + shininessField.setFloat(material.shininess); |
---|
| 2061 | + shadowbiasField.setFloat(material.shadowbias); |
---|
| 2062 | + diffuseField.setFloat(material.diffuse); |
---|
| 2063 | + specularField.setFloat(material.specular); |
---|
| 2064 | + |
---|
| 2065 | + bumpField.setFloat(object.projectedVertices[0].x / 1000.0); |
---|
| 2066 | + noiseField.setFloat(object.projectedVertices[0].y / 1000.0); |
---|
| 2067 | + powerField.setFloat(object.projectedVertices[2].x / 1000.0); |
---|
| 2068 | + |
---|
1748 | 2069 | materialtouched = true; |
---|
1749 | 2070 | applySelf(); |
---|
1750 | 2071 | } |
---|
1751 | 2072 | }); |
---|
1752 | | - presetpanel.add(label); |
---|
| 2073 | + presetpanel.add(skin); |
---|
1753 | 2074 | |
---|
1754 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00001.png", !Grafreed.NIMBUSLAF)); |
---|
1755 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00002.png", !Grafreed.NIMBUSLAF)); |
---|
1756 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00003.png", !Grafreed.NIMBUSLAF)); |
---|
1757 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00004.png", !Grafreed.NIMBUSLAF)); |
---|
1758 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00005.png", !Grafreed.NIMBUSLAF)); |
---|
1759 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00006.png", !Grafreed.NIMBUSLAF)); |
---|
1760 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00007.png", !Grafreed.NIMBUSLAF)); |
---|
1761 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00008.png", !Grafreed.NIMBUSLAF)); |
---|
1762 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00009.png", !Grafreed.NIMBUSLAF)); |
---|
1763 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00010.png", !Grafreed.NIMBUSLAF)); |
---|
1764 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00011.png", !Grafreed.NIMBUSLAF)); |
---|
1765 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00012.png", !Grafreed.NIMBUSLAF)); |
---|
1766 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00013.png", !Grafreed.NIMBUSLAF)); |
---|
1767 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00014.png", !Grafreed.NIMBUSLAF)); |
---|
1768 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00015.png", !Grafreed.NIMBUSLAF)); |
---|
1769 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00016.png", !Grafreed.NIMBUSLAF)); |
---|
1770 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00017.png", !Grafreed.NIMBUSLAF)); |
---|
1771 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00018.png", !Grafreed.NIMBUSLAF)); |
---|
1772 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00019.png", !Grafreed.NIMBUSLAF)); |
---|
1773 | | - presetpanel.add(GetLabel("icons/shadericons/shadericon00020.png", !Grafreed.NIMBUSLAF)); |
---|
| 2075 | + cLabel lambert = GetLabel("icons/shadericons/shadericon00002.png", !Globals.NIMBUSLAF); |
---|
| 2076 | + lambert.setToolTipText("Diffuse"); |
---|
| 2077 | + lambert.addMouseListener(new MouseAdapter() |
---|
| 2078 | + { |
---|
| 2079 | + public void mouseClicked(MouseEvent e) |
---|
| 2080 | + { |
---|
| 2081 | + Object3D object = Grafreed.materials.versionlist[2].get(0); |
---|
| 2082 | + cMaterial material = object.material; |
---|
| 2083 | + |
---|
| 2084 | + diffusenessField.setFloat(material.factor); |
---|
| 2085 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 2086 | + |
---|
| 2087 | + materialtouched = true; |
---|
| 2088 | + applySelf(); |
---|
| 2089 | + } |
---|
| 2090 | + }); |
---|
| 2091 | + presetpanel.add(lambert); |
---|
| 2092 | + |
---|
| 2093 | + cLabel diffuse2 = GetLabel("icons/shadericons/shadericon00003.png", !Globals.NIMBUSLAF); |
---|
| 2094 | + diffuse2.setToolTipText("Diffuse2"); |
---|
| 2095 | + diffuse2.addMouseListener(new MouseAdapter() |
---|
| 2096 | + { |
---|
| 2097 | + public void mouseClicked(MouseEvent e) |
---|
| 2098 | + { |
---|
| 2099 | + Object3D object = Grafreed.materials.versionlist[3].get(0); |
---|
| 2100 | + cMaterial material = object.material; |
---|
| 2101 | + |
---|
| 2102 | + diffusenessField.setFloat(material.factor); |
---|
| 2103 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 2104 | + |
---|
| 2105 | + materialtouched = true; |
---|
| 2106 | + applySelf(); |
---|
| 2107 | + } |
---|
| 2108 | + }); |
---|
| 2109 | + presetpanel.add(diffuse2); |
---|
| 2110 | + |
---|
| 2111 | + cLabel diffusemoon = GetLabel("icons/shadericons/shadericon00004.png", !Globals.NIMBUSLAF); |
---|
| 2112 | + diffusemoon.setToolTipText("Moon"); |
---|
| 2113 | + diffusemoon.addMouseListener(new MouseAdapter() |
---|
| 2114 | + { |
---|
| 2115 | + public void mouseClicked(MouseEvent e) |
---|
| 2116 | + { |
---|
| 2117 | + Object3D object = Grafreed.materials.versionlist[4].get(0); |
---|
| 2118 | + cMaterial material = object.material; |
---|
| 2119 | + |
---|
| 2120 | + diffusenessField.setFloat(material.factor); |
---|
| 2121 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 2122 | + |
---|
| 2123 | + materialtouched = true; |
---|
| 2124 | + applySelf(); |
---|
| 2125 | + } |
---|
| 2126 | + }); |
---|
| 2127 | + presetpanel.add(diffusemoon); |
---|
| 2128 | + |
---|
| 2129 | + cLabel diffusemoon2 = GetLabel("icons/shadericons/shadericon00005.png", !Globals.NIMBUSLAF); |
---|
| 2130 | + diffusemoon2.setToolTipText("Moon2"); |
---|
| 2131 | + diffusemoon2.addMouseListener(new MouseAdapter() |
---|
| 2132 | + { |
---|
| 2133 | + public void mouseClicked(MouseEvent e) |
---|
| 2134 | + { |
---|
| 2135 | + Object3D object = Grafreed.materials.versionlist[5].get(0); |
---|
| 2136 | + cMaterial material = object.material; |
---|
| 2137 | + |
---|
| 2138 | + diffusenessField.setFloat(material.factor); |
---|
| 2139 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 2140 | + |
---|
| 2141 | + materialtouched = true; |
---|
| 2142 | + applySelf(); |
---|
| 2143 | + } |
---|
| 2144 | + }); |
---|
| 2145 | + presetpanel.add(diffusemoon2); |
---|
| 2146 | + |
---|
| 2147 | + cLabel diffusemoon3 = GetLabel("icons/shadericons/shadericon00006.png", !Globals.NIMBUSLAF); |
---|
| 2148 | + diffusemoon3.setToolTipText("Moon3"); |
---|
| 2149 | + diffusemoon3.addMouseListener(new MouseAdapter() |
---|
| 2150 | + { |
---|
| 2151 | + public void mouseClicked(MouseEvent e) |
---|
| 2152 | + { |
---|
| 2153 | + Object3D object = Grafreed.materials.versionlist[6].get(0); |
---|
| 2154 | + cMaterial material = object.material; |
---|
| 2155 | + |
---|
| 2156 | + diffusenessField.setFloat(material.factor); |
---|
| 2157 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 2158 | + |
---|
| 2159 | + materialtouched = true; |
---|
| 2160 | + applySelf(); |
---|
| 2161 | + } |
---|
| 2162 | + }); |
---|
| 2163 | + presetpanel.add(diffusemoon3); |
---|
| 2164 | + |
---|
| 2165 | + cLabel diffusesheen = GetLabel("icons/shadericons/shadericon00007.png", !Globals.NIMBUSLAF); |
---|
| 2166 | + diffusesheen.setToolTipText("Sheen"); |
---|
| 2167 | + diffusesheen.addMouseListener(new MouseAdapter() |
---|
| 2168 | + { |
---|
| 2169 | + public void mouseClicked(MouseEvent e) |
---|
| 2170 | + { |
---|
| 2171 | + Object3D object = Grafreed.materials.versionlist[7].get(0); |
---|
| 2172 | + cMaterial material = object.material; |
---|
| 2173 | + |
---|
| 2174 | + sheenField.setFloat(material.sheen); |
---|
| 2175 | + |
---|
| 2176 | + materialtouched = true; |
---|
| 2177 | + applySelf(); |
---|
| 2178 | + } |
---|
| 2179 | + }); |
---|
| 2180 | + presetpanel.add(diffusesheen); |
---|
| 2181 | + |
---|
| 2182 | + cLabel rough = GetLabel("icons/shadericons/shadericon00001.png", !Globals.NIMBUSLAF); |
---|
| 2183 | + rough.setToolTipText("Rough metal"); |
---|
| 2184 | + rough.addMouseListener(new MouseAdapter() |
---|
| 2185 | + { |
---|
| 2186 | + public void mouseClicked(MouseEvent e) |
---|
| 2187 | + { |
---|
| 2188 | + Object3D object = Grafreed.materials.versionlist[1].get(0); |
---|
| 2189 | + cMaterial material = object.material; |
---|
| 2190 | + |
---|
| 2191 | + shininessField.setFloat(material.shininess); |
---|
| 2192 | + velvetField.setFloat(material.velvet); |
---|
| 2193 | + |
---|
| 2194 | + materialtouched = true; |
---|
| 2195 | + applySelf(); |
---|
| 2196 | + } |
---|
| 2197 | + }); |
---|
| 2198 | + presetpanel.add(rough); |
---|
| 2199 | + |
---|
| 2200 | + cLabel rough2 = GetLabel("icons/shadericons/shadericon00013.png", !Globals.NIMBUSLAF); |
---|
| 2201 | + rough2.setToolTipText("Medium metal"); |
---|
| 2202 | + rough2.addMouseListener(new MouseAdapter() |
---|
| 2203 | + { |
---|
| 2204 | + public void mouseClicked(MouseEvent e) |
---|
| 2205 | + { |
---|
| 2206 | + Object3D object = Grafreed.materials.versionlist[13].get(0); |
---|
| 2207 | + cMaterial material = object.material; |
---|
| 2208 | + |
---|
| 2209 | + shininessField.setFloat(material.shininess); |
---|
| 2210 | + lightareaField.setFloat(material.lightarea); |
---|
| 2211 | + |
---|
| 2212 | + materialtouched = true; |
---|
| 2213 | + applySelf(); |
---|
| 2214 | + } |
---|
| 2215 | + }); |
---|
| 2216 | + presetpanel.add(rough2); |
---|
| 2217 | + |
---|
| 2218 | + cLabel shini0 = GetLabel("icons/shadericons/shadericon00014.png", !Globals.NIMBUSLAF); |
---|
| 2219 | + shini0.setToolTipText("Shiny"); |
---|
| 2220 | + shini0.addMouseListener(new MouseAdapter() |
---|
| 2221 | + { |
---|
| 2222 | + public void mouseClicked(MouseEvent e) |
---|
| 2223 | + { |
---|
| 2224 | + Object3D object = Grafreed.materials.versionlist[14].get(0); |
---|
| 2225 | + cMaterial material = object.material; |
---|
| 2226 | + |
---|
| 2227 | + shininessField.setFloat(material.shininess); |
---|
| 2228 | + lightareaField.setFloat(material.lightarea); |
---|
| 2229 | + |
---|
| 2230 | + materialtouched = true; |
---|
| 2231 | + applySelf(); |
---|
| 2232 | + } |
---|
| 2233 | + }); |
---|
| 2234 | + presetpanel.add(shini0); |
---|
| 2235 | + |
---|
| 2236 | + cLabel shini1 = GetLabel("icons/shadericons/shadericon00011.png", !Globals.NIMBUSLAF); |
---|
| 2237 | + shini1.setToolTipText("Shiny2"); |
---|
| 2238 | + shini1.addMouseListener(new MouseAdapter() |
---|
| 2239 | + { |
---|
| 2240 | + public void mouseClicked(MouseEvent e) |
---|
| 2241 | + { |
---|
| 2242 | + Object3D object = Grafreed.materials.versionlist[11].get(0); |
---|
| 2243 | + cMaterial material = object.material; |
---|
| 2244 | + |
---|
| 2245 | + shininessField.setFloat(material.shininess); |
---|
| 2246 | + lightareaField.setFloat(material.lightarea); |
---|
| 2247 | + |
---|
| 2248 | + materialtouched = true; |
---|
| 2249 | + applySelf(); |
---|
| 2250 | + } |
---|
| 2251 | + }); |
---|
| 2252 | + presetpanel.add(shini1); |
---|
| 2253 | + |
---|
| 2254 | + cLabel shini2 = GetLabel("icons/shadericons/shadericon00012.png", !Globals.NIMBUSLAF); |
---|
| 2255 | + shini2.setToolTipText("Shiny3"); |
---|
| 2256 | + shini2.addMouseListener(new MouseAdapter() |
---|
| 2257 | + { |
---|
| 2258 | + public void mouseClicked(MouseEvent e) |
---|
| 2259 | + { |
---|
| 2260 | + Object3D object = Grafreed.materials.versionlist[12].get(0); |
---|
| 2261 | + cMaterial material = object.material; |
---|
| 2262 | + |
---|
| 2263 | + shininessField.setFloat(material.shininess); |
---|
| 2264 | + lightareaField.setFloat(material.lightarea); |
---|
| 2265 | + |
---|
| 2266 | + materialtouched = true; |
---|
| 2267 | + applySelf(); |
---|
| 2268 | + } |
---|
| 2269 | + }); |
---|
| 2270 | + presetpanel.add(shini2); |
---|
| 2271 | + |
---|
| 2272 | + cLabel aniso = GetLabel("icons/shadericons/shadericon00008.png", !Globals.NIMBUSLAF); |
---|
| 2273 | + aniso.setToolTipText("AnisoU"); |
---|
| 2274 | + aniso.addMouseListener(new MouseAdapter() |
---|
| 2275 | + { |
---|
| 2276 | + public void mouseClicked(MouseEvent e) |
---|
| 2277 | + { |
---|
| 2278 | + Object3D object = Grafreed.materials.versionlist[8].get(0); |
---|
| 2279 | + cMaterial material = object.material; |
---|
| 2280 | + |
---|
| 2281 | + anisoField.setFloat(material.aniso); |
---|
| 2282 | + anisoVField.setFloat(material.anisoV); |
---|
| 2283 | + |
---|
| 2284 | + materialtouched = true; |
---|
| 2285 | + applySelf(); |
---|
| 2286 | + } |
---|
| 2287 | + }); |
---|
| 2288 | + presetpanel.add(aniso); |
---|
| 2289 | + |
---|
| 2290 | + cLabel aniso2 = GetLabel("icons/shadericons/shadericon00009.png", !Globals.NIMBUSLAF); |
---|
| 2291 | + aniso2.setToolTipText("AnisoV"); |
---|
| 2292 | + aniso2.addMouseListener(new MouseAdapter() |
---|
| 2293 | + { |
---|
| 2294 | + public void mouseClicked(MouseEvent e) |
---|
| 2295 | + { |
---|
| 2296 | + Object3D object = Grafreed.materials.versionlist[9].get(0); |
---|
| 2297 | + cMaterial material = object.material; |
---|
| 2298 | + |
---|
| 2299 | + anisoField.setFloat(material.aniso); |
---|
| 2300 | + anisoVField.setFloat(material.anisoV); |
---|
| 2301 | + |
---|
| 2302 | + materialtouched = true; |
---|
| 2303 | + applySelf(); |
---|
| 2304 | + } |
---|
| 2305 | + }); |
---|
| 2306 | + presetpanel.add(aniso2); |
---|
| 2307 | + |
---|
| 2308 | + cLabel aniso3 = GetLabel("icons/shadericons/shadericon00010.png", !Globals.NIMBUSLAF); |
---|
| 2309 | + aniso3.setToolTipText("AnisoUV"); |
---|
| 2310 | + aniso3.addMouseListener(new MouseAdapter() |
---|
| 2311 | + { |
---|
| 2312 | + public void mouseClicked(MouseEvent e) |
---|
| 2313 | + { |
---|
| 2314 | + Object3D object = Grafreed.materials.versionlist[10].get(0); |
---|
| 2315 | + cMaterial material = object.material; |
---|
| 2316 | + |
---|
| 2317 | + anisoField.setFloat(material.aniso); |
---|
| 2318 | + anisoVField.setFloat(material.anisoV); |
---|
| 2319 | + |
---|
| 2320 | + materialtouched = true; |
---|
| 2321 | + applySelf(); |
---|
| 2322 | + } |
---|
| 2323 | + }); |
---|
| 2324 | + presetpanel.add(aniso3); |
---|
| 2325 | + |
---|
| 2326 | + cLabel velvet0 = GetLabel("icons/shadericons/shadericon00015.png", !Globals.NIMBUSLAF); |
---|
| 2327 | + velvet0.setToolTipText("Velvet"); |
---|
| 2328 | + velvet0.addMouseListener(new MouseAdapter() |
---|
| 2329 | + { |
---|
| 2330 | + public void mouseClicked(MouseEvent e) |
---|
| 2331 | + { |
---|
| 2332 | + Object3D object = Grafreed.materials.versionlist[15].get(0); |
---|
| 2333 | + cMaterial material = object.material; |
---|
| 2334 | + |
---|
| 2335 | + diffusenessField.setFloat(material.factor); |
---|
| 2336 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 2337 | + sheenField.setFloat(material.sheen); |
---|
| 2338 | + shininessField.setFloat(material.shininess); |
---|
| 2339 | + velvetField.setFloat(material.velvet); |
---|
| 2340 | + shiftField.setFloat(material.shift); |
---|
| 2341 | + |
---|
| 2342 | + materialtouched = true; |
---|
| 2343 | + applySelf(); |
---|
| 2344 | + } |
---|
| 2345 | + }); |
---|
| 2346 | + presetpanel.add(velvet0); |
---|
| 2347 | + |
---|
| 2348 | + cLabel bump0 = GetLabel("icons/shadericons/shadericon00016.png", !Globals.NIMBUSLAF); |
---|
| 2349 | + bump0.setToolTipText("Bump texture"); |
---|
| 2350 | + bump0.addMouseListener(new MouseAdapter() |
---|
| 2351 | + { |
---|
| 2352 | + public void mouseClicked(MouseEvent e) |
---|
| 2353 | + { |
---|
| 2354 | + Object3D object = Grafreed.materials.versionlist[16].get(0); |
---|
| 2355 | + cMaterial material = object.material; |
---|
| 2356 | + |
---|
| 2357 | + bumpField.setFloat(object.projectedVertices[0].x / 1000.0); |
---|
| 2358 | + noiseField.setFloat(object.projectedVertices[0].y / 1000.0); |
---|
| 2359 | + powerField.setFloat(object.projectedVertices[2].x / 1000.0); |
---|
| 2360 | + |
---|
| 2361 | + materialtouched = true; |
---|
| 2362 | + applySelf(); |
---|
| 2363 | + } |
---|
| 2364 | + }); |
---|
| 2365 | + presetpanel.add(bump0); |
---|
| 2366 | + |
---|
| 2367 | + cLabel borderShader = GetLabel("icons/shadericons/borderfade.jpg", !Globals.NIMBUSLAF); |
---|
| 2368 | + borderShader.setToolTipText("Border fade"); |
---|
| 2369 | + borderShader.addMouseListener(new MouseAdapter() |
---|
| 2370 | + { |
---|
| 2371 | + public void mouseClicked(MouseEvent e) |
---|
| 2372 | + { |
---|
| 2373 | + borderfadeField.setFloat(0.5); |
---|
| 2374 | + opacityField.setFloat(0.75); |
---|
| 2375 | + |
---|
| 2376 | + materialtouched = true; |
---|
| 2377 | + applySelf(); |
---|
| 2378 | + } |
---|
| 2379 | + }); |
---|
| 2380 | + presetpanel.add(borderShader); |
---|
| 2381 | + |
---|
| 2382 | + cLabel halo = GetLabel("icons/shadericons/shadericon00017.png", !Globals.NIMBUSLAF); |
---|
| 2383 | + halo.setToolTipText("Halo"); |
---|
| 2384 | + halo.addMouseListener(new MouseAdapter() |
---|
| 2385 | + { |
---|
| 2386 | + public void mouseClicked(MouseEvent e) |
---|
| 2387 | + { |
---|
| 2388 | + Object3D object = Grafreed.materials.versionlist[17].get(0); |
---|
| 2389 | + cMaterial material = object.material; |
---|
| 2390 | + |
---|
| 2391 | + opacityPowerField.setFloat(object.projectedVertices[2].y / 1000.0); |
---|
| 2392 | + |
---|
| 2393 | + materialtouched = true; |
---|
| 2394 | + applySelf(); |
---|
| 2395 | + } |
---|
| 2396 | + }); |
---|
| 2397 | + presetpanel.add(halo); |
---|
| 2398 | + |
---|
| 2399 | + cLabel candle = GetLabel("icons/shadericons/shadericon00018.png", !Globals.NIMBUSLAF); |
---|
| 2400 | + candle.setToolTipText("Candle"); |
---|
| 2401 | + candle.addMouseListener(new MouseAdapter() |
---|
| 2402 | + { |
---|
| 2403 | + public void mouseClicked(MouseEvent e) |
---|
| 2404 | + { |
---|
| 2405 | + Object3D object = Grafreed.materials.versionlist[18].get(0); |
---|
| 2406 | + cMaterial material = object.material; |
---|
| 2407 | + |
---|
| 2408 | + subsurfaceField.setFloat(material.subsurface); |
---|
| 2409 | + shadowbiasField.setFloat(material.shadowbias); |
---|
| 2410 | + ambientField.setFloat(material.ambient); |
---|
| 2411 | + specularField.setFloat(material.specular); |
---|
| 2412 | + lightareaField.setFloat(material.lightarea); |
---|
| 2413 | + shininessField.setFloat(material.shininess); |
---|
| 2414 | + |
---|
| 2415 | + materialtouched = true; |
---|
| 2416 | + applySelf(); |
---|
| 2417 | + } |
---|
| 2418 | + }); |
---|
| 2419 | + presetpanel.add(candle); |
---|
| 2420 | + |
---|
| 2421 | + cLabel shadowShader = GetLabel("icons/shadericons/shadow.png", !Globals.NIMBUSLAF); |
---|
| 2422 | + shadowShader.setToolTipText("Shadow"); |
---|
| 2423 | + shadowShader.addMouseListener(new MouseAdapter() |
---|
| 2424 | + { |
---|
| 2425 | + public void mouseClicked(MouseEvent e) |
---|
| 2426 | + { |
---|
| 2427 | + diffuseField.setFloat(0.001); |
---|
| 2428 | + ambientField.setFloat(0.001); |
---|
| 2429 | + cameraField.setFloat(0.001); |
---|
| 2430 | + specularField.setFloat(0.001); |
---|
| 2431 | + fakedepthField.setFloat(0.001); |
---|
| 2432 | + opacityField.setFloat(0.6); |
---|
| 2433 | + |
---|
| 2434 | + materialtouched = true; |
---|
| 2435 | + applySelf(); |
---|
| 2436 | + } |
---|
| 2437 | + }); |
---|
| 2438 | + presetpanel.add(shadowShader); |
---|
1774 | 2439 | |
---|
1775 | 2440 | cGridBag panel = new cGridBag().setVertical(true); |
---|
1776 | 2441 | |
---|
1777 | 2442 | presetpanel.preferredWidth = 1; |
---|
1778 | 2443 | |
---|
1779 | | - materialpanel.add(panel); |
---|
1780 | 2444 | materialpanel.add(presetpanel); |
---|
| 2445 | + materialpanel.add(panel); |
---|
1781 | 2446 | |
---|
1782 | 2447 | panel.preferredWidth = 8; |
---|
1783 | 2448 | |
---|
.. | .. |
---|
1788 | 2453 | |
---|
1789 | 2454 | cGridBag editBar = new cGridBag().setVertical(false); |
---|
1790 | 2455 | |
---|
1791 | | - editBar.add(createMaterialButton = new cButton("Create", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 2456 | + editBar.add(createMaterialButton = new cButton("Create", !Globals.NIMBUSLAF)); // , aConstraints); |
---|
1792 | 2457 | createMaterialButton.setToolTipText("Create material"); |
---|
1793 | 2458 | |
---|
1794 | 2459 | /* |
---|
1795 | 2460 | ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints); |
---|
1796 | 2461 | */ |
---|
1797 | 2462 | |
---|
1798 | | - editBar.add(clearMaterialButton = new cButton("Clear", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 2463 | + editBar.add(clearMaterialButton = new cButton("Clear", !Globals.NIMBUSLAF)); // , aConstraints); |
---|
1799 | 2464 | clearMaterialButton.setToolTipText("Clear material"); |
---|
1800 | 2465 | |
---|
1801 | 2466 | if (Globals.ADVANCED) |
---|
1802 | 2467 | { |
---|
1803 | | - editBar.add(resetSlidersButton = new cButton("Reset", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 2468 | + editBar.add(resetSlidersButton = new cButton("Reset", !Globals.NIMBUSLAF)); // , aConstraints); |
---|
1804 | 2469 | editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints); |
---|
1805 | 2470 | editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints); |
---|
1806 | 2471 | } |
---|
.. | .. |
---|
1821 | 2486 | |
---|
1822 | 2487 | cGridBag huepanel = new cGridBag(); |
---|
1823 | 2488 | cGridBag huelabel = new cGridBag(); |
---|
1824 | | - label = GetLabel("icons/hue.png", false); |
---|
1825 | | - label.fit = true; |
---|
1826 | | - huelabel.add(label); |
---|
| 2489 | + cLabel hue = GetLabel("icons/hue.png", false); |
---|
| 2490 | + hue.fit = true; |
---|
| 2491 | + |
---|
| 2492 | + hue.addMouseListener(new MouseAdapter() |
---|
| 2493 | + { |
---|
| 2494 | + public void mousePressed(MouseEvent e) |
---|
| 2495 | + { |
---|
| 2496 | + int x = e.getX(); |
---|
| 2497 | + |
---|
| 2498 | + colorField.setFloat((double)x / ((cLabel)e.getSource()).getWidth()); |
---|
| 2499 | + } |
---|
| 2500 | + }); |
---|
| 2501 | + |
---|
| 2502 | + huelabel.add(hue); |
---|
1827 | 2503 | huelabel.preferredWidth = 20; |
---|
1828 | 2504 | huepanel.add(new cGridBag()); // Label |
---|
1829 | 2505 | huepanel.add(huelabel); // Field/slider |
---|
.. | .. |
---|
2006 | 2682 | backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
2007 | 2683 | colorSection.add(backlit); |
---|
2008 | 2684 | |
---|
| 2685 | + cGridBag parallax = new cGridBag(); |
---|
| 2686 | + parallax.add(parallaxLabel = new JLabel("Parallax")); // , aConstraints); |
---|
| 2687 | + parallaxLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2688 | + parallax.add(parallaxField = new cNumberSlider(this, 0.001, 0.5, -0.25)); // , aConstraints); |
---|
| 2689 | + colorSection.add(parallax); |
---|
| 2690 | + |
---|
2009 | 2691 | //panel.add(new JSeparator()); |
---|
2010 | 2692 | |
---|
2011 | 2693 | //panel.add(globalSection); |
---|
.. | .. |
---|
3057 | 3739 | shadowField.setFloat(mat.shadow); |
---|
3058 | 3740 | textureField.setFloat(mat.texture); |
---|
3059 | 3741 | opacityField.setFloat(mat.opacity); |
---|
| 3742 | + parallaxField.setFloat(mat.parallax + 0.25f); |
---|
3060 | 3743 | fakedepthField.setFloat(mat.fakedepth); |
---|
3061 | 3744 | shadowbiasField.setFloat(mat.shadowbias); |
---|
3062 | 3745 | bumpField.setInteger(1); // dec 2013 |
---|
.. | .. |
---|
3099 | 3782 | |
---|
3100 | 3783 | if (multiplyToggle != null) |
---|
3101 | 3784 | multiplyToggle.setSelected(mat.multiply); |
---|
3102 | | - |
---|
3103 | | - assert (object.projectedVertices != null); |
---|
3104 | | - |
---|
3105 | | - if (object.projectedVertices.length <= 2) |
---|
3106 | | - { |
---|
3107 | | - // Side effect... |
---|
3108 | | - Object3D.cVector2[] keep = object.projectedVertices; |
---|
3109 | | - object.projectedVertices = new Object3D.cVector2[3]; |
---|
3110 | | - for (int i = 0; i < 3; i++) |
---|
3111 | | - { |
---|
3112 | | - if (i < keep.length) |
---|
3113 | | - { |
---|
3114 | | - object.projectedVertices[i] = keep[i]; |
---|
3115 | | - } else |
---|
3116 | | - { |
---|
3117 | | - object.projectedVertices[i] = new Object3D.cVector2(); |
---|
3118 | | - } |
---|
3119 | | - /* |
---|
3120 | | - if(keep.length == 0) |
---|
3121 | | - object.projectedVertices[0] = new Object3D.cVector2(); |
---|
3122 | | - else |
---|
3123 | | - object.projectedVertices[0] = keep[0]; |
---|
3124 | | - object.projectedVertices[1] = new Object3D.cVector2(); |
---|
3125 | | - */ |
---|
3126 | | - } |
---|
3127 | | - } |
---|
| 3785 | + |
---|
| 3786 | + AllocProjectedVertices(object); |
---|
3128 | 3787 | |
---|
3129 | 3788 | SetMaterial(mat, object.projectedVertices); |
---|
3130 | 3789 | } |
---|
.. | .. |
---|
3244 | 3903 | public void itemStateChanged(ItemEvent event) |
---|
3245 | 3904 | { |
---|
3246 | 3905 | // System.out.println("Propagate = " + propagate); |
---|
| 3906 | + if (event.getSource() == pinButton) |
---|
| 3907 | + { |
---|
| 3908 | + copy.pinned ^= true; |
---|
| 3909 | + if (!copy.pinned && !copy.editWindow.copy.selection.contains(copy)) |
---|
| 3910 | + { |
---|
| 3911 | + ((GroupEditor)copy.editWindow).listUI.remove(copy); |
---|
| 3912 | + copy.CloseUI(); |
---|
| 3913 | + //copy.editWindow.refreshContents(); |
---|
| 3914 | + } |
---|
| 3915 | + } |
---|
| 3916 | + else |
---|
3247 | 3917 | if (event.getSource() == propagateToggle) |
---|
3248 | 3918 | { |
---|
3249 | 3919 | propagate ^= true; |
---|
.. | .. |
---|
3423 | 4093 | //System.out.println("ObjEditor " + event); |
---|
3424 | 4094 | applySelf0(true); |
---|
3425 | 4095 | //parent.applySelf(); |
---|
3426 | | - objEditor.refreshContents(); |
---|
| 4096 | + // conflicts with requestFocus objEditor.refreshContents(); |
---|
3427 | 4097 | } else if (source == resetButton) |
---|
3428 | 4098 | { |
---|
3429 | 4099 | CameraPane.fullreset = true; |
---|
.. | .. |
---|
3603 | 4273 | |
---|
3604 | 4274 | void New() |
---|
3605 | 4275 | { |
---|
3606 | | - while (copy.Size() > 1) |
---|
| 4276 | + while (copy.Size() > 0) |
---|
3607 | 4277 | { |
---|
3608 | | - copy.remove(1); |
---|
| 4278 | + copy.remove(0); |
---|
3609 | 4279 | } |
---|
3610 | 4280 | |
---|
| 4281 | + copy.selection.clear(); |
---|
| 4282 | + |
---|
| 4283 | + if (copy == Grafreed.grafreed.universe) |
---|
| 4284 | + { |
---|
| 4285 | + CreateCameras(); |
---|
| 4286 | + cameraView.SetCamera(GetCamera(copy, 0)); |
---|
| 4287 | + } |
---|
3611 | 4288 | ResetModel(); |
---|
3612 | 4289 | objEditor.refreshContents(); |
---|
3613 | 4290 | } |
---|
.. | .. |
---|
3716 | 4393 | { |
---|
3717 | 4394 | //Save(true); |
---|
3718 | 4395 | Replace(); |
---|
3719 | | - SetUndoStates(); |
---|
| 4396 | + SetVersionStates(); |
---|
3720 | 4397 | } |
---|
3721 | 4398 | |
---|
3722 | 4399 | private boolean Equal(byte[] compress, byte[] name) |
---|
.. | .. |
---|
3735 | 4412 | return true; |
---|
3736 | 4413 | } |
---|
3737 | 4414 | |
---|
3738 | | - java.util.Hashtable<java.util.UUID, Object3D> versiontable = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
| 4415 | + void DeleteVersion() |
---|
| 4416 | + { |
---|
| 4417 | + for (int i = copy.versionindex; i < copy.versionlist.length-1; i++) |
---|
| 4418 | + { |
---|
| 4419 | + copy.versionlist[i] = copy.versionlist[i+1]; |
---|
| 4420 | + } |
---|
| 4421 | + |
---|
| 4422 | + if (copy.versionlist[copy.versionindex] == null) |
---|
| 4423 | + copy.versionindex -= 1; |
---|
| 4424 | + |
---|
| 4425 | + if (copy.versionindex != -1) |
---|
| 4426 | + CopyChanged(); |
---|
| 4427 | + |
---|
| 4428 | + SetVersionStates(); |
---|
| 4429 | + } |
---|
3739 | 4430 | |
---|
3740 | 4431 | public boolean Save(boolean user) |
---|
3741 | 4432 | { |
---|
3742 | 4433 | System.err.println("Save"); |
---|
3743 | 4434 | Replace(); |
---|
3744 | 4435 | |
---|
3745 | | - cRadio tab = GetCurrentTab(); |
---|
| 4436 | + //cRadio tab = GetCurrentTab(); |
---|
3746 | 4437 | |
---|
3747 | | - Object3D compress = CompressCopy(); // Saved version. No need for "Replace". |
---|
| 4438 | + Object3D compress = Duplicate(copy); // Saved version. No need for "Replace"? |
---|
3748 | 4439 | |
---|
3749 | 4440 | boolean thesame = false; |
---|
3750 | 4441 | |
---|
.. | .. |
---|
3756 | 4447 | //EditorFrame.m_MainFrame.requestFocusInWindow(); |
---|
3757 | 4448 | if (!thesame) |
---|
3758 | 4449 | { |
---|
| 4450 | + for (int i = copy.versionlist.length; --i > copy.versionindex+1;) |
---|
| 4451 | + { |
---|
| 4452 | + copy.versionlist[i] = copy.versionlist[i-1]; |
---|
| 4453 | + } |
---|
| 4454 | + |
---|
3759 | 4455 | //tab.user[tab.versionindex] = user; |
---|
3760 | 4456 | //boolean increment = true; // tab.graphs[tab.versionindex] == null; |
---|
3761 | 4457 | |
---|
.. | .. |
---|
3769 | 4465 | |
---|
3770 | 4466 | //assert(hashtable.isEmpty()); |
---|
3771 | 4467 | |
---|
3772 | | - for (int i = copy.versionindex+1; i < copy.versionlist.length; i++) |
---|
3773 | | - { |
---|
3774 | | - //tab.user[i] = false; |
---|
3775 | | - copy.versionlist[i] = null; |
---|
3776 | | - } |
---|
| 4468 | +// for (int i = copy.versionindex+1; i < copy.versionlist.length; i++) |
---|
| 4469 | +// { |
---|
| 4470 | +// //tab.user[i] = false; |
---|
| 4471 | +// copy.versionlist[i] = null; |
---|
| 4472 | +// } |
---|
3777 | 4473 | |
---|
3778 | | - SetUndoStates(); |
---|
| 4474 | + SetVersionStates(); |
---|
3779 | 4475 | |
---|
3780 | 4476 | // test save |
---|
3781 | 4477 | if (false) |
---|
.. | .. |
---|
3828 | 4524 | GetTree().addSelectionPath(selection.elementAt(i).GetTreePath().GetTreePath()); |
---|
3829 | 4525 | flashIt = true; |
---|
3830 | 4526 | |
---|
3831 | | - refreshContents(false); |
---|
| 4527 | + //refreshContents(false); |
---|
3832 | 4528 | } |
---|
3833 | 4529 | |
---|
3834 | | - void CopyChanged(Object3D obj) |
---|
| 4530 | + void CopyChanged() |
---|
3835 | 4531 | { |
---|
3836 | | - SetUndoStates(); |
---|
| 4532 | + Object3D obj = (Object3D)Grafreed.clone(copy.versionlist[copy.versionindex]); |
---|
| 4533 | + |
---|
| 4534 | + SetVersionStates(); |
---|
3837 | 4535 | |
---|
3838 | 4536 | boolean temp = CameraPane.SWITCH; |
---|
3839 | 4537 | CameraPane.SWITCH = false; |
---|
3840 | 4538 | |
---|
3841 | | - copy.ExtractBigData(versiontable); |
---|
| 4539 | + copy.ExtractBigData(Grafreed.grafreed.universe.versiontable); |
---|
3842 | 4540 | |
---|
3843 | 4541 | copy.clear(); |
---|
3844 | 4542 | |
---|
.. | .. |
---|
3850 | 4548 | copy.add(obj.get(i)); |
---|
3851 | 4549 | } |
---|
3852 | 4550 | |
---|
3853 | | - copy.RestoreBigData(versiontable); |
---|
| 4551 | + copy.RestoreBigData(Grafreed.grafreed.universe.versiontable); |
---|
3854 | 4552 | |
---|
3855 | 4553 | CameraPane.SWITCH = temp; |
---|
3856 | 4554 | |
---|
.. | .. |
---|
3875 | 4573 | } |
---|
3876 | 4574 | } |
---|
3877 | 4575 | |
---|
3878 | | - refreshContents(); |
---|
| 4576 | + refreshContents(true); |
---|
3879 | 4577 | } |
---|
3880 | 4578 | |
---|
3881 | | - cButton undoButton; |
---|
| 4579 | + cButton previousVersionButton; |
---|
3882 | 4580 | cButton restoreButton; |
---|
3883 | 4581 | cButton replaceButton; |
---|
3884 | | - cButton redoButton; |
---|
| 4582 | + cButton nextVersionButton; |
---|
| 4583 | + cButton saveVersionButton; |
---|
| 4584 | + cButton deleteVersionButton; |
---|
3885 | 4585 | |
---|
3886 | 4586 | boolean muteSlider; |
---|
3887 | 4587 | |
---|
.. | .. |
---|
3898 | 4598 | return count; |
---|
3899 | 4599 | } |
---|
3900 | 4600 | |
---|
3901 | | - void SetUndoStates() |
---|
| 4601 | + public cGridBag versionSliderPane; |
---|
| 4602 | + |
---|
| 4603 | + void SetVersionStates() |
---|
3902 | 4604 | { |
---|
3903 | | - cRadio tab = GetCurrentTab(); |
---|
| 4605 | + //if (true) |
---|
| 4606 | + // return; |
---|
| 4607 | + |
---|
| 4608 | + //cRadio tab = GetCurrentTab(); |
---|
3904 | 4609 | |
---|
3905 | | - restoreButton.setEnabled(copy.versionindex != -1); |
---|
3906 | | - replaceButton.setEnabled(copy.versionindex != -1); |
---|
3907 | | - |
---|
3908 | | - undoButton.setEnabled(copy.versionindex > 0); |
---|
3909 | | - redoButton.setEnabled(copy.versionlist[copy.versionindex + 1] != null); |
---|
3910 | | - |
---|
3911 | | - muteSlider = true; |
---|
3912 | | - versionSlider.setMaximum(VersionCount() - 1); |
---|
3913 | | - versionSlider.setInteger(copy.versionindex); |
---|
3914 | | - muteSlider = false; |
---|
| 4610 | + if (copy.versionlist == null) |
---|
| 4611 | + { |
---|
| 4612 | + saveVersionButton.setEnabled(false); |
---|
| 4613 | + restoreButton.setEnabled(false); |
---|
| 4614 | + replaceButton.setEnabled(false); |
---|
| 4615 | + previousVersionButton.setEnabled(false); |
---|
| 4616 | + nextVersionButton.setEnabled(false); |
---|
| 4617 | + deleteVersionButton.setEnabled(false); |
---|
| 4618 | + versionSliderPane.setVisible(false); |
---|
| 4619 | + } |
---|
| 4620 | + else |
---|
| 4621 | + { |
---|
| 4622 | + restoreButton.setEnabled(copy.versionindex != -1); |
---|
| 4623 | + replaceButton.setEnabled(copy.versionindex != -1); |
---|
| 4624 | + |
---|
| 4625 | + previousVersionButton.setEnabled(copy.versionindex > 0); |
---|
| 4626 | + nextVersionButton.setEnabled(copy.versionlist[copy.versionindex + 1] != null); |
---|
| 4627 | + |
---|
| 4628 | + deleteVersionButton.setEnabled(copy.versionindex != -1); |
---|
| 4629 | + //copy.versionlist[copy.versionindex + 1] != null); |
---|
| 4630 | + |
---|
| 4631 | + muteSlider = true; |
---|
| 4632 | + versionSlider.setMinimum(0); |
---|
| 4633 | + versionSlider.setMaximum(VersionCount() - 1); |
---|
| 4634 | + versionSlider.setInteger(copy.versionindex); |
---|
| 4635 | + versionSlider.setEnabled(copy.versionindex != -1); |
---|
| 4636 | + muteSlider = false; |
---|
| 4637 | + |
---|
| 4638 | + versionSliderPane.setVisible(true); |
---|
| 4639 | + } |
---|
3915 | 4640 | } |
---|
3916 | 4641 | |
---|
3917 | | - public boolean Undo() |
---|
| 4642 | + public boolean PreviousVersion() |
---|
3918 | 4643 | { |
---|
3919 | 4644 | // Option? |
---|
3920 | 4645 | Replace(); |
---|
3921 | 4646 | |
---|
3922 | 4647 | System.err.println("Undo"); |
---|
3923 | 4648 | |
---|
3924 | | - cRadio tab = GetCurrentTab(); |
---|
| 4649 | + //cRadio tab = GetCurrentTab(); |
---|
3925 | 4650 | |
---|
3926 | 4651 | if (copy.versionindex == 0) |
---|
3927 | 4652 | { |
---|
.. | .. |
---|
3944 | 4669 | |
---|
3945 | 4670 | copy.versionindex -= 1; |
---|
3946 | 4671 | |
---|
3947 | | - CopyChanged((Object3D)copy.versionlist[copy.versionindex]); |
---|
| 4672 | + CopyChanged(); |
---|
3948 | 4673 | |
---|
3949 | 4674 | return true; |
---|
3950 | 4675 | } |
---|
.. | .. |
---|
3953 | 4678 | { |
---|
3954 | 4679 | System.err.println("Restore"); |
---|
3955 | 4680 | |
---|
3956 | | - cRadio tab = GetCurrentTab(); |
---|
| 4681 | + //cRadio tab = GetCurrentTab(); |
---|
3957 | 4682 | |
---|
3958 | 4683 | if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
3959 | 4684 | { |
---|
.. | .. |
---|
3962 | 4687 | } |
---|
3963 | 4688 | |
---|
3964 | 4689 | //CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
3965 | | - CopyChanged(copy.versionlist[copy.versionindex]); |
---|
| 4690 | + CopyChanged(); |
---|
3966 | 4691 | |
---|
3967 | 4692 | return true; |
---|
3968 | 4693 | } |
---|
3969 | 4694 | |
---|
3970 | 4695 | public boolean Replace() |
---|
3971 | 4696 | { |
---|
3972 | | - System.err.println("Replace"); |
---|
| 4697 | + //System.err.println("Replace"); |
---|
3973 | 4698 | |
---|
3974 | | - cRadio tab = GetCurrentTab(); |
---|
| 4699 | + //cRadio tab = GetCurrentTab(); |
---|
3975 | 4700 | |
---|
3976 | 4701 | if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
3977 | 4702 | { |
---|
.. | .. |
---|
3979 | 4704 | return false; |
---|
3980 | 4705 | } |
---|
3981 | 4706 | |
---|
3982 | | - copy.versionlist[copy.versionindex] = CompressCopy(); |
---|
| 4707 | + copy.versionlist[copy.versionindex] = Duplicate(copy); |
---|
3983 | 4708 | |
---|
3984 | 4709 | return true; |
---|
3985 | 4710 | } |
---|
3986 | 4711 | |
---|
3987 | | - public void Redo() |
---|
| 4712 | + public void NextVersion() |
---|
3988 | 4713 | { |
---|
3989 | 4714 | // Option? |
---|
3990 | 4715 | Replace(); |
---|
3991 | 4716 | |
---|
3992 | | - cRadio tab = GetCurrentTab(); |
---|
| 4717 | + //cRadio tab = GetCurrentTab(); |
---|
3993 | 4718 | |
---|
3994 | 4719 | if (copy.versionlist[copy.versionindex + 1] == null) |
---|
3995 | 4720 | { |
---|
.. | .. |
---|
3999 | 4724 | |
---|
4000 | 4725 | copy.versionindex += 1; |
---|
4001 | 4726 | |
---|
4002 | | - CopyChanged(copy.versionlist[copy.versionindex]); |
---|
| 4727 | + CopyChanged(); |
---|
4003 | 4728 | |
---|
4004 | 4729 | //if (!tab.user[tab.versionindex]) |
---|
4005 | 4730 | // tab.graphs[tab.versionindex] = null; |
---|
.. | .. |
---|
4196 | 4921 | // else |
---|
4197 | 4922 | // applySelf(true); |
---|
4198 | 4923 | // } |
---|
| 4924 | + |
---|
| 4925 | + boolean Equal(double a, double b) |
---|
| 4926 | + { |
---|
| 4927 | + return Math.abs(a - b) < 0.001; |
---|
| 4928 | + } |
---|
| 4929 | + |
---|
4199 | 4930 | void applySelf0(boolean name) |
---|
4200 | 4931 | { |
---|
4201 | 4932 | if (name) |
---|
.. | .. |
---|
4233 | 4964 | current.shadow = (float) shadowField.getFloat(); |
---|
4234 | 4965 | current.texture = (float) textureField.getFloat(); |
---|
4235 | 4966 | current.opacity = (float) opacityField.getFloat(); |
---|
| 4967 | + current.parallax = (float) parallaxField.getFloat() - 0.25f; |
---|
4236 | 4968 | current.fakedepth = (float) fakedepthField.getFloat(); |
---|
4237 | 4969 | current.shadowbias = (float) shadowbiasField.getFloat(); |
---|
4238 | 4970 | |
---|
.. | .. |
---|
4245 | 4977 | { |
---|
4246 | 4978 | cMaterial mat = copy.material; |
---|
4247 | 4979 | |
---|
4248 | | - colorField.SetToolTipValue((mat.color)); |
---|
4249 | | - saturationField.SetToolTipValue((mat.modulation)); |
---|
4250 | | - metalnessField.SetToolTipValue((mat.metalness)); |
---|
4251 | | - diffuseField.SetToolTipValue((mat.diffuse)); |
---|
4252 | | - specularField.SetToolTipValue((mat.specular)); |
---|
4253 | | - shininessField.SetToolTipValue((mat.shininess)); |
---|
4254 | | - shiftField.SetToolTipValue((mat.shift)); |
---|
4255 | | - ambientField.SetToolTipValue((mat.ambient)); |
---|
4256 | | - lightareaField.SetToolTipValue((mat.lightarea)); |
---|
4257 | | - diffusenessField.SetToolTipValue((mat.factor)); |
---|
4258 | | - velvetField.SetToolTipValue((mat.velvet)); |
---|
4259 | | - sheenField.SetToolTipValue((mat.sheen)); |
---|
4260 | | - subsurfaceField.SetToolTipValue((mat.subsurface)); |
---|
4261 | | - backlitField.SetToolTipValue((mat.bump)); |
---|
4262 | | - anisoField.SetToolTipValue((mat.aniso)); |
---|
4263 | | - anisoVField.SetToolTipValue((mat.anisoV)); |
---|
4264 | | - cameraField.SetToolTipValue((mat.cameralight)); |
---|
4265 | | - selfshadowField.SetToolTipValue((mat.diffuseness)); |
---|
4266 | | - shadowField.SetToolTipValue((mat.shadow)); |
---|
4267 | | - textureField.SetToolTipValue((mat.texture)); |
---|
4268 | | - opacityField.SetToolTipValue((mat.opacity)); |
---|
4269 | | - fakedepthField.SetToolTipValue((mat.fakedepth)); |
---|
4270 | | - shadowbiasField.SetToolTipValue((mat.shadowbias)); |
---|
| 4980 | + if (!Equal(colorField.getFloat(), mat.color)) |
---|
| 4981 | + colorField.SetToolTipValue((mat.color)); |
---|
| 4982 | + if (!Equal(saturationField.getFloat(), mat.modulation)) |
---|
| 4983 | + saturationField.SetToolTipValue((mat.modulation)); |
---|
| 4984 | + if (!Equal(metalnessField.getFloat(), mat.metalness)) |
---|
| 4985 | + metalnessField.SetToolTipValue((mat.metalness)); |
---|
| 4986 | + if (!Equal(diffuseField.getFloat(), mat.diffuse)) |
---|
| 4987 | + diffuseField.SetToolTipValue((mat.diffuse)); |
---|
| 4988 | + if (!Equal(specularField.getFloat(), mat.specular)) |
---|
| 4989 | + specularField.SetToolTipValue((mat.specular)); |
---|
| 4990 | + if (!Equal(shininessField.getFloat(), mat.shininess)) |
---|
| 4991 | + shininessField.SetToolTipValue((mat.shininess)); |
---|
| 4992 | + if (!Equal(shiftField.getFloat(), mat.shift)) |
---|
| 4993 | + shiftField.SetToolTipValue((mat.shift)); |
---|
| 4994 | + if (!Equal(ambientField.getFloat(), mat.ambient)) |
---|
| 4995 | + ambientField.SetToolTipValue((mat.ambient)); |
---|
| 4996 | + if (!Equal(lightareaField.getFloat(), mat.lightarea)) |
---|
| 4997 | + lightareaField.SetToolTipValue((mat.lightarea)); |
---|
| 4998 | + if (!Equal(diffusenessField.getFloat(), mat.factor)) |
---|
| 4999 | + diffusenessField.SetToolTipValue((mat.factor)); |
---|
| 5000 | + if (!Equal(velvetField.getFloat(), mat.velvet)) |
---|
| 5001 | + velvetField.SetToolTipValue((mat.velvet)); |
---|
| 5002 | + if (!Equal(sheenField.getFloat(), mat.sheen)) |
---|
| 5003 | + sheenField.SetToolTipValue((mat.sheen)); |
---|
| 5004 | + if (!Equal(subsurfaceField.getFloat(), mat.subsurface)) |
---|
| 5005 | + subsurfaceField.SetToolTipValue((mat.subsurface)); |
---|
| 5006 | + if (!Equal(backlitField.getFloat(), mat.bump)) |
---|
| 5007 | + backlitField.SetToolTipValue((mat.bump)); |
---|
| 5008 | + if (!Equal(anisoField.getFloat(), mat.aniso)) |
---|
| 5009 | + anisoField.SetToolTipValue((mat.aniso)); |
---|
| 5010 | + if (!Equal(anisoVField.getFloat(), mat.anisoV)) |
---|
| 5011 | + anisoVField.SetToolTipValue((mat.anisoV)); |
---|
| 5012 | + if (!Equal(cameraField.getFloat(), mat.cameralight)) |
---|
| 5013 | + cameraField.SetToolTipValue((mat.cameralight)); |
---|
| 5014 | + if (!Equal(selfshadowField.getFloat(), mat.diffuseness)) |
---|
| 5015 | + selfshadowField.SetToolTipValue((mat.diffuseness)); |
---|
| 5016 | + if (!Equal(shadowField.getFloat(), mat.shadow)) |
---|
| 5017 | + shadowField.SetToolTipValue((mat.shadow)); |
---|
| 5018 | + if (!Equal(textureField.getFloat(), mat.texture)) |
---|
| 5019 | + textureField.SetToolTipValue((mat.texture)); |
---|
| 5020 | + if (!Equal(opacityField.getFloat(), mat.opacity)) |
---|
| 5021 | + opacityField.SetToolTipValue((mat.opacity)); |
---|
| 5022 | + //if (!Equal(parallaxField.getFloat(), mat.parallax)) |
---|
| 5023 | + parallaxField.SetToolTipValue((mat.parallax)); |
---|
| 5024 | + if (!Equal(fakedepthField.getFloat(), mat.fakedepth)) |
---|
| 5025 | + fakedepthField.SetToolTipValue((mat.fakedepth)); |
---|
| 5026 | + if (!Equal(shadowbiasField.getFloat(), mat.shadowbias)) |
---|
| 5027 | + shadowbiasField.SetToolTipValue((mat.shadowbias)); |
---|
4271 | 5028 | } |
---|
4272 | 5029 | |
---|
4273 | 5030 | if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null) |
---|
.. | .. |
---|
4302 | 5059 | |
---|
4303 | 5060 | public void stateChanged(ChangeEvent e) |
---|
4304 | 5061 | { |
---|
4305 | | - // assert(false); |
---|
| 5062 | + // assert(false); |
---|
4306 | 5063 | if (e.getSource() == versionSlider) |
---|
4307 | 5064 | { |
---|
4308 | 5065 | if (muteSlider) |
---|
4309 | 5066 | return; |
---|
4310 | 5067 | |
---|
| 5068 | + Replace(); |
---|
| 5069 | + |
---|
4311 | 5070 | int version = versionSlider.getInteger(); |
---|
4312 | 5071 | |
---|
4313 | | - if (copy.versionlist[version] != null) |
---|
| 5072 | + if (version != -1 && copy.versionlist[version] != null) |
---|
4314 | 5073 | { |
---|
4315 | | - CopyChanged(copy.versionlist[copy.versionindex = version]); |
---|
| 5074 | + copy.versionindex = version; |
---|
| 5075 | + CopyChanged(); |
---|
4316 | 5076 | } |
---|
4317 | 5077 | |
---|
4318 | 5078 | return; |
---|
.. | .. |
---|
4353 | 5113 | //System.out.println("stateChanged = " + this); |
---|
4354 | 5114 | materialtouched = true; |
---|
4355 | 5115 | |
---|
4356 | | - if (e.getSource() == colorField && saturationField.getFloat() == 0.001) |
---|
| 5116 | + if (Globals.AUTOSATURATE && e.getSource() == colorField && saturationField.getFloat() == 0.001) |
---|
4357 | 5117 | { |
---|
4358 | 5118 | saturationField.setFloat(1); |
---|
4359 | 5119 | } |
---|
.. | .. |
---|
4666 | 5426 | ctrlPanel.validate(); // ? new |
---|
4667 | 5427 | ctrlPanel.repaint(); |
---|
4668 | 5428 | } |
---|
| 5429 | + |
---|
| 5430 | + if (previousVersionButton != null && copy.versionlist != null) |
---|
| 5431 | + SetVersionStates(); |
---|
| 5432 | + |
---|
| 5433 | + cameraView.requestFocusInWindow(); |
---|
4669 | 5434 | } |
---|
4670 | 5435 | |
---|
4671 | 5436 | static TweenManager tweenManager = new TweenManager(); |
---|
.. | .. |
---|
4697 | 5462 | // group = (Composite) group.get(0); |
---|
4698 | 5463 | // } |
---|
4699 | 5464 | |
---|
4700 | | - System.out.println("makeSomething of " + thing); |
---|
| 5465 | + //System.out.println("makeSomething of " + thing); |
---|
4701 | 5466 | |
---|
4702 | 5467 | /* |
---|
4703 | 5468 | if (deselect && jList != null) |
---|
.. | .. |
---|
5051 | 5816 | |
---|
5052 | 5817 | copy.versionlist = readobj.versionlist; |
---|
5053 | 5818 | copy.versionindex = readobj.versionindex; |
---|
| 5819 | + copy.versiontable = readobj.versiontable; |
---|
5054 | 5820 | |
---|
5055 | 5821 | if (copy.versionlist == null) |
---|
5056 | 5822 | { |
---|
| 5823 | + // Backward compatibility |
---|
5057 | 5824 | copy.versionlist = new Object3D[100]; |
---|
5058 | 5825 | copy.versionindex = -1; |
---|
| 5826 | + |
---|
| 5827 | + //Save(true); |
---|
5059 | 5828 | } |
---|
5060 | 5829 | |
---|
5061 | 5830 | //? SetUndoStates(); |
---|
.. | .. |
---|
5070 | 5839 | { |
---|
5071 | 5840 | if (Grafreed.standAlone) |
---|
5072 | 5841 | { |
---|
5073 | | - FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD); |
---|
| 5842 | + FileDialog browser = new FileDialog(frame, "Open", FileDialog.LOAD); |
---|
5074 | 5843 | browser.show(); |
---|
5075 | 5844 | String filename = browser.getFile(); |
---|
5076 | 5845 | if (filename != null && filename.length() > 0) |
---|
.. | .. |
---|
5147 | 5916 | |
---|
5148 | 5917 | void save() |
---|
5149 | 5918 | { |
---|
| 5919 | + Replace(); |
---|
| 5920 | + |
---|
5150 | 5921 | if (lastname == null) |
---|
5151 | 5922 | { |
---|
5152 | 5923 | return; |
---|
.. | .. |
---|
5389 | 6160 | ButtonGroup buttonGroup; |
---|
5390 | 6161 | |
---|
5391 | 6162 | cGridBag toolboxPanel; |
---|
| 6163 | + cGridBag skyboxPanel; |
---|
5392 | 6164 | cGridBag materialPanel; |
---|
5393 | 6165 | cGridBag ctrlPanel; |
---|
5394 | 6166 | |
---|
.. | .. |
---|
5400 | 6172 | boolean materialFlushed; |
---|
5401 | 6173 | Object3D latestObject; |
---|
5402 | 6174 | |
---|
| 6175 | + cGridBag transformPanel; |
---|
5403 | 6176 | cGridBag XYZPanel; |
---|
5404 | 6177 | |
---|
5405 | 6178 | JSplitPane gridPanel; |
---|
.. | .. |
---|
5493 | 6266 | cNumberSlider anisoField; |
---|
5494 | 6267 | JLabel anisoVLabel; |
---|
5495 | 6268 | cNumberSlider anisoVField; |
---|
| 6269 | + |
---|
5496 | 6270 | JLabel cameraLabel; |
---|
5497 | 6271 | cNumberSlider cameraField; |
---|
5498 | 6272 | JLabel selfshadowLabel; |
---|
.. | .. |
---|
5503 | 6277 | cNumberSlider textureField; |
---|
5504 | 6278 | JLabel opacityLabel; |
---|
5505 | 6279 | cNumberSlider opacityField; |
---|
| 6280 | + JLabel parallaxLabel; |
---|
| 6281 | + cNumberSlider parallaxField; |
---|
5506 | 6282 | JLabel fakedepthLabel; |
---|
5507 | 6283 | cNumberSlider fakedepthField; |
---|
5508 | 6284 | JLabel shadowbiasLabel; |
---|
5509 | 6285 | cNumberSlider shadowbiasField; |
---|
| 6286 | + |
---|
5510 | 6287 | JLabel bumpLabel; |
---|
5511 | 6288 | cNumberSlider bumpField; |
---|
5512 | 6289 | JLabel noiseLabel; |
---|