- Make TextureBrowser clear textures from assetManager cache after displaying them

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10380 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
nor..67 12 years ago
parent e2476e4e5c
commit 4360d22f02
  1. 2
      sdk/jme3-core/src/com/jme3/gde/core/properties/TextureBrowser.form
  2. 2
      sdk/jme3-core/src/com/jme3/gde/core/properties/TextureBrowser.java

@ -1,4 +1,4 @@
<?xml version="1.1" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JDialogFormInfo"> <Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
<Properties> <Properties>

@ -31,6 +31,7 @@
*/ */
package com.jme3.gde.core.properties; package com.jme3.gde.core.properties;
import com.jme3.asset.TextureKey;
import com.jme3.gde.core.assets.ProjectAssetManager; import com.jme3.gde.core.assets.ProjectAssetManager;
import com.jme3.gde.core.properties.preview.DDSPreview; import com.jme3.gde.core.properties.preview.DDSPreview;
import com.jme3.gde.core.util.TreeUtil; import com.jme3.gde.core.util.TreeUtil;
@ -294,6 +295,7 @@ private void noTexturebuttonActionPerformed(java.awt.event.ActionEvent evt) {//G
} else { } else {
Texture tex = assetManager.loadTexture(selected); Texture tex = assetManager.loadTexture(selected);
newicon = ImageUtilities.image2Icon(ImageToAwt.convert(tex.getImage(), false, true, 0)); newicon = ImageUtilities.image2Icon(ImageToAwt.convert(tex.getImage(), false, true, 0));
assetManager.deleteFromCache(new TextureKey(selected));
imagePreviewLabel.setIcon(newicon); imagePreviewLabel.setIcon(newicon);
infoLabel.setText(" " + node.getUserObject() + " w : " + newicon.getIconWidth() + " h : " + newicon.getIconHeight()); infoLabel.setText(" " + node.getUserObject() + " w : " + newicon.getIconWidth() + " h : " + newicon.getIconHeight());
} }

Loading…
Cancel
Save