Checker.java | ●●●●● patch | view | raw | blame | history | |
Composite.java | ●●●●● patch | view | raw | blame | history | |
Grafreed.java | ●●●●● patch | view | raw | blame | history | |
GroupEditor.java | ●●●●● patch | view | raw | blame | history | |
ObjEditor.java | ●●●●● patch | view | raw | blame | history | |
cButton.java | ●●●●● patch | view | raw | blame | history | |
cToggleButton.java | ●●●●● patch | view | raw | blame | history | |
icons/white-sphere-icon.png | patch | view | raw | blame | history |
Checker.java
.. .. @@ -11,10 +11,13 @@ 11 11 12 12 material = new cMaterial(); 13 13 14 - material.ambient = 100;14 + material.ambient = 1;15 15 material.specular = 0.001f; 16 16 material.diffuse = 0.01f; 17 17 material.cameralight = 0.001f; 18 + material.opacity = 0.5f;19 +20 + flipV = true;18 21 } 19 22 20 23 Object3D deepCopy() Composite.java
.. .. @@ -401,7 +401,6 @@ 401 401 { 402 402 child = (Object3D) e.nextElement(); 403 403 } 404 -405 404 } 406 405 407 406 void createEditWindow(GroupEditor callee, boolean newWindow) //, boolean root) Grafreed.java
.. .. @@ -5,6 +5,7 @@ 5 5 6 6 import java.io.*; 7 7 8 +import java.util.ArrayList;8 9 import javax.swing.UIManager; 9 10 import javax.swing.plaf.metal.MetalLookAndFeel; 10 11 import javax.swing.plaf.ColorUIResource; .. .. @@ -15,7 +16,7 @@ 15 16 //import com.jamonapi.*; 16 17 public class Grafreed extends Applet implements ActionListener 17 18 { 18 - static boolean NIMBUSLAF = true;19 + static boolean NIMBUSLAF = false; // true;19 20 20 21 static int RENDERME = 0; 21 22 .. .. @@ -898,6 +899,13 @@ 898 899 //UIManager.setLookAndFeel("com.apple.laf.AquaLookAndFeel"); 899 900 //UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel"); 900 901 //UIManager.put("nimbusBase", new Color(0,0,0)); 902 +903 + javax.swing.UIDefaults ui = UIManager.getDefaults();904 + for (java.util.Enumeration e = ui.keys(); e.hasMoreElements();)905 + {906 + Object key = e.nextElement();907 + System.out.println(key + " --> " + ui.get(key));908 + }901 909 } 902 910 catch (Exception e) 903 911 { .. .. @@ -907,12 +915,49 @@ 907 915 { 908 916 try 909 917 { 910 - MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());911 - MetalLookAndFeel.setCurrentTheme(new Theme(Constants.yellowTheme));918 + //Object o = UIManager.getInstalledLookAndFeels();919 +920 + MetalLookAndFeel.setCurrentTheme(new javax.swing.plaf.metal.DefaultMetalTheme());921 + //MetalLookAndFeel.setCurrentTheme(new Theme(Constants.yellowTheme));922 + //UIManager.put("ScrollBar.background", new javax.swing.plaf.ColorUIResource(100,0,0));912 923 UIManager.setLookAndFeel(new MetalLookAndFeel()); 913 924 //UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"); 914 925 //UIManager.setLookAndFeel("com.apple.laf.AquaLookAndFeel"); 926 + //UIManager.setLookAndFeel("javax.swing.plaf.nimbus.NimbusLookAndFeel");915 927 //UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel"); 928 +929 + javax.swing.UIDefaults ui = UIManager.getDefaults();930 + ArrayList gradient = new java.util.ArrayList(5);931 + gradient.add(1.0);932 + gradient.add(0.0);933 + gradient.add(new javax.swing.plaf.ColorUIResource(255,255,255));934 + gradient.add(new javax.swing.plaf.ColorUIResource(192,192,192));935 + gradient.add(new javax.swing.plaf.ColorUIResource(0,0,0));936 +937 + ui.put("Button.gradient", gradient);938 + ui.put("TabbedPane.tabInsets", new javax.swing.plaf.InsetsUIResource(0,8,0,0));939 + ui.put("Slider.foreground", new javax.swing.plaf.ColorUIResource(0,0,0));940 + ui.put("Slider.horizontalThumbIcon", ObjEditor.GetIcon("icons/white-sphere-icon.png"));941 +942 + //javax.swing.plaf.metal.MetalIconFactory.getHorizontalSliderThumbIcon().943 + Object o = ui.get("Slider.horizontalThumbIcon");944 +945 + gradient = new java.util.ArrayList(5);946 + gradient.add(1.0);947 + gradient.add(0.0);948 + gradient.add(new javax.swing.plaf.ColorUIResource(192,192,192));949 + gradient.add(new javax.swing.plaf.ColorUIResource(255,255,255));950 + gradient.add(new javax.swing.plaf.ColorUIResource(0,0,0));951 +952 + ui.put("ToggleButton.gradient", gradient);953 + //ui.put("Button[MouseOver].backgroundPainter", new com.sun.java.swing.plaf.nimbus.ButtonPainter());954 + //ui.put("Button.highlight", new javax.swing.plaf.ColorUIResource(155,155,155));955 +956 + for (java.util.Enumeration e = ui.keys(); e.hasMoreElements();)957 + {958 + Object key = e.nextElement();959 + //System.out.println(key + " --> " + ui.get(key));960 + }916 961 } catch (Exception e) 917 962 { 918 963 } GroupEditor.java
.. .. @@ -1040,7 +1040,7 @@ 1040 1040 */ 1041 1041 cGridBag copyOptionsPanel = new cGridBag(); 1042 1042 1043 - copyOptionsPanel.preferredHeight = 2;1043 + copyOptionsPanel.preferredHeight = 3;1044 1044 1045 1045 //this.AddOptions(oe.toolbarPanel, oe.aConstraints); 1046 1046 .. .. @@ -1323,7 +1323,7 @@ 1323 1323 oe.treePanel.Return(); 1324 1324 cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); 1325 1325 versionSlider = (cNumberSlider)sliderPane.getComponent(1); 1326 - sliderPane.preferredHeight = 1;1326 + sliderPane.preferredHeight = 2;1327 1327 1328 1328 // mainPanel.setDividerLocation(0.1); //1.0); 1329 1329 mainPanel.setResizeWeight(0.4); ObjEditor.java
.. .. @@ -106,7 +106,7 @@ 106 106 107 107 static java.util.Hashtable<String, javax.swing.ImageIcon> icons = new java.util.Hashtable<String, javax.swing.ImageIcon>(); 108 108 109 - ImageIcon GetIcon(String name)109 + static ImageIcon GetIcon(String name)110 110 { 111 111 javax.swing.ImageIcon iconCache = icons.get(name); 112 112 if (iconCache != null) .. .. @@ -116,7 +116,7 @@ 116 116 117 117 try 118 118 { 119 - BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name));119 + BufferedImage image = javax.imageio.ImageIO.read(ObjEditor.class.getClassLoader().getResourceAsStream(name));120 120 121 121 // if (image.getWidth() > 48 && image.getHeight() > 48) 122 122 // { .. .. @@ -1715,7 +1715,7 @@ 1715 1715 scrollpane.addMouseWheelListener(this); // Default not fast enough 1716 1716 1717 1717 /*JTabbedPane*/ scenePanel = new cGridBag(); 1718 - scenePanel.preferredWidth = 5;1718 + scenePanel.preferredWidth = 6;1719 1719 1720 1720 JTabbedPane tabbedPane = new JTabbedPane(); 1721 1721 tabbedPane.add(scrollpane); .. .. @@ -4738,6 +4738,12 @@ 4738 4738 // else 4739 4739 // applySelf(true); 4740 4740 // } 4741 +4742 + boolean Equal(double a, double b)4743 + {4744 + return Math.abs(a - b) < 0.001;4745 + }4746 +4741 4747 void applySelf0(boolean name) 4742 4748 { 4743 4749 if (name) .. .. @@ -4787,29 +4793,52 @@ 4787 4793 { 4788 4794 cMaterial mat = copy.material; 4789 4795 4790 - colorField.SetToolTipValue((mat.color));4791 - saturationField.SetToolTipValue((mat.modulation));4792 - metalnessField.SetToolTipValue((mat.metalness));4793 - diffuseField.SetToolTipValue((mat.diffuse));4794 - specularField.SetToolTipValue((mat.specular));4795 - shininessField.SetToolTipValue((mat.shininess));4796 - shiftField.SetToolTipValue((mat.shift));4797 - ambientField.SetToolTipValue((mat.ambient));4798 - lightareaField.SetToolTipValue((mat.lightarea));4799 - diffusenessField.SetToolTipValue((mat.factor));4800 - velvetField.SetToolTipValue((mat.velvet));4801 - sheenField.SetToolTipValue((mat.sheen));4802 - subsurfaceField.SetToolTipValue((mat.subsurface));4803 - backlitField.SetToolTipValue((mat.bump));4804 - anisoField.SetToolTipValue((mat.aniso));4805 - anisoVField.SetToolTipValue((mat.anisoV));4806 - cameraField.SetToolTipValue((mat.cameralight));4807 - selfshadowField.SetToolTipValue((mat.diffuseness));4808 - shadowField.SetToolTipValue((mat.shadow));4809 - textureField.SetToolTipValue((mat.texture));4810 - opacityField.SetToolTipValue((mat.opacity));4811 - fakedepthField.SetToolTipValue((mat.fakedepth));4812 - shadowbiasField.SetToolTipValue((mat.shadowbias));4796 + if (!Equal(colorField.getFloat(), mat.color))4797 + colorField.SetToolTipValue((mat.color));4798 + if (!Equal(saturationField.getFloat(), mat.modulation))4799 + saturationField.SetToolTipValue((mat.modulation));4800 + if (!Equal(metalnessField.getFloat(), mat.metalness))4801 + metalnessField.SetToolTipValue((mat.metalness));4802 + if (!Equal(diffuseField.getFloat(), mat.diffuse))4803 + diffuseField.SetToolTipValue((mat.diffuse));4804 + if (!Equal(specularField.getFloat(), mat.specular))4805 + specularField.SetToolTipValue((mat.specular));4806 + if (!Equal(shininessField.getFloat(), mat.shininess))4807 + shininessField.SetToolTipValue((mat.shininess));4808 + if (!Equal(shiftField.getFloat(), mat.shift))4809 + shiftField.SetToolTipValue((mat.shift));4810 + if (!Equal(ambientField.getFloat(), mat.ambient))4811 + ambientField.SetToolTipValue((mat.ambient));4812 + if (!Equal(lightareaField.getFloat(), mat.lightarea))4813 + lightareaField.SetToolTipValue((mat.lightarea));4814 + if (!Equal(diffusenessField.getFloat(), mat.factor))4815 + diffusenessField.SetToolTipValue((mat.factor));4816 + if (!Equal(velvetField.getFloat(), mat.velvet))4817 + velvetField.SetToolTipValue((mat.velvet));4818 + if (!Equal(sheenField.getFloat(), mat.sheen))4819 + sheenField.SetToolTipValue((mat.sheen));4820 + if (!Equal(subsurfaceField.getFloat(), mat.subsurface))4821 + subsurfaceField.SetToolTipValue((mat.subsurface));4822 + if (!Equal(backlitField.getFloat(), mat.bump))4823 + backlitField.SetToolTipValue((mat.bump));4824 + if (!Equal(anisoField.getFloat(), mat.aniso))4825 + anisoField.SetToolTipValue((mat.aniso));4826 + if (!Equal(anisoVField.getFloat(), mat.anisoV))4827 + anisoVField.SetToolTipValue((mat.anisoV));4828 + if (!Equal(cameraField.getFloat(), mat.cameralight))4829 + cameraField.SetToolTipValue((mat.cameralight));4830 + if (!Equal(selfshadowField.getFloat(), mat.diffuseness))4831 + selfshadowField.SetToolTipValue((mat.diffuseness));4832 + if (!Equal(shadowField.getFloat(), mat.shadow))4833 + shadowField.SetToolTipValue((mat.shadow));4834 + if (!Equal(textureField.getFloat(), mat.texture))4835 + textureField.SetToolTipValue((mat.texture));4836 + if (!Equal(opacityField.getFloat(), mat.opacity))4837 + opacityField.SetToolTipValue((mat.opacity));4838 + if (!Equal(fakedepthField.getFloat(), mat.fakedepth))4839 + fakedepthField.SetToolTipValue((mat.fakedepth));4840 + if (!Equal(shadowbiasField.getFloat(), mat.shadowbias))4841 + shadowbiasField.SetToolTipValue((mat.shadowbias));4813 4842 } 4814 4843 4815 4844 if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null) cButton.java
.. .. @@ -26,7 +26,7 @@ 26 26 { 27 27 super(icon); 28 28 29 - setMargin(new java.awt.Insets(-1, -1, -1, -1));29 + setMargin(new java.awt.Insets(1, 10, 1, 10)); // ??30 30 31 31 //result = new JButton( icon ); 32 32 //result.setBorderPainted( false ); cToggleButton.java
.. .. @@ -37,7 +37,7 @@ 37 37 //if (getWidth() > image.getWidth(null) + 8) 38 38 { 39 39 g.drawImage(image, this.getWidth()/2 - 12, this.getHeight()/2 - 12, this); 40 - g.drawRect(0, 0, this.getWidth()-1, this.getHeight()-1);40 + g.drawRect(2, 2, this.getWidth()-5, this.getHeight()-5);41 41 } 42 42 } 43 43 } icons/white-sphere-icon.pngBinary files differ