.. | .. |
---|
41 | 41 | JFrame frame; |
---|
42 | 42 | |
---|
43 | 43 | static ObjEditor theFrame; |
---|
| 44 | + |
---|
| 45 | + public cGridBag GetSeparator() |
---|
| 46 | + { |
---|
| 47 | + cGridBag separator = new cGridBag(); |
---|
| 48 | + separator.add(new JSeparator()); |
---|
| 49 | + separator.preferredHeight = 5; |
---|
| 50 | + return separator; |
---|
| 51 | + } |
---|
44 | 52 | |
---|
45 | 53 | cButton GetButton(String name, boolean border) |
---|
46 | 54 | { |
---|
47 | 55 | ImageIcon icon = GetIcon(name); |
---|
48 | 56 | return new cButton(icon, border); |
---|
| 57 | + } |
---|
| 58 | + |
---|
| 59 | + cLabel GetLabel(String name, boolean border) |
---|
| 60 | + { |
---|
| 61 | + //ImageIcon icon = GetIcon(name); |
---|
| 62 | + return new cLabel(GetImage(name), border); |
---|
49 | 63 | } |
---|
50 | 64 | |
---|
51 | 65 | cToggleButton GetToggleButton(String name, boolean border) |
---|
.. | .. |
---|
66 | 80 | { |
---|
67 | 81 | BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name)); |
---|
68 | 82 | |
---|
69 | | - if (image.getWidth() > 48 && image.getHeight() > 48) |
---|
70 | | - { |
---|
71 | | - BufferedImage resized = new BufferedImage(48, 48, image.getType()); |
---|
72 | | - Graphics2D g = resized.createGraphics(); |
---|
73 | | - g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); |
---|
74 | | - //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
---|
75 | | - g.drawImage(image, 0, 0, 48, 48, 0, 0, image.getWidth(), image.getHeight(), null); |
---|
76 | | - g.dispose(); |
---|
77 | | - |
---|
78 | | - image = resized; |
---|
79 | | - } |
---|
| 83 | +// if (image.getWidth() > 48 && image.getHeight() > 48) |
---|
| 84 | +// { |
---|
| 85 | +// BufferedImage resized = new BufferedImage(48, 48, image.getType()); |
---|
| 86 | +// Graphics2D g = resized.createGraphics(); |
---|
| 87 | +// g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); |
---|
| 88 | +// //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
---|
| 89 | +// g.drawImage(image, 0, 0, 48, 48, 0, 0, image.getWidth(), image.getHeight(), null); |
---|
| 90 | +// g.dispose(); |
---|
| 91 | +// |
---|
| 92 | +// image = resized; |
---|
| 93 | +// } |
---|
80 | 94 | |
---|
81 | 95 | javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image); |
---|
82 | 96 | return icon; |
---|
| 97 | + } |
---|
| 98 | + catch (Exception e) |
---|
| 99 | + { |
---|
| 100 | + return null; |
---|
| 101 | + } |
---|
| 102 | + } |
---|
| 103 | + |
---|
| 104 | + BufferedImage GetImage(String name) |
---|
| 105 | + { |
---|
| 106 | + try |
---|
| 107 | + { |
---|
| 108 | + BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name)); |
---|
| 109 | + |
---|
| 110 | + return image; |
---|
83 | 111 | } |
---|
84 | 112 | catch (Exception e) |
---|
85 | 113 | { |
---|
.. | .. |
---|
1522 | 1550 | //tmp.setName("Edit"); |
---|
1523 | 1551 | objectPanel.add(materialPanel); |
---|
1524 | 1552 | objectPanel.setIconAt(0, GetIcon("icons/material.png")); |
---|
| 1553 | + objectPanel.setToolTipTextAt(0, "Material panel"); |
---|
| 1554 | + |
---|
1525 | 1555 | // JPanel north = new JPanel(new BorderLayout()); |
---|
1526 | 1556 | // north.setName("Edit"); |
---|
1527 | 1557 | // north.add(ctrlPanel, BorderLayout.NORTH); |
---|
1528 | 1558 | // objectPanel.add(north); |
---|
1529 | 1559 | objectPanel.add(editPanel); |
---|
1530 | 1560 | objectPanel.setIconAt(1, GetIcon("icons/write.png")); |
---|
| 1561 | + objectPanel.setToolTipTextAt(1, "Edit panel"); |
---|
1531 | 1562 | |
---|
1532 | 1563 | //if (Globals.ADVANCED) |
---|
1533 | 1564 | objectPanel.add(infoPanel); |
---|
1534 | 1565 | objectPanel.setIconAt(2, GetIcon("icons/info.png")); |
---|
| 1566 | + objectPanel.setToolTipTextAt(2, "Info panel"); |
---|
1535 | 1567 | |
---|
1536 | 1568 | objectPanel.add(XYZPanel); |
---|
1537 | 1569 | objectPanel.setIconAt(3, GetIcon("icons/XYZ.png")); |
---|
| 1570 | + objectPanel.setToolTipTextAt(3, "XYZ/RGB panel"); |
---|
1538 | 1571 | |
---|
1539 | 1572 | objectPanel.add(toolboxPanel); |
---|
1540 | 1573 | objectPanel.setIconAt(4, GetIcon("icons/primitives.png")); |
---|
| 1574 | + objectPanel.setToolTipTextAt(4, "Objects/backgrounds panel"); |
---|
1541 | 1575 | |
---|
1542 | 1576 | /* |
---|
1543 | 1577 | aConstraints.gridx = 0; |
---|
.. | .. |
---|
1634 | 1668 | /**/ |
---|
1635 | 1669 | |
---|
1636 | 1670 | bigThree = new cGridBag(); |
---|
1637 | | - bigThree.addComponent(centralPanel); |
---|
1638 | 1671 | bigThree.addComponent(scenePanel); |
---|
| 1672 | + bigThree.addComponent(centralPanel); |
---|
1639 | 1673 | //bigThree.addComponent(XYZPanel); |
---|
1640 | 1674 | |
---|
1641 | 1675 | // // SIDE EFFECT!!! |
---|
.. | .. |
---|
1677 | 1711 | frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); |
---|
1678 | 1712 | frame.addWindowListener(new WindowAdapter() |
---|
1679 | 1713 | { |
---|
1680 | | - |
---|
1681 | 1714 | public void windowClosing(WindowEvent e) |
---|
1682 | 1715 | { |
---|
1683 | 1716 | Close(); |
---|
.. | .. |
---|
1739 | 1772 | //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1740 | 1773 | |
---|
1741 | 1774 | cGridBag colorSection = new cGridBag().setVertical(true); |
---|
| 1775 | + |
---|
| 1776 | + cGridBag huepanel = new cGridBag(); |
---|
| 1777 | + cGridBag huelabel = new cGridBag(); |
---|
| 1778 | + huelabel.add(GetLabel("icons/hue.png", false)); |
---|
| 1779 | + huelabel.preferredWidth = 20; |
---|
| 1780 | + huepanel.add(new cGridBag()); // Label |
---|
| 1781 | + huepanel.add(huelabel); // Field/slider |
---|
| 1782 | + |
---|
| 1783 | + huepanel.preferredHeight = 7; |
---|
| 1784 | + |
---|
| 1785 | + colorSection.add(huepanel); |
---|
1742 | 1786 | |
---|
1743 | 1787 | cGridBag color = new cGridBag(); |
---|
1744 | | - color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints); |
---|
1745 | | - colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1746 | | - color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1788 | + |
---|
| 1789 | + color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints); |
---|
| 1790 | + colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1791 | + color.add(colorField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
| 1792 | + |
---|
1747 | 1793 | //colorField.preferredWidth = 200; |
---|
1748 | 1794 | colorSection.add(color); |
---|
1749 | 1795 | |
---|
1750 | 1796 | cGridBag modulation = new cGridBag(); |
---|
1751 | 1797 | modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints); |
---|
1752 | 1798 | modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1753 | | - modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1799 | + modulation.add(modulationField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
1754 | 1800 | colorSection.add(modulation); |
---|
1755 | 1801 | |
---|
| 1802 | + cGridBag opacity = new cGridBag(); |
---|
| 1803 | + opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints); |
---|
| 1804 | + opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1805 | + opacity.add(opacityField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
| 1806 | + colorSection.add(opacity); |
---|
| 1807 | + |
---|
| 1808 | + colorSection.add(GetSeparator()); |
---|
| 1809 | + |
---|
1756 | 1810 | cGridBag texture = new cGridBag(); |
---|
1757 | 1811 | texture.add(textureLabel = new JLabel("Texture")); // , aConstraints); |
---|
1758 | 1812 | textureLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1759 | 1813 | texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1760 | 1814 | colorSection.add(texture); |
---|
1761 | 1815 | |
---|
1762 | | - panel.add(new JSeparator()); |
---|
| 1816 | + panel.add(GetSeparator()); |
---|
1763 | 1817 | |
---|
1764 | 1818 | panel.add(colorSection); |
---|
1765 | 1819 | |
---|
.. | .. |
---|
1815 | 1869 | shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1816 | 1870 | diffuseSection.add(shadowbias); |
---|
1817 | 1871 | |
---|
1818 | | - panel.add(new JSeparator()); |
---|
| 1872 | + panel.add(GetSeparator()); |
---|
1819 | 1873 | |
---|
1820 | 1874 | panel.add(diffuseSection); |
---|
1821 | 1875 | |
---|
.. | .. |
---|
1878 | 1932 | specularSection.add(anisoV); |
---|
1879 | 1933 | |
---|
1880 | 1934 | |
---|
1881 | | - panel.add(new JSeparator()); |
---|
| 1935 | + panel.add(GetSeparator()); |
---|
1882 | 1936 | |
---|
1883 | 1937 | panel.add(specularSection); |
---|
1884 | 1938 | |
---|
.. | .. |
---|
1903 | 1957 | backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1904 | 1958 | backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1905 | 1959 | colorSection.add(backlit); |
---|
1906 | | - |
---|
1907 | | - cGridBag opacity = new cGridBag(); |
---|
1908 | | - opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints); |
---|
1909 | | - opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1910 | | - opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1911 | | - colorSection.add(opacity); |
---|
1912 | 1960 | |
---|
1913 | 1961 | //panel.add(new JSeparator()); |
---|
1914 | 1962 | |
---|
.. | .. |
---|
1954 | 2002 | opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints); |
---|
1955 | 2003 | textureSection.add(opacityPower); |
---|
1956 | 2004 | |
---|
1957 | | - panel.add(new JSeparator()); |
---|
| 2005 | + panel.add(GetSeparator()); |
---|
1958 | 2006 | |
---|
1959 | 2007 | panel.add(textureSection); |
---|
1960 | 2008 | |
---|
.. | .. |
---|
3644 | 3692 | |
---|
3645 | 3693 | cRadio tab = GetCurrentTab(); |
---|
3646 | 3694 | |
---|
3647 | | - byte[] compress = CompressCopy(); |
---|
| 3695 | + byte[] compress = CompressCopy(); // Saved version. No need for "Replace". |
---|
3648 | 3696 | |
---|
3649 | 3697 | boolean thesame = false; |
---|
3650 | 3698 | |
---|
.. | .. |
---|
3711 | 3759 | |
---|
3712 | 3760 | copy.clear(); |
---|
3713 | 3761 | |
---|
| 3762 | + copy.skyboxname = obj.skyboxname; |
---|
| 3763 | + copy.skyboxext = obj.skyboxext; |
---|
| 3764 | + |
---|
3714 | 3765 | for (int i=0; i<obj.Size(); i++) |
---|
3715 | 3766 | { |
---|
3716 | 3767 | copy.add(obj.get(i)); |
---|
.. | .. |
---|
4853 | 4904 | { |
---|
4854 | 4905 | //readobj.deepCopySelf(copy); |
---|
4855 | 4906 | copy.clear(); // june 2014 |
---|
| 4907 | + copy.skyboxname = readobj.skyboxname; |
---|
| 4908 | + copy.skyboxext = readobj.skyboxext; |
---|
4856 | 4909 | for (int i = 0; i < readobj.size(); i++) |
---|
4857 | 4910 | { |
---|
4858 | 4911 | Object3D child = readobj.get(i); // reserve(i); |
---|