From f9325048496d7cdbcad233f8a6b84c88e79adcc2 Mon Sep 17 00:00:00 2001 From: Normand Briere <nbriere@noware.ca> Date: Tue, 17 Sep 2019 20:11:47 -0400 Subject: [PATCH] Rename link2master to link2support. --- Grafreed.java | 107 +++++++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 99 insertions(+), 8 deletions(-) diff --git a/Grafreed.java b/Grafreed.java index 2c1cfc9..28064c8 100644 --- a/Grafreed.java +++ b/Grafreed.java @@ -13,6 +13,17 @@ import javax.sound.sampled.*; +import javax.net.ssl.HostnameVerifier; +import javax.net.ssl.HttpsURLConnection; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLSession; +import javax.net.ssl.TrustManager; +import javax.net.ssl.X509TrustManager; + +import java.security.cert.X509Certificate; +import java.net.Authenticator; +import java.net.PasswordAuthentication; + //import com.jamonapi.*; public class Grafreed extends Applet implements ActionListener { @@ -673,12 +684,18 @@ PlayWord(word, 1); } + static boolean isWindows; + 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); + String osName = System.getProperty("os.name"); + + isWindows = !osName.equals("Mac OS X"); + if (argv.length == 0) { String javaPath = System.getProperty("java.home") + File.separator + "bin" + File.separator + "java"; @@ -881,7 +898,6 @@ // try{Thread.sleep(5000);}catch(Exception e){} // PlayAudio("/Users/nbriere/Downloads/Footsteps-6.wav", 4, 1); - /**/ if (Globals.NIMBUSLAF) { @@ -934,6 +950,8 @@ ui = UIManager.getDefaults(); + x = ui.get("RadioButton.icon"); + ArrayList gradient = new java.util.ArrayList(5); gradient.add(1.0); gradient.add(0.0); @@ -943,9 +961,9 @@ ui.put("Button.gradient", gradient); - //ui.put("RadioButton.icon", ObjEditor.GetIcon("icons/white-sphere-icon.png")); - //ui.put("RadioButtonMenuItem.checkIcon", ObjEditor.GetIcon("icons/fit.png")); - //ui.put("RadioButtonMenuItem.arrowIcon", ObjEditor.GetIcon("icons/fit.png")); + //ui.put("RadioButton.icon", new CheckBox()); //ObjEditor.GetIcon("icons/white-sphere-icon.png"))); + ui.put("CheckBox.icon", new CheckBox()); //ObjEditor.GetIcon("icons/white-sphere-icon.png"))); + //ui.put("CheckBoxMenuItem.checkIcon", ObjEditor.GetIcon("icons/white-sphere-icon.png")); ui.put("Slider.foreground", new javax.swing.plaf.ColorUIResource(0,0,0)); ui.put("Slider.horizontalThumbIcon", ObjEditor.GetIcon("icons/white-sphere-icon.png")); @@ -1010,24 +1028,70 @@ } } /**/ + + // Create a trust manager that does not validate certificate chains + final TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() { + @Override + public void checkClientTrusted(final X509Certificate[] chain, final String authType) { + } + + @Override + public void checkServerTrusted(final X509Certificate[] chain, final String authType) { + } + + @Override + public X509Certificate[] getAcceptedIssuers() { + return null; + } + } }; + + try + { + // Install the all-trusting trust manager + final SSLContext sslContext = SSLContext.getInstance("SSL"); + sslContext.init(null, trustAllCerts, null); + // Create an ssl socket factory with our all-trusting manager + HttpsURLConnection.setDefaultSSLSocketFactory(sslContext.getSocketFactory()); + HttpsURLConnection.setDefaultHostnameVerifier(new HostnameVerifier() { + public boolean verify(String urlHostName, SSLSession session) { + return true; + } + }); + // be authentic + Authenticator.setDefault(new Authenticator() { + @Override + protected PasswordAuthentication getPasswordAuthentication() { + return new PasswordAuthentication("args[0]", "args[1]".toCharArray()); + } + }); + } + catch (Exception e) + { + e.printStackTrace(); + } + + + ///////////// // javax.swing.ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false); //Monitor mon=MonitorFactory.start("myFirstMonitor"); standAlone = true; - grafreed = new Grafreed(); + + grafreed = new Grafreed(); + grafreed.materials = ReadGFD(grafreed.getClass().getClassLoader().getResourceAsStream("gfd/materials.gfd")); 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; grafreed.universe.openEditWindow(null, true); //, true); + grafreed.universe.editWindow.New(); + //mon.stop(); //System.out.println(mon); //timeflow.app.TimeflowAppLauncher.GetTimeFlow(); @@ -1035,6 +1099,33 @@ javax.swing.ToolTipManager.sharedInstance().setEnabled(Globals.TOOLTIPS); } + static class CheckBox extends javax.swing.plaf.metal.MetalCheckBoxIcon + { + java.awt.image.BufferedImage image; + + CheckBox() + { + try + { + image = javax.imageio.ImageIO.read(ObjEditor.class.getClassLoader().getResourceAsStream("icons/checkbox.png")); + } + catch (Exception e) + { + } + } + + protected void drawCheck(Component c, Graphics g, int x, int y) + { + super.drawCheck(c, g, x, y); + } + + public void paintIcon(Component c, Graphics g, int x, int y) + { + g.drawImage(image, x-1, y-1, 19, 19, null); + super.paintIcon(c, g, x+2, y+2); + } + } + static Object3D materials; static Object3D ReadGFD(java.io.InputStream istream) -- Gitblit v1.6.2