/*
* $Header: /cvs/j3dfly/J3dEditor/src/org/jdesktop/j3dedit/scenegrapheditor/sourcecontrol/spec/javax/media/j3d/Texture2D.java,v 1.1 2005/04/20 22:21:25 paulby Exp $
*
* Sun Public License Notice
*
* The contents of this file are subject to the Sun Public License Version
* 1.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is available at http://www.sun.com/
*
* The Original Code is the Java 3D(tm) Scene Graph Editor.
* The Initial Developer of the Original Code is Jan Becicka.
* Portions created by Jan Becicka are Copyright (C) 2002.
* All Rights Reserved.
*
* Contributor(s): Jan Becicka.
*
**/
package org.jdesktop.j3dedit.scenegrapheditor.sourcecontrol.spec.javax.media.j3d;
import com.sun.j3d.utils.image.TextureLoader;
import org.jdesktop.j3dedit.scenegrapheditor.sourcecontrol.NamePool;
import org.jdesktop.j3dedit.scenegrapheditor.sourcecontrol.BeanCodeGenerator;
/**
*
* @author Jan Becicka
* @version
*/
public class Texture2D extends BeanCodeGenerator {
private String filename;
public Texture2D(Object bean, NamePool naming) {
super(bean, naming);
}
/** creates setters e.g. <CODE>t.setTransform(..);</CODE>
*/
protected void createCustomizationCode() {
}
/** Override this method, if you want to create parametric constructor constr
*/
protected void createConstructionCode() {
StringBuffer buffer = new StringBuffer();
String textureLoaderClassName = TextureLoader.class.getName();
String textureLoaderName = naming.createName(TextureLoader.class);
String textureName = (String) naming.getObjectName(bean);
if (textureName != null) {
textureName = ((String) textureName).replace('\\', '/');
}
textureName = createIdentifier(textureName);
buffer.append(textureLoaderClassName + " " + textureLoaderName + " = new " + textureLoaderClassName +
"(" + '"' + textureName + '"'+ ", this);\n");
buffer.append(getFieldName() + " = (javax.media.j3d.Texture2D) " + textureLoaderName + ".getTexture();\n");
constructionCode= buffer.toString();
}
}
|