.. | .. |
---|
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 cGridBag GetSeparator() |
---|
| 47 | + { |
---|
| 48 | + cGridBag separator = new cGridBag(); |
---|
| 49 | + separator.add(new JSeparator()); |
---|
| 50 | + separator.preferredHeight = 5; |
---|
| 51 | + return separator; |
---|
| 52 | + } |
---|
44 | 53 | |
---|
45 | 54 | cButton GetButton(String name, boolean border) |
---|
46 | 55 | { |
---|
47 | | - try |
---|
48 | | - { |
---|
49 | | - ImageIcon icon = GetIcon(name); |
---|
50 | | - return new cButton(icon, border); |
---|
51 | | - } |
---|
52 | | - catch (Exception e) |
---|
53 | | - { |
---|
54 | | - return new cButton(name, border); |
---|
55 | | - } |
---|
| 56 | + ImageIcon icon = GetIcon(name); |
---|
| 57 | + return new cButton(icon, border); |
---|
| 58 | + } |
---|
| 59 | + |
---|
| 60 | + cLabel GetLabel(String name, boolean border) |
---|
| 61 | + { |
---|
| 62 | + //ImageIcon icon = GetIcon(name); |
---|
| 63 | + return new cLabel(GetImage(name), border); |
---|
56 | 64 | } |
---|
57 | 65 | |
---|
58 | 66 | cToggleButton GetToggleButton(String name, boolean border) |
---|
59 | 67 | { |
---|
60 | | - try |
---|
61 | | - { |
---|
62 | | - ImageIcon icon = GetIcon(name); |
---|
63 | | - return new cToggleButton(icon, border); |
---|
64 | | - } |
---|
65 | | - catch (Exception e) |
---|
66 | | - { |
---|
67 | | - return new cToggleButton(name, border); |
---|
68 | | - } |
---|
| 68 | + ImageIcon icon = GetIcon(name); |
---|
| 69 | + return new cToggleButton(icon, border); |
---|
69 | 70 | } |
---|
70 | 71 | |
---|
71 | 72 | cCheckBox GetCheckBox(String name, boolean border) |
---|
72 | 73 | { |
---|
| 74 | + ImageIcon icon = GetIcon(name); |
---|
| 75 | + return new cCheckBox(icon, border); |
---|
| 76 | + } |
---|
| 77 | + |
---|
| 78 | + ImageIcon GetIcon(String name) |
---|
| 79 | + { |
---|
73 | 80 | try |
---|
74 | 81 | { |
---|
75 | | - ImageIcon icon = GetIcon(name); |
---|
76 | | - return new cCheckBox(icon, border); |
---|
| 82 | + BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name)); |
---|
| 83 | + |
---|
| 84 | +// if (image.getWidth() > 48 && image.getHeight() > 48) |
---|
| 85 | +// { |
---|
| 86 | +// BufferedImage resized = new BufferedImage(48, 48, image.getType()); |
---|
| 87 | +// Graphics2D g = resized.createGraphics(); |
---|
| 88 | +// g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); |
---|
| 89 | +// //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
---|
| 90 | +// g.drawImage(image, 0, 0, 48, 48, 0, 0, image.getWidth(), image.getHeight(), null); |
---|
| 91 | +// g.dispose(); |
---|
| 92 | +// |
---|
| 93 | +// image = resized; |
---|
| 94 | +// } |
---|
| 95 | + |
---|
| 96 | + javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image); |
---|
| 97 | + return icon; |
---|
77 | 98 | } |
---|
78 | 99 | catch (Exception e) |
---|
79 | 100 | { |
---|
80 | | - return new cCheckBox(name, border); |
---|
| 101 | + return null; |
---|
81 | 102 | } |
---|
82 | 103 | } |
---|
83 | | - |
---|
84 | | - private ImageIcon GetIcon(String name) throws IOException |
---|
| 104 | + |
---|
| 105 | + BufferedImage GetImage(String name) |
---|
85 | 106 | { |
---|
86 | | - BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name)); |
---|
87 | | - |
---|
88 | | - if (image.getWidth() != 24 && image.getHeight() != 24) |
---|
| 107 | + try |
---|
89 | 108 | { |
---|
90 | | - BufferedImage resized = new BufferedImage(24, 24, image.getType()); |
---|
91 | | - Graphics2D g = resized.createGraphics(); |
---|
92 | | - g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); |
---|
93 | | - //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
---|
94 | | - g.drawImage(image, 0, 0, 24, 24, 0, 0, image.getWidth(), image.getHeight(), null); |
---|
95 | | - g.dispose(); |
---|
96 | | - |
---|
97 | | - image = resized; |
---|
| 109 | + BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name)); |
---|
| 110 | + |
---|
| 111 | + return image; |
---|
98 | 112 | } |
---|
99 | | - |
---|
100 | | - javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image); |
---|
101 | | - return icon; |
---|
| 113 | + catch (Exception e) |
---|
| 114 | + { |
---|
| 115 | + return null; |
---|
| 116 | + } |
---|
102 | 117 | } |
---|
103 | 118 | |
---|
104 | 119 | // SCRIPT |
---|
.. | .. |
---|
282 | 297 | client = inClient; |
---|
283 | 298 | copy = client; |
---|
284 | 299 | |
---|
| 300 | + if (copy.versionlist == null) |
---|
| 301 | + { |
---|
| 302 | + copy.versionlist = new Object3D[100]; |
---|
| 303 | + copy.versionindex = -1; |
---|
| 304 | + } |
---|
| 305 | + |
---|
285 | 306 | // "this" is not called: SetupUI2(objEditor); |
---|
286 | 307 | } |
---|
287 | 308 | |
---|
.. | .. |
---|
295 | 316 | client = inClient; |
---|
296 | 317 | copy = client; |
---|
297 | 318 | |
---|
| 319 | + if (copy.versionlist == null) |
---|
| 320 | + { |
---|
| 321 | + copy.versionlist = new Object3D[100]; |
---|
| 322 | + copy.versionindex = -1; |
---|
| 323 | + } |
---|
| 324 | + |
---|
298 | 325 | SetupUI2(callee.GetEditor()); |
---|
299 | 326 | } |
---|
300 | 327 | |
---|
.. | .. |
---|
327 | 354 | copy = localCopy; |
---|
328 | 355 | copy.editWindow = this; |
---|
329 | 356 | |
---|
| 357 | + if (copy.versionlist == null) |
---|
| 358 | + { |
---|
| 359 | +// copy.versions = new byte[100][]; |
---|
| 360 | +// copy.versionindex = -1; |
---|
| 361 | + } |
---|
| 362 | + |
---|
330 | 363 | SetupMenu(); |
---|
331 | 364 | |
---|
332 | 365 | //SetupName(objEditor); // new |
---|
.. | .. |
---|
419 | 452 | |
---|
420 | 453 | toolbarPanel = new JPanel(); |
---|
421 | 454 | toolbarPanel.setName("Toolbar"); |
---|
| 455 | + |
---|
422 | 456 | treePanel = new cGridBag(); |
---|
423 | 457 | treePanel.setName("Tree"); |
---|
424 | 458 | |
---|
425 | 459 | editPanel = new cGridBag().setVertical(true); |
---|
426 | | - editPanel.setName("Edit"); |
---|
| 460 | + //editPanel.setName("Edit"); |
---|
427 | 461 | |
---|
428 | 462 | ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout()); |
---|
429 | 463 | |
---|
.. | .. |
---|
431 | 465 | editPanel.add(editCommandsPanel); |
---|
432 | 466 | editPanel.add(ctrlPanel); |
---|
433 | 467 | |
---|
434 | | - toolboxPanel = new cGridBag().setVertical(false); |
---|
435 | | - toolboxPanel.setName("Toolbox"); |
---|
| 468 | + toolboxPanel = new cGridBag().setVertical(true); |
---|
| 469 | + //toolboxPanel.setName("Toolbox"); |
---|
436 | 470 | |
---|
437 | | - materialPanel = new cGridBag().setVertical(true); |
---|
438 | | - materialPanel.setName("Material"); |
---|
| 471 | + skyboxPanel = new cGridBag().setVertical(true); |
---|
| 472 | + |
---|
| 473 | + materialPanel = new cGridBag().setVertical(false); |
---|
| 474 | + //materialPanel.setName("Material"); |
---|
439 | 475 | |
---|
440 | 476 | /*JTextPane*/ |
---|
441 | 477 | infoarea = createTextPane(); |
---|
.. | .. |
---|
443 | 479 | |
---|
444 | 480 | infoarea.setEditable(true); |
---|
445 | 481 | SetText(); |
---|
| 482 | + |
---|
446 | 483 | // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f)); |
---|
447 | 484 | // infoarea.setOpaque(false); |
---|
448 | 485 | // //infoarea.setForeground(textcolor); |
---|
.. | .. |
---|
450 | 487 | // TEXTAREA infoarea.setWrapStyleWord(true); |
---|
451 | 488 | infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED); |
---|
452 | 489 | infoPanel.setPreferredSize(new Dimension(1, 1)); |
---|
453 | | - infoPanel.setName("Info"); |
---|
| 490 | + //infoPanel.setName("Info"); |
---|
454 | 491 | //infoPanel.setLayout(new BorderLayout()); |
---|
455 | 492 | //infoPanel.add(createTextPane()); |
---|
456 | 493 | |
---|
.. | .. |
---|
717 | 754 | boolean maximized; |
---|
718 | 755 | |
---|
719 | 756 | cButton fullscreenLayout; |
---|
| 757 | + cButton expandedLayout; |
---|
720 | 758 | |
---|
721 | 759 | void Minimize() |
---|
722 | 760 | { |
---|
.. | .. |
---|
756 | 794 | cButton minButton; |
---|
757 | 795 | cButton maxButton; |
---|
758 | 796 | cButton fullButton; |
---|
| 797 | + cButton collapseButton; |
---|
| 798 | + cButton maximize3DButton; |
---|
759 | 799 | |
---|
760 | 800 | void ToggleFullScreen() |
---|
761 | 801 | { |
---|
762 | | -GraphicsDevice device = frame.getGraphicsConfiguration().getDevice(); |
---|
| 802 | + GraphicsDevice device = frame.getGraphicsConfiguration().getDevice(); |
---|
763 | 803 | |
---|
764 | 804 | cameraView.ToggleFullScreen(); |
---|
765 | 805 | |
---|
.. | .. |
---|
780 | 820 | // X frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
781 | 821 | // X framePanel.add(bigThree); |
---|
782 | 822 | // X frame.getContentPane().add(/*"Center",*/framePanel); |
---|
783 | | - framePanel.setDividerLocation(46); |
---|
| 823 | +// framePanel.setDividerLocation(46); // icons are 24x24 |
---|
784 | 824 | |
---|
785 | 825 | //frame.setVisible(true); |
---|
786 | | - radio.layout = keepButton; |
---|
| 826 | +// radio.layout = keepButton; |
---|
787 | 827 | //theFrame = null; |
---|
788 | 828 | keepButton = null; |
---|
789 | | - radio.layout.doClick(); |
---|
| 829 | +// radio.layout.doClick(); |
---|
790 | 830 | |
---|
791 | 831 | } else |
---|
792 | 832 | { |
---|
.. | .. |
---|
807 | 847 | // X frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
808 | 848 | // X framePanel.remove(bigThree); |
---|
809 | 849 | // X frame.getContentPane().add(/*"Center",*/bigThree); |
---|
810 | | - framePanel.setDividerLocation(0); |
---|
| 850 | +// framePanel.setDividerLocation(0); |
---|
811 | 851 | |
---|
812 | | - radio.layout = fullscreenLayout; |
---|
813 | | - radio.layout.doClick(); |
---|
| 852 | +// radio.layout = fullscreenLayout; |
---|
| 853 | +// radio.layout.doClick(); |
---|
814 | 854 | //frame.setVisible(true); |
---|
815 | 855 | } |
---|
816 | 856 | frame.validate(); |
---|
| 857 | + |
---|
| 858 | + cameraView.requestFocusInWindow(); |
---|
817 | 859 | } |
---|
818 | 860 | |
---|
819 | | - private byte[] CompressCopy() |
---|
| 861 | + void CollapseToolbar() |
---|
| 862 | + { |
---|
| 863 | + framePanel.setDividerLocation(0); |
---|
| 864 | + //frame.validate(); |
---|
| 865 | + |
---|
| 866 | + cameraView.requestFocusInWindow(); |
---|
| 867 | + } |
---|
| 868 | + |
---|
| 869 | + private Object3D Duplicate(Object3D object) |
---|
820 | 870 | { |
---|
821 | 871 | boolean temp = CameraPane.SWITCH; |
---|
822 | 872 | CameraPane.SWITCH = false; |
---|
823 | 873 | |
---|
824 | | - copy.ExtractBigData(versiontable); |
---|
| 874 | + object.ExtractBigData(versiontable); |
---|
825 | 875 | // if (copy == client) |
---|
826 | 876 | |
---|
827 | | - byte[] versions[] = copy.versions; |
---|
828 | | - copy.versions = null; |
---|
| 877 | + Object3D versions[] = object.versionlist; |
---|
| 878 | + object.versionlist = null; |
---|
829 | 879 | |
---|
830 | | - byte[] compress = Compress(copy); |
---|
| 880 | + //byte[] compress = Compress(copy); |
---|
| 881 | + Object3D compress = (Object3D)Grafreed.clone(object); |
---|
831 | 882 | |
---|
832 | | - copy.versions = versions; |
---|
| 883 | + object.versionlist = versions; |
---|
833 | 884 | |
---|
834 | | - copy.RestoreBigData(versiontable); |
---|
| 885 | + object.RestoreBigData(versiontable); |
---|
835 | 886 | |
---|
836 | 887 | CameraPane.SWITCH = temp; |
---|
837 | 888 | |
---|
.. | .. |
---|
959 | 1010 | { |
---|
960 | 1011 | SetupMaterial(materialPanel); |
---|
961 | 1012 | } |
---|
| 1013 | + |
---|
962 | 1014 | //SetupName(); |
---|
963 | 1015 | //SetupViews(); |
---|
964 | 1016 | } |
---|
.. | .. |
---|
968 | 1020 | // NumberSlider vDivsField; |
---|
969 | 1021 | // JCheckBox endcaps; |
---|
970 | 1022 | JCheckBox liveCB; |
---|
971 | | - JCheckBox selectCB; |
---|
| 1023 | + JCheckBox selectableCB; |
---|
972 | 1024 | JCheckBox hideCB; |
---|
973 | 1025 | JCheckBox link2masterCB; |
---|
974 | 1026 | JCheckBox markCB; |
---|
.. | .. |
---|
1167 | 1219 | |
---|
1168 | 1220 | namePanel = new cGridBag(); |
---|
1169 | 1221 | |
---|
| 1222 | + //if (copy.pinned) |
---|
| 1223 | + { |
---|
| 1224 | + pinButton = GetToggleButton("icons/pin.png", !Grafreed.NIMBUSLAF); |
---|
| 1225 | + pinButton.setSelected(copy.pinned); |
---|
| 1226 | + cGridBag t = new cGridBag(); |
---|
| 1227 | + t.preferredWidth = 2; |
---|
| 1228 | + t.add(pinButton); |
---|
| 1229 | + namePanel.add(t); |
---|
| 1230 | + |
---|
| 1231 | + pinButton.addItemListener(this); |
---|
| 1232 | + } |
---|
| 1233 | + |
---|
1170 | 1234 | nameField = AddText(namePanel, copy.GetName()); |
---|
1171 | 1235 | namePanel.add(new JScrollPane(nameField, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER)); |
---|
1172 | 1236 | oe.ctrlPanel.add(namePanel); |
---|
.. | .. |
---|
1180 | 1244 | |
---|
1181 | 1245 | liveCB = AddCheckBox(setupPanel, "Live", copy.live); |
---|
1182 | 1246 | liveCB.setToolTipText("Animate object"); |
---|
1183 | | - selectCB = AddCheckBox(setupPanel, "Select", !copy.dontselect); |
---|
1184 | | - selectCB.setToolTipText("Make object selectable"); |
---|
| 1247 | + selectableCB = AddCheckBox(setupPanel, "Select", !copy.dontselect); |
---|
| 1248 | + selectableCB.setToolTipText("Make object selectable"); |
---|
1185 | 1249 | // Return(); |
---|
| 1250 | + |
---|
1186 | 1251 | hideCB = AddCheckBox(setupPanel, "Hide", copy.hide); |
---|
1187 | 1252 | hideCB.setToolTipText("Hide object"); |
---|
1188 | 1253 | markCB = AddCheckBox(setupPanel, "Mark", copy.marked); |
---|
1189 | 1254 | markCB.setToolTipText("As animation target transform"); |
---|
| 1255 | + |
---|
| 1256 | + ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false); |
---|
1190 | 1257 | |
---|
1191 | 1258 | setupPanel2 = new cGridBag().setVertical(false); |
---|
1192 | 1259 | |
---|
.. | .. |
---|
1474 | 1541 | XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll); |
---|
1475 | 1542 | XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll); |
---|
1476 | 1543 | XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll); |
---|
| 1544 | + //XYZPanel.setName("XYZ"); |
---|
1477 | 1545 | |
---|
1478 | 1546 | /* |
---|
1479 | 1547 | gridPanel = new JPanel(); //new BorderLayout()); |
---|
.. | .. |
---|
1511 | 1579 | //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); |
---|
1512 | 1580 | //tmp.setName("Edit"); |
---|
1513 | 1581 | objectPanel.add(materialPanel); |
---|
| 1582 | + objectPanel.setIconAt(0, GetIcon("icons/material.png")); |
---|
| 1583 | + objectPanel.setToolTipTextAt(0, "Material"); |
---|
| 1584 | + |
---|
| 1585 | + objectPanel.add(toolboxPanel); |
---|
| 1586 | + objectPanel.setIconAt(1, GetIcon("icons/primitives.png")); |
---|
| 1587 | + objectPanel.setToolTipTextAt(1, "Objects & textures"); |
---|
| 1588 | + |
---|
| 1589 | + objectPanel.add(skyboxPanel); |
---|
| 1590 | + objectPanel.setIconAt(2, GetIcon("icons/skybox.jpg")); |
---|
| 1591 | + objectPanel.setToolTipTextAt(2, "Backgrounds"); |
---|
| 1592 | + |
---|
1514 | 1593 | // JPanel north = new JPanel(new BorderLayout()); |
---|
1515 | 1594 | // north.setName("Edit"); |
---|
1516 | 1595 | // north.add(ctrlPanel, BorderLayout.NORTH); |
---|
1517 | 1596 | // objectPanel.add(north); |
---|
1518 | 1597 | objectPanel.add(editPanel); |
---|
| 1598 | + objectPanel.setIconAt(3, GetIcon("icons/write.png")); |
---|
| 1599 | + objectPanel.setToolTipTextAt(3, "Edit controls"); |
---|
1519 | 1600 | |
---|
1520 | | - //if (Globals.ADVANCED) |
---|
1521 | | - objectPanel.add(infoPanel); |
---|
| 1601 | + objectPanel.add(XYZPanel); |
---|
| 1602 | + objectPanel.setIconAt(4, GetIcon("icons/XYZ.png")); |
---|
| 1603 | + objectPanel.setToolTipTextAt(4, "XYZ/RGB transform"); |
---|
1522 | 1604 | |
---|
1523 | | - objectPanel.add(toolboxPanel); |
---|
1524 | | - |
---|
1525 | 1605 | /* |
---|
1526 | 1606 | aConstraints.gridx = 0; |
---|
1527 | 1607 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1541 | 1621 | scrollpane.addMouseWheelListener(this); // Default not fast enough |
---|
1542 | 1622 | |
---|
1543 | 1623 | /*JTabbedPane*/ scenePanel = new cGridBag(); |
---|
1544 | | - scenePanel.preferredWidth = 6; |
---|
| 1624 | + scenePanel.preferredWidth = 5; |
---|
1545 | 1625 | |
---|
1546 | 1626 | JTabbedPane tabbedPane = new JTabbedPane(); |
---|
1547 | 1627 | tabbedPane.add(scrollpane); |
---|
.. | .. |
---|
1558 | 1638 | |
---|
1559 | 1639 | scenePanel.add(tabbedPane); |
---|
1560 | 1640 | |
---|
| 1641 | + //if (Globals.ADVANCED) |
---|
| 1642 | + tabbedPane.add(infoPanel); |
---|
| 1643 | + tabbedPane.setIconAt(3, GetIcon("icons/info.png")); |
---|
| 1644 | + tabbedPane.setToolTipTextAt(3, "Information"); |
---|
| 1645 | + |
---|
1561 | 1646 | /* |
---|
1562 | 1647 | cTree jTree = new cTree(null); |
---|
1563 | 1648 | ToolTipManager.sharedInstance().registerComponent(jTree); |
---|
.. | .. |
---|
1619 | 1704 | bigThree = new cGridBag(); |
---|
1620 | 1705 | bigThree.addComponent(scenePanel); |
---|
1621 | 1706 | bigThree.addComponent(centralPanel); |
---|
1622 | | - bigThree.addComponent(XYZPanel); |
---|
| 1707 | + //bigThree.addComponent(XYZPanel); |
---|
1623 | 1708 | |
---|
1624 | 1709 | // // SIDE EFFECT!!! |
---|
1625 | 1710 | // aConstraints.gridx = 0; |
---|
.. | .. |
---|
1628 | 1713 | // aConstraints.gridheight = 1; |
---|
1629 | 1714 | |
---|
1630 | 1715 | framePanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, toolbarPanel, bigThree); |
---|
| 1716 | + |
---|
| 1717 | + framePanel.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY, |
---|
| 1718 | + new java.beans.PropertyChangeListener() |
---|
| 1719 | + { |
---|
| 1720 | + public void propertyChange(java.beans.PropertyChangeEvent pce) |
---|
| 1721 | + { |
---|
| 1722 | + if ((Integer)pce.getOldValue() == 1) |
---|
| 1723 | + { |
---|
| 1724 | + if (radio.layout != expandedLayout) |
---|
| 1725 | + { |
---|
| 1726 | + radio.layout = expandedLayout; |
---|
| 1727 | + radio.layout.doClick(); |
---|
| 1728 | + } |
---|
| 1729 | + } |
---|
| 1730 | + } |
---|
| 1731 | + }); |
---|
| 1732 | + |
---|
1631 | 1733 | framePanel.setContinuousLayout(false); |
---|
1632 | 1734 | framePanel.setOneTouchExpandable(false); |
---|
1633 | 1735 | //.setDividerLocation(0.8); |
---|
.. | .. |
---|
1660 | 1762 | frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); |
---|
1661 | 1763 | frame.addWindowListener(new WindowAdapter() |
---|
1662 | 1764 | { |
---|
1663 | | - |
---|
1664 | 1765 | public void windowClosing(WindowEvent e) |
---|
1665 | 1766 | { |
---|
1666 | 1767 | Close(); |
---|
.. | .. |
---|
1683 | 1784 | ctrlPanel.removeAll(); |
---|
1684 | 1785 | } |
---|
1685 | 1786 | |
---|
1686 | | - void SetupMaterial(cGridBag panel) |
---|
| 1787 | + void SetupMaterial(cGridBag materialpanel) |
---|
1687 | 1788 | { |
---|
1688 | | - /* |
---|
| 1789 | + cGridBag presetpanel = new cGridBag().setVertical(true); |
---|
| 1790 | + |
---|
| 1791 | + cLabel skin = GetLabel("icons/shadericons/shadericon00000.png", !Grafreed.NIMBUSLAF); |
---|
| 1792 | + skin.setToolTipText("Skin"); |
---|
| 1793 | + skin.addMouseListener(new MouseAdapter() |
---|
| 1794 | + { |
---|
| 1795 | + public void mouseClicked(MouseEvent e) |
---|
| 1796 | + { |
---|
| 1797 | + Object3D object = Grafreed.materials.versionlist[0].get(0); |
---|
| 1798 | + cMaterial material = object.material; |
---|
| 1799 | + |
---|
| 1800 | + // Skin |
---|
| 1801 | + colorField.setFloat(material.color); |
---|
| 1802 | + saturationField.setFloat(material.modulation); |
---|
| 1803 | + subsurfaceField.setFloat(material.subsurface); |
---|
| 1804 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1805 | + diffusenessField.setFloat(material.factor); |
---|
| 1806 | + shininessField.setFloat(material.shininess); |
---|
| 1807 | + shadowbiasField.setFloat(material.shadowbias); |
---|
| 1808 | + diffuseField.setFloat(material.diffuse); |
---|
| 1809 | + specularField.setFloat(material.specular); |
---|
| 1810 | + |
---|
| 1811 | + bumpField.setFloat(object.projectedVertices[0].x / 1000.0); |
---|
| 1812 | + noiseField.setFloat(object.projectedVertices[0].y / 1000.0); |
---|
| 1813 | + powerField.setFloat(object.projectedVertices[2].x / 1000.0); |
---|
| 1814 | + |
---|
| 1815 | + materialtouched = true; |
---|
| 1816 | + applySelf(); |
---|
| 1817 | + } |
---|
| 1818 | + }); |
---|
| 1819 | + presetpanel.add(skin); |
---|
| 1820 | + |
---|
| 1821 | + cLabel lambert = GetLabel("icons/shadericons/shadericon00002.png", !Grafreed.NIMBUSLAF); |
---|
| 1822 | + lambert.setToolTipText("Diffuse"); |
---|
| 1823 | + lambert.addMouseListener(new MouseAdapter() |
---|
| 1824 | + { |
---|
| 1825 | + public void mouseClicked(MouseEvent e) |
---|
| 1826 | + { |
---|
| 1827 | + Object3D object = Grafreed.materials.versionlist[2].get(0); |
---|
| 1828 | + cMaterial material = object.material; |
---|
| 1829 | + |
---|
| 1830 | + diffusenessField.setFloat(material.factor); |
---|
| 1831 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1832 | + |
---|
| 1833 | + materialtouched = true; |
---|
| 1834 | + applySelf(); |
---|
| 1835 | + } |
---|
| 1836 | + }); |
---|
| 1837 | + presetpanel.add(lambert); |
---|
| 1838 | + |
---|
| 1839 | + cLabel diffuse2 = GetLabel("icons/shadericons/shadericon00003.png", !Grafreed.NIMBUSLAF); |
---|
| 1840 | + diffuse2.setToolTipText("Diffuse2"); |
---|
| 1841 | + diffuse2.addMouseListener(new MouseAdapter() |
---|
| 1842 | + { |
---|
| 1843 | + public void mouseClicked(MouseEvent e) |
---|
| 1844 | + { |
---|
| 1845 | + Object3D object = Grafreed.materials.versionlist[3].get(0); |
---|
| 1846 | + cMaterial material = object.material; |
---|
| 1847 | + |
---|
| 1848 | + diffusenessField.setFloat(material.factor); |
---|
| 1849 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1850 | + |
---|
| 1851 | + materialtouched = true; |
---|
| 1852 | + applySelf(); |
---|
| 1853 | + } |
---|
| 1854 | + }); |
---|
| 1855 | + presetpanel.add(diffuse2); |
---|
| 1856 | + |
---|
| 1857 | + cLabel diffusemoon = GetLabel("icons/shadericons/shadericon00004.png", !Grafreed.NIMBUSLAF); |
---|
| 1858 | + diffusemoon.setToolTipText("Moon"); |
---|
| 1859 | + diffusemoon.addMouseListener(new MouseAdapter() |
---|
| 1860 | + { |
---|
| 1861 | + public void mouseClicked(MouseEvent e) |
---|
| 1862 | + { |
---|
| 1863 | + Object3D object = Grafreed.materials.versionlist[4].get(0); |
---|
| 1864 | + cMaterial material = object.material; |
---|
| 1865 | + |
---|
| 1866 | + diffusenessField.setFloat(material.factor); |
---|
| 1867 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1868 | + |
---|
| 1869 | + materialtouched = true; |
---|
| 1870 | + applySelf(); |
---|
| 1871 | + } |
---|
| 1872 | + }); |
---|
| 1873 | + presetpanel.add(diffusemoon); |
---|
| 1874 | + |
---|
| 1875 | + cLabel diffusemoon2 = GetLabel("icons/shadericons/shadericon00005.png", !Grafreed.NIMBUSLAF); |
---|
| 1876 | + diffusemoon2.setToolTipText("Moon2"); |
---|
| 1877 | + diffusemoon2.addMouseListener(new MouseAdapter() |
---|
| 1878 | + { |
---|
| 1879 | + public void mouseClicked(MouseEvent e) |
---|
| 1880 | + { |
---|
| 1881 | + Object3D object = Grafreed.materials.versionlist[5].get(0); |
---|
| 1882 | + cMaterial material = object.material; |
---|
| 1883 | + |
---|
| 1884 | + diffusenessField.setFloat(material.factor); |
---|
| 1885 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1886 | + |
---|
| 1887 | + materialtouched = true; |
---|
| 1888 | + applySelf(); |
---|
| 1889 | + } |
---|
| 1890 | + }); |
---|
| 1891 | + presetpanel.add(diffusemoon2); |
---|
| 1892 | + |
---|
| 1893 | + cLabel diffusemoon3 = GetLabel("icons/shadericons/shadericon00006.png", !Grafreed.NIMBUSLAF); |
---|
| 1894 | + diffusemoon3.setToolTipText("Moon3"); |
---|
| 1895 | + diffusemoon3.addMouseListener(new MouseAdapter() |
---|
| 1896 | + { |
---|
| 1897 | + public void mouseClicked(MouseEvent e) |
---|
| 1898 | + { |
---|
| 1899 | + Object3D object = Grafreed.materials.versionlist[6].get(0); |
---|
| 1900 | + cMaterial material = object.material; |
---|
| 1901 | + |
---|
| 1902 | + diffusenessField.setFloat(material.factor); |
---|
| 1903 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1904 | + |
---|
| 1905 | + materialtouched = true; |
---|
| 1906 | + applySelf(); |
---|
| 1907 | + } |
---|
| 1908 | + }); |
---|
| 1909 | + presetpanel.add(diffusemoon3); |
---|
| 1910 | + |
---|
| 1911 | + cLabel diffusesheen = GetLabel("icons/shadericons/shadericon00007.png", !Grafreed.NIMBUSLAF); |
---|
| 1912 | + diffusesheen.setToolTipText("Sheen"); |
---|
| 1913 | + diffusesheen.addMouseListener(new MouseAdapter() |
---|
| 1914 | + { |
---|
| 1915 | + public void mouseClicked(MouseEvent e) |
---|
| 1916 | + { |
---|
| 1917 | + Object3D object = Grafreed.materials.versionlist[7].get(0); |
---|
| 1918 | + cMaterial material = object.material; |
---|
| 1919 | + |
---|
| 1920 | + sheenField.setFloat(material.sheen); |
---|
| 1921 | + |
---|
| 1922 | + materialtouched = true; |
---|
| 1923 | + applySelf(); |
---|
| 1924 | + } |
---|
| 1925 | + }); |
---|
| 1926 | + presetpanel.add(diffusesheen); |
---|
| 1927 | + |
---|
| 1928 | + cLabel rough = GetLabel("icons/shadericons/shadericon00001.png", !Grafreed.NIMBUSLAF); |
---|
| 1929 | + rough.setToolTipText("Rough metal"); |
---|
| 1930 | + rough.addMouseListener(new MouseAdapter() |
---|
| 1931 | + { |
---|
| 1932 | + public void mouseClicked(MouseEvent e) |
---|
| 1933 | + { |
---|
| 1934 | + Object3D object = Grafreed.materials.versionlist[1].get(0); |
---|
| 1935 | + cMaterial material = object.material; |
---|
| 1936 | + |
---|
| 1937 | + shininessField.setFloat(material.shininess); |
---|
| 1938 | + velvetField.setFloat(material.velvet); |
---|
| 1939 | + |
---|
| 1940 | + materialtouched = true; |
---|
| 1941 | + applySelf(); |
---|
| 1942 | + } |
---|
| 1943 | + }); |
---|
| 1944 | + presetpanel.add(rough); |
---|
| 1945 | + |
---|
| 1946 | + cLabel rough2 = GetLabel("icons/shadericons/shadericon00013.png", !Grafreed.NIMBUSLAF); |
---|
| 1947 | + rough2.setToolTipText("Medium metal"); |
---|
| 1948 | + rough2.addMouseListener(new MouseAdapter() |
---|
| 1949 | + { |
---|
| 1950 | + public void mouseClicked(MouseEvent e) |
---|
| 1951 | + { |
---|
| 1952 | + Object3D object = Grafreed.materials.versionlist[13].get(0); |
---|
| 1953 | + cMaterial material = object.material; |
---|
| 1954 | + |
---|
| 1955 | + shininessField.setFloat(material.shininess); |
---|
| 1956 | + lightareaField.setFloat(material.lightarea); |
---|
| 1957 | + |
---|
| 1958 | + materialtouched = true; |
---|
| 1959 | + applySelf(); |
---|
| 1960 | + } |
---|
| 1961 | + }); |
---|
| 1962 | + presetpanel.add(rough2); |
---|
| 1963 | + |
---|
| 1964 | + cLabel shini0 = GetLabel("icons/shadericons/shadericon00014.png", !Grafreed.NIMBUSLAF); |
---|
| 1965 | + shini0.setToolTipText("Shiny"); |
---|
| 1966 | + shini0.addMouseListener(new MouseAdapter() |
---|
| 1967 | + { |
---|
| 1968 | + public void mouseClicked(MouseEvent e) |
---|
| 1969 | + { |
---|
| 1970 | + Object3D object = Grafreed.materials.versionlist[14].get(0); |
---|
| 1971 | + cMaterial material = object.material; |
---|
| 1972 | + |
---|
| 1973 | + shininessField.setFloat(material.shininess); |
---|
| 1974 | + lightareaField.setFloat(material.lightarea); |
---|
| 1975 | + |
---|
| 1976 | + materialtouched = true; |
---|
| 1977 | + applySelf(); |
---|
| 1978 | + } |
---|
| 1979 | + }); |
---|
| 1980 | + presetpanel.add(shini0); |
---|
| 1981 | + |
---|
| 1982 | + cLabel shini1 = GetLabel("icons/shadericons/shadericon00011.png", !Grafreed.NIMBUSLAF); |
---|
| 1983 | + shini1.setToolTipText("Shiny2"); |
---|
| 1984 | + shini1.addMouseListener(new MouseAdapter() |
---|
| 1985 | + { |
---|
| 1986 | + public void mouseClicked(MouseEvent e) |
---|
| 1987 | + { |
---|
| 1988 | + Object3D object = Grafreed.materials.versionlist[11].get(0); |
---|
| 1989 | + cMaterial material = object.material; |
---|
| 1990 | + |
---|
| 1991 | + shininessField.setFloat(material.shininess); |
---|
| 1992 | + lightareaField.setFloat(material.lightarea); |
---|
| 1993 | + |
---|
| 1994 | + materialtouched = true; |
---|
| 1995 | + applySelf(); |
---|
| 1996 | + } |
---|
| 1997 | + }); |
---|
| 1998 | + presetpanel.add(shini1); |
---|
| 1999 | + |
---|
| 2000 | + cLabel shini2 = GetLabel("icons/shadericons/shadericon00012.png", !Grafreed.NIMBUSLAF); |
---|
| 2001 | + shini2.setToolTipText("Shiny3"); |
---|
| 2002 | + shini2.addMouseListener(new MouseAdapter() |
---|
| 2003 | + { |
---|
| 2004 | + public void mouseClicked(MouseEvent e) |
---|
| 2005 | + { |
---|
| 2006 | + Object3D object = Grafreed.materials.versionlist[12].get(0); |
---|
| 2007 | + cMaterial material = object.material; |
---|
| 2008 | + |
---|
| 2009 | + shininessField.setFloat(material.shininess); |
---|
| 2010 | + lightareaField.setFloat(material.lightarea); |
---|
| 2011 | + |
---|
| 2012 | + materialtouched = true; |
---|
| 2013 | + applySelf(); |
---|
| 2014 | + } |
---|
| 2015 | + }); |
---|
| 2016 | + presetpanel.add(shini2); |
---|
| 2017 | + |
---|
| 2018 | + cLabel aniso = GetLabel("icons/shadericons/shadericon00008.png", !Grafreed.NIMBUSLAF); |
---|
| 2019 | + aniso.setToolTipText("AnisoU"); |
---|
| 2020 | + aniso.addMouseListener(new MouseAdapter() |
---|
| 2021 | + { |
---|
| 2022 | + public void mouseClicked(MouseEvent e) |
---|
| 2023 | + { |
---|
| 2024 | + Object3D object = Grafreed.materials.versionlist[8].get(0); |
---|
| 2025 | + cMaterial material = object.material; |
---|
| 2026 | + |
---|
| 2027 | + anisoField.setFloat(material.aniso); |
---|
| 2028 | + anisoVField.setFloat(material.anisoV); |
---|
| 2029 | + |
---|
| 2030 | + materialtouched = true; |
---|
| 2031 | + applySelf(); |
---|
| 2032 | + } |
---|
| 2033 | + }); |
---|
| 2034 | + presetpanel.add(aniso); |
---|
| 2035 | + |
---|
| 2036 | + cLabel aniso2 = GetLabel("icons/shadericons/shadericon00009.png", !Grafreed.NIMBUSLAF); |
---|
| 2037 | + aniso2.setToolTipText("AnisoV"); |
---|
| 2038 | + aniso2.addMouseListener(new MouseAdapter() |
---|
| 2039 | + { |
---|
| 2040 | + public void mouseClicked(MouseEvent e) |
---|
| 2041 | + { |
---|
| 2042 | + Object3D object = Grafreed.materials.versionlist[9].get(0); |
---|
| 2043 | + cMaterial material = object.material; |
---|
| 2044 | + |
---|
| 2045 | + anisoField.setFloat(material.aniso); |
---|
| 2046 | + anisoVField.setFloat(material.anisoV); |
---|
| 2047 | + |
---|
| 2048 | + materialtouched = true; |
---|
| 2049 | + applySelf(); |
---|
| 2050 | + } |
---|
| 2051 | + }); |
---|
| 2052 | + presetpanel.add(aniso2); |
---|
| 2053 | + |
---|
| 2054 | + cLabel aniso3 = GetLabel("icons/shadericons/shadericon00010.png", !Grafreed.NIMBUSLAF); |
---|
| 2055 | + aniso3.setToolTipText("AnisoUV"); |
---|
| 2056 | + aniso3.addMouseListener(new MouseAdapter() |
---|
| 2057 | + { |
---|
| 2058 | + public void mouseClicked(MouseEvent e) |
---|
| 2059 | + { |
---|
| 2060 | + Object3D object = Grafreed.materials.versionlist[10].get(0); |
---|
| 2061 | + cMaterial material = object.material; |
---|
| 2062 | + |
---|
| 2063 | + anisoField.setFloat(material.aniso); |
---|
| 2064 | + anisoVField.setFloat(material.anisoV); |
---|
| 2065 | + |
---|
| 2066 | + materialtouched = true; |
---|
| 2067 | + applySelf(); |
---|
| 2068 | + } |
---|
| 2069 | + }); |
---|
| 2070 | + presetpanel.add(aniso3); |
---|
| 2071 | + |
---|
| 2072 | + cLabel velvet0 = GetLabel("icons/shadericons/shadericon00015.png", !Grafreed.NIMBUSLAF); |
---|
| 2073 | + velvet0.setToolTipText("Velvet"); |
---|
| 2074 | + velvet0.addMouseListener(new MouseAdapter() |
---|
| 2075 | + { |
---|
| 2076 | + public void mouseClicked(MouseEvent e) |
---|
| 2077 | + { |
---|
| 2078 | + Object3D object = Grafreed.materials.versionlist[15].get(0); |
---|
| 2079 | + cMaterial material = object.material; |
---|
| 2080 | + |
---|
| 2081 | + diffusenessField.setFloat(material.factor); |
---|
| 2082 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 2083 | + sheenField.setFloat(material.sheen); |
---|
| 2084 | + shininessField.setFloat(material.shininess); |
---|
| 2085 | + velvetField.setFloat(material.velvet); |
---|
| 2086 | + shiftField.setFloat(material.shift); |
---|
| 2087 | + |
---|
| 2088 | + materialtouched = true; |
---|
| 2089 | + applySelf(); |
---|
| 2090 | + } |
---|
| 2091 | + }); |
---|
| 2092 | + presetpanel.add(velvet0); |
---|
| 2093 | + |
---|
| 2094 | + cLabel bump0 = GetLabel("icons/shadericons/shadericon00016.png", !Grafreed.NIMBUSLAF); |
---|
| 2095 | + bump0.setToolTipText("Bump texture"); |
---|
| 2096 | + bump0.addMouseListener(new MouseAdapter() |
---|
| 2097 | + { |
---|
| 2098 | + public void mouseClicked(MouseEvent e) |
---|
| 2099 | + { |
---|
| 2100 | + Object3D object = Grafreed.materials.versionlist[16].get(0); |
---|
| 2101 | + cMaterial material = object.material; |
---|
| 2102 | + |
---|
| 2103 | + bumpField.setFloat(object.projectedVertices[0].x / 1000.0); |
---|
| 2104 | + noiseField.setFloat(object.projectedVertices[0].y / 1000.0); |
---|
| 2105 | + powerField.setFloat(object.projectedVertices[2].x / 1000.0); |
---|
| 2106 | + |
---|
| 2107 | + materialtouched = true; |
---|
| 2108 | + applySelf(); |
---|
| 2109 | + } |
---|
| 2110 | + }); |
---|
| 2111 | + presetpanel.add(bump0); |
---|
| 2112 | + |
---|
| 2113 | + cLabel halo = GetLabel("icons/shadericons/shadericon00017.png", !Grafreed.NIMBUSLAF); |
---|
| 2114 | + halo.setToolTipText("Halo"); |
---|
| 2115 | + halo.addMouseListener(new MouseAdapter() |
---|
| 2116 | + { |
---|
| 2117 | + public void mouseClicked(MouseEvent e) |
---|
| 2118 | + { |
---|
| 2119 | + Object3D object = Grafreed.materials.versionlist[17].get(0); |
---|
| 2120 | + cMaterial material = object.material; |
---|
| 2121 | + |
---|
| 2122 | + opacityPowerField.setFloat(object.projectedVertices[2].y / 1000.0); |
---|
| 2123 | + |
---|
| 2124 | + materialtouched = true; |
---|
| 2125 | + applySelf(); |
---|
| 2126 | + } |
---|
| 2127 | + }); |
---|
| 2128 | + presetpanel.add(halo); |
---|
| 2129 | + |
---|
| 2130 | + cLabel candle = GetLabel("icons/shadericons/shadericon00018.png", !Grafreed.NIMBUSLAF); |
---|
| 2131 | + candle.setToolTipText("Candle"); |
---|
| 2132 | + candle.addMouseListener(new MouseAdapter() |
---|
| 2133 | + { |
---|
| 2134 | + public void mouseClicked(MouseEvent e) |
---|
| 2135 | + { |
---|
| 2136 | + Object3D object = Grafreed.materials.versionlist[18].get(0); |
---|
| 2137 | + cMaterial material = object.material; |
---|
| 2138 | + |
---|
| 2139 | + subsurfaceField.setFloat(material.subsurface); |
---|
| 2140 | + shadowbiasField.setFloat(material.shadowbias); |
---|
| 2141 | + ambientField.setFloat(material.ambient); |
---|
| 2142 | + specularField.setFloat(material.specular); |
---|
| 2143 | + lightareaField.setFloat(material.lightarea); |
---|
| 2144 | + shininessField.setFloat(material.shininess); |
---|
| 2145 | + |
---|
| 2146 | + materialtouched = true; |
---|
| 2147 | + applySelf(); |
---|
| 2148 | + } |
---|
| 2149 | + }); |
---|
| 2150 | + presetpanel.add(candle); |
---|
| 2151 | + |
---|
| 2152 | + cLabel shadowShader = GetLabel("icons/shadericons/shadow.png", !Grafreed.NIMBUSLAF); |
---|
| 2153 | + shadowShader.setToolTipText("Shadow"); |
---|
| 2154 | + shadowShader.addMouseListener(new MouseAdapter() |
---|
| 2155 | + { |
---|
| 2156 | + public void mouseClicked(MouseEvent e) |
---|
| 2157 | + { |
---|
| 2158 | + diffuseField.setFloat(0.001); |
---|
| 2159 | + ambientField.setFloat(0.001); |
---|
| 2160 | + cameraField.setFloat(0.001); |
---|
| 2161 | + specularField.setFloat(0.001); |
---|
| 2162 | + fakedepthField.setFloat(0.001); |
---|
| 2163 | + opacityField.setFloat(0.6); |
---|
| 2164 | + |
---|
| 2165 | + materialtouched = true; |
---|
| 2166 | + applySelf(); |
---|
| 2167 | + } |
---|
| 2168 | + }); |
---|
| 2169 | + presetpanel.add(shadowShader); |
---|
| 2170 | + |
---|
| 2171 | + cGridBag panel = new cGridBag().setVertical(true); |
---|
| 2172 | + |
---|
| 2173 | + presetpanel.preferredWidth = 1; |
---|
| 2174 | + |
---|
| 2175 | + materialpanel.add(presetpanel); |
---|
| 2176 | + materialpanel.add(panel); |
---|
| 2177 | + |
---|
| 2178 | + panel.preferredWidth = 8; |
---|
| 2179 | + |
---|
| 2180 | + /* |
---|
1689 | 2181 | ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints); |
---|
1690 | 2182 | materialLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1691 | | - */ |
---|
| 2183 | + */ |
---|
1692 | 2184 | |
---|
1693 | 2185 | cGridBag editBar = new cGridBag().setVertical(false); |
---|
1694 | 2186 | |
---|
.. | .. |
---|
1722 | 2214 | //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1723 | 2215 | |
---|
1724 | 2216 | cGridBag colorSection = new cGridBag().setVertical(true); |
---|
| 2217 | + |
---|
| 2218 | + cGridBag huepanel = new cGridBag(); |
---|
| 2219 | + cGridBag huelabel = new cGridBag(); |
---|
| 2220 | + skin = GetLabel("icons/hue.png", false); |
---|
| 2221 | + skin.fit = true; |
---|
| 2222 | + huelabel.add(skin); |
---|
| 2223 | + huelabel.preferredWidth = 20; |
---|
| 2224 | + huepanel.add(new cGridBag()); // Label |
---|
| 2225 | + huepanel.add(huelabel); // Field/slider |
---|
| 2226 | + |
---|
| 2227 | + huepanel.preferredHeight = 7; |
---|
| 2228 | + |
---|
| 2229 | + colorSection.add(huepanel); |
---|
1725 | 2230 | |
---|
1726 | 2231 | cGridBag color = new cGridBag(); |
---|
1727 | | - color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints); |
---|
1728 | | - colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1729 | | - color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 2232 | + |
---|
| 2233 | + color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints); |
---|
| 2234 | + colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2235 | + color.add(colorField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
| 2236 | + |
---|
1730 | 2237 | //colorField.preferredWidth = 200; |
---|
1731 | 2238 | colorSection.add(color); |
---|
1732 | 2239 | |
---|
1733 | 2240 | cGridBag modulation = new cGridBag(); |
---|
1734 | 2241 | modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints); |
---|
1735 | 2242 | modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1736 | | - modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 2243 | + modulation.add(saturationField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
1737 | 2244 | colorSection.add(modulation); |
---|
1738 | 2245 | |
---|
| 2246 | + cGridBag opacity = new cGridBag(); |
---|
| 2247 | + opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints); |
---|
| 2248 | + opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2249 | + opacity.add(opacityField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
| 2250 | + colorSection.add(opacity); |
---|
| 2251 | + |
---|
| 2252 | + colorSection.add(GetSeparator()); |
---|
| 2253 | + |
---|
1739 | 2254 | cGridBag texture = new cGridBag(); |
---|
1740 | 2255 | texture.add(textureLabel = new JLabel("Texture")); // , aConstraints); |
---|
1741 | 2256 | textureLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1742 | 2257 | texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1743 | 2258 | colorSection.add(texture); |
---|
1744 | 2259 | |
---|
1745 | | - panel.add(new JSeparator()); |
---|
| 2260 | + panel.add(GetSeparator()); |
---|
1746 | 2261 | |
---|
1747 | 2262 | panel.add(colorSection); |
---|
1748 | 2263 | |
---|
.. | .. |
---|
1798 | 2313 | shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1799 | 2314 | diffuseSection.add(shadowbias); |
---|
1800 | 2315 | |
---|
1801 | | - panel.add(new JSeparator()); |
---|
| 2316 | + panel.add(GetSeparator()); |
---|
1802 | 2317 | |
---|
1803 | 2318 | panel.add(diffuseSection); |
---|
1804 | 2319 | |
---|
.. | .. |
---|
1861 | 2376 | specularSection.add(anisoV); |
---|
1862 | 2377 | |
---|
1863 | 2378 | |
---|
1864 | | - panel.add(new JSeparator()); |
---|
| 2379 | + panel.add(GetSeparator()); |
---|
1865 | 2380 | |
---|
1866 | 2381 | panel.add(specularSection); |
---|
1867 | 2382 | |
---|
.. | .. |
---|
1886 | 2401 | backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1887 | 2402 | backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1888 | 2403 | colorSection.add(backlit); |
---|
1889 | | - |
---|
1890 | | - cGridBag opacity = new cGridBag(); |
---|
1891 | | - opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints); |
---|
1892 | | - opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1893 | | - opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1894 | | - colorSection.add(opacity); |
---|
1895 | 2404 | |
---|
1896 | 2405 | //panel.add(new JSeparator()); |
---|
1897 | 2406 | |
---|
.. | .. |
---|
1937 | 2446 | opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints); |
---|
1938 | 2447 | textureSection.add(opacityPower); |
---|
1939 | 2448 | |
---|
1940 | | - panel.add(new JSeparator()); |
---|
| 2449 | + panel.add(GetSeparator()); |
---|
1941 | 2450 | |
---|
1942 | 2451 | panel.add(textureSection); |
---|
1943 | 2452 | |
---|
.. | .. |
---|
2924 | 3433 | |
---|
2925 | 3434 | freezematerial = true; |
---|
2926 | 3435 | colorField.setFloat(mat.color); |
---|
2927 | | - modulationField.setFloat(mat.modulation); |
---|
| 3436 | + saturationField.setFloat(mat.modulation); |
---|
2928 | 3437 | metalnessField.setFloat(mat.metalness); |
---|
2929 | 3438 | diffuseField.setFloat(mat.diffuse); |
---|
2930 | 3439 | specularField.setFloat(mat.specular); |
---|
.. | .. |
---|
3131 | 3640 | public void itemStateChanged(ItemEvent event) |
---|
3132 | 3641 | { |
---|
3133 | 3642 | // System.out.println("Propagate = " + propagate); |
---|
| 3643 | + if (event.getSource() == pinButton) |
---|
| 3644 | + { |
---|
| 3645 | + copy.pinned ^= true; |
---|
| 3646 | + if (!copy.pinned && !copy.editWindow.copy.selection.contains(copy)) |
---|
| 3647 | + { |
---|
| 3648 | + ((GroupEditor)copy.editWindow).listUI.remove(copy); |
---|
| 3649 | + copy.CloseUI(); |
---|
| 3650 | + //copy.editWindow.refreshContents(); |
---|
| 3651 | + } |
---|
| 3652 | + } |
---|
| 3653 | + else |
---|
3134 | 3654 | if (event.getSource() == propagateToggle) |
---|
3135 | 3655 | { |
---|
3136 | 3656 | propagate ^= true; |
---|
.. | .. |
---|
3235 | 3755 | } else if (event.getSource() == liveCB) |
---|
3236 | 3756 | { |
---|
3237 | 3757 | copy.live ^= true; |
---|
| 3758 | + objEditor.refreshContents(true); // To show item colors |
---|
3238 | 3759 | return; |
---|
3239 | | - } else if (event.getSource() == selectCB) |
---|
| 3760 | + } else if (event.getSource() == selectableCB) |
---|
3240 | 3761 | { |
---|
3241 | 3762 | copy.dontselect ^= true; |
---|
3242 | 3763 | return; |
---|
.. | .. |
---|
3244 | 3765 | { |
---|
3245 | 3766 | copy.hide ^= true; |
---|
3246 | 3767 | copy.Touch(); // display list issue |
---|
3247 | | - objEditor.refreshContents(); |
---|
| 3768 | + objEditor.refreshContents(true); // To show item colors |
---|
3248 | 3769 | return; |
---|
3249 | 3770 | } else if (event.getSource() == link2masterCB) |
---|
3250 | 3771 | { |
---|
.. | .. |
---|
3500 | 4021 | |
---|
3501 | 4022 | static public byte[] Compress(Object3D o) |
---|
3502 | 4023 | { |
---|
| 4024 | + // Slower to actually compress. |
---|
3503 | 4025 | try |
---|
3504 | 4026 | { |
---|
3505 | 4027 | ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
---|
.. | .. |
---|
3601 | 4123 | { |
---|
3602 | 4124 | //Save(true); |
---|
3603 | 4125 | Replace(); |
---|
| 4126 | + SetUndoStates(); |
---|
3604 | 4127 | } |
---|
3605 | 4128 | |
---|
3606 | 4129 | private boolean Equal(byte[] compress, byte[] name) |
---|
.. | .. |
---|
3621 | 4144 | |
---|
3622 | 4145 | java.util.Hashtable<java.util.UUID, Object3D> versiontable = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
3623 | 4146 | |
---|
| 4147 | + void DeleteVersion() |
---|
| 4148 | + { |
---|
| 4149 | + for (int i = copy.versionindex; i < copy.versionlist.length-1; i++) |
---|
| 4150 | + { |
---|
| 4151 | + copy.versionlist[i] = copy.versionlist[i+1]; |
---|
| 4152 | + } |
---|
| 4153 | + |
---|
| 4154 | + CopyChanged(); |
---|
| 4155 | + |
---|
| 4156 | + SetUndoStates(); |
---|
| 4157 | + } |
---|
| 4158 | + |
---|
3624 | 4159 | public boolean Save(boolean user) |
---|
3625 | 4160 | { |
---|
3626 | 4161 | System.err.println("Save"); |
---|
| 4162 | + Replace(); |
---|
3627 | 4163 | |
---|
3628 | 4164 | cRadio tab = GetCurrentTab(); |
---|
3629 | 4165 | |
---|
3630 | | - byte[] compress = CompressCopy(); |
---|
| 4166 | + Object3D compress = Duplicate(copy); // Saved version. No need for "Replace"? |
---|
3631 | 4167 | |
---|
3632 | 4168 | boolean thesame = false; |
---|
3633 | 4169 | |
---|
3634 | | - // Quick heuristic using length. Works only when stream is compressed. |
---|
3635 | | - if (copy.versionindex > 0 && copy.versions[copy.versionindex-1] != null && Equal(compress, copy.versions[copy.versionindex-1])) |
---|
3636 | | - { |
---|
3637 | | - thesame = true; |
---|
3638 | | - } |
---|
| 4170 | +// if (copy.versionindex > 0 && copy.versions[copy.versionindex-1] != null && Equal(compress, copy.versions[copy.versionindex-1])) |
---|
| 4171 | +// { |
---|
| 4172 | +// thesame = true; |
---|
| 4173 | +// } |
---|
3639 | 4174 | |
---|
3640 | 4175 | //EditorFrame.m_MainFrame.requestFocusInWindow(); |
---|
3641 | 4176 | if (!thesame) |
---|
3642 | 4177 | { |
---|
| 4178 | + for (int i = copy.versionlist.length; --i > copy.versionindex+1;) |
---|
| 4179 | + { |
---|
| 4180 | + copy.versionlist[i] = copy.versionlist[i-1]; |
---|
| 4181 | + } |
---|
| 4182 | + |
---|
3643 | 4183 | //tab.user[tab.versionindex] = user; |
---|
3644 | 4184 | //boolean increment = true; // tab.graphs[tab.versionindex] == null; |
---|
3645 | 4185 | |
---|
3646 | | - copy.versions[++copy.versionindex] = compress; |
---|
| 4186 | + copy.versionlist[++copy.versionindex] = compress; |
---|
3647 | 4187 | |
---|
3648 | 4188 | // if (increment) |
---|
3649 | 4189 | // tab.versionindex++; |
---|
.. | .. |
---|
3653 | 4193 | |
---|
3654 | 4194 | //assert(hashtable.isEmpty()); |
---|
3655 | 4195 | |
---|
3656 | | - for (int i = copy.versionindex+1; i < copy.versions.length; i++) |
---|
3657 | | - { |
---|
3658 | | - //tab.user[i] = false; |
---|
3659 | | - copy.versions[i] = null; |
---|
3660 | | - } |
---|
| 4196 | +// for (int i = copy.versionindex+1; i < copy.versionlist.length; i++) |
---|
| 4197 | +// { |
---|
| 4198 | +// //tab.user[i] = false; |
---|
| 4199 | +// copy.versionlist[i] = null; |
---|
| 4200 | +// } |
---|
3661 | 4201 | |
---|
3662 | 4202 | SetUndoStates(); |
---|
3663 | 4203 | |
---|
.. | .. |
---|
3682 | 4222 | |
---|
3683 | 4223 | return !thesame; |
---|
3684 | 4224 | } |
---|
3685 | | - |
---|
3686 | | - void CopyChanged(Object3D obj) |
---|
| 4225 | + |
---|
| 4226 | + boolean flashIt = true; |
---|
| 4227 | + |
---|
| 4228 | + void RefreshSelection() |
---|
3687 | 4229 | { |
---|
| 4230 | + Object3D selection = new Object3D(); |
---|
| 4231 | + |
---|
| 4232 | + for (int i = 0; i < copy.selection.size(); i++) |
---|
| 4233 | + { |
---|
| 4234 | + Object3D elem = copy.selection.elementAt(i); |
---|
| 4235 | + |
---|
| 4236 | + Object3D obj = copy.GetObject(elem.GetUUID()); |
---|
| 4237 | + |
---|
| 4238 | + if (obj == null) |
---|
| 4239 | + { |
---|
| 4240 | + copy.selection.remove(i--); |
---|
| 4241 | + } |
---|
| 4242 | + else |
---|
| 4243 | + { |
---|
| 4244 | + selection.add(obj); |
---|
| 4245 | + copy.selection.setElementAt(obj, i); |
---|
| 4246 | + } |
---|
| 4247 | + } |
---|
| 4248 | + |
---|
| 4249 | + flashIt = false; |
---|
| 4250 | + GetTree().clearSelection(); |
---|
| 4251 | + for (int i = 0; i < selection.size(); i++) |
---|
| 4252 | + GetTree().addSelectionPath(selection.elementAt(i).GetTreePath().GetTreePath()); |
---|
| 4253 | + flashIt = true; |
---|
| 4254 | + |
---|
| 4255 | + //refreshContents(false); |
---|
| 4256 | + } |
---|
| 4257 | + |
---|
| 4258 | + void CopyChanged() |
---|
| 4259 | + { |
---|
| 4260 | + Object3D obj = (Object3D)Grafreed.clone(copy.versionlist[copy.versionindex]); |
---|
| 4261 | + |
---|
3688 | 4262 | SetUndoStates(); |
---|
3689 | 4263 | |
---|
3690 | 4264 | boolean temp = CameraPane.SWITCH; |
---|
.. | .. |
---|
3694 | 4268 | |
---|
3695 | 4269 | copy.clear(); |
---|
3696 | 4270 | |
---|
| 4271 | + copy.skyboxname = obj.skyboxname; |
---|
| 4272 | + copy.skyboxext = obj.skyboxext; |
---|
| 4273 | + |
---|
3697 | 4274 | for (int i=0; i<obj.Size(); i++) |
---|
3698 | 4275 | { |
---|
3699 | 4276 | copy.add(obj.get(i)); |
---|
.. | .. |
---|
3703 | 4280 | |
---|
3704 | 4281 | CameraPane.SWITCH = temp; |
---|
3705 | 4282 | |
---|
| 4283 | + RefreshSelection(); |
---|
3706 | 4284 | //assert(hashtable.isEmpty()); |
---|
3707 | 4285 | |
---|
3708 | 4286 | copy.Touch(); |
---|
.. | .. |
---|
3723 | 4301 | } |
---|
3724 | 4302 | } |
---|
3725 | 4303 | |
---|
3726 | | - refreshContents(); |
---|
| 4304 | + refreshContents(true); |
---|
3727 | 4305 | } |
---|
3728 | 4306 | |
---|
3729 | | - cButton undoButton; |
---|
| 4307 | + cButton previousVersionButton; |
---|
3730 | 4308 | cButton restoreButton; |
---|
3731 | 4309 | cButton replaceButton; |
---|
3732 | | - cButton redoButton; |
---|
| 4310 | + cButton nextVersionButton; |
---|
| 4311 | + cButton saveVersionButton; |
---|
| 4312 | + cButton deleteVersionButton; |
---|
3733 | 4313 | |
---|
| 4314 | + boolean muteSlider; |
---|
| 4315 | + |
---|
| 4316 | + int VersionCount() |
---|
| 4317 | + { |
---|
| 4318 | + int count = 0; |
---|
| 4319 | + |
---|
| 4320 | + for (int i = copy.versionlist.length; --i >= 0;) |
---|
| 4321 | + { |
---|
| 4322 | + if (copy.versionlist[i] != null) |
---|
| 4323 | + count++; |
---|
| 4324 | + } |
---|
| 4325 | + |
---|
| 4326 | + return count; |
---|
| 4327 | + } |
---|
| 4328 | + |
---|
3734 | 4329 | void SetUndoStates() |
---|
3735 | 4330 | { |
---|
3736 | 4331 | cRadio tab = GetCurrentTab(); |
---|
3737 | 4332 | |
---|
3738 | | - restoreButton.setEnabled(copy.versionindex != -1); |
---|
3739 | | - replaceButton.setEnabled(copy.versionindex != -1); |
---|
3740 | | - undoButton.setEnabled(copy.versionindex > 0); |
---|
3741 | | - redoButton.setEnabled(copy.versions[copy.versionindex + 1] != null); |
---|
| 4333 | + restoreButton.setEnabled(true); // copy.versionindex != -1); |
---|
| 4334 | + replaceButton.setEnabled(true); // copy.versionindex != -1); |
---|
| 4335 | + |
---|
| 4336 | + previousVersionButton.setEnabled(copy.versionindex > 0); |
---|
| 4337 | + nextVersionButton.setEnabled(copy.versionlist[copy.versionindex + 1] != null); |
---|
| 4338 | + |
---|
| 4339 | + deleteVersionButton.setEnabled(//copy.versionindex > 0 && |
---|
| 4340 | + copy.versionlist[copy.versionindex + 1] != null); |
---|
| 4341 | + |
---|
| 4342 | + muteSlider = true; |
---|
| 4343 | + versionSlider.setMaximum(VersionCount() - 1); |
---|
| 4344 | + versionSlider.setInteger(copy.versionindex); |
---|
| 4345 | + muteSlider = false; |
---|
3742 | 4346 | } |
---|
3743 | 4347 | |
---|
3744 | | - public boolean Undo() |
---|
| 4348 | + public boolean PreviousVersion() |
---|
3745 | 4349 | { |
---|
| 4350 | + // Option? |
---|
| 4351 | + Replace(); |
---|
| 4352 | + |
---|
3746 | 4353 | System.err.println("Undo"); |
---|
3747 | 4354 | |
---|
3748 | 4355 | cRadio tab = GetCurrentTab(); |
---|
.. | .. |
---|
3768 | 4375 | |
---|
3769 | 4376 | copy.versionindex -= 1; |
---|
3770 | 4377 | |
---|
3771 | | - CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
| 4378 | + CopyChanged(); |
---|
3772 | 4379 | |
---|
3773 | 4380 | return true; |
---|
3774 | 4381 | } |
---|
.. | .. |
---|
3779 | 4386 | |
---|
3780 | 4387 | cRadio tab = GetCurrentTab(); |
---|
3781 | 4388 | |
---|
3782 | | - if (copy.versionindex == -1 || copy.versions[copy.versionindex] == null) |
---|
| 4389 | + if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
3783 | 4390 | { |
---|
3784 | 4391 | java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
3785 | 4392 | return false; |
---|
3786 | 4393 | } |
---|
3787 | 4394 | |
---|
3788 | | - CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
| 4395 | + //CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
| 4396 | + CopyChanged(); |
---|
3789 | 4397 | |
---|
3790 | 4398 | return true; |
---|
3791 | 4399 | } |
---|
.. | .. |
---|
3796 | 4404 | |
---|
3797 | 4405 | cRadio tab = GetCurrentTab(); |
---|
3798 | 4406 | |
---|
3799 | | - if (copy.versionindex == -1 || copy.versions[copy.versionindex] == null) |
---|
| 4407 | + if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
3800 | 4408 | { |
---|
3801 | 4409 | // No version yet. OK. java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
3802 | 4410 | return false; |
---|
3803 | 4411 | } |
---|
3804 | 4412 | |
---|
3805 | | - copy.versions[copy.versionindex] = CompressCopy(); |
---|
| 4413 | + copy.versionlist[copy.versionindex] = Duplicate(copy); |
---|
3806 | 4414 | |
---|
3807 | 4415 | return true; |
---|
3808 | 4416 | } |
---|
3809 | 4417 | |
---|
3810 | | - public void Redo() |
---|
| 4418 | + public void NextVersion() |
---|
3811 | 4419 | { |
---|
| 4420 | + // Option? |
---|
| 4421 | + Replace(); |
---|
| 4422 | + |
---|
3812 | 4423 | cRadio tab = GetCurrentTab(); |
---|
3813 | 4424 | |
---|
3814 | | - if (copy.versions[copy.versionindex + 1] == null) |
---|
| 4425 | + if (copy.versionlist[copy.versionindex + 1] == null) |
---|
3815 | 4426 | { |
---|
3816 | 4427 | java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
3817 | 4428 | return; |
---|
.. | .. |
---|
3819 | 4430 | |
---|
3820 | 4431 | copy.versionindex += 1; |
---|
3821 | 4432 | |
---|
3822 | | - CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
| 4433 | + CopyChanged(); |
---|
3823 | 4434 | |
---|
3824 | 4435 | //if (!tab.user[tab.versionindex]) |
---|
3825 | 4436 | // tab.graphs[tab.versionindex] = null; |
---|
.. | .. |
---|
4033 | 4644 | //copy.material = new cMaterial(copy.GetMaterial()); |
---|
4034 | 4645 | |
---|
4035 | 4646 | current.color = (float) colorField.getFloat(); |
---|
4036 | | - current.modulation = (float) modulationField.getFloat(); |
---|
| 4647 | + current.modulation = (float) saturationField.getFloat(); |
---|
4037 | 4648 | current.metalness = (float) metalnessField.getFloat(); |
---|
4038 | 4649 | current.diffuse = (float) diffuseField.getFloat(); |
---|
4039 | 4650 | current.specular = (float) specularField.getFloat(); |
---|
.. | .. |
---|
4066 | 4677 | cMaterial mat = copy.material; |
---|
4067 | 4678 | |
---|
4068 | 4679 | colorField.SetToolTipValue((mat.color)); |
---|
4069 | | - modulationField.SetToolTipValue((mat.modulation)); |
---|
| 4680 | + saturationField.SetToolTipValue((mat.modulation)); |
---|
4070 | 4681 | metalnessField.SetToolTipValue((mat.metalness)); |
---|
4071 | 4682 | diffuseField.SetToolTipValue((mat.diffuse)); |
---|
4072 | 4683 | specularField.SetToolTipValue((mat.specular)); |
---|
.. | .. |
---|
4118 | 4729 | //copy.Touch(); |
---|
4119 | 4730 | } |
---|
4120 | 4731 | |
---|
4121 | | - cNumberSlider versionField; |
---|
| 4732 | + cNumberSlider versionSlider; |
---|
4122 | 4733 | |
---|
4123 | 4734 | public void stateChanged(ChangeEvent e) |
---|
4124 | 4735 | { |
---|
4125 | 4736 | // assert(false); |
---|
4126 | | - if (e.getSource() == versionField) |
---|
| 4737 | + if (e.getSource() == versionSlider) |
---|
4127 | 4738 | { |
---|
4128 | | - int version = versionField.getInteger(); |
---|
| 4739 | + if (muteSlider) |
---|
| 4740 | + return; |
---|
4129 | 4741 | |
---|
4130 | | - if (copy.versions[version] != null) |
---|
| 4742 | + int version = versionSlider.getInteger(); |
---|
| 4743 | + |
---|
| 4744 | + if (copy.versionlist[version] != null) |
---|
4131 | 4745 | { |
---|
4132 | | - CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex = version])); |
---|
| 4746 | + copy.versionindex = version; |
---|
| 4747 | + CopyChanged(); |
---|
4133 | 4748 | } |
---|
4134 | 4749 | |
---|
4135 | 4750 | return; |
---|
.. | .. |
---|
4169 | 4784 | { |
---|
4170 | 4785 | //System.out.println("stateChanged = " + this); |
---|
4171 | 4786 | materialtouched = true; |
---|
| 4787 | + |
---|
| 4788 | + if (Globals.AUTOSATURATE && e.getSource() == colorField && saturationField.getFloat() == 0.001) |
---|
| 4789 | + { |
---|
| 4790 | + saturationField.setFloat(1); |
---|
| 4791 | + } |
---|
| 4792 | + |
---|
4172 | 4793 | applySelf(); |
---|
4173 | 4794 | //System.out.println("this = " + this); |
---|
4174 | 4795 | //System.out.println("PARENT = " + parent); |
---|
.. | .. |
---|
4468 | 5089 | { |
---|
4469 | 5090 | if (GetTree() != null) |
---|
4470 | 5091 | { |
---|
| 5092 | + GetTree().revalidate(); |
---|
4471 | 5093 | GetTree().repaint(); |
---|
4472 | 5094 | } |
---|
4473 | 5095 | |
---|
.. | .. |
---|
4476 | 5098 | ctrlPanel.validate(); // ? new |
---|
4477 | 5099 | ctrlPanel.repaint(); |
---|
4478 | 5100 | } |
---|
| 5101 | + |
---|
| 5102 | + if (previousVersionButton != null && copy.versionlist != null) |
---|
| 5103 | + SetUndoStates(); |
---|
4479 | 5104 | } |
---|
4480 | 5105 | |
---|
4481 | 5106 | static TweenManager tweenManager = new TweenManager(); |
---|
.. | .. |
---|
4724 | 5349 | readobj.ResetDisplayList(); |
---|
4725 | 5350 | } catch (Exception e) |
---|
4726 | 5351 | { |
---|
4727 | | - //e.printStackTrace(); |
---|
| 5352 | + if (!e.toString().contains("GZIP")) |
---|
| 5353 | + e.printStackTrace(); |
---|
| 5354 | + |
---|
4728 | 5355 | try |
---|
4729 | 5356 | { |
---|
4730 | 5357 | java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
.. | .. |
---|
4804 | 5431 | { |
---|
4805 | 5432 | //readobj.deepCopySelf(copy); |
---|
4806 | 5433 | copy.clear(); // june 2014 |
---|
| 5434 | + copy.skyboxname = readobj.skyboxname; |
---|
| 5435 | + copy.skyboxext = readobj.skyboxext; |
---|
4807 | 5436 | for (int i = 0; i < readobj.size(); i++) |
---|
4808 | 5437 | { |
---|
4809 | 5438 | Object3D child = readobj.get(i); // reserve(i); |
---|
.. | .. |
---|
4844 | 5473 | } |
---|
4845 | 5474 | } catch (ClassCastException e) |
---|
4846 | 5475 | { |
---|
| 5476 | + e.printStackTrace(); |
---|
4847 | 5477 | assert (false); |
---|
4848 | 5478 | Composite c = (Composite) copy; |
---|
4849 | 5479 | c.children.clear(); |
---|
.. | .. |
---|
4854 | 5484 | c.addChild(csg); |
---|
4855 | 5485 | } |
---|
4856 | 5486 | |
---|
4857 | | - copy.versions = readobj.versions; |
---|
| 5487 | + copy.versionlist = readobj.versionlist; |
---|
4858 | 5488 | copy.versionindex = readobj.versionindex; |
---|
4859 | 5489 | |
---|
4860 | | - SetUndoStates(); |
---|
| 5490 | + if (copy.versionlist == null) |
---|
| 5491 | + { |
---|
| 5492 | + copy.versionlist = new Object3D[100]; |
---|
| 5493 | + copy.versionindex = -1; |
---|
| 5494 | + } |
---|
| 5495 | + |
---|
| 5496 | + //? SetUndoStates(); |
---|
4861 | 5497 | |
---|
4862 | 5498 | ResetModel(); |
---|
4863 | 5499 | copy.HardTouch(); // recompile? |
---|
.. | .. |
---|
4869 | 5505 | { |
---|
4870 | 5506 | if (Grafreed.standAlone) |
---|
4871 | 5507 | { |
---|
4872 | | - FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD); |
---|
| 5508 | + FileDialog browser = new FileDialog(frame, "Open", FileDialog.LOAD); |
---|
4873 | 5509 | browser.show(); |
---|
4874 | 5510 | String filename = browser.getFile(); |
---|
4875 | 5511 | if (filename != null && filename.length() > 0) |
---|
.. | .. |
---|
4968 | 5604 | //ps.print(buffer.toString()); |
---|
4969 | 5605 | } catch (IOException e) |
---|
4970 | 5606 | { |
---|
| 5607 | + e.printStackTrace(); |
---|
4971 | 5608 | } |
---|
4972 | 5609 | } |
---|
4973 | 5610 | |
---|
.. | .. |
---|
5187 | 5824 | ButtonGroup buttonGroup; |
---|
5188 | 5825 | |
---|
5189 | 5826 | cGridBag toolboxPanel; |
---|
| 5827 | + cGridBag skyboxPanel; |
---|
5190 | 5828 | cGridBag materialPanel; |
---|
5191 | 5829 | cGridBag ctrlPanel; |
---|
5192 | 5830 | |
---|
.. | .. |
---|
5260 | 5898 | JLabel colorLabel; |
---|
5261 | 5899 | cNumberSlider colorField; |
---|
5262 | 5900 | JLabel modulationLabel; |
---|
5263 | | - cNumberSlider modulationField; |
---|
| 5901 | + cNumberSlider saturationField; |
---|
5264 | 5902 | JLabel metalnessLabel; |
---|
5265 | 5903 | cNumberSlider metalnessField; |
---|
5266 | 5904 | JLabel diffuseLabel; |
---|
.. | .. |
---|
5291 | 5929 | cNumberSlider anisoField; |
---|
5292 | 5930 | JLabel anisoVLabel; |
---|
5293 | 5931 | cNumberSlider anisoVField; |
---|
| 5932 | + |
---|
5294 | 5933 | JLabel cameraLabel; |
---|
5295 | 5934 | cNumberSlider cameraField; |
---|
5296 | 5935 | JLabel selfshadowLabel; |
---|
.. | .. |
---|
5305 | 5944 | cNumberSlider fakedepthField; |
---|
5306 | 5945 | JLabel shadowbiasLabel; |
---|
5307 | 5946 | cNumberSlider shadowbiasField; |
---|
| 5947 | + |
---|
5308 | 5948 | JLabel bumpLabel; |
---|
5309 | 5949 | cNumberSlider bumpField; |
---|
5310 | 5950 | JLabel noiseLabel; |
---|