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
This commit is contained in:
parent
59857d7bc3
commit
3445985717
@ -12,7 +12,7 @@
|
|||||||
<file name="SetWireframe.xml" url="nbresloc:/com/jme3/gde/codepalette/scene/SetWireframe.xml">
|
<file name="SetWireframe.xml" url="nbresloc:/com/jme3/gde/codepalette/scene/SetWireframe.xml">
|
||||||
<attr name="position" intvalue="150"/>
|
<attr name="position" intvalue="150"/>
|
||||||
</file>
|
</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"/>
|
<attr name="position" intvalue="150"/>
|
||||||
</file>
|
</file>
|
||||||
<file name="ShinySphere.xml" url="nbresloc:/com/jme3/gde/codepalette/scene/ShinySphere.xml">
|
<file name="ShinySphere.xml" url="nbresloc:/com/jme3/gde/codepalette/scene/ShinySphere.xml">
|
||||||
|
@ -4,14 +4,14 @@
|
|||||||
|
|
||||||
<editor_palette_item version="1.0">
|
<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" />
|
<icon16 urlvalue="com/jme3/gde/core/sceneviewer/jme-logo.png" />
|
||||||
<icon32 urlvalue="com/jme3/gde/core/sceneviewer/jme-logo.png" />
|
<icon32 urlvalue="com/jme3/gde/core/sceneviewer/jme-logo.png" />
|
||||||
|
|
||||||
<inline-description>
|
<inline-description>
|
||||||
<display-name>BleedCube</display-name>
|
<display-name>ColoredCube</display-name>
|
||||||
<tooltip>Textured with color bleeding through</tooltip>
|
<tooltip>Plainly colored lit material</tooltip>
|
||||||
</inline-description>
|
</inline-description>
|
||||||
|
|
||||||
</editor_palette_item>
|
</editor_palette_item>
|
@ -40,15 +40,18 @@ import org.openide.text.ActiveEditorDrop;
|
|||||||
*
|
*
|
||||||
* @author normenhansen
|
* @author normenhansen
|
||||||
*/
|
*/
|
||||||
public class JmePaletteBleedCube implements ActiveEditorDrop {
|
public class JmePaletteColoredCube implements ActiveEditorDrop {
|
||||||
|
|
||||||
public JmePaletteBleedCube() {
|
public JmePaletteColoredCube() {
|
||||||
}
|
}
|
||||||
|
|
||||||
private String createBody() {
|
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;
|
return body;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean handleTransfer(JTextComponent targetComponent) {
|
public boolean handleTransfer(JTextComponent targetComponent) {
|
Loading…
x
Reference in New Issue
Block a user