svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.plugin / org.gvsig.app / org.gvsig.app.mainplugin / src / main / java / org / gvsig / app / project / documents / view / toc / actions / FLyrVectEditPropertiesTocMenuEntry.java @ 40558
History | View | Annotate | Download (5.75 KB)
1 |
/**
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright (C) 2007-2013 gvSIG Association.
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 3
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 |
* MA 02110-1301, USA.
|
20 |
*
|
21 |
* For any additional information, do not hesitate to contact us
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com.
|
23 |
*/
|
24 |
package org.gvsig.app.project.documents.view.toc.actions; |
25 |
|
26 |
import javax.swing.JDialog; |
27 |
|
28 |
import org.gvsig.andami.PluginServices; |
29 |
import org.gvsig.app.extension.ProjectExtension; |
30 |
import org.gvsig.app.project.Project; |
31 |
import org.gvsig.app.project.documents.view.legend.gui.ThemeManagerWindow; |
32 |
import org.gvsig.app.project.documents.view.toc.AbstractTocContextMenuAction; |
33 |
import org.gvsig.app.project.documents.view.toc.ITocItem; |
34 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
35 |
import org.gvsig.fmap.mapcontext.layers.operations.ClassifiableVectorial; |
36 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
37 |
|
38 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
39 |
*
|
40 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
41 |
*
|
42 |
* This program is free software; you can redistribute it and/or
|
43 |
* modify it under the terms of the GNU General Public License
|
44 |
* as published by the Free Software Foundation; either version 2
|
45 |
* of the License, or (at your option) any later version.
|
46 |
*
|
47 |
* This program is distributed in the hope that it will be useful,
|
48 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
49 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
50 |
* GNU General Public License for more details.
|
51 |
*
|
52 |
* You should have received a copy of the GNU General Public License
|
53 |
* along with this program; if not, write to the Free Software
|
54 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
55 |
*
|
56 |
* For more information, contact:
|
57 |
*
|
58 |
* Generalitat Valenciana
|
59 |
* Conselleria d'Infraestructures i Transport
|
60 |
* Av. Blasco Ib??ez, 50
|
61 |
* 46010 VALENCIA
|
62 |
* SPAIN
|
63 |
*
|
64 |
* +34 963862235
|
65 |
* gvsig@gva.es
|
66 |
* www.gvsig.gva.es
|
67 |
*
|
68 |
* or
|
69 |
*
|
70 |
* IVER T.I. S.A
|
71 |
* Salamanca 50
|
72 |
* 46005 Valencia
|
73 |
* Spain
|
74 |
*
|
75 |
* +34 963163400
|
76 |
* dac@iver.es
|
77 |
*/
|
78 |
/* CVS MESSAGES:
|
79 |
*
|
80 |
* $Id: FLyrVectEditPropertiesTocMenuEntry.java 29598 2009-06-29 16:09:14Z jpiera $
|
81 |
* $Log$
|
82 |
* Revision 1.8 2007-09-19 15:51:33 jaume
|
83 |
* fixed bug when opening the layer properties dialog for more than one layer (two or more active layers selected)
|
84 |
*
|
85 |
* Revision 1.7 2007/07/30 12:56:04 jaume
|
86 |
* organize imports, java 5 code downgraded to 1.4 and added PictureFillSymbol
|
87 |
*
|
88 |
* Revision 1.6 2007/03/09 11:25:00 jaume
|
89 |
* Advanced symbology (start committing)
|
90 |
*
|
91 |
* Revision 1.4.2.3 2007/02/01 12:12:41 jaume
|
92 |
* theme manager window and all its components are now dynamic
|
93 |
*
|
94 |
* Revision 1.4.2.2 2007/01/30 18:10:10 jaume
|
95 |
* start commiting labeling stuff
|
96 |
*
|
97 |
* Revision 1.4.2.1 2007/01/26 13:49:03 jaume
|
98 |
* *** empty log message ***
|
99 |
*
|
100 |
* Revision 1.4 2007/01/23 13:10:45 caballero
|
101 |
* no mostrar propiedades de una capa de anotaciones
|
102 |
*
|
103 |
* Revision 1.3 2007/01/04 07:24:31 caballero
|
104 |
* isModified
|
105 |
*
|
106 |
* Revision 1.2 2006/10/02 13:52:34 jaume
|
107 |
* organize impots
|
108 |
*
|
109 |
* Revision 1.1 2006/09/15 10:41:30 caballero
|
110 |
* extensibilidad de documentos
|
111 |
*
|
112 |
* Revision 1.1 2006/09/12 15:58:14 jorpiell
|
113 |
* "Sacadas" las opcines del men? de FPopupMenu
|
114 |
*
|
115 |
*
|
116 |
*/
|
117 |
/**
|
118 |
* Muestra el men? de propiedades del tema.
|
119 |
*
|
120 |
* @author jmorell
|
121 |
*/
|
122 |
|
123 |
|
124 |
public class FLyrVectEditPropertiesTocMenuEntry extends AbstractTocContextMenuAction { |
125 |
public String getGroup() { |
126 |
return "group2"; //FIXME |
127 |
} |
128 |
|
129 |
public int getGroupOrder() { |
130 |
return 20; |
131 |
} |
132 |
|
133 |
public int getOrder() { |
134 |
return 0; |
135 |
} |
136 |
|
137 |
public String getText() { |
138 |
return PluginServices.getText(this, "propiedades"); |
139 |
} |
140 |
|
141 |
public boolean isEnabled(ITocItem item, FLayer[] selectedItems) { |
142 |
return selectedItems.length == 1; |
143 |
} |
144 |
|
145 |
public boolean isVisible(ITocItem item, FLayer[] selectedItems) { |
146 |
if (isTocItemBranch(item)) {
|
147 |
FLayer lyr = getNodeLayer(item); |
148 |
if ((lyr instanceof ClassifiableVectorial)) { |
149 |
if (!((lyr instanceof FLyrVect) && |
150 |
!((FLyrVect)lyr).isPropertiesMenuVisible())){ |
151 |
return true; |
152 |
// if (!(lyr instanceof FLyrAnnotation))
|
153 |
// return true;
|
154 |
} |
155 |
|
156 |
} |
157 |
} |
158 |
return false; |
159 |
|
160 |
} |
161 |
|
162 |
|
163 |
public void execute(ITocItem item, FLayer[] selectedItems) { |
164 |
// long t1 = System.currentTimeMillis();
|
165 |
|
166 |
FLayer lyr = getNodeLayer(item); |
167 |
ThemeManagerWindow fThemeManagerWindow = null;
|
168 |
|
169 |
if (lyr.isAvailable()) {
|
170 |
fThemeManagerWindow = new ThemeManagerWindow(lyr);
|
171 |
} |
172 |
|
173 |
if (PluginServices.getMainFrame() == null) { |
174 |
JDialog dlg = new JDialog(); |
175 |
fThemeManagerWindow.setPreferredSize(fThemeManagerWindow.getSize()); |
176 |
dlg.getContentPane().add(fThemeManagerWindow); |
177 |
dlg.setModal(false);
|
178 |
dlg.pack(); |
179 |
dlg.setVisible(true);
|
180 |
// System.err.println("open properties dialog time: "+(System.currentTimeMillis()-t1));
|
181 |
} else {
|
182 |
// System.err.println("open properties dialog time: "+(System.currentTimeMillis()-t1));
|
183 |
PluginServices.getMDIManager().addWindow(fThemeManagerWindow); |
184 |
} |
185 |
|
186 |
Project project=((ProjectExtension)PluginServices.getExtension(ProjectExtension.class)).getProject(); |
187 |
project.setModified(true);
|
188 |
} |
189 |
|
190 |
} |