root / branches / v10 / extensions / extPublish / src / com / iver / cit / gvsig / publish / gui / view / DefaultPublicationJTreePanel.java @ 13570
History | View | Annotate | Download (2.83 KB)
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2004-2006 IVER T.I. and Generalitat Valenciana.
|
4 |
*
|
5 |
* This program is free software; you can redistribute it and/or
|
6 |
* modify it under the terms of the GNU General Public License
|
7 |
* as published by the Free Software Foundation; either version 2
|
8 |
* of the License, or (at your option) any later version.
|
9 |
*
|
10 |
* This program is distributed in the hope that it will be useful,
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
* GNU General Public License for more details.
|
14 |
*
|
15 |
* You should have received a copy of the GNU General Public License
|
16 |
* along with this program; if not, write to the Free Software
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
18 |
*
|
19 |
* For more information, contact:
|
20 |
*
|
21 |
* Generalitat Valenciana
|
22 |
* Conselleria d'Infraestructures i Transport
|
23 |
* Av. Blasco Iba?ez, 50
|
24 |
* 46010 VALENCIA
|
25 |
* SPAIN
|
26 |
*
|
27 |
* +34 963862235
|
28 |
* gvsig@gva.es
|
29 |
* www.gvsig.gva.es
|
30 |
*
|
31 |
* or
|
32 |
*
|
33 |
* IVER T.I. S.A
|
34 |
* Salamanca 50
|
35 |
* 46005 Valencia
|
36 |
* Spain
|
37 |
*
|
38 |
* +34 963163400
|
39 |
* dac@iver.es
|
40 |
*/
|
41 |
package com.iver.cit.gvsig.publish.gui.view; |
42 |
|
43 |
import java.awt.BorderLayout; |
44 |
import java.awt.event.ActionListener; |
45 |
import java.util.EventListener; |
46 |
|
47 |
import javax.swing.JScrollPane; |
48 |
import javax.swing.JTree; |
49 |
import javax.swing.ScrollPaneLayout; |
50 |
import javax.swing.event.TreeSelectionListener; |
51 |
import javax.swing.tree.DefaultMutableTreeNode; |
52 |
|
53 |
import com.iver.cit.gvsig.publish.serversModel.Publication; |
54 |
|
55 |
public class DefaultPublicationJTreePanel extends JScrollPane implements IPublishView { |
56 |
private JTree tree = null; |
57 |
public DefaultPublicationJTreePanel(){
|
58 |
super();
|
59 |
tree = new JTree(); |
60 |
initialize(); |
61 |
} |
62 |
private void initialize(){ |
63 |
this.setLayout(new ScrollPaneLayout()); |
64 |
this.setSize(new java.awt.Dimension(400,106)); |
65 |
//this.add(tree, java.awt.BorderLayout.CENTER);
|
66 |
this.setViewportView(tree);
|
67 |
} |
68 |
|
69 |
public Object getModel() { |
70 |
// TODO Auto-generated
|
71 |
return null; |
72 |
} |
73 |
|
74 |
public void setListener(EventListener listener) { |
75 |
tree.addTreeSelectionListener((TreeSelectionListener) listener);
|
76 |
//TODO: I must remove the listener if already exists ??????
|
77 |
//tree.getComponentListeners()
|
78 |
//tree.removeComponentListener(l)
|
79 |
|
80 |
} |
81 |
|
82 |
public void setModel(Object entityModel) { |
83 |
//Cast to publication
|
84 |
//TODO: check cast
|
85 |
Publication p = (Publication)entityModel; |
86 |
//DefaultMutableTreeNode root = new DefaultMutableTreeNode(p.getServer());
|
87 |
tree.setModel(new PublicationTreeModel(p));
|
88 |
} |
89 |
/*public void setModel(Publication entityModel) {
|
90 |
//Cast to publication
|
91 |
//TODO: check cast
|
92 |
Publication p = entityModel;
|
93 |
//DefaultMutableTreeNode root = new DefaultMutableTreeNode(p.getServer());
|
94 |
tree.setModel(new PublicationTreeModel(p));
|
95 |
}*/
|
96 |
} |