60 |
60 |
import javax.swing.tree.TreePath;
|
61 |
61 |
|
62 |
62 |
import com.iver.andami.PluginServices;
|
|
63 |
import com.iver.andami.ui.mdiManager.IWindow;
|
|
64 |
import com.iver.andami.ui.mdiManager.WindowInfo;
|
63 |
65 |
|
64 |
66 |
/**
|
65 |
67 |
* @author FJP
|
... | ... | |
67 |
69 |
* TODO To change the template for this generated type comment go to
|
68 |
70 |
* Window - Preferences - Java - Code Generation - Code and Comments
|
69 |
71 |
*/
|
70 |
|
public class SymbolSelector extends JPanel {
|
|
72 |
public class SymbolSelector extends JPanel implements IWindow{
|
71 |
73 |
|
72 |
|
private JTree treeFamilies = null; // @jve:decl-index=0:visual-constraint="83,408"
|
|
74 |
private JTree treeFamilies = null;
|
73 |
75 |
private JList jListSymbols = null;
|
74 |
76 |
private JPanel jPanel = null;
|
75 |
77 |
private JScrollPane jScrollPane = null;
|
76 |
78 |
private JScrollPane jScrollPane1 = null;
|
77 |
79 |
private SymbolPreview jPanelPreview = null;
|
78 |
80 |
private JPanel jPanelOptions = null;
|
79 |
|
private JPanel jPanel1 = null; // @jve:decl-index=0:visual-constraint="178,9"
|
|
81 |
private JPanel jPanel1 = null;
|
80 |
82 |
private JLabel jLabel = null;
|
81 |
83 |
private JComboBox cmbFamily = null;
|
|
84 |
private WindowInfo wi;
|
82 |
85 |
/**
|
83 |
86 |
* This method initializes
|
84 |
87 |
*
|
... | ... | |
89 |
92 |
|
90 |
93 |
// TODO: Poner la funci?n para que el modelo
|
91 |
94 |
// sea un directorio con s?mbolos, etc.
|
92 |
|
DefaultListModel listModel = new DefaultListModel();
|
|
95 |
/*DefaultListModel listModel = new DefaultListModel();
|
93 |
96 |
listModel.addElement("C:\\Workspace-HEAD\\_fwAndami\\gvSIG\\extensiones\\com.iver.cit.gvsig\\northimages\\complex.svg");
|
94 |
97 |
listModel.addElement("C:\\Workspace-HEAD\\_fwAndami\\gvSIG\\extensiones\\com.iver.cit.gvsig\\northimages\\nordRosas.svg");
|
95 |
98 |
listModel.addElement("C:\\Workspace-HEAD\\_fwAndami\\gvSIG\\extensiones\\com.iver.cit.gvsig\\northimages\\norte1-1.svg");
|
... | ... | |
98 |
101 |
listModel.addElement("C:\\Workspace-HEAD\\_fwAndami\\gvSIG\\extensiones\\com.iver.cit.gvsig\\northimages\\rosas_en.svg");
|
99 |
102 |
listModel.addElement("C:\\Workspace-HEAD\\_fwAndami\\gvSIG\\extensiones\\com.iver.cit.gvsig\\northimages\\simple.svg");
|
100 |
103 |
listModel.addElement("C:\\Workspace-HEAD\\_fwAndami\\gvSIG\\extensiones\\com.iver.cit.gvsig\\northimages\\simpleNorth.svg");
|
|
104 |
*/
|
|
105 |
getJListSymbols().setModel(new SymbolSelectorListModel());
|
101 |
106 |
|
102 |
|
getJListSymbols().setModel(listModel);
|
103 |
|
|
104 |
107 |
SLDListBoxCellRenderer renderer = new SLDListBoxCellRenderer();
|
105 |
108 |
renderer.setPreferredSize(new Dimension(60, 50));
|
106 |
109 |
getJListSymbols().setCellRenderer(renderer);
|
107 |
110 |
// petList.setMaximumRowCount(3);
|
108 |
|
|
109 |
|
|
110 |
|
|
111 |
111 |
}
|
112 |
112 |
|
113 |
113 |
/**
|
... | ... | |
145 |
145 |
}
|
146 |
146 |
|
147 |
147 |
public int getChildCount(Object parent) {
|
148 |
|
|
149 |
|
return 0;
|
|
148 |
return ((File) parent).listFiles(ff).length;
|
150 |
149 |
}
|
151 |
150 |
|
152 |
151 |
public boolean isLeaf(Object node) {
|
153 |
|
|
154 |
152 |
return getChildCount(node)==0;
|
155 |
153 |
}
|
156 |
154 |
|
... | ... | |
309 |
307 |
return cmbFamily;
|
310 |
308 |
}
|
311 |
309 |
|
|
310 |
public WindowInfo getWindowInfo() {
|
|
311 |
if (wi == null) {
|
|
312 |
wi = new WindowInfo(WindowInfo.MODALDIALOG);
|
|
313 |
wi.setWidth(700);
|
|
314 |
wi.setHeight(700);
|
|
315 |
wi.setTitle(PluginServices.getText(this, "symbol_selector"));
|
|
316 |
}
|
|
317 |
return wi;
|
|
318 |
}
|
|
319 |
|
312 |
320 |
} // @jve:decl-index=0:visual-constraint="10,10"
|