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