From 6600d22461ccc1cb602f238a9ffa83cf07dd830e Mon Sep 17 00:00:00 2001
From: Normand Briere <nbriere@noware.ca>
Date: Mon, 01 Jul 2019 18:04:02 -0400
Subject: [PATCH] Get icons 256x256

---
 ObjEditor.java |  138 +++++++++++++++++++++++++++++----------------
 1 files changed, 89 insertions(+), 49 deletions(-)

diff --git a/ObjEditor.java b/ObjEditor.java
index 559d8de..93548e1 100644
--- a/ObjEditor.java
+++ b/ObjEditor.java
@@ -309,7 +309,7 @@
         //localCopy.parent = null;
 
         frame = new JFrame();
-                frame.setUndecorated(true);
+                frame.setUndecorated(false);
         objEditor = this;
         this.callee = callee;
 
@@ -350,7 +350,7 @@
         frame.setMenuBar(menuBar = new MenuBar());
         menuBar.add(fileMenu = new Menu("File"));
         fileMenu.add(newItem = new MenuItem("New"));
-        fileMenu.add(loadItem = new MenuItem("Open..."));
+        fileMenu.add(openItem = new MenuItem("Open..."));
         
                 //oe.menuBar.add(menu = new Menu("Include"));
         Menu menu = new Menu("Import");
@@ -382,7 +382,7 @@
         }
 
         newItem.addActionListener(this);
-        loadItem.addActionListener(this);
+        openItem.addActionListener(this);
         saveItem.addActionListener(this);
         saveAsItem.addActionListener(this);
         exportAsItem.addActionListener(this);
@@ -449,7 +449,7 @@
 // TEXTAREA           infoarea.setLineWrap(true);
 // TEXTAREA           infoarea.setWrapStyleWord(true);
         infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED);
-        infoPanel.setPreferredSize(new Dimension(50, 200));
+        infoPanel.setPreferredSize(new Dimension(1, 1));
         infoPanel.setName("Info");
         //infoPanel.setLayout(new BorderLayout());
         //infoPanel.add(createTextPane());
@@ -699,8 +699,8 @@
         }
     }
 
-static GraphicsDevice device = GraphicsEnvironment
-        .getLocalGraphicsEnvironment().getScreenDevices()[0];
+//static GraphicsDevice device = GraphicsEnvironment
+//        .getLocalGraphicsEnvironment().getScreenDevices()[0];
 
     Rectangle keeprect;
         cRadio radio;
@@ -721,10 +721,19 @@
         void Minimize()
         {
             frame.setState(Frame.ICONIFIED);
+            frame.validate();
         }
         
+//        artifactURI=null, type=0, property=${file.reference.jfxrt.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@6767876f, broken=false, additional={}
+//        artifactURI=null, type=0, property=${file.reference.mac-ui.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@16bdc817, broken=false, additional={}
+//        artifactURI=null, type=0, property=${file.reference.classes.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@9daa9c17, broken=false, additional={}
         void Maximize()
         {
+            if (CameraPane.FULLSCREEN)
+            {
+                ToggleFullScreen();
+            }
+            
             if (maximized)
             {
                 frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height);
@@ -732,22 +741,36 @@
             else
             {
                 keeprect = frame.getBounds();
-                Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds();
-                Dimension rect2 = frame.getToolkit().getScreenSize();
-                frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height);
+//                Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds();
+//                Dimension rect2 = frame.getToolkit().getScreenSize();
+//                frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height);
 //                frame.setState(Frame.MAXIMIZED_BOTH);
+                frame.setBounds(frame.getGraphicsConfiguration().getBounds());
             }
             
             maximized ^= true;
+            
+            frame.validate();
         }
+        
+	cButton minButton;
+	cButton maxButton;
+	cButton fullButton;
         
         void ToggleFullScreen()
         {
+GraphicsDevice device = frame.getGraphicsConfiguration().getDevice();
+
                 cameraView.ToggleFullScreen();
                 
                 if (!CameraPane.FULLSCREEN)
                 {
                     device.setFullScreenWindow(null);
+                    frame.dispose();
+                frame.setUndecorated(false);
+            frame.validate();
+                    frame.setVisible(true);
+                    
                     //frame.setVisible(false);
 //                frame.removeNotify();
 //                frame.setUndecorated(false);
@@ -757,7 +780,7 @@
 // X                   frame.getContentPane().remove(/*"Center",*/bigThree);
 // X                   framePanel.add(bigThree);
 // X                   frame.getContentPane().add(/*"Center",*/framePanel);
-                    framePanel.setDividerLocation(1);
+                    framePanel.setDividerLocation(46);
                     
                     //frame.setVisible(true);
                     radio.layout = keepButton;
@@ -772,7 +795,12 @@
 //                frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width,
 //                        frame.getToolkit().getScreenSize().height);
                     //frame.setVisible(false);
+                    
+            frame.dispose();
+                frame.setUndecorated(true);
                     device.setFullScreenWindow(frame);
+            frame.validate();
+                    frame.setVisible(true);
 //                frame.removeNotify();
 //                frame.setUndecorated(true);
 //                frame.addNotify();
@@ -785,6 +813,7 @@
                     radio.layout.doClick();
                     //frame.setVisible(true);
                 }
+            frame.validate();
         }
 
     private JTextPane createTextPane()
@@ -1117,7 +1146,7 @@
             namePanel = new cGridBag();
             
         nameField = AddText(namePanel, copy.GetName());
-        namePanel.add(nameField);
+        namePanel.add(new JScrollPane(nameField, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER));
         oe.ctrlPanel.add(namePanel);
         
         oe.ctrlPanel.Return();
@@ -1142,7 +1171,7 @@
         rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind);
         rewindCB.setToolTipText("Rewind animation");
         
-        randomCB = AddCheckBox(setupPanel2, "Rand", copy.random);
+        randomCB = AddCheckBox(setupPanel2, "Random", copy.random);
         randomCB.setToolTipText("Randomly Rewind (or Go back and forth)");
 
         if (Globals.ADVANCED)
@@ -1464,7 +1493,10 @@
 //        north.add(ctrlPanel, BorderLayout.NORTH);
 //        objectPanel.add(north);
         objectPanel.add(editPanel);
-        objectPanel.add(infoPanel);
+        
+        //if (Globals.ADVANCED)
+            objectPanel.add(infoPanel);
+        
         objectPanel.add(toolboxPanel);
 
         /*
@@ -1573,9 +1605,9 @@
 //		aConstraints.gridheight = 1;
 
         framePanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, toolbarPanel, bigThree);
-        framePanel.setContinuousLayout(true);
-        framePanel.setOneTouchExpandable(true);
-        framePanel.setDividerLocation(0.8);
+        framePanel.setContinuousLayout(false);
+        framePanel.setOneTouchExpandable(false);
+        //.setDividerLocation(0.8);
         //framePanel.setDividerSize(15);
         //framePanel.setResizeWeight(0.15);
         framePanel.setName("Frame");
@@ -1594,12 +1626,13 @@
 
         frame.setSize(1280, 860);
         
-        frame.validate();
-        frame.setVisible(true);
-
                     cameraView.requestFocusInWindow();
                     
         gridPanel.setDividerLocation(1.0);
+        
+        frame.validate();
+
+        frame.setVisible(true);
 
         frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
         frame.addWindowListener(new WindowAdapter()
@@ -1686,24 +1719,6 @@
                 texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
         colorSection.add(texture);
 
-        cGridBag anisoU = new cGridBag();
-                anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints);
-                anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
-                anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
-        colorSection.add(anisoU);
-
-        cGridBag anisoV = new cGridBag();
-                anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints);
-                anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
-                anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
-        colorSection.add(anisoV);
-
-        cGridBag shadowbias = new cGridBag();
-                shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints);
-                shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
-                shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
-        colorSection.add(shadowbias);
-
         panel.add(new JSeparator());
         
         panel.add(colorSection);
@@ -1753,6 +1768,12 @@
                 fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
                 fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
         diffuseSection.add(fakedepth);
+
+        cGridBag shadowbias = new cGridBag();
+                shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints);
+                shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
+                shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
+        diffuseSection.add(shadowbias);
 
         panel.add(new JSeparator());
         
@@ -1804,6 +1825,18 @@
 //		aConstraints.gridy += 1;
 //		aConstraints.gridwidth = 1;
 
+        cGridBag anisoU = new cGridBag();
+                anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints);
+                anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
+                anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
+        specularSection.add(anisoU);
+
+        cGridBag anisoV = new cGridBag();
+                anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints);
+                anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
+                anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
+        specularSection.add(anisoV);
+
 
         panel.add(new JSeparator());
         
@@ -1811,35 +1844,35 @@
         
         //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
         
-        cGridBag globalSection = new cGridBag().setVertical(true);
+        //cGridBag globalSection = new cGridBag().setVertical(true);
 
         cGridBag camera = new cGridBag();
                 camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints);
                 cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
                 camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
-        globalSection.add(camera);
+        colorSection.add(camera);
 
         cGridBag ambient = new cGridBag();
                 ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints);
                 ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
                 ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
-        globalSection.add(ambient);
+        colorSection.add(ambient);
 
         cGridBag backlit = new cGridBag();
                 backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints);
                 backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
                 backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
-        globalSection.add(backlit);
+        colorSection.add(backlit);
 
         cGridBag opacity = new cGridBag();
                 opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints);
                 opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
                 opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
-        globalSection.add(opacity);
+        colorSection.add(opacity);
 
-        panel.add(new JSeparator());
+        //panel.add(new JSeparator());
         
-        panel.add(globalSection);
+        //panel.add(globalSection);
         
         //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
         
@@ -3361,9 +3394,9 @@
         {
             Close();
             //return true;
-        } else if (source == loadItem)
+        } else if (source == openItem)
         {
-            load();
+            Open();
             //return true;
         } else if (source == newItem)
         {
@@ -3388,6 +3421,10 @@
         {
             generatePOV();
             //return true;
+        } else if (event.getSource() == archiveItem)
+        {
+            cTools.Archive(frame);
+            return;
         } else if (source == zBufferItem)
         {
             try
@@ -3538,8 +3575,10 @@
         
         copy.ExtractBigData(hashtable);
         
+        byte[] compress = Compress(copy);
+        
         //EditorFrame.m_MainFrame.requestFocusInWindow();
-        tab.graphs[tab.undoindex++] = Compress(copy);
+        tab.graphs[tab.undoindex++] = compress;
 
         copy.RestoreBigData(hashtable);
 
@@ -4688,7 +4727,7 @@
         }
     }
 
-    void load() // throws ClassNotFoundException
+    void Open() // throws ClassNotFoundException
     {
         if (Grafreed.standAlone)
         {
@@ -4973,7 +5012,7 @@
     MenuBar menuBar;
     Menu fileMenu;
     MenuItem newItem;
-    MenuItem loadItem;
+    MenuItem openItem;
     MenuItem saveItem;
     MenuItem saveAsItem;
     MenuItem exportAsItem;
@@ -4996,6 +5035,7 @@
     CheckboxMenuItem toggleSwitchItem;
     CheckboxMenuItem toggleRootItem;
     CheckboxMenuItem animationItem;
+    MenuItem archiveItem;
     CheckboxMenuItem toggleHandleItem;
     CheckboxMenuItem togglePaintItem;
     JSplitPane mainPanel;

--
Gitblit v1.6.2