• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Main repository of MikuMikuStudio


コミットメタ情報

リビジョン200f7f0aa40da89053ea1e3601284dd2d3a6d6fd (tree)
日時2013-03-06 03:20:27
作者brentowens@gmail.com <brentowens@gmai...>
コミッターbrentowens@gmail.com

ログメッセージ

MaterialBrowser will remember browse path. Removed commented out code from TextureBrowser

git-svn-id: http://jmonkeyengine.googlecode.com/svn/trunk@10467 75d07b2b-3a1a-0410-a2c5-0572b91ccdca

変更サマリ

差分

--- a/sdk/jme3-core/src/com/jme3/gde/core/properties/TextureBrowser.java
+++ b/sdk/jme3-core/src/com/jme3/gde/core/properties/TextureBrowser.java
@@ -69,7 +69,6 @@ public class TextureBrowser extends javax.swing.JDialog implements TreeSelection
6969 private ProjectAssetManager assetManager;
7070 private TexturePropertyEditor editor;
7171 private DDSPreview ddsPreview;
72- //private static TreePath lastSelectedTexture;
7372 private Preferences prefs;
7473 private static final String PREF_LAST_SELECTED = "lastSelectedTexture";
7574
--- a/sdk/jme3-materialeditor/src/com/jme3/gde/materials/MaterialBrowser.java
+++ b/sdk/jme3-materialeditor/src/com/jme3/gde/materials/MaterialBrowser.java
@@ -22,6 +22,7 @@ import java.util.Arrays;
2222 import java.util.Collections;
2323 import java.util.List;
2424 import java.util.logging.Logger;
25+import java.util.prefs.Preferences;
2526 import javax.swing.event.TreeSelectionEvent;
2627 import javax.swing.event.TreeSelectionListener;
2728 import javax.swing.tree.DefaultMutableTreeNode;
@@ -37,11 +38,14 @@ public class MaterialBrowser extends javax.swing.JDialog implements TreeSelectio
3738
3839 private ProjectAssetManager assetManager;
3940 private MaterialPropertyEditor editor;
41+ private Preferences prefs;
42+ private static final String PREF_LAST_SELECTED = "lastSelectedMaterial";
4043
4144 /** Creates new form MaterialBrowser */
4245 public MaterialBrowser(java.awt.Frame parent, boolean modal, ProjectAssetManager assetManager, MaterialPropertyEditor editor) {
4346 this.assetManager = assetManager;
4447 this.editor = editor;
48+ prefs = Preferences.userNodeForPackage(this.getClass());
4549 initComponents();
4650 loadAvailableMaterials();
4751 setSelectedMaterial((Material) editor.getValue());
@@ -85,6 +89,13 @@ public class MaterialBrowser extends javax.swing.JDialog implements TreeSelectio
8589 jTree1.expandPath(TreeUtil.buildTreePath(jTree1, parent, path, 0, true));
8690 jTree1.getSelectionModel().setSelectionPath(TreeUtil.buildTreePath(jTree1, parent, path, 0, false));
8791
92+ } else {
93+ String lastSelected = prefs.get(PREF_LAST_SELECTED, null);
94+ if (lastSelected != null) {
95+ TreePath parent = new TreePath((TreeNode) jTree1.getModel().getRoot());
96+ TreePath selectedTreePath = TreeUtil.buildTreePath(jTree1, parent, ("/"+lastSelected).split("/"), 0, true);
97+ jTree1.expandPath(selectedTreePath);
98+ }
8899 }
89100 }
90101
@@ -109,10 +120,11 @@ public class MaterialBrowser extends javax.swing.JDialog implements TreeSelectio
109120 fr.read(b);
110121 materialTextPreview.setText(new String(b).trim());
111122 }
123+ prefs.put(PREF_LAST_SELECTED, selected);
112124 } catch (IOException ex) {
113125 Exceptions.printStackTrace(ex);
114126 }
115-
127+
116128 } else {
117129 materialPreviewWidget1.clear();
118130 materialTextPreview.setText("");