Преглед изворни кода

Replaced depricated material example in Palette by a colored code sample snippet

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10722 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
roo..li пре 12 година
родитељ
комит
3445985717

+ 1 - 1
sdk/jme3-codepalette/src/com/jme3/gde/codepalette/layer.xml

@@ -12,7 +12,7 @@
             <file name="SetWireframe.xml" url="nbresloc:/com/jme3/gde/codepalette/scene/SetWireframe.xml">
                 <attr name="position" intvalue="150"/>
             </file>
-            <file name="BleedCube.xml" url="nbresloc:/com/jme3/gde/codepalette/scene/BleedCube.xml">
+            <file name="ColoredCube.xml" url="nbresloc:/com/jme3/gde/codepalette/scene/ColoredCube.xml">
                 <attr name="position" intvalue="150"/>
             </file>
             <file name="ShinySphere.xml" url="nbresloc:/com/jme3/gde/codepalette/scene/ShinySphere.xml">

+ 3 - 3
sdk/jme3-codepalette/src/com/jme3/gde/codepalette/scene/BleedCube.xml → sdk/jme3-codepalette/src/com/jme3/gde/codepalette/scene/ColoredCube.xml

@@ -4,14 +4,14 @@
 
 <editor_palette_item version="1.0">
 
-    <class name="com.jme3.gde.codepalette.scene.JmePaletteBleedCube" />
+    <class name="com.jme3.gde.codepalette.scene.JmePaletteColoredCube" />
 
     <icon16 urlvalue="com/jme3/gde/core/sceneviewer/jme-logo.png" />
     <icon32 urlvalue="com/jme3/gde/core/sceneviewer/jme-logo.png" />
 
     <inline-description>
-       <display-name>BleedCube</display-name>
-       <tooltip>Textured with color bleeding through</tooltip>
+       <display-name>ColoredCube</display-name>
+       <tooltip>Plainly colored lit material</tooltip>
     </inline-description>
 
 </editor_palette_item>

+ 6 - 3
sdk/jme3-codepalette/src/com/jme3/gde/codepalette/scene/JmePaletteBleedCube.java → sdk/jme3-codepalette/src/com/jme3/gde/codepalette/scene/JmePaletteColoredCube.java

@@ -40,15 +40,18 @@ import org.openide.text.ActiveEditorDrop;
  *
  * @author normenhansen
  */
-public class JmePaletteBleedCube implements ActiveEditorDrop {
+public class JmePaletteColoredCube implements ActiveEditorDrop {
 
-    public JmePaletteBleedCube() {
+    public JmePaletteColoredCube() {
     }
 
     private String createBody() {
 
-        String body = "    /** A cube with a color \"bleeding\" through  transparent texture. Uses Texture from jme3-test-data library! */ \n    Box boxshape4 = new Box(Vector3f.ZERO, 1f,1f,1f);\n    Geometry cube_leak = new Geometry(\"Bleed-through color cube\", boxshape4);\n    Material mat_tl = new Material(assetManager, \"Common/MatDefs/Misc/Unshaded.j3md\");\n    mat_tl.setTexture(\"ColorMap\", assetManager.loadTexture(\"Textures/ColoredTex/Monkey.png\"));\n    mat_tl.setColor(\"Color\", new ColorRGBA(1f,0f,1f, 1f)); // purple\n    cube_leak.setMaterial(mat_tl);\n    rootNode.attachChild(cube_leak); ";
+        String body = "/* A colored lit cube. Needs light source! */ \n    Box boxMesh = new Box(1f,1f,1f); \n    Geometry boxGeo = new Geometry(\"Colored Box\", boxMesh); \n    Material boxMat = new Material(assetManager, \"Common/MatDefs/Light/Lighting.j3md\"); \n    boxMat.setBoolean(\"UseMaterialColors\", true); \n    boxMat.setColor(\"Ambient\", ColorRGBA.Green); \n    boxMat.setColor(\"Diffuse\", ColorRGBA.Green); \n    boxGeo.setMaterial(boxMat); \n     rootNode.attachChild(boxGeo);";
         return body;
+        
+    
+    
     }
 
     public boolean handleTransfer(JTextComponent targetComponent) {