.. | .. |
---|
15 | 15 | |
---|
16 | 16 | //import com.jamonapi.*; |
---|
17 | 17 | public class Grafreed extends Applet implements ActionListener |
---|
18 | | -{ |
---|
19 | | - static boolean NIMBUSLAF = false; // true; |
---|
20 | | - |
---|
| 18 | +{ |
---|
21 | 19 | static int RENDERME = 0; |
---|
22 | 20 | |
---|
23 | 21 | static boolean epsequal = false; |
---|
.. | .. |
---|
883 | 881 | // try{Thread.sleep(5000);}catch(Exception e){} |
---|
884 | 882 | // PlayAudio("/Users/nbriere/Downloads/Footsteps-6.wav", 4, 1); |
---|
885 | 883 | |
---|
886 | | - |
---|
887 | 884 | /**/ |
---|
888 | | - if (NIMBUSLAF) |
---|
| 885 | + if (Globals.NIMBUSLAF) |
---|
889 | 886 | { |
---|
890 | 887 | try |
---|
891 | 888 | { |
---|
892 | | - Object o = UIManager.getInstalledLookAndFeels(); |
---|
| 889 | + //Object o = UIManager.getInstalledLookAndFeels(); |
---|
893 | 890 | |
---|
894 | 891 | javax.swing.plaf.metal.MetalLookAndFeel.setCurrentTheme(new javax.swing.plaf.metal.DefaultMetalTheme()); |
---|
895 | 892 | //MetalLookAndFeel.setCurrentTheme(new Theme(Constants.beigeTheme)); |
---|
896 | | - UIManager.setLookAndFeel(new javax.swing.plaf.metal.MetalLookAndFeel()); |
---|
| 893 | + //UIManager.setLookAndFeel(new javax.swing.plaf.metal.MetalLookAndFeel()); |
---|
897 | 894 | |
---|
898 | 895 | UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"); |
---|
899 | 896 | //UIManager.setLookAndFeel("com.apple.laf.AquaLookAndFeel"); |
---|
.. | .. |
---|
901 | 898 | //UIManager.put("nimbusBase", new Color(0,0,0)); |
---|
902 | 899 | |
---|
903 | 900 | javax.swing.UIDefaults ui = UIManager.getDefaults(); |
---|
| 901 | + |
---|
| 902 | + ui.put("TabbedPane.tabInsets", new javax.swing.plaf.InsetsUIResource(0,8,0,0)); |
---|
| 903 | + |
---|
904 | 904 | for (java.util.Enumeration e = ui.keys(); e.hasMoreElements();) |
---|
905 | 905 | { |
---|
906 | 906 | Object key = e.nextElement(); |
---|
.. | .. |
---|
920 | 920 | MetalLookAndFeel.setCurrentTheme(new javax.swing.plaf.metal.DefaultMetalTheme()); |
---|
921 | 921 | //MetalLookAndFeel.setCurrentTheme(new Theme(Constants.yellowTheme)); |
---|
922 | 922 | //UIManager.put("ScrollBar.background", new javax.swing.plaf.ColorUIResource(100,0,0)); |
---|
| 923 | + UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"); |
---|
| 924 | + |
---|
| 925 | + javax.swing.UIDefaults ui = UIManager.getDefaults(); |
---|
| 926 | + |
---|
| 927 | + Object x = ui.get("TabbedPane.background"); |
---|
| 928 | + |
---|
923 | 929 | UIManager.setLookAndFeel(new MetalLookAndFeel()); |
---|
924 | | - //UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"); |
---|
925 | 930 | //UIManager.setLookAndFeel("com.apple.laf.AquaLookAndFeel"); |
---|
926 | 931 | //UIManager.setLookAndFeel("javax.swing.plaf.nimbus.NimbusLookAndFeel"); |
---|
927 | 932 | //UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel"); |
---|
928 | 933 | |
---|
929 | | - javax.swing.UIDefaults ui = UIManager.getDefaults(); |
---|
| 934 | + ui = UIManager.getDefaults(); |
---|
| 935 | + |
---|
| 936 | + x = ui.get("RadioButton.icon"); |
---|
| 937 | + |
---|
930 | 938 | ArrayList gradient = new java.util.ArrayList(5); |
---|
931 | 939 | gradient.add(1.0); |
---|
932 | 940 | gradient.add(0.0); |
---|
.. | .. |
---|
935 | 943 | gradient.add(new javax.swing.plaf.ColorUIResource(0,0,0)); |
---|
936 | 944 | |
---|
937 | 945 | ui.put("Button.gradient", gradient); |
---|
938 | | - ui.put("TabbedPane.tabInsets", new javax.swing.plaf.InsetsUIResource(0,8,0,0)); |
---|
| 946 | + |
---|
| 947 | + //ui.put("RadioButton.icon", new CheckBox()); //ObjEditor.GetIcon("icons/white-sphere-icon.png"))); |
---|
| 948 | + ui.put("CheckBox.icon", new CheckBox()); //ObjEditor.GetIcon("icons/white-sphere-icon.png"))); |
---|
| 949 | + //ui.put("CheckBoxMenuItem.checkIcon", ObjEditor.GetIcon("icons/white-sphere-icon.png")); |
---|
| 950 | + |
---|
939 | 951 | ui.put("Slider.foreground", new javax.swing.plaf.ColorUIResource(0,0,0)); |
---|
940 | 952 | ui.put("Slider.horizontalThumbIcon", ObjEditor.GetIcon("icons/white-sphere-icon.png")); |
---|
941 | 953 | |
---|
| 954 | + /* |
---|
| 955 | +TabbedPane.unselectedBackground Color |
---|
| 956 | +TabbedPane.unselectedTabBackground Color |
---|
| 957 | +TabbedPane.unselectedTabForeground Color |
---|
| 958 | +TabbedPane.unselectedTabHighlight Color |
---|
| 959 | +TabbedPane.unselectedTabShadow |
---|
| 960 | + */ |
---|
| 961 | +// ui.put("TabbedPane.contentAreaColor", new javax.swing.plaf.ColorUIResource(0,100,0)); |
---|
| 962 | + //ui.put("TabbedPane.selected", new javax.swing.plaf.ColorUIResource(200,0,200)); |
---|
| 963 | + |
---|
| 964 | + ui.put("TabbedPane.background", new javax.swing.plaf.ColorUIResource(150,150,150)); |
---|
| 965 | + ui.put("TabbedPane.foreground", new javax.swing.plaf.ColorUIResource(50,50,50)); |
---|
| 966 | + ui.put("TabbedPane.light", new javax.swing.plaf.ColorUIResource(255,255,255)); |
---|
| 967 | + ui.put("TabbedPane.selectedForeground", new javax.swing.plaf.ColorUIResource(0,0,0)); |
---|
| 968 | + ui.put("TabbedPane.selectHighlight", new javax.swing.plaf.ColorUIResource(255,255,255)); |
---|
| 969 | + ui.put("TabbedPane.darkShadow", new javax.swing.plaf.ColorUIResource(0,0,0)); |
---|
| 970 | + |
---|
| 971 | +// ui.put("TabbedPane.shadow", new javax.swing.plaf.ColorUIResource(200,0,0)); |
---|
| 972 | +// ui.put("TabbedPane.tabAreaBackground", new javax.swing.plaf.ColorUIResource(0,200,0)); |
---|
| 973 | +// ui.put("TabbedPane.unselectedBackground", new javax.swing.plaf.ColorUIResource(200,200,0)); |
---|
| 974 | +// ui.put("TabbedPane.unselectedTabBackground", new javax.swing.plaf.ColorUIResource(0,0,200)); |
---|
| 975 | +// ui.put("TabbedPane.unselectedTabForeground", new javax.swing.plaf.ColorUIResource(200,0,200)); |
---|
| 976 | +// ui.put("TabbedPane.unselectedTabHighlight", new javax.swing.plaf.ColorUIResource(0,200,200)); |
---|
| 977 | +// ui.put("TabbedPane.unselectedTabShadow", new javax.swing.plaf.ColorUIResource(200,200,200)); |
---|
| 978 | + |
---|
| 979 | + ui.put("TabbedPane.textIconGap", 0); |
---|
| 980 | + ui.put("TabbedPane.contentBorderInsets", new javax.swing.plaf.InsetsUIResource(0,0,0,0)); |
---|
| 981 | + ui.put("TabbedPane.tabAreaInsets", new javax.swing.plaf.InsetsUIResource(1,1,0,0)); |
---|
| 982 | + ui.put("TabbedPane.tabInsets", new javax.swing.plaf.InsetsUIResource(0,8,0,0)); |
---|
| 983 | + |
---|
| 984 | + Object openIcon2 = ui.get("Tree.openIcon"); |
---|
| 985 | + |
---|
| 986 | + ui.put("Tree.openIcon", ObjEditor.GetIcon("icons/folderopen.png")); |
---|
| 987 | + ui.put("Tree.closedIcon", ObjEditor.GetIcon("icons/folderclose.png")); |
---|
| 988 | + ui.put("Tree.leafIcon", ObjEditor.GetIcon("icons/file.png")); |
---|
| 989 | + |
---|
942 | 990 | //javax.swing.plaf.metal.MetalIconFactory.getHorizontalSliderThumbIcon(). |
---|
943 | 991 | Object o = ui.get("Slider.horizontalThumbIcon"); |
---|
944 | 992 | |
---|
.. | .. |
---|
968 | 1016 | |
---|
969 | 1017 | //Monitor mon=MonitorFactory.start("myFirstMonitor"); |
---|
970 | 1018 | standAlone = true; |
---|
971 | | - grafreed = new Grafreed(); |
---|
| 1019 | + |
---|
| 1020 | + grafreed = new Grafreed(); |
---|
| 1021 | + |
---|
972 | 1022 | grafreed.materials = ReadGFD(grafreed.getClass().getClassLoader().getResourceAsStream("gfd/materials.gfd")); |
---|
973 | 1023 | |
---|
974 | 1024 | grafreed.universe = new cGroup(); |
---|
.. | .. |
---|
988 | 1038 | javax.swing.ToolTipManager.sharedInstance().setEnabled(Globals.TOOLTIPS); |
---|
989 | 1039 | } |
---|
990 | 1040 | |
---|
| 1041 | + static class CheckBox extends javax.swing.plaf.metal.MetalCheckBoxIcon |
---|
| 1042 | + { |
---|
| 1043 | + java.awt.image.BufferedImage image; |
---|
| 1044 | + |
---|
| 1045 | + CheckBox() |
---|
| 1046 | + { |
---|
| 1047 | + try |
---|
| 1048 | + { |
---|
| 1049 | + image = javax.imageio.ImageIO.read(ObjEditor.class.getClassLoader().getResourceAsStream("icons/checkbox.png")); |
---|
| 1050 | + } |
---|
| 1051 | + catch (Exception e) |
---|
| 1052 | + { |
---|
| 1053 | + } |
---|
| 1054 | + } |
---|
| 1055 | + |
---|
| 1056 | + protected void drawCheck(Component c, Graphics g, int x, int y) |
---|
| 1057 | + { |
---|
| 1058 | + super.drawCheck(c, g, x, y); |
---|
| 1059 | + } |
---|
| 1060 | + |
---|
| 1061 | + public void paintIcon(Component c, Graphics g, int x, int y) |
---|
| 1062 | + { |
---|
| 1063 | + g.drawImage(image, x-1, y-1, 19, 19, null); |
---|
| 1064 | + super.paintIcon(c, g, x+2, y+2); |
---|
| 1065 | + } |
---|
| 1066 | + } |
---|
| 1067 | + |
---|
991 | 1068 | static Object3D materials; |
---|
992 | 1069 | |
---|
993 | 1070 | static Object3D ReadGFD(java.io.InputStream istream) |
---|
.. | .. |
---|
1150 | 1227 | |
---|
1151 | 1228 | static public Object clone(Object o) |
---|
1152 | 1229 | { |
---|
| 1230 | + if (o instanceof Object3D) |
---|
| 1231 | + { |
---|
| 1232 | + assert(((Object3D)o).parent == null); |
---|
| 1233 | + } |
---|
| 1234 | + |
---|
1153 | 1235 | if (o == null) |
---|
1154 | 1236 | return null; |
---|
1155 | 1237 | |
---|