.. | .. |
---|
72 | 72 | } |
---|
73 | 73 | } |
---|
74 | 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 | + } |
---|
| 89 | + |
---|
75 | 90 | public cGridBag GetSeparator() |
---|
76 | 91 | { |
---|
77 | 92 | cGridBag separator = new cGridBag(); |
---|
.. | .. |
---|
445 | 460 | importOBJItem.addActionListener(this); |
---|
446 | 461 | import3DSItem = menu.add(new MenuItem("3DS file...")); |
---|
447 | 462 | import3DSItem.addActionListener(this); |
---|
| 463 | + if (Globals.ADVANCED) |
---|
| 464 | + { |
---|
448 | 465 | importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file...")); |
---|
449 | 466 | importVRMLX3DItem.addActionListener(this); |
---|
| 467 | + } |
---|
450 | 468 | menu.add("-"); |
---|
451 | 469 | importGFDItem = menu.add(new MenuItem("Grafreed file...")); |
---|
452 | 470 | importGFDItem.addActionListener(this); |
---|
.. | .. |
---|
1550 | 1568 | |
---|
1551 | 1569 | if (cam == null || !(copy.get(0) instanceof cGroup)) |
---|
1552 | 1570 | { |
---|
1553 | | - if (Globals.DEBUG) |
---|
1554 | | - System.out.println("CREATE CAMERAS"); |
---|
1555 | | - cams = new cTemplate(); |
---|
1556 | | - cams.name = "Cameras"; |
---|
1557 | | - copy.insertElementAt(cams, 0); |
---|
1558 | | - //cams.parent = copy; |
---|
1559 | | - |
---|
1560 | | - cam = new Camera(); // LA.newVector(3, 2, 1)); |
---|
1561 | | - cams.addChild(cam); |
---|
1562 | | - cam = new Camera(1); |
---|
1563 | | - cams.addChild(cam); |
---|
1564 | | - cam = new Camera(2); |
---|
1565 | | - cams.addChild(cam); |
---|
1566 | | - cam = new Camera(3); |
---|
1567 | | - cams.addChild(cam); |
---|
1568 | | - cam = new Camera(4); // Light |
---|
1569 | | - cams.addChild(cam); |
---|
| 1571 | + if (Globals.DEBUG) |
---|
| 1572 | + System.out.println("CREATE CAMERAS"); |
---|
| 1573 | + cams = CreateCameras(); |
---|
1570 | 1574 | } else |
---|
1571 | 1575 | { |
---|
1572 | 1576 | cams = (cGroup) copy.get(0); |
---|
.. | .. |
---|
1718 | 1722 | |
---|
1719 | 1723 | //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); |
---|
1720 | 1724 | //tmp.setName("Edit"); |
---|
| 1725 | + objectPanel.add(skyboxPanel); |
---|
| 1726 | + objectPanel.setIconAt(0, GetIcon("icons/skybox.jpg")); |
---|
| 1727 | + objectPanel.setToolTipTextAt(0, "Backgrounds"); |
---|
| 1728 | + |
---|
1721 | 1729 | objectPanel.add(toolboxPanel); |
---|
1722 | | - objectPanel.setIconAt(0, GetIcon("icons/primitives.png")); |
---|
1723 | | - objectPanel.setToolTipTextAt(0, "Objects & textures"); |
---|
| 1730 | + objectPanel.setIconAt(1, GetIcon("icons/primitives.png")); |
---|
| 1731 | + objectPanel.setToolTipTextAt(1, "Objects & textures"); |
---|
1724 | 1732 | |
---|
1725 | 1733 | objectPanel.add(materialPanel); |
---|
1726 | | - objectPanel.setIconAt(1, GetIcon("icons/material.png")); |
---|
1727 | | - objectPanel.setToolTipTextAt(1, "Material"); |
---|
| 1734 | + objectPanel.setIconAt(2, GetIcon("icons/material.png")); |
---|
| 1735 | + objectPanel.setToolTipTextAt(2, "Material"); |
---|
1728 | 1736 | |
---|
1729 | | - objectPanel.add(skyboxPanel); |
---|
1730 | | - objectPanel.setIconAt(2, GetIcon("icons/skybox.jpg")); |
---|
1731 | | - objectPanel.setToolTipTextAt(2, "Backgrounds"); |
---|
1732 | | - |
---|
1733 | 1737 | // JPanel north = new JPanel(new BorderLayout()); |
---|
1734 | 1738 | // north.setName("Edit"); |
---|
1735 | 1739 | // north.add(ctrlPanel, BorderLayout.NORTH); |
---|
1736 | 1740 | // objectPanel.add(north); |
---|
1737 | 1741 | objectPanel.add(editPanel); |
---|
1738 | | - objectPanel.setIconAt(3, GetIcon("icons/write.png")); |
---|
| 1742 | + objectPanel.setIconAt(3, GetIcon("icons/writewhite.png")); |
---|
1739 | 1743 | objectPanel.setToolTipTextAt(3, "Edit controls"); |
---|
1740 | 1744 | |
---|
1741 | 1745 | objectPanel.add(transformPanel); |
---|
.. | .. |
---|
1744 | 1748 | |
---|
1745 | 1749 | patchMaterial = true; |
---|
1746 | 1750 | cameraView.patchMaterial = this; |
---|
1747 | | - objectPanel.setSelectedIndex(1); |
---|
| 1751 | + objectPanel.setSelectedIndex(2); |
---|
1748 | 1752 | |
---|
1749 | 1753 | /* |
---|
1750 | 1754 | aConstraints.gridx = 0; |
---|
.. | .. |
---|
1788 | 1792 | cLabel ogaLabel = new cLabel(" Most Skyboxes courtesy of OpenGameArt!", !Globals.NIMBUSLAF); |
---|
1789 | 1793 | creditsPanel.add(ogaLabel); |
---|
1790 | 1794 | |
---|
1791 | | - cButton opengameartButton; |
---|
1792 | | - creditsPanel.add(opengameartButton = GetButton("icons/sara-logo.png", !Globals.NIMBUSLAF)); |
---|
1793 | | - opengameartButton.setToolTipText("https://opengameart.org"); |
---|
| 1795 | + cButton creditButton; |
---|
| 1796 | + creditsPanel.add(creditButton = GetButton("icons/sara-logo.png", !Globals.NIMBUSLAF)); |
---|
| 1797 | + creditButton.setToolTipText("https://opengameart.org"); |
---|
1794 | 1798 | |
---|
1795 | | - opengameartButton.addMouseListener(new MouseAdapter() |
---|
| 1799 | + creditButton.addMouseListener(new MouseAdapter() |
---|
1796 | 1800 | { |
---|
1797 | 1801 | public void mouseClicked(MouseEvent e) |
---|
1798 | 1802 | { |
---|
.. | .. |
---|
1807 | 1811 | } |
---|
1808 | 1812 | }); |
---|
1809 | 1813 | |
---|
1810 | | - for (int i=10; --i>=0;) |
---|
| 1814 | + ogaLabel = new cLabel(" Download 3D models! (.3ds and .obj only)", !Globals.NIMBUSLAF); |
---|
| 1815 | + creditsPanel.add(ogaLabel); |
---|
| 1816 | + |
---|
| 1817 | + creditsPanel.add(creditButton = GetButton("icons/3delicious.png", !Globals.NIMBUSLAF)); |
---|
| 1818 | + creditButton.setToolTipText("https://3delicious.net"); |
---|
| 1819 | + |
---|
| 1820 | + creditButton.addMouseListener(new MouseAdapter() |
---|
| 1821 | + { |
---|
| 1822 | + public void mouseClicked(MouseEvent e) |
---|
| 1823 | + { |
---|
| 1824 | + try |
---|
| 1825 | + { |
---|
| 1826 | + Desktop.getDesktop().browse(new java.net.URI("https://3delicious.net")); |
---|
| 1827 | + } catch (Exception e1) |
---|
| 1828 | +// } catch (java.io.IOException | java.net.URISyntaxException e1) |
---|
| 1829 | + { |
---|
| 1830 | + e1.printStackTrace(); |
---|
| 1831 | + } |
---|
| 1832 | + } |
---|
| 1833 | + }); |
---|
| 1834 | + |
---|
| 1835 | + creditsPanel.add(creditButton = GetButton("icons/archive3d.png", !Globals.NIMBUSLAF)); |
---|
| 1836 | + creditButton.setToolTipText("https://archive3d.net"); |
---|
| 1837 | + |
---|
| 1838 | + creditButton.addMouseListener(new MouseAdapter() |
---|
| 1839 | + { |
---|
| 1840 | + public void mouseClicked(MouseEvent e) |
---|
| 1841 | + { |
---|
| 1842 | + try |
---|
| 1843 | + { |
---|
| 1844 | + Desktop.getDesktop().browse(new java.net.URI("https://archive3d.net")); |
---|
| 1845 | + } catch (Exception e1) |
---|
| 1846 | +// } catch (java.io.IOException | java.net.URISyntaxException e1) |
---|
| 1847 | + { |
---|
| 1848 | + e1.printStackTrace(); |
---|
| 1849 | + } |
---|
| 1850 | + } |
---|
| 1851 | + }); |
---|
| 1852 | + |
---|
| 1853 | + creditsPanel.add(creditButton = GetButton("icons/turbosquid.png", !Globals.NIMBUSLAF)); |
---|
| 1854 | + creditButton.setToolTipText("https://turbosquid.com"); |
---|
| 1855 | + |
---|
| 1856 | + creditButton.addMouseListener(new MouseAdapter() |
---|
| 1857 | + { |
---|
| 1858 | + public void mouseClicked(MouseEvent e) |
---|
| 1859 | + { |
---|
| 1860 | + try |
---|
| 1861 | + { |
---|
| 1862 | + Desktop.getDesktop().browse(new java.net.URI("https://www.turbosquid.com/Search/3D-Models/free")); |
---|
| 1863 | + } catch (Exception e1) |
---|
| 1864 | +// } catch (java.io.IOException | java.net.URISyntaxException e1) |
---|
| 1865 | + { |
---|
| 1866 | + e1.printStackTrace(); |
---|
| 1867 | + } |
---|
| 1868 | + } |
---|
| 1869 | + }); |
---|
| 1870 | + |
---|
| 1871 | + for (int i=6; --i>=0;) |
---|
1811 | 1872 | { |
---|
1812 | 1873 | creditsPanel.add(new cGridBag()); |
---|
1813 | 1874 | } |
---|
.. | .. |
---|
4206 | 4267 | |
---|
4207 | 4268 | copy.selection.clear(); |
---|
4208 | 4269 | |
---|
| 4270 | + if (copy == Grafreed.grafreed.universe) |
---|
| 4271 | + { |
---|
| 4272 | + CreateCameras(); |
---|
| 4273 | + cameraView.SetCamera(GetCamera(copy, 0)); |
---|
| 4274 | + } |
---|
4209 | 4275 | ResetModel(); |
---|
4210 | | - SetupViews(); |
---|
4211 | 4276 | objEditor.refreshContents(); |
---|
4212 | 4277 | } |
---|
4213 | 4278 | |
---|