SDK :
- Used DDSPreview in material editor - Added support for texture3D and CubeMaps to material editor git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8015 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
e89d38df6f
commit
d591ae968e
@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
|
<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
|
||||||
<!-- for some information on what you could do (e.g. targets to override). -->
|
<!-- for some information on what you could do (e.g. targets to override). -->
|
||||||
<!-- If you delete this file and reopen the project it will be recreated. -->
|
<!-- If you delete this file and reopen the project it will be recreated. -->
|
||||||
<project name="com.jme3.gde.materials" default="netbeans" basedir=".">
|
<project name="com.jme3.gde.materials" default="netbeans" basedir=".">
|
||||||
<description>Builds, tests, and runs the project com.jme3.gde.materials.</description>
|
<description>Builds, tests, and runs the project com.jme3.gde.materials.</description>
|
||||||
<import file="nbproject/build-impl.xml"/>
|
<import file="nbproject/build-impl.xml"/>
|
||||||
</project>
|
</project>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
Manifest-Version: 1.0
|
Manifest-Version: 1.0
|
||||||
OpenIDE-Module: com.jme3.gde.materials/1
|
OpenIDE-Module: com.jme3.gde.materials/1
|
||||||
OpenIDE-Module-Implementation-Version: 0
|
OpenIDE-Module-Implementation-Version: 0
|
||||||
OpenIDE-Module-Layer: com/jme3/gde/materials/layer.xml
|
OpenIDE-Module-Layer: com/jme3/gde/materials/layer.xml
|
||||||
OpenIDE-Module-Localizing-Bundle: com/jme3/gde/materials/Bundle.properties
|
OpenIDE-Module-Localizing-Bundle: com/jme3/gde/materials/Bundle.properties
|
||||||
|
|
||||||
|
@ -1,45 +1,45 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!--
|
<!--
|
||||||
*** GENERATED FROM project.xml - DO NOT EDIT ***
|
*** GENERATED FROM project.xml - DO NOT EDIT ***
|
||||||
*** EDIT ../build.xml INSTEAD ***
|
*** EDIT ../build.xml INSTEAD ***
|
||||||
-->
|
-->
|
||||||
<project name="com.jme3.gde.materials-impl" basedir="..">
|
<project name="com.jme3.gde.materials-impl" basedir="..">
|
||||||
<fail message="Please build using Ant 1.7.1 or higher.">
|
<fail message="Please build using Ant 1.7.1 or higher.">
|
||||||
<condition>
|
<condition>
|
||||||
<not>
|
<not>
|
||||||
<antversion atleast="1.7.1"/>
|
<antversion atleast="1.7.1"/>
|
||||||
</not>
|
</not>
|
||||||
</condition>
|
</condition>
|
||||||
</fail>
|
</fail>
|
||||||
<property file="nbproject/private/suite-private.properties"/>
|
<property file="nbproject/private/suite-private.properties"/>
|
||||||
<property file="nbproject/suite.properties"/>
|
<property file="nbproject/suite.properties"/>
|
||||||
<fail unless="suite.dir">You must set 'suite.dir' to point to your containing module suite</fail>
|
<fail unless="suite.dir">You must set 'suite.dir' to point to your containing module suite</fail>
|
||||||
<property file="${suite.dir}/nbproject/private/platform-private.properties"/>
|
<property file="${suite.dir}/nbproject/private/platform-private.properties"/>
|
||||||
<property file="${suite.dir}/nbproject/platform.properties"/>
|
<property file="${suite.dir}/nbproject/platform.properties"/>
|
||||||
<macrodef name="property" uri="http://www.netbeans.org/ns/nb-module-project/2">
|
<macrodef name="property" uri="http://www.netbeans.org/ns/nb-module-project/2">
|
||||||
<attribute name="name"/>
|
<attribute name="name"/>
|
||||||
<attribute name="value"/>
|
<attribute name="value"/>
|
||||||
<sequential>
|
<sequential>
|
||||||
<property name="@{name}" value="${@{value}}"/>
|
<property name="@{name}" value="${@{value}}"/>
|
||||||
</sequential>
|
</sequential>
|
||||||
</macrodef>
|
</macrodef>
|
||||||
<macrodef name="evalprops" uri="http://www.netbeans.org/ns/nb-module-project/2">
|
<macrodef name="evalprops" uri="http://www.netbeans.org/ns/nb-module-project/2">
|
||||||
<attribute name="property"/>
|
<attribute name="property"/>
|
||||||
<attribute name="value"/>
|
<attribute name="value"/>
|
||||||
<sequential>
|
<sequential>
|
||||||
<property name="@{property}" value="@{value}"/>
|
<property name="@{property}" value="@{value}"/>
|
||||||
</sequential>
|
</sequential>
|
||||||
</macrodef>
|
</macrodef>
|
||||||
<property file="${user.properties.file}"/>
|
<property file="${user.properties.file}"/>
|
||||||
<nbmproject2:property name="harness.dir" value="nbplatform.${nbplatform.active}.harness.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
|
<nbmproject2:property name="harness.dir" value="nbplatform.${nbplatform.active}.harness.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
|
||||||
<nbmproject2:property name="nbplatform.active.dir" value="nbplatform.${nbplatform.active}.netbeans.dest.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
|
<nbmproject2:property name="nbplatform.active.dir" value="nbplatform.${nbplatform.active}.netbeans.dest.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
|
||||||
<nbmproject2:evalprops property="cluster.path.evaluated" value="${cluster.path}" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
|
<nbmproject2:evalprops property="cluster.path.evaluated" value="${cluster.path}" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
|
||||||
<fail message="Path to 'platform' cluster missing in $${cluster.path} property or using corrupt Netbeans Platform (missing harness).">
|
<fail message="Path to 'platform' cluster missing in $${cluster.path} property or using corrupt Netbeans Platform (missing harness).">
|
||||||
<condition>
|
<condition>
|
||||||
<not>
|
<not>
|
||||||
<contains string="${cluster.path.evaluated}" substring="platform"/>
|
<contains string="${cluster.path.evaluated}" substring="platform"/>
|
||||||
</not>
|
</not>
|
||||||
</condition>
|
</condition>
|
||||||
</fail>
|
</fail>
|
||||||
<import file="${harness.dir}/build.xml"/>
|
<import file="${harness.dir}/build.xml"/>
|
||||||
</project>
|
</project>
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
build.xml.data.CRC32=6e7dc984
|
build.xml.data.CRC32=6e7dc984
|
||||||
build.xml.script.CRC32=f284e28d
|
build.xml.script.CRC32=f284e28d
|
||||||
build.xml.stylesheet.CRC32=a56c6a5b@1.42.2
|
build.xml.stylesheet.CRC32=a56c6a5b@2.45
|
||||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||||
nbproject/build-impl.xml.data.CRC32=6e7dc984
|
nbproject/build-impl.xml.data.CRC32=6e7dc984
|
||||||
nbproject/build-impl.xml.script.CRC32=56cee44d
|
nbproject/build-impl.xml.script.CRC32=56cee44d
|
||||||
nbproject/build-impl.xml.stylesheet.CRC32=238281d1@1.42.2
|
nbproject/build-impl.xml.stylesheet.CRC32=238281d1@2.45
|
||||||
|
@ -1,140 +1,140 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project xmlns="http://www.netbeans.org/ns/project/1">
|
<project xmlns="http://www.netbeans.org/ns/project/1">
|
||||||
<type>org.netbeans.modules.apisupport.project</type>
|
<type>org.netbeans.modules.apisupport.project</type>
|
||||||
<configuration>
|
<configuration>
|
||||||
<data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
|
<data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
|
||||||
<code-name-base>com.jme3.gde.materials</code-name-base>
|
<code-name-base>com.jme3.gde.materials</code-name-base>
|
||||||
<suite-component/>
|
<suite-component/>
|
||||||
<module-dependencies>
|
<module-dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<code-name-base>com.jme3.gde.core</code-name-base>
|
<code-name-base>com.jme3.gde.core</code-name-base>
|
||||||
<build-prerequisite/>
|
<build-prerequisite/>
|
||||||
<compile-dependency/>
|
<compile-dependency/>
|
||||||
<run-dependency>
|
<run-dependency>
|
||||||
<release-version>1</release-version>
|
<release-version>1</release-version>
|
||||||
<specification-version>0.12.1</specification-version>
|
<specification-version>0.12.1</specification-version>
|
||||||
</run-dependency>
|
</run-dependency>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<code-name-base>com.jme3.gde.core.baselibs</code-name-base>
|
<code-name-base>com.jme3.gde.core.baselibs</code-name-base>
|
||||||
<build-prerequisite/>
|
<build-prerequisite/>
|
||||||
<compile-dependency/>
|
<compile-dependency/>
|
||||||
<run-dependency>
|
<run-dependency>
|
||||||
<release-version>1</release-version>
|
<release-version>1</release-version>
|
||||||
<specification-version>0.5</specification-version>
|
<specification-version>0.5</specification-version>
|
||||||
</run-dependency>
|
</run-dependency>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<code-name-base>com.jme3.gde.core.libraries</code-name-base>
|
<code-name-base>com.jme3.gde.core.libraries</code-name-base>
|
||||||
<build-prerequisite/>
|
<build-prerequisite/>
|
||||||
<compile-dependency/>
|
<compile-dependency/>
|
||||||
<run-dependency>
|
<run-dependency>
|
||||||
<release-version>1</release-version>
|
<release-version>1</release-version>
|
||||||
<specification-version>0.5</specification-version>
|
<specification-version>0.5</specification-version>
|
||||||
</run-dependency>
|
</run-dependency>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<code-name-base>org.netbeans.core.multiview</code-name-base>
|
<code-name-base>org.netbeans.core.multiview</code-name-base>
|
||||||
<build-prerequisite/>
|
<build-prerequisite/>
|
||||||
<compile-dependency/>
|
<compile-dependency/>
|
||||||
<run-dependency>
|
<run-dependency>
|
||||||
<release-version>1</release-version>
|
<release-version>1</release-version>
|
||||||
<specification-version>1.16.1</specification-version>
|
<specification-version>1.16.1</specification-version>
|
||||||
</run-dependency>
|
</run-dependency>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<code-name-base>org.netbeans.modules.settings</code-name-base>
|
<code-name-base>org.netbeans.modules.settings</code-name-base>
|
||||||
<build-prerequisite/>
|
<build-prerequisite/>
|
||||||
<compile-dependency/>
|
<compile-dependency/>
|
||||||
<run-dependency>
|
<run-dependency>
|
||||||
<release-version>1</release-version>
|
<release-version>1</release-version>
|
||||||
<specification-version>1.22.1.1</specification-version>
|
<specification-version>1.22.1.1</specification-version>
|
||||||
</run-dependency>
|
</run-dependency>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<code-name-base>org.openide.actions</code-name-base>
|
<code-name-base>org.openide.actions</code-name-base>
|
||||||
<build-prerequisite/>
|
<build-prerequisite/>
|
||||||
<compile-dependency/>
|
<compile-dependency/>
|
||||||
<run-dependency>
|
<run-dependency>
|
||||||
<specification-version>6.12.1.1</specification-version>
|
<specification-version>6.12.1.1</specification-version>
|
||||||
</run-dependency>
|
</run-dependency>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<code-name-base>org.openide.awt</code-name-base>
|
<code-name-base>org.openide.awt</code-name-base>
|
||||||
<build-prerequisite/>
|
<build-prerequisite/>
|
||||||
<compile-dependency/>
|
<compile-dependency/>
|
||||||
<run-dependency>
|
<run-dependency>
|
||||||
<specification-version>7.19.1.1</specification-version>
|
<specification-version>7.19.1.1</specification-version>
|
||||||
</run-dependency>
|
</run-dependency>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<code-name-base>org.openide.dialogs</code-name-base>
|
<code-name-base>org.openide.dialogs</code-name-base>
|
||||||
<build-prerequisite/>
|
<build-prerequisite/>
|
||||||
<compile-dependency/>
|
<compile-dependency/>
|
||||||
<run-dependency>
|
<run-dependency>
|
||||||
<specification-version>7.13.1</specification-version>
|
<specification-version>7.13.1</specification-version>
|
||||||
</run-dependency>
|
</run-dependency>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<code-name-base>org.openide.filesystems</code-name-base>
|
<code-name-base>org.openide.filesystems</code-name-base>
|
||||||
<build-prerequisite/>
|
<build-prerequisite/>
|
||||||
<compile-dependency/>
|
<compile-dependency/>
|
||||||
<run-dependency>
|
<run-dependency>
|
||||||
<specification-version>7.32.1.1.1</specification-version>
|
<specification-version>7.32.1.1.1</specification-version>
|
||||||
</run-dependency>
|
</run-dependency>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<code-name-base>org.openide.loaders</code-name-base>
|
<code-name-base>org.openide.loaders</code-name-base>
|
||||||
<build-prerequisite/>
|
<build-prerequisite/>
|
||||||
<compile-dependency/>
|
<compile-dependency/>
|
||||||
<run-dependency>
|
<run-dependency>
|
||||||
<specification-version>7.10.1</specification-version>
|
<specification-version>7.10.1</specification-version>
|
||||||
</run-dependency>
|
</run-dependency>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<code-name-base>org.openide.nodes</code-name-base>
|
<code-name-base>org.openide.nodes</code-name-base>
|
||||||
<build-prerequisite/>
|
<build-prerequisite/>
|
||||||
<compile-dependency/>
|
<compile-dependency/>
|
||||||
<run-dependency>
|
<run-dependency>
|
||||||
<specification-version>7.12.1.1</specification-version>
|
<specification-version>7.12.1.1</specification-version>
|
||||||
</run-dependency>
|
</run-dependency>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<code-name-base>org.openide.text</code-name-base>
|
<code-name-base>org.openide.text</code-name-base>
|
||||||
<build-prerequisite/>
|
<build-prerequisite/>
|
||||||
<compile-dependency/>
|
<compile-dependency/>
|
||||||
<run-dependency>
|
<run-dependency>
|
||||||
<specification-version>6.27.1</specification-version>
|
<specification-version>6.27.1</specification-version>
|
||||||
</run-dependency>
|
</run-dependency>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<code-name-base>org.openide.util</code-name-base>
|
<code-name-base>org.openide.util</code-name-base>
|
||||||
<build-prerequisite/>
|
<build-prerequisite/>
|
||||||
<compile-dependency/>
|
<compile-dependency/>
|
||||||
<run-dependency>
|
<run-dependency>
|
||||||
<specification-version>7.31.2.1</specification-version>
|
<specification-version>7.31.2.1</specification-version>
|
||||||
</run-dependency>
|
</run-dependency>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<code-name-base>org.openide.util.lookup</code-name-base>
|
<code-name-base>org.openide.util.lookup</code-name-base>
|
||||||
<build-prerequisite/>
|
<build-prerequisite/>
|
||||||
<compile-dependency/>
|
<compile-dependency/>
|
||||||
<run-dependency>
|
<run-dependency>
|
||||||
<specification-version>8.3.1</specification-version>
|
<specification-version>8.3.1</specification-version>
|
||||||
</run-dependency>
|
</run-dependency>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<code-name-base>org.openide.windows</code-name-base>
|
<code-name-base>org.openide.windows</code-name-base>
|
||||||
<build-prerequisite/>
|
<build-prerequisite/>
|
||||||
<compile-dependency/>
|
<compile-dependency/>
|
||||||
<run-dependency>
|
<run-dependency>
|
||||||
<specification-version>6.30.1</specification-version>
|
<specification-version>6.30.1</specification-version>
|
||||||
</run-dependency>
|
</run-dependency>
|
||||||
</dependency>
|
</dependency>
|
||||||
</module-dependencies>
|
</module-dependencies>
|
||||||
<public-packages>
|
<public-packages>
|
||||||
<package>com.jme3.gde.materials</package>
|
<package>com.jme3.gde.materials</package>
|
||||||
</public-packages>
|
</public-packages>
|
||||||
</data>
|
</data>
|
||||||
</configuration>
|
</configuration>
|
||||||
</project>
|
</project>
|
||||||
|
@ -27,6 +27,7 @@ import java.util.List;
|
|||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
import javax.swing.JComponent;
|
||||||
import javax.swing.event.DocumentEvent;
|
import javax.swing.event.DocumentEvent;
|
||||||
import javax.swing.event.DocumentListener;
|
import javax.swing.event.DocumentListener;
|
||||||
import org.openide.loaders.DataObjectNotFoundException;
|
import org.openide.loaders.DataObjectNotFoundException;
|
||||||
@ -101,15 +102,10 @@ public final class MaterialEditorTopComponent extends CloneableTopComponent impl
|
|||||||
materialPreviewWidget1.showMaterial(manager, materialFileName);
|
materialPreviewWidget1.showMaterial(manager, materialFileName);
|
||||||
|
|
||||||
relativeMaterialFileName = manager.getRelativeAssetPath(materialFileName);
|
relativeMaterialFileName = manager.getRelativeAssetPath(materialFileName);
|
||||||
for (Iterator it = WindowManager.getDefault().getModes().iterator(); it.hasNext();) {
|
|
||||||
Mode mode = (Mode) it.next();
|
|
||||||
System.out.println(mode.getName());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** This method is called from within the constructor to
|
/** This method is called from within the constructor to
|
||||||
* initialize the form.
|
* initialize the form.
|
||||||
* WARNING: Do NOT modify this code. The content of this method is
|
* WARNING: Do NOT modify this code. The content of this method is
|
||||||
@ -337,7 +333,6 @@ public final class MaterialEditorTopComponent extends CloneableTopComponent impl
|
|||||||
private void jCheckBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox1ActionPerformed
|
private void jCheckBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox1ActionPerformed
|
||||||
saveImmediate = jCheckBox1.isSelected();
|
saveImmediate = jCheckBox1.isSelected();
|
||||||
}//GEN-LAST:event_jCheckBox1ActionPerformed
|
}//GEN-LAST:event_jCheckBox1ActionPerformed
|
||||||
|
|
||||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
private javax.swing.JCheckBox jCheckBox1;
|
private javax.swing.JCheckBox jCheckBox1;
|
||||||
private javax.swing.JComboBox jComboBox1;
|
private javax.swing.JComboBox jComboBox1;
|
||||||
@ -416,8 +411,16 @@ public final class MaterialEditorTopComponent extends CloneableTopComponent impl
|
|||||||
@Override
|
@Override
|
||||||
public void componentClosed() {
|
public void componentClosed() {
|
||||||
materialPreviewWidget1.cleanUp();
|
materialPreviewWidget1.cleanUp();
|
||||||
|
for (int i = 0; i < texturePanel.getComponentCount(); i++) {
|
||||||
|
Component c = texturePanel.getComponent(i);
|
||||||
|
if (c instanceof MaterialPropertyWidget) {
|
||||||
|
((MaterialPropertyWidget) c).cleanUp();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
clearMaterialChangeListeners();
|
clearMaterialChangeListeners();
|
||||||
SceneExplorerTopComponent.getDefault().removeMaterialChangeProvider(this);
|
SceneExplorerTopComponent.getDefault().removeMaterialChangeProvider(this);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void writeProperties(java.util.Properties p) {
|
void writeProperties(java.util.Properties p) {
|
||||||
@ -568,7 +571,7 @@ public final class MaterialEditorTopComponent extends CloneableTopComponent impl
|
|||||||
widget.registerChangeListener(this);
|
widget.registerChangeListener(this);
|
||||||
if ("Boolean".equals(entry.getValue().getType())) {
|
if ("Boolean".equals(entry.getValue().getType())) {
|
||||||
optionList.add(widget);
|
optionList.add(widget);
|
||||||
} else if ("Texture2D".equals(entry.getValue().getType())) {
|
} else if (entry.getValue().getType().indexOf("Texture") >= 0) {
|
||||||
textureList.add(widget);
|
textureList.add(widget);
|
||||||
} else if ("Color".equals(entry.getValue().getType())) {
|
} else if ("Color".equals(entry.getValue().getType())) {
|
||||||
colorList.add(widget);
|
colorList.add(widget);
|
||||||
|
@ -41,5 +41,9 @@ public abstract class MaterialPropertyWidget extends JPanel{
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected abstract void readProperty();
|
protected abstract void readProperty();
|
||||||
|
|
||||||
|
public void cleanUp(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -75,9 +75,9 @@
|
|||||||
</Group>
|
</Group>
|
||||||
<Group type="103" rootIndex="1" groupAlignment="0" attributes="0">
|
<Group type="103" rootIndex="1" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" attributes="0">
|
<Group type="102" attributes="0">
|
||||||
<EmptySpace min="0" pref="41" max="32767" attributes="0"/>
|
<EmptySpace min="0" pref="78" max="32767" attributes="0"/>
|
||||||
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
|
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace min="0" pref="24" max="32767" attributes="0"/>
|
<EmptySpace min="0" pref="61" max="32767" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
|
@ -12,6 +12,7 @@ package com.jme3.gde.materials.multiview.widgets;
|
|||||||
|
|
||||||
import com.jme3.gde.core.assets.ProjectAssetManager;
|
import com.jme3.gde.core.assets.ProjectAssetManager;
|
||||||
import com.jme3.gde.core.properties.TexturePropertyEditor;
|
import com.jme3.gde.core.properties.TexturePropertyEditor;
|
||||||
|
import com.jme3.gde.core.properties.preview.DDSPreview;
|
||||||
import com.jme3.gde.materials.MaterialProperty;
|
import com.jme3.gde.materials.MaterialProperty;
|
||||||
import com.jme3.texture.Texture;
|
import com.jme3.texture.Texture;
|
||||||
import java.awt.Component;
|
import java.awt.Component;
|
||||||
@ -32,6 +33,7 @@ public class TexturePanel extends MaterialPropertyWidget {
|
|||||||
private boolean flip = false;
|
private boolean flip = false;
|
||||||
private boolean repeat = false;
|
private boolean repeat = false;
|
||||||
private String textureName = null;
|
private String textureName = null;
|
||||||
|
private DDSPreview ddsPreview;
|
||||||
|
|
||||||
/** Creates new form SelectionPanel */
|
/** Creates new form SelectionPanel */
|
||||||
public TexturePanel(ProjectAssetManager manager) {
|
public TexturePanel(ProjectAssetManager manager) {
|
||||||
@ -45,7 +47,10 @@ public class TexturePanel extends MaterialPropertyWidget {
|
|||||||
Texture tex = manager.loadTexture(textureName);
|
Texture tex = manager.loadTexture(textureName);
|
||||||
Icon newicon = null;
|
Icon newicon = null;
|
||||||
if (textureName.endsWith(".dds") || textureName.endsWith(".DDS")) {
|
if (textureName.endsWith(".dds") || textureName.endsWith(".DDS")) {
|
||||||
texturePreview.setIcon(null);
|
if (ddsPreview == null) {
|
||||||
|
ddsPreview = new DDSPreview(manager);
|
||||||
|
}
|
||||||
|
ddsPreview.requestPreview(textureName, "", 80, 80, texturePreview, null);
|
||||||
} else {
|
} else {
|
||||||
newicon = ImageUtilities.image2Icon(resizeImage(ImageToAwt.convert(tex.getImage(), false, true, 0)));
|
newicon = ImageUtilities.image2Icon(resizeImage(ImageToAwt.convert(tex.getImage(), false, true, 0)));
|
||||||
}
|
}
|
||||||
@ -80,8 +85,6 @@ public class TexturePanel extends MaterialPropertyWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private static BufferedImage resizeImage(BufferedImage originalImage) {
|
private static BufferedImage resizeImage(BufferedImage originalImage) {
|
||||||
int type = originalImage.getType() == 0 ? BufferedImage.TYPE_INT_ARGB : originalImage.getType();
|
int type = originalImage.getType() == 0 ? BufferedImage.TYPE_INT_ARGB : originalImage.getType();
|
||||||
float ratio = (float) originalImage.getWidth() / (float) originalImage.getHeight();
|
float ratio = (float) originalImage.getWidth() / (float) originalImage.getHeight();
|
||||||
@ -251,7 +254,7 @@ public class TexturePanel extends MaterialPropertyWidget {
|
|||||||
view.setVisible(true);
|
view.setVisible(true);
|
||||||
if (editor.getValue() != null) {
|
if (editor.getValue() != null) {
|
||||||
textureName = editor.getAsText();
|
textureName = editor.getAsText();
|
||||||
displayPreview();
|
displayPreview();
|
||||||
updateFlipRepeat();
|
updateFlipRepeat();
|
||||||
fireChanged();
|
fireChanged();
|
||||||
}
|
}
|
||||||
@ -259,7 +262,7 @@ public class TexturePanel extends MaterialPropertyWidget {
|
|||||||
|
|
||||||
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
|
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
|
||||||
textureName = "";
|
textureName = "";
|
||||||
texturePreview.setIcon(null);
|
texturePreview.setIcon(null);
|
||||||
texturePreview.setToolTipText("");
|
texturePreview.setToolTipText("");
|
||||||
property.setValue("");
|
property.setValue("");
|
||||||
fireChanged();
|
fireChanged();
|
||||||
@ -303,7 +306,7 @@ public class TexturePanel extends MaterialPropertyWidget {
|
|||||||
}
|
}
|
||||||
jLabel1.setText(property.getName());
|
jLabel1.setText(property.getName());
|
||||||
jLabel1.setToolTipText(property.getName());
|
jLabel1.setToolTipText(property.getName());
|
||||||
displayPreview();
|
displayPreview();
|
||||||
texturePreview.setToolTipText(property.getValue());
|
texturePreview.setToolTipText(property.getValue());
|
||||||
MaterialProperty prop = property;
|
MaterialProperty prop = property;
|
||||||
property = null;
|
property = null;
|
||||||
@ -313,6 +316,13 @@ public class TexturePanel extends MaterialPropertyWidget {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void cleanUp() {
|
||||||
|
if (ddsPreview != null) {
|
||||||
|
ddsPreview.cleanUp();
|
||||||
|
}
|
||||||
|
}
|
||||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
private javax.swing.JButton jButton1;
|
private javax.swing.JButton jButton1;
|
||||||
private javax.swing.JButton jButton2;
|
private javax.swing.JButton jButton2;
|
||||||
|
@ -18,7 +18,7 @@ public class WidgetFactory {
|
|||||||
|
|
||||||
public static MaterialPropertyWidget getWidget(MaterialProperty prop, ProjectAssetManager manager){
|
public static MaterialPropertyWidget getWidget(MaterialProperty prop, ProjectAssetManager manager){
|
||||||
MaterialPropertyWidget widget;
|
MaterialPropertyWidget widget;
|
||||||
if("Texture2D".equals(prop.getType())){
|
if(prop.getType().indexOf("Texture")>=0){
|
||||||
widget=new TexturePanel(manager);
|
widget=new TexturePanel(manager);
|
||||||
widget.setProperty(prop);
|
widget.setProperty(prop);
|
||||||
return widget;
|
return widget;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user