From c23a2a128cbd5eb94b1a11e3b3a34676cf681135 Mon Sep 17 00:00:00 2001
From: Normand Briere <nbriere@noware.ca>
Date: Mon, 02 Sep 2019 10:46:28 -0400
Subject: [PATCH] isWindows flag.

---
 FileObject.java   |   13 ++++++
 ObjEditor.java    |   47 ++++++++++++++++-------
 RandomEditor.java |    6 +++
 GroupEditor.java  |    8 ++--
 MocapEditor.java  |    5 ++
 Mocap.java        |    5 ++
 Grafreed.java     |    3 +
 7 files changed, 69 insertions(+), 18 deletions(-)

diff --git a/FileObject.java b/FileObject.java
index 6de2b2c..0d614bf 100644
--- a/FileObject.java
+++ b/FileObject.java
@@ -17,6 +17,19 @@
             filecontent = null;
     }
     
+    boolean HasBigData()
+    {
+        return false;
+    }
+    
+    void ExtractBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable)
+    {
+    }
+    
+    void RestoreBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable)
+    {
+    }
+    
     boolean IsStatic()
     {
         return false; // ???? false;
diff --git a/Grafreed.java b/Grafreed.java
index 8de12f4..40116a4 100644
--- a/Grafreed.java
+++ b/Grafreed.java
@@ -673,6 +673,8 @@
         PlayWord(word, 1);
     }
     
+    static boolean isWindows;
+    
     public static void main(String argv[])
     {
          String osArch = System.getProperty("os.arch");
@@ -704,6 +706,7 @@
             // -Djava.library.path=/Users/nbriere/Projects/shared/lib
         if (jarfile.charAt(2) == ':')
         {
+            isWindows = true;
             command = "\"" + javaPath + "\" -Xmx1024m -Djava.library.path=" + jarpath;
                 // On Windows systems, the path is /C:/
                 jarfile = jarfile.substring(1, jarfile.length());
diff --git a/GroupEditor.java b/GroupEditor.java
index 2e6edb6..597afe6 100644
--- a/GroupEditor.java
+++ b/GroupEditor.java
@@ -766,10 +766,10 @@
                 shadowZItem = menu.add(new MenuItem("Shadow Blue"));
 		shadowZItem.addActionListener(this);
                 
-        if (Globals.ADVANCED)
-        {
 		attributeItem = menu.add(new MenuItem("Attribute"));
 		attributeItem.addActionListener(this);
+        if (Globals.ADVANCED)
+        {
 		menu.add("-");
 		linkerItem = menu.add(new MenuItem("Linker"));
 		linkerItem.addActionListener(this);
@@ -2722,11 +2722,11 @@
                     if (!group.selection.isEmpty())
                     {
                         Composite csg = new GroupLeaf();
+			group(csg);
                         csg.count = 5;
                         Composite child = new cGroup("Branch");
                         csg.addChild(child);
                         child.addChild(csg);
-			group(csg);
                     }
 		} else
 		if (source == doubleItem)
@@ -2734,6 +2734,7 @@
                     if (!group.selection.isEmpty())
                     {
                         Composite csg = new GroupLeaf("Fork");
+			group(csg);
                         csg.count = 5;
                         Composite child = new cGroup("Branch A");
                         csg.addChild(child);
@@ -2741,7 +2742,6 @@
                         child = new cGroup("Branch B");
                         csg.addChild(child);
                         child.addChild(csg);
-			group(csg);
                     }
 		} else
 		if (source == tripleItem)
diff --git a/Mocap.java b/Mocap.java
index aa11165..32c8f73 100644
--- a/Mocap.java
+++ b/Mocap.java
@@ -3992,6 +3992,11 @@
      //   GetObject().release(i);
     }
     
+    boolean HasBigData()
+    {
+        return skeleton != null;
+    }
+    
     public Object3D get(int i)
     {
         if (i != 0)
diff --git a/MocapEditor.java b/MocapEditor.java
index 74a1069..0a8553d 100644
--- a/MocapEditor.java
+++ b/MocapEditor.java
@@ -59,6 +59,11 @@
 		SetupUI2(objEditor);
 	}
 	
+    String GetSupportText()
+    {
+        return "Hip pos";
+    }
+    
 	void SetupUI2(ObjEditor oe)
 	{
             /*
diff --git a/ObjEditor.java b/ObjEditor.java
index b849ed2..eab8b93 100644
--- a/ObjEditor.java
+++ b/ObjEditor.java
@@ -136,19 +136,19 @@
         {
             BufferedImage image;
             
-//            if (name.endsWith("jpg"))
-//            {
-//                try
-//                {
-//                    // Much faster!
-//                    image = new sun.awt.image.codec.JPEGImageDecoderImpl(ObjEditor.class.getClassLoader().getResourceAsStream(name)).decodeAsBufferedImage();
-//                }
-//                catch (Exception e)
-//                {
-//                    image = javax.imageio.ImageIO.read(ObjEditor.class.getClassLoader().getResourceAsStream(name));
-//                }
-//            }
-//            else
+            if (!Grafreed.isWindows && name.endsWith("jpg"))
+            {
+                try
+                {
+                    // Much faster!
+                    image = new sun.awt.image.codec.JPEGImageDecoderImpl(ObjEditor.class.getClassLoader().getResourceAsStream(name)).decodeAsBufferedImage();
+                }
+                catch (Exception e)
+                {
+                    image = javax.imageio.ImageIO.read(ObjEditor.class.getClassLoader().getResourceAsStream(name));
+                }
+            }
+            else
                 image = javax.imageio.ImageIO.read(ObjEditor.class.getClassLoader().getResourceAsStream(name));
   
 //            if (image.getWidth() > 48 && image.getHeight() > 48)
@@ -1341,6 +1341,11 @@
             obj = o;
         }
     }
+    
+    String GetSupportText()
+    {
+        return "Support";
+    }
 
     void SetupUI2(ObjEditor oe)
     {
@@ -1392,7 +1397,7 @@
         randomCB = AddCheckBox(setupPanel2, "Random", copy.random);
         randomCB.setToolTipText("Randomly Rewind (or Go back and forth)");
 
-        link2masterCB = AddCheckBox(setupPanel2, "Support", copy.link2master);
+        link2masterCB = AddCheckBox(setupPanel2, GetSupportText(), copy.link2master);
         link2masterCB.setToolTipText("Attach to support");
         
         if (Globals.ADVANCED)
@@ -4094,6 +4099,20 @@
         if (event.getSource() == randomCB)
         {
             copy.random ^= true;
+            if (this instanceof RandomEditor)
+            {
+                cGridBag itemPanel = ((RandomEditor)this).itemPanel;
+                itemPanel.getComponent(0).setEnabled(!copy.random);
+                
+                // Tooltip?
+                if (copy.random)
+                {
+                }
+                else
+                {
+                }
+            }
+            
             objEditor.refreshContents();
             return;
         }
diff --git a/RandomEditor.java b/RandomEditor.java
index 864154b..f6e4a71 100644
--- a/RandomEditor.java
+++ b/RandomEditor.java
@@ -58,12 +58,18 @@
 		SetupUI2(objEditor);
 	}
 	
+    String GetSupportText()
+    {
+        return "Show all";
+    }
+
 	void SetupUI2(ObjEditor oe)
 	{
             super.SetupUI2(oe);
                 itemPanel = AddSlider(oe.ctrlPanel, "Item: ", 0, randomnode.Size()-1, randomnode.rndIndex);
                 
             itemField = (cNumberSlider)itemPanel.getComponent(1);
+            itemPanel.getComponent(0).setEnabled(!randomnode.random);
             oe.ctrlPanel.Return();
             
         oe.ctrlPanel.Return();

--
Gitblit v1.6.2