Statistics
| Revision:

svn-gvsig-desktop / trunk / extensions / extPublish / src / com / iver / cit / gvsig / publish / gui / panelServices / LayersPanel.java @ 10626

History | View | Annotate | Download (3.64 KB)

1
package com.iver.cit.gvsig.publish.gui.panelServices;
2

    
3
import javax.swing.JPanel;
4

    
5
import com.iver.cit.gvsig.publish.servers.PublishControler;
6

    
7
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
8
 *
9
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
10
 *
11
 * This program is free software; you can redistribute it and/or
12
 * modify it under the terms of the GNU General Public License
13
 * as published by the Free Software Foundation; either version 2
14
 * of the License, or (at your option) any later version.
15
 *
16
 * This program is distributed in the hope that it will be useful,
17
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
 * GNU General Public License for more details.
20
 *
21
 * You should have received a copy of the GNU General Public License
22
 * along with this program; if not, write to the Free Software
23
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
24
 *
25
 * For more information, contact:
26
 *
27
 *  Generalitat Valenciana
28
 *   Conselleria d'Infraestructures i Transport
29
 *   Av. Blasco Ib??ez, 50
30
 *   46010 VALENCIA
31
 *   SPAIN
32
 *
33
 *      +34 963862235
34
 *   gvsig@gva.es
35
 *      www.gvsig.gva.es
36
 *
37
 *    or
38
 *
39
 *   IVER T.I. S.A
40
 *   Salamanca 50
41
 *   46005 Valencia
42
 *   Spain
43
 *
44
 *   +34 963163400
45
 *   dac@iver.es
46
 */
47
/* CVS MESSAGES:
48
 *
49
 * $Id: LayersPanel.java 10626 2007-03-06 16:55:54Z caballero $
50
 * $Log$
51
 * Revision 1.2  2007-03-06 16:50:30  caballero
52
 * Exceptions
53
 *
54
 * Revision 1.1  2006/11/22 15:57:03  jorpiell
55
 * Se ha ajustado el interfaz de usuario
56
 *
57
 * Revision 1.3  2006/11/22 12:48:21  jorpiell
58
 * Subidos algunos cambios para ver las capas en forma de ?rbol
59
 *
60
 * Revision 1.2  2006/11/20 12:59:05  dagilgon
61
 * *** empty log message ***
62
 *
63
 * Revision 1.1  2006/11/17 13:43:45  jorpiell
64
 * A?adido el nuevo panel donde se muestran las capas
65
 *
66
 *
67
 */
68
/**
69
 * @author Jorge Piera Llodr? (piera_jor@gva.es)
70
 */
71
public class LayersPanel extends JPanel{
72
        private LayersTreePanel treePanel = null;
73
        private LayerAttributesPanel attributesPanel = null;
74
        private PublishControler publishControler = null;
75
        /**
76
         * This method initializes 
77
         * 
78
         */
79
        public LayersPanel() {
80
                super();
81
                initialize();
82
        }
83

    
84
        /**
85
         * This method initializes this
86
         * 
87
         */
88
        private void initialize() {
89
        this.setLayout(null);
90
        this.setSize(new java.awt.Dimension(650,220));
91
        this.add(getTreePanel(), null);
92
        this.add(getAttributesPanel(), null);
93
                        
94
        }
95

    
96
        /**
97
         * This method initializes treePanel        
98
         *         
99
         * @return javax.swing.JPanel        
100
         */
101
        private LayersTreePanel getTreePanel() {
102
                if (treePanel == null) {
103
                        treePanel = new LayersTreePanel(getAttributesPanel());                        
104
                        treePanel.setPreferredSize(new java.awt.Dimension(250,100));
105
                        treePanel.setBounds(new java.awt.Rectangle(14,19,212,181));
106
                }
107
                return treePanel;
108
        }
109

    
110
        /**
111
         * This method initializes attributesPanel        
112
         *         
113
         * @return javax.swing.JPanel        
114
         */
115
        private LayerAttributesPanel getAttributesPanel() {
116
                if (attributesPanel == null) {
117
                        attributesPanel = new LayerAttributesPanel();
118
                        attributesPanel.setBounds(new java.awt.Rectangle(250,20,397,130));
119
                }
120
                return attributesPanel;
121
        }
122
        
123
        private void setTreeModel(LayerTreeModel model){
124
                getTreePanel().setTreeModel(model);
125
        }        
126
        
127
        public void setPublishControler(PublishControler publishControler){
128
                this.publishControler = publishControler;
129
                setTreeModel(new LayerTreeModel(publishControler.getServiceInfo()));
130
        }
131

    
132
        public PublishControler getPublishControler() {
133
                return publishControler;
134
        }
135

    
136
        public void restoreLayers() {
137
                getTreePanel().restoreLayers();                
138
        }
139
        
140
        public void setSelectedRoot(){
141
                getTreePanel().setSelectedRoot();
142
        }
143

    
144
}  //  @jve:decl-index=0:visual-constraint="10,10"