From d5d6485126da83b06645e90e3e4ce66659a56009 Mon Sep 17 00:00:00 2001 From: Normand Briere <nbriere@noware.ca> Date: Sat, 17 Aug 2019 13:56:24 -0400 Subject: [PATCH] Reset transform, fix loop versioning. --- Grafreed.java | 75 +++++++++++++++++++++++++++++++++---- 1 files changed, 67 insertions(+), 8 deletions(-) diff --git a/Grafreed.java b/Grafreed.java index ed3e880..e0acda9 100644 --- a/Grafreed.java +++ b/Grafreed.java @@ -5,6 +5,7 @@ import java.io.*; +import java.util.ArrayList; import javax.swing.UIManager; import javax.swing.plaf.metal.MetalLookAndFeel; import javax.swing.plaf.ColorUIResource; @@ -15,7 +16,7 @@ //import com.jamonapi.*; public class Grafreed extends Applet implements ActionListener { - static boolean NIMBUSLAF = true; + static boolean NIMBUSLAF = false; // true; static int RENDERME = 0; @@ -62,7 +63,7 @@ static void ParseFileSystem(java.io.File dir, iResourceCallBack callback, String prefix) { - callback.CallBack(RemovePrefix(dir.toString(),prefix).split("/")); + callback.ResourceCallBack(RemovePrefix(dir.toString(),prefix).split("/")); File[] listFiles = dir.listFiles(); if (listFiles != null) { @@ -75,7 +76,7 @@ static interface iResourceCallBack { - void CallBack(String[] path); + void ResourceCallBack(String[] path); } static void ParseResources(String path, iResourceCallBack callback) @@ -94,7 +95,7 @@ String name = entries.nextElement().getName(); if (name.startsWith(path + "/")) - callback.CallBack(RemovePrefix(name, path).split("/")); + callback.ResourceCallBack(RemovePrefix(name, path + "/").split("/")); } jar.close(); } catch (Exception ex) @@ -110,7 +111,7 @@ try { java.io.File apps = new java.io.File(url.toURI()); - ParseFileSystem(apps, callback, RemovePrefix(url.toString(), "file:")); + ParseFileSystem(apps, callback, RemovePrefix(url.toString() + "/", "file:")); // for (java.io.File app : apps.listFiles()) // { // //System.out.println(RemovePrefix(app.toString(), RemovePrefix(url.toString(), "file:") + "/")); @@ -676,7 +677,8 @@ public static void main(String argv[]) { - String osArch = System.getProperty("os.arch"); + String osArch = System.getProperty("os.arch"); + if (Globals.DEBUG) System.out.println("os.arch = " + osArch); if (argv.length == 0) @@ -897,6 +899,13 @@ //UIManager.setLookAndFeel("com.apple.laf.AquaLookAndFeel"); //UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel"); //UIManager.put("nimbusBase", new Color(0,0,0)); + + javax.swing.UIDefaults ui = UIManager.getDefaults(); + for (java.util.Enumeration e = ui.keys(); e.hasMoreElements();) + { + Object key = e.nextElement(); + System.out.println(key + " --> " + ui.get(key)); + } } catch (Exception e) { @@ -906,12 +915,49 @@ { try { - MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme()); - MetalLookAndFeel.setCurrentTheme(new Theme(Constants.yellowTheme)); + //Object o = UIManager.getInstalledLookAndFeels(); + + MetalLookAndFeel.setCurrentTheme(new javax.swing.plaf.metal.DefaultMetalTheme()); + //MetalLookAndFeel.setCurrentTheme(new Theme(Constants.yellowTheme)); + //UIManager.put("ScrollBar.background", new javax.swing.plaf.ColorUIResource(100,0,0)); UIManager.setLookAndFeel(new MetalLookAndFeel()); //UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"); //UIManager.setLookAndFeel("com.apple.laf.AquaLookAndFeel"); + //UIManager.setLookAndFeel("javax.swing.plaf.nimbus.NimbusLookAndFeel"); //UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel"); + + javax.swing.UIDefaults ui = UIManager.getDefaults(); + ArrayList gradient = new java.util.ArrayList(5); + gradient.add(1.0); + gradient.add(0.0); + gradient.add(new javax.swing.plaf.ColorUIResource(255,255,255)); + gradient.add(new javax.swing.plaf.ColorUIResource(192,192,192)); + gradient.add(new javax.swing.plaf.ColorUIResource(0,0,0)); + + ui.put("Button.gradient", gradient); + ui.put("TabbedPane.tabInsets", new javax.swing.plaf.InsetsUIResource(0,8,0,0)); + ui.put("Slider.foreground", new javax.swing.plaf.ColorUIResource(0,0,0)); + ui.put("Slider.horizontalThumbIcon", ObjEditor.GetIcon("icons/white-sphere-icon.png")); + + //javax.swing.plaf.metal.MetalIconFactory.getHorizontalSliderThumbIcon(). + Object o = ui.get("Slider.horizontalThumbIcon"); + + gradient = new java.util.ArrayList(5); + gradient.add(1.0); + gradient.add(0.0); + gradient.add(new javax.swing.plaf.ColorUIResource(192,192,192)); + gradient.add(new javax.swing.plaf.ColorUIResource(255,255,255)); + gradient.add(new javax.swing.plaf.ColorUIResource(0,0,0)); + + ui.put("ToggleButton.gradient", gradient); + //ui.put("Button[MouseOver].backgroundPainter", new com.sun.java.swing.plaf.nimbus.ButtonPainter()); + //ui.put("Button.highlight", new javax.swing.plaf.ColorUIResource(155,155,155)); + + for (java.util.Enumeration e = ui.keys(); e.hasMoreElements();) + { + Object key = e.nextElement(); + //System.out.println(key + " --> " + ui.get(key)); + } } catch (Exception e) { } @@ -928,6 +974,9 @@ grafreed.universe = new cGroup(); grafreed.universe.name = "Grafreed"; grafreed.universe.material = new cMaterial(); + grafreed.universe.skyboxname = "cubemaps/penguins-skyboxes/yonder"; + grafreed.universe.skyboxext = "jpg"; + // theApplet3D.universe.textures = CameraPane.DEFAULT_TEXTURE; grafreed.universe.root = true; @@ -935,6 +984,8 @@ //mon.stop(); //System.out.println(mon); //timeflow.app.TimeflowAppLauncher.GetTimeFlow(); + + javax.swing.ToolTipManager.sharedInstance().setEnabled(Globals.TOOLTIPS); } static Object3D materials; @@ -950,6 +1001,8 @@ java.io.ObjectInputStream p = new java.io.ObjectInputStream(zstream); readobj = (Object3D) p.readObject(); + p.close(); + zstream.close(); istream.close(); readobj.ResetDisplayList(); @@ -963,6 +1016,7 @@ java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream); readobj = (Object3D) p.readObject(); + p.close(); istream.close(); readobj.ResetDisplayList(); @@ -1096,6 +1150,11 @@ static public Object clone(Object o) { + if (o instanceof Object3D) + { + assert(((Object3D)o).parent == null); + } + if (o == null) return null; -- Gitblit v1.6.2