Normand Briere
2019-08-20 7dc9a8879ed29a7693d617afcb48014504ddc4a9
ObjEditor.java
....@@ -72,6 +72,21 @@
7272 }
7373 }
7474
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
+
7590 public cGridBag GetSeparator()
7691 {
7792 cGridBag separator = new cGridBag();
....@@ -445,8 +460,11 @@
445460 importOBJItem.addActionListener(this);
446461 import3DSItem = menu.add(new MenuItem("3DS file..."));
447462 import3DSItem.addActionListener(this);
463
+ if (Globals.ADVANCED)
464
+ {
448465 importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file..."));
449466 importVRMLX3DItem.addActionListener(this);
467
+ }
450468 menu.add("-");
451469 importGFDItem = menu.add(new MenuItem("Grafreed file..."));
452470 importGFDItem.addActionListener(this);
....@@ -1550,23 +1568,9 @@
15501568
15511569 if (cam == null || !(copy.get(0) instanceof cGroup))
15521570 {
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();
15701574 } else
15711575 {
15721576 cams = (cGroup) copy.get(0);
....@@ -1718,24 +1722,24 @@
17181722
17191723 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
17201724 //tmp.setName("Edit");
1725
+ objectPanel.add(skyboxPanel);
1726
+ objectPanel.setIconAt(0, GetIcon("icons/skybox.jpg"));
1727
+ objectPanel.setToolTipTextAt(0, "Backgrounds");
1728
+
17211729 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");
17241732
17251733 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");
17281736
1729
- objectPanel.add(skyboxPanel);
1730
- objectPanel.setIconAt(2, GetIcon("icons/skybox.jpg"));
1731
- objectPanel.setToolTipTextAt(2, "Backgrounds");
1732
-
17331737 // JPanel north = new JPanel(new BorderLayout());
17341738 // north.setName("Edit");
17351739 // north.add(ctrlPanel, BorderLayout.NORTH);
17361740 // objectPanel.add(north);
17371741 objectPanel.add(editPanel);
1738
- objectPanel.setIconAt(3, GetIcon("icons/write.png"));
1742
+ objectPanel.setIconAt(3, GetIcon("icons/writewhite.png"));
17391743 objectPanel.setToolTipTextAt(3, "Edit controls");
17401744
17411745 objectPanel.add(transformPanel);
....@@ -1744,7 +1748,7 @@
17441748
17451749 patchMaterial = true;
17461750 cameraView.patchMaterial = this;
1747
- objectPanel.setSelectedIndex(1);
1751
+ objectPanel.setSelectedIndex(2);
17481752
17491753 /*
17501754 aConstraints.gridx = 0;
....@@ -1785,14 +1789,14 @@
17851789 cGridBag creditsPanel = new cGridBag().setVertical(true);
17861790 creditsPanel.setName("Credits");
17871791
1788
- cLabel ogaLabel = new cLabel(" Most Skyboxes courtesy of OpenGameArt!", !Globals.NIMBUSLAF);
1792
+ cLabel ogaLabel = new cLabel(" Skyboxes courtesy of OpenGameArt!", !Globals.NIMBUSLAF);
17891793 creditsPanel.add(ogaLabel);
17901794
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");
17941798
1795
- opengameartButton.addMouseListener(new MouseAdapter()
1799
+ creditButton.addMouseListener(new MouseAdapter()
17961800 {
17971801 public void mouseClicked(MouseEvent e)
17981802 {
....@@ -1807,7 +1811,64 @@
18071811 }
18081812 });
18091813
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;)
18111872 {
18121873 creditsPanel.add(new cGridBag());
18131874 }
....@@ -4206,8 +4267,12 @@
42064267
42074268 copy.selection.clear();
42084269
4270
+ if (copy == Grafreed.grafreed.universe)
4271
+ {
4272
+ CreateCameras();
4273
+ cameraView.SetCamera(GetCamera(copy, 0));
4274
+ }
42094275 ResetModel();
4210
- SetupViews();
42114276 objEditor.refreshContents();
42124277 }
42134278