From 22e8ab6479334206f97b0093f6c5ffd14610cce3 Mon Sep 17 00:00:00 2001
From: Normand Briere <nbriere@noware.ca>
Date: Sun, 18 Aug 2019 20:30:44 -0400
Subject: [PATCH] More credits

---
 ObjEditor.java |  131 ++++++++++++++++++++++++++++++++-----------
 1 files changed, 98 insertions(+), 33 deletions(-)

diff --git a/ObjEditor.java b/ObjEditor.java
index 8108843..93c90ad 100644
--- a/ObjEditor.java
+++ b/ObjEditor.java
@@ -72,6 +72,21 @@
         }
     }
 
+    public Composite CreateCameras()
+    {
+        Composite cams = new cTemplate();
+        cams.name = "Cameras";
+        copy.insertElementAt(cams, 0);
+
+        cams.addChild(new Camera());
+        cams.addChild(new Camera(1));
+        cams.addChild(new Camera(2));
+        cams.addChild(new Camera(3));
+        cams.addChild(new Camera(4));
+        
+        return cams;
+    }
+
     public cGridBag GetSeparator()
     {
         cGridBag separator = new cGridBag();
@@ -445,8 +460,11 @@
 		importOBJItem.addActionListener(this);
 		import3DSItem = menu.add(new MenuItem("3DS file..."));
 		import3DSItem.addActionListener(this);
+                if (Globals.ADVANCED)
+                {
 		importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file..."));
 		importVRMLX3DItem.addActionListener(this);
+                }
 		menu.add("-");
 		importGFDItem = menu.add(new MenuItem("Grafreed file..."));
 		importGFDItem.addActionListener(this);
@@ -1550,23 +1568,9 @@
 
         if (cam == null || !(copy.get(0) instanceof cGroup))
         {
-        if (Globals.DEBUG)
-            System.out.println("CREATE CAMERAS");
-            cams = new cTemplate();
-            cams.name = "Cameras";
-            copy.insertElementAt(cams, 0);
-            //cams.parent = copy;
-
-            cam = new Camera(); // LA.newVector(3, 2, 1));
-            cams.addChild(cam);
-            cam = new Camera(1);
-            cams.addChild(cam);
-            cam = new Camera(2);
-            cams.addChild(cam);
-            cam = new Camera(3);
-            cams.addChild(cam);
-            cam = new Camera(4); // Light
-            cams.addChild(cam);
+            if (Globals.DEBUG)
+                System.out.println("CREATE CAMERAS");
+            cams = CreateCameras();
         } else
         {
             cams = (cGroup) copy.get(0);
@@ -1718,24 +1722,24 @@
 
         //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
         //tmp.setName("Edit");
+        objectPanel.add(skyboxPanel);
+        objectPanel.setIconAt(0, GetIcon("icons/skybox.jpg"));
+        objectPanel.setToolTipTextAt(0, "Backgrounds");
+        
         objectPanel.add(toolboxPanel);
-        objectPanel.setIconAt(0, GetIcon("icons/primitives.png"));
-        objectPanel.setToolTipTextAt(0, "Objects & textures");
+        objectPanel.setIconAt(1, GetIcon("icons/primitives.png"));
+        objectPanel.setToolTipTextAt(1, "Objects & textures");
 
         objectPanel.add(materialPanel);
-        objectPanel.setIconAt(1, GetIcon("icons/material.png"));
-        objectPanel.setToolTipTextAt(1, "Material");
+        objectPanel.setIconAt(2, GetIcon("icons/material.png"));
+        objectPanel.setToolTipTextAt(2, "Material");
     
-        objectPanel.add(skyboxPanel);
-        objectPanel.setIconAt(2, GetIcon("icons/skybox.jpg"));
-        objectPanel.setToolTipTextAt(2, "Backgrounds");
-        
 //        JPanel north = new JPanel(new BorderLayout());
 //        north.setName("Edit");
 //        north.add(ctrlPanel, BorderLayout.NORTH);
 //        objectPanel.add(north);
         objectPanel.add(editPanel);
-        objectPanel.setIconAt(3, GetIcon("icons/write.png"));
+        objectPanel.setIconAt(3, GetIcon("icons/writewhite.png"));
         objectPanel.setToolTipTextAt(3, "Edit controls");
         
         objectPanel.add(transformPanel);
@@ -1744,7 +1748,7 @@
         
         patchMaterial = true;
         cameraView.patchMaterial = this;
-        objectPanel.setSelectedIndex(1);
+        objectPanel.setSelectedIndex(2);
                 
         /*
         aConstraints.gridx = 0;
@@ -1788,11 +1792,11 @@
         cLabel ogaLabel = new cLabel("   Most Skyboxes courtesy of OpenGameArt!", !Globals.NIMBUSLAF);
 	creditsPanel.add(ogaLabel);
         
-        cButton opengameartButton;
-	creditsPanel.add(opengameartButton = GetButton("icons/sara-logo.png", !Globals.NIMBUSLAF));
-        opengameartButton.setToolTipText("https://opengameart.org");
+        cButton creditButton;
+	creditsPanel.add(creditButton = GetButton("icons/sara-logo.png", !Globals.NIMBUSLAF));
+        creditButton.setToolTipText("https://opengameart.org");
         
-        opengameartButton.addMouseListener(new MouseAdapter()
+        creditButton.addMouseListener(new MouseAdapter()
         {
             public void mouseClicked(MouseEvent e)
             {
@@ -1807,7 +1811,64 @@
             }
         });
         
-        for (int i=10; --i>=0;)
+        ogaLabel = new cLabel("   Download 3D models! (.3ds and .obj only)", !Globals.NIMBUSLAF);
+	creditsPanel.add(ogaLabel);
+        
+	creditsPanel.add(creditButton = GetButton("icons/3delicious.png", !Globals.NIMBUSLAF));
+        creditButton.setToolTipText("https://3delicious.net");
+        
+        creditButton.addMouseListener(new MouseAdapter()
+        {
+            public void mouseClicked(MouseEvent e)
+            {
+                try
+                {
+                    Desktop.getDesktop().browse(new java.net.URI("https://3delicious.net"));
+                } catch (Exception e1)
+//                } catch (java.io.IOException | java.net.URISyntaxException e1)
+                {
+                    e1.printStackTrace();
+                }
+            }
+        });
+        
+	creditsPanel.add(creditButton = GetButton("icons/archive3d.png", !Globals.NIMBUSLAF));
+        creditButton.setToolTipText("https://archive3d.net");
+        
+        creditButton.addMouseListener(new MouseAdapter()
+        {
+            public void mouseClicked(MouseEvent e)
+            {
+                try
+                {
+                    Desktop.getDesktop().browse(new java.net.URI("https://archive3d.net"));
+                } catch (Exception e1)
+//                } catch (java.io.IOException | java.net.URISyntaxException e1)
+                {
+                    e1.printStackTrace();
+                }
+            }
+        });
+        
+	creditsPanel.add(creditButton = GetButton("icons/turbosquid.png", !Globals.NIMBUSLAF));
+        creditButton.setToolTipText("https://turbosquid.com");
+        
+        creditButton.addMouseListener(new MouseAdapter()
+        {
+            public void mouseClicked(MouseEvent e)
+            {
+                try
+                {
+                    Desktop.getDesktop().browse(new java.net.URI("https://www.turbosquid.com/Search/3D-Models/free"));
+                } catch (Exception e1)
+//                } catch (java.io.IOException | java.net.URISyntaxException e1)
+                {
+                    e1.printStackTrace();
+                }
+            }
+        });
+        
+        for (int i=6; --i>=0;)
         {
             creditsPanel.add(new cGridBag());
         }
@@ -4206,8 +4267,12 @@
         
         copy.selection.clear();
         
+        if (copy == Grafreed.grafreed.universe)
+        {
+            CreateCameras();
+            cameraView.SetCamera(GetCamera(copy, 0));
+        }
         ResetModel();
-        SetupViews();
         objEditor.refreshContents();
     }
     

--
Gitblit v1.6.2