.. | .. |
---|
50 | 50 | universe.material = new cMaterial(); |
---|
51 | 51 | //god.addChild(universe); |
---|
52 | 52 | universe.name = "Applet"; |
---|
53 | | - theApplet3D = this; |
---|
| 53 | + grafreeD = this; |
---|
54 | 54 | } |
---|
55 | 55 | |
---|
56 | 56 | /**/ |
---|
.. | .. |
---|
595 | 595 | |
---|
596 | 596 | public static void main(String argv[]) |
---|
597 | 597 | { |
---|
598 | | - if (false) // argv.length == 0) |
---|
| 598 | + if (argv.length == 0) |
---|
599 | 599 | { |
---|
600 | | - String javaPath = System.getProperty("java.home") + "/bin/java"; |
---|
| 600 | + String javaPath = System.getProperty("java.home") + File.separator + "bin" + File.separator + "java"; |
---|
| 601 | + System.out.println("javaPath = " + javaPath); |
---|
601 | 602 | java.net.URL u = new GrafreeD().getClass().getResource("default.png"); |
---|
602 | 603 | |
---|
603 | | - System.out.println(u); |
---|
| 604 | + System.out.println("URL = " + u); |
---|
604 | 605 | |
---|
605 | 606 | String jarfile = u.toString().split("file:")[1].split("default.png")[0]; |
---|
606 | 607 | |
---|
| 608 | + System.out.println("jarfile0 = " + jarfile); |
---|
| 609 | + |
---|
607 | 610 | String jarpath = u.toString().split("file:")[1].split("GrafreeD.jar")[0]; |
---|
608 | 611 | |
---|
609 | | - System.out.println(jarfile); |
---|
610 | | - System.out.println(jarpath); |
---|
| 612 | + System.out.println("jarpath0 = " + jarpath); |
---|
611 | 613 | |
---|
612 | 614 | jarfile = jarfile.substring(0, jarfile.length() - 2); |
---|
613 | 615 | |
---|
614 | | - // -Djava.library.path=/Users/nbriere/Projects/shared/lib |
---|
| 616 | + System.out.println("jarfile = " + jarfile); |
---|
| 617 | + |
---|
| 618 | + String command = javaPath + " -Xmx1024m -Djava.library.path=" + jarpath; |
---|
615 | 619 | |
---|
616 | | - String command = "" + javaPath + " -Xmx1024m -Djava.library.path=" + jarpath + "lib -jar " + jarfile + " dummyarg"; |
---|
| 620 | + // -Djava.library.path=/Users/nbriere/Projects/shared/lib |
---|
| 621 | + if (jarfile.charAt(2) == ':') |
---|
| 622 | + { |
---|
| 623 | + command = "\"" + javaPath + "\" -Xmx1024m -Djava.library.path=" + jarpath; |
---|
| 624 | + // On Windows systems, the path is /C:/ |
---|
| 625 | + jarfile = jarfile.substring(1, jarfile.length()); |
---|
| 626 | + System.out.println("jarfile = " + jarfile); |
---|
| 627 | + jarpath = jarpath.substring(1, jarpath.length()); |
---|
| 628 | + System.out.println("jarpath = " + jarpath); |
---|
| 629 | + command += "native" + File.separator + "windows_amd64"; |
---|
| 630 | + } |
---|
| 631 | + else |
---|
| 632 | + command += "native" + File.separator + "macosx"; |
---|
| 633 | + |
---|
| 634 | + command += " -jar " + jarfile + " dummyarg"; |
---|
617 | 635 | |
---|
618 | 636 | try |
---|
619 | 637 | { |
---|
620 | | - System.out.println(command); |
---|
| 638 | + System.out.println("command = " + command); |
---|
621 | 639 | Runtime.getRuntime().exec(command); |
---|
622 | 640 | |
---|
623 | 641 | return; |
---|
.. | .. |
---|
626 | 644 | { |
---|
627 | 645 | e.printStackTrace(); |
---|
628 | 646 | } |
---|
| 647 | + |
---|
| 648 | + /* |
---|
| 649 | + if (argv.length == 0) |
---|
| 650 | + { |
---|
| 651 | + String javaPath = System.getProperty("java.home") + File.separator + "bin" + File.separator + "java"; |
---|
| 652 | + System.out.println("javaPath = " + javaPath); |
---|
| 653 | + java.net.URL u = new Grafeme().getClass().getResource("grafeme.jpg"); |
---|
| 654 | + System.out.println("URL = " + u); |
---|
| 655 | + |
---|
| 656 | + String jarfile = u.toString().split("file:")[1].split("grafeme/grafeme.jpg")[0]; |
---|
| 657 | + System.out.println("jarfile0 = " + jarfile); |
---|
| 658 | + |
---|
| 659 | + jarfile = jarfile.substring(0, jarfile.length() - 2); // Remove "!/" after .jar |
---|
| 660 | + System.out.println("jarfile = " + jarfile); |
---|
| 661 | + |
---|
| 662 | + if (jarfile.charAt(2) == ':') |
---|
| 663 | + { |
---|
| 664 | + // On Windows systems, the path is /C:/ |
---|
| 665 | + jarfile = jarfile.substring(1, jarfile.length()); |
---|
| 666 | + System.out.println("jarfile = " + jarfile); |
---|
| 667 | + } |
---|
| 668 | + |
---|
| 669 | + String command = "\"" + javaPath + "\" -Xmx1024m -jar " + jarfile + " dummyarg"; |
---|
| 670 | + |
---|
| 671 | + try |
---|
| 672 | + { |
---|
| 673 | + System.out.println(command); |
---|
| 674 | + Runtime.getRuntime().exec(command); |
---|
| 675 | + |
---|
| 676 | + return; |
---|
| 677 | + } |
---|
| 678 | + catch (Exception e) |
---|
| 679 | + { |
---|
| 680 | + e.printStackTrace(); |
---|
| 681 | + } |
---|
| 682 | + } |
---|
| 683 | + |
---|
| 684 | + */ |
---|
629 | 685 | } |
---|
630 | 686 | |
---|
631 | 687 | // InitDictionary(); |
---|
.. | .. |
---|
742 | 798 | try |
---|
743 | 799 | { |
---|
744 | 800 | MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme()); |
---|
745 | | - //MetalLookAndFeel.setCurrentTheme(new Theme(Constants.beigeTheme)); |
---|
| 801 | + MetalLookAndFeel.setCurrentTheme(new Theme(Constants.yellowTheme)); |
---|
746 | 802 | UIManager.setLookAndFeel(new MetalLookAndFeel()); |
---|
| 803 | + //UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"); |
---|
| 804 | + //UIManager.setLookAndFeel("com.apple.laf.AquaLookAndFeel"); |
---|
| 805 | + //UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel"); |
---|
747 | 806 | } catch (Exception e) |
---|
748 | 807 | { |
---|
749 | 808 | } |
---|
750 | 809 | |
---|
751 | 810 | //Monitor mon=MonitorFactory.start("myFirstMonitor"); |
---|
752 | 811 | standAlone = true; |
---|
753 | | - theApplet3D = new GrafreeD(); |
---|
754 | | - theApplet3D.universe = new Composite(); |
---|
755 | | - theApplet3D.universe.name = "Scene"; |
---|
756 | | - theApplet3D.universe.material = new cMaterial(); |
---|
| 812 | + grafreeD = new GrafreeD(); |
---|
| 813 | + grafreeD.universe = new Composite(); |
---|
| 814 | + grafreeD.universe.name = "Scene"; |
---|
| 815 | + grafreeD.universe.material = new cMaterial(); |
---|
757 | 816 | // theApplet3D.universe.textures = CameraPane.DEFAULT_TEXTURE; |
---|
758 | 817 | |
---|
759 | | - theApplet3D.universe.root = true; |
---|
760 | | - theApplet3D.universe.openEditWindow(null, true); //, true); |
---|
| 818 | + grafreeD.universe.root = true; |
---|
| 819 | + grafreeD.universe.openEditWindow(null, true); //, true); |
---|
761 | 820 | //mon.stop(); |
---|
762 | 821 | //System.out.println(mon); |
---|
| 822 | + //timeflow.app.TimeflowAppLauncher.GetTimeFlow(); |
---|
763 | 823 | } |
---|
764 | 824 | |
---|
765 | 825 | // Timer callback |
---|
.. | .. |
---|
984 | 1044 | } while (avail > 0 && numRead >= 0); |
---|
985 | 1045 | return new String(data, 0, pos, "US-ASCII"); |
---|
986 | 1046 | } |
---|
987 | | - public static GrafreeD theApplet3D; |
---|
| 1047 | + public static GrafreeD grafreeD; |
---|
988 | 1048 | public static boolean standAlone = true; |
---|
989 | 1049 | public Composite universe; |
---|
990 | 1050 | public static Object3D clipboard = new Object3D(); |
---|