本文整理汇总了Java中com.jme3.material.MatParam.getName方法的典型用法代码示例。如果您正苦于以下问题:Java MatParam.getName方法的具体用法?Java MatParam.getName怎么用?Java MatParam.getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jme3.material.MatParam
的用法示例。
在下文中一共展示了MatParam.getName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: convert
import com.jme3.material.MatParam; //导入方法依赖的package包/类
/**
* Convert the material parameter to editable property.
*
* @param param the material parameter.
* @param material the material.
* @return the editable property or null.
*/
@FXThread
private @Nullable EditableProperty<?, Material> convert(@NotNull final MatParam param,
@NotNull final Material material) {
final EditablePropertyType propertyType = convert(param.getVarType());
if (propertyType == null) {
return null;
}
return new SimpleProperty<>(propertyType, param.getName(), 0.1F, material,
object -> getParamValue(param, object),
(object, newValue) -> applyParam(param, object, newValue));
}
示例2: convert
import com.jme3.material.MatParam; //导入方法依赖的package包/类
/**
* Convert the material parameter to an editable property.
*
* @param param the material parameter.
* @param material the material.
* @param settings the settings.
* @return the editable property or null.
*/
@FXThread
private @Nullable EditableProperty<?, ?> convert(@NotNull final MatParam param, @NotNull final Material material,
@NotNull final MaterialSettings settings) {
final EditablePropertyType propertyType = convert(param.getVarType());
if (propertyType == null) {
return null;
}
return new SimpleProperty<>(propertyType, param.getName(), 0.1F, settings,
object -> getParamValue(param, material),
(object, newValue) -> applyParam(param, material, newValue));
}
示例3: MaterialProperty
import com.jme3.material.MatParam; //导入方法依赖的package包/类
public MaterialProperty(MatParam param) {
this.type = param.getVarType().name();
this.name = param.getName();
if (param.getValue() != null) {
try {
this.value = param.getValueAsString();
} catch (UnsupportedOperationException e) {
}
}
}
示例4: findMaterialParamName
import com.jme3.material.MatParam; //导入方法依赖的package包/类
public String findMaterialParamName(String[] names, VarType type, MaterialDef scope) {
for(String name2:names){
for(MatParam mp:scope.getMaterialParams()){
if(mp.getVarType()==type&&mp.getName().equalsIgnoreCase(name2)){ return mp.getName(); }
}
}
return null;
}
示例5: checkPackedTextureProps
import com.jme3.material.MatParam; //导入方法依赖的package包/类
/**
* Prompts user to save packed textures
*
* @param mat
* @param param
*/
private void checkPackedTextureProps(Material mat) {
Collection<MatParam> params = mat.getParams();
for (Iterator<MatParam> it = new ArrayList<MatParam>(params).iterator(); it.hasNext();) {
MatParam param = it.next();
MaterialProperty prop = new MaterialProperty(param);
if (prop.getValue() == null) {
switch (param.getVarType()) {
case Texture2D:
case Texture3D:
case TextureArray:
case TextureBuffer:
case TextureCubeMap:
try {
MatParamTexture texParam = mat.getTextureParam(param.getName());
Texture tex = texParam.getTextureValue();
Image img = tex.getImage();
if (img == null) {
logger.log(Level.INFO, "No image found");
return;
}
BufferedImage image = ImageToAwt.convert(img, false, false, 0);
ByteArrayOutputStream out = new ByteArrayOutputStream();
ImageWriter imgWrtr = ImageIO.getImageWritersByFormatName("png").next();
ImageOutputStream imgOutStrm;
imgOutStrm = ImageIO.createImageOutputStream(out);
imgWrtr.setOutput(imgOutStrm);
ImageWriteParam jpgWrtPrm = imgWrtr.getDefaultWriteParam();
imgWrtr.write(null, new IIOImage(image, null, null), jpgWrtPrm);
imgOutStrm.close();
out.close();
String texturePath = material.getName();
texturePath = "Textures/" + texturePath + "-" + param.getName() + ".png";
StoreTextureWizardWizardAction act = new StoreTextureWizardWizardAction(manager, out.toByteArray(), texturePath);
act.actionPerformed(null);
texturePath = act.getName();
TextureKey texKey = new TextureKey(texturePath);
TextureKey oldKey = (TextureKey)tex.getKey();
if(oldKey!=null){
Beans.copyProperties(texKey, oldKey);
}
//TODO: seems like flip is removed due to ImageToAwt
texKey.setFlipY(false);
Texture texture = manager.loadTexture(texKey);
MatParamTexture newParam = new MatParamTexture(texParam.getVarType(), texParam.getName(), texture, null);
materialParameters.put(newParam.getName(), new MaterialProperty(newParam));
} catch (Exception ex) {
Exceptions.printStackTrace(ex);
}
break;
default:
}
} else {
materialParameters.put(param.getName(), prop);
}
}
}
示例6: MaterialProperty
import com.jme3.material.MatParam; //导入方法依赖的package包/类
public MaterialProperty(MatParam param) {
this.type = param.getVarType().name();
this.name = param.getName();
Object obj = param.getValue();
this.value = param.getValueAsString();
}