Revision 9217
org.gvsig.vcsgis/tags/org.gvsig.vcsgis-1.0.118/org.gvsig.vcsgis.app/org.gvsig.vcsgis.app.mainplugin/buildNumber.properties | ||
---|---|---|
1 |
#Sun Nov 26 21:31:16 CET 2023 |
|
2 |
buildNumber=129 |
org.gvsig.vcsgis/tags/org.gvsig.vcsgis-1.0.118/org.gvsig.vcsgis.app/org.gvsig.vcsgis.app.mainplugin/src/main/assembly/gvsig-plugin-package.xml | ||
---|---|---|
1 |
<!-- gvSIG. Desktop Geographic Information System. Copyright (C) 2007-2013 gvSIG |
|
2 |
Association. This program is free software; you can redistribute it and/or modify |
|
3 |
it under the terms of the GNU General Public License as published by the Free Software |
|
4 |
Foundation; either version 3 of the License, or (at your option) any later version. |
|
5 |
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
|
6 |
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
|
7 |
PURPOSE. See the GNU General Public License for more details. You should have received |
|
8 |
a copy of the GNU General Public License along with this program; if not, write to |
|
9 |
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, |
|
10 |
USA. For any additional information, do not hesitate to contact us at info AT gvsig.com, |
|
11 |
or visit our website www.gvsig.com. --> |
|
12 |
<assembly> |
|
13 |
<id>gvsig-plugin-package</id> |
|
14 |
<formats> |
|
15 |
<format>zip</format> |
|
16 |
</formats> |
|
17 |
<baseDirectory>${project.artifactId}</baseDirectory> |
|
18 |
<includeBaseDirectory>true</includeBaseDirectory> |
|
19 |
<files> |
|
20 |
<file> |
|
21 |
<source>target/${project.artifactId}-${project.version}.jar</source> |
|
22 |
<outputDirectory>lib</outputDirectory> |
|
23 |
</file> |
|
24 |
<file> |
|
25 |
<source>target/package.info</source> |
|
26 |
</file> |
|
27 |
</files> |
|
28 |
|
|
29 |
<fileSets> |
|
30 |
<fileSet> |
|
31 |
<directory>src/main/resources-plugin</directory> |
|
32 |
<outputDirectory>.</outputDirectory> |
|
33 |
</fileSet> |
|
34 |
</fileSets> |
|
35 |
|
|
36 |
|
|
37 |
<dependencySets> |
|
38 |
<dependencySet> |
|
39 |
<useProjectArtifact>false</useProjectArtifact> |
|
40 |
<useTransitiveDependencies>false</useTransitiveDependencies> |
|
41 |
<outputDirectory>lib</outputDirectory> |
|
42 |
<includes> |
|
43 |
<include>org.gvsig:org.gvsig.vcsgis.lib.api</include> |
|
44 |
<include>org.gvsig:org.gvsig.vcsgis.lib.impl</include> |
|
45 |
<include>org.gvsig:org.gvsig.vcsgis.swing.api</include> |
|
46 |
<include>org.gvsig:org.gvsig.vcsgis.swing.impl</include> |
|
47 |
<include>javax.servlet:javax.servlet-api</include> |
|
48 |
|
|
49 |
</includes> |
|
50 |
</dependencySet> |
|
51 |
</dependencySets> |
|
52 |
|
|
53 |
</assembly> |
|
54 |
|
org.gvsig.vcsgis/tags/org.gvsig.vcsgis-1.0.118/org.gvsig.vcsgis.app/org.gvsig.vcsgis.app.mainplugin/src/main/java/org/gvsig/vcsgis/app/FeatureStoresTreeModel.java | ||
---|---|---|
1 |
/* |
|
2 |
* To change this license header, choose License Headers in Project Properties. |
|
3 |
* To change this template file, choose Tools | Templates |
|
4 |
* and open the template in the editor. |
|
5 |
*/ |
|
6 |
package org.gvsig.vcsgis.app; |
|
7 |
|
|
8 |
import java.util.HashMap; |
|
9 |
import java.util.Map; |
|
10 |
import javax.swing.Icon; |
|
11 |
import javax.swing.ImageIcon; |
|
12 |
import javax.swing.event.TreeModelListener; |
|
13 |
import javax.swing.tree.TreeModel; |
|
14 |
import javax.swing.tree.TreePath; |
|
15 |
import org.gvsig.app.ApplicationLocator; |
|
16 |
import org.gvsig.fmap.dal.DataStore; |
|
17 |
import org.gvsig.fmap.mapcontext.MapContextLocator; |
|
18 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
|
19 |
import org.gvsig.fmap.mapcontext.layers.FLayers; |
|
20 |
import org.gvsig.fmap.mapcontext.layers.operations.SingleLayer; |
|
21 |
import org.gvsig.fmap.mapcontext.layers.vectorial.VectorLayer; |
|
22 |
import org.gvsig.fmap.mapcontrol.LayersTreeModel; |
|
23 |
import org.gvsig.tools.evaluator.Evaluator; |
|
24 |
import org.gvsig.tools.evaluator.EvaluatorData; |
|
25 |
import org.gvsig.tools.evaluator.EvaluatorException; |
|
26 |
import org.gvsig.tools.evaluator.EvaluatorFieldsInfo; |
|
27 |
import org.gvsig.tools.swing.api.IconGetter; |
|
28 |
import org.gvsig.tools.swing.api.ListElement; |
|
29 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
|
30 |
|
|
31 |
|
|
32 |
/** |
|
33 |
* |
|
34 |
* @author fdiaz |
|
35 |
*/ |
|
36 |
public class FeatureStoresTreeModel implements TreeModel, IconGetter { |
|
37 |
|
|
38 |
private final LayersTreeModel delegated; |
|
39 |
private final ListElement<Object> root; |
|
40 |
private final Map<Object,Icon> icons; |
|
41 |
|
|
42 |
public FeatureStoresTreeModel() { |
|
43 |
this.delegated = (LayersTreeModel) ApplicationLocator.getApplicationManager().createProjectLayersTreeModel(); |
|
44 |
this.icons = new HashMap<>(); |
|
45 |
this.delegated.setFilter(new Evaluator() { |
|
46 |
@Override |
|
47 |
public Object evaluate(EvaluatorData data) throws EvaluatorException { |
|
48 |
FLayer layer = (FLayer) data.getDataValue("layer"); |
|
49 |
return (layer instanceof VectorLayer); |
|
50 |
} |
|
51 |
|
|
52 |
@Override |
|
53 |
public String getName() { |
|
54 |
return "VectorialLayersFilter"; |
|
55 |
} |
|
56 |
|
|
57 |
@Override |
|
58 |
public String getDescription() { |
|
59 |
return null; |
|
60 |
} |
|
61 |
|
|
62 |
@Override |
|
63 |
public String getSQL() { |
|
64 |
return null; |
|
65 |
} |
|
66 |
|
|
67 |
@Override |
|
68 |
public EvaluatorFieldsInfo getFieldsInfo() { |
|
69 |
return null; |
|
70 |
} |
|
71 |
}); |
|
72 |
this.root = new ListElement<>("Project", this.delegated.getRoot()); |
|
73 |
} |
|
74 |
|
|
75 |
private Object getNode(Object value) { |
|
76 |
if( value instanceof ListElement ) { |
|
77 |
return ((ListElement) value).getValue(); |
|
78 |
} |
|
79 |
return value; |
|
80 |
} |
|
81 |
|
|
82 |
@Override |
|
83 |
public Object getRoot() { |
|
84 |
return this.root; |
|
85 |
} |
|
86 |
|
|
87 |
@Override |
|
88 |
public Object getChild(Object parent, int index) { |
|
89 |
parent = this.getNode(parent); |
|
90 |
Object x = this.delegated.getChild(parent, index); |
|
91 |
if( x instanceof VectorLayer ) { |
|
92 |
SingleLayer layer = (SingleLayer)x; |
|
93 |
DataStore store = (DataStore) layer.getDataStore(); |
|
94 |
return store; |
|
95 |
} |
|
96 |
return x; |
|
97 |
} |
|
98 |
|
|
99 |
@Override |
|
100 |
public int getChildCount(Object parent) { |
|
101 |
parent = this.getNode(parent); |
|
102 |
return this.delegated.getChildCount(parent); |
|
103 |
} |
|
104 |
|
|
105 |
@Override |
|
106 |
public boolean isLeaf(Object node) { |
|
107 |
node = this.getNode(node); |
|
108 |
return this.delegated.isLeaf(node); |
|
109 |
} |
|
110 |
|
|
111 |
@Override |
|
112 |
public void valueForPathChanged(TreePath path, Object newValue) { |
|
113 |
this.delegated.valueForPathChanged(path, newValue); |
|
114 |
} |
|
115 |
|
|
116 |
@Override |
|
117 |
public int getIndexOfChild(Object parent, Object child) { |
|
118 |
parent = this.getNode(parent); |
|
119 |
return this.delegated.getIndexOfChild(parent, child); |
|
120 |
} |
|
121 |
|
|
122 |
@Override |
|
123 |
public void addTreeModelListener(TreeModelListener l) { |
|
124 |
this.delegated.addTreeModelListener(l); |
|
125 |
} |
|
126 |
|
|
127 |
@Override |
|
128 |
public void removeTreeModelListener(TreeModelListener l) { |
|
129 |
this.delegated.removeTreeModelListener(l); |
|
130 |
} |
|
131 |
|
|
132 |
@Override |
|
133 |
public Icon getIcon(Object item) { |
|
134 |
if( !this.icons.containsKey(item) ) { |
|
135 |
String iconName; |
|
136 |
if( item instanceof DataStore ) { |
|
137 |
iconName = MapContextLocator.getMapContextManager().getIconLayer((DataStore)item); |
|
138 |
} else if( item instanceof FLayers ) { |
|
139 |
FLayers layers = (FLayers) item; |
|
140 |
if( layers.getParentLayer()!=null && layers.getParentLayer().getParentLayer()==null ) { |
|
141 |
iconName = "view-navigation-zoom-all"; |
|
142 |
} else { |
|
143 |
iconName = "layer-icon-group"; |
|
144 |
} |
|
145 |
} else if( item == root ) { |
|
146 |
iconName = "common-folder-open"; |
|
147 |
} else { |
|
148 |
iconName = "common-leaf"; |
|
149 |
} |
|
150 |
ImageIcon icon = ToolsSwingLocator.getIconThemeManager().getCurrent().get(iconName); |
|
151 |
this.icons.put(item, icon); |
|
152 |
} |
|
153 |
return this.icons.get(item); |
|
154 |
} |
|
155 |
} |
org.gvsig.vcsgis/tags/org.gvsig.vcsgis-1.0.118/org.gvsig.vcsgis.app/org.gvsig.vcsgis.app.mainplugin/src/main/java/org/gvsig/vcsgis/app/VCSGisSwingServicesImpl.java | ||
---|---|---|
1 |
/* |
|
2 |
* To change this license header, choose License Headers in Project Properties. |
|
3 |
* To change this template file, choose Tools | Templates |
|
4 |
* and open the template in the editor. |
|
5 |
*/ |
|
6 |
package org.gvsig.vcsgis.app; |
|
7 |
|
|
8 |
import java.io.File; |
|
9 |
import java.util.ArrayList; |
|
10 |
import java.util.HashMap; |
|
11 |
import java.util.HashSet; |
|
12 |
import java.util.Iterator; |
|
13 |
import java.util.List; |
|
14 |
import java.util.Map; |
|
15 |
import java.util.Set; |
|
16 |
import javax.json.JsonArray; |
|
17 |
import javax.json.JsonObject; |
|
18 |
import javax.json.JsonValue; |
|
19 |
import javax.swing.ComboBoxModel; |
|
20 |
import javax.swing.DefaultComboBoxModel; |
|
21 |
import javax.swing.DefaultListModel; |
|
22 |
import javax.swing.Icon; |
|
23 |
import javax.swing.ListModel; |
|
24 |
import javax.swing.tree.TreeModel; |
|
25 |
import org.apache.commons.lang3.StringUtils; |
|
26 |
import org.gvsig.andami.PluginsLocator; |
|
27 |
import org.gvsig.app.ApplicationLocator; |
|
28 |
import org.gvsig.app.ApplicationManager; |
|
29 |
import org.gvsig.app.project.Project; |
|
30 |
import org.gvsig.app.project.ProjectManager; |
|
31 |
import org.gvsig.app.project.documents.Document; |
|
32 |
import org.gvsig.app.project.documents.DocumentManager; |
|
33 |
import org.gvsig.app.project.documents.table.TableDocument; |
|
34 |
import org.gvsig.app.project.documents.table.TableManager; |
|
35 |
import org.gvsig.app.project.documents.view.ViewDocument; |
|
36 |
import org.gvsig.app.project.documents.view.ViewManager; |
|
37 |
import org.gvsig.app.project.documents.view.gui.IView; |
|
38 |
import org.gvsig.fmap.dal.DALLocator; |
|
39 |
import org.gvsig.fmap.dal.DataManager; |
|
40 |
import org.gvsig.fmap.dal.exception.DataException; |
|
41 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
42 |
import org.gvsig.fmap.dal.store.jdbc2.JDBCServerExplorer; |
|
43 |
import org.gvsig.fmap.dal.store.jdbc.JDBCServerExplorerParameters; |
|
44 |
import org.gvsig.fmap.geom.Geometry; |
|
45 |
import org.gvsig.fmap.geom.aggregate.MultiCurve; |
|
46 |
import org.gvsig.fmap.geom.aggregate.MultiPoint; |
|
47 |
import org.gvsig.fmap.geom.aggregate.MultiSurface; |
|
48 |
import org.gvsig.fmap.geom.primitive.Curve; |
|
49 |
import org.gvsig.fmap.geom.primitive.Point; |
|
50 |
import org.gvsig.fmap.geom.primitive.Surface; |
|
51 |
import org.gvsig.fmap.mapcontext.MapContext; |
|
52 |
import org.gvsig.fmap.mapcontext.MapContextLocator; |
|
53 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
|
54 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
|
55 |
import org.gvsig.fmap.mapcontext.layers.vectorial.GraphicLayer; |
|
56 |
import org.gvsig.fmap.mapcontext.layers.vectorial.VectorLayer; |
|
57 |
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol; |
|
58 |
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol_v2; |
|
59 |
import org.gvsig.fmap.mapcontrol.MapControl; |
|
60 |
import org.gvsig.json.Json; |
|
61 |
import org.gvsig.json.JsonArrayBuilder; |
|
62 |
import org.gvsig.json.JsonObjectBuilder; |
|
63 |
import org.gvsig.tools.ToolsLocator; |
|
64 |
import org.gvsig.tools.dispose.Disposable; |
|
65 |
import org.gvsig.tools.dispose.DisposeUtils; |
|
66 |
import org.gvsig.tools.i18n.I18nManager; |
|
67 |
import org.gvsig.tools.util.LabeledValue; |
|
68 |
import org.gvsig.tools.util.LabeledValueImpl; |
|
69 |
import org.gvsig.vcsgis.app.addlayer.LayersWithGroup; |
|
70 |
import org.gvsig.vcsgis.lib.VCSGisLocator; |
|
71 |
import org.gvsig.vcsgis.lib.VCSGisManager; |
|
72 |
import org.gvsig.vcsgis.lib.VCSGisRuntimeException; |
|
73 |
import org.gvsig.vcsgis.lib.workspace.VCSGisWorkspace; |
|
74 |
import org.gvsig.vcsgis.swing.VCSGisSwingServices; |
|
75 |
import org.slf4j.LoggerFactory; |
|
76 |
|
|
77 |
/** |
|
78 |
* |
|
79 |
* @author gvSIG Team |
|
80 |
*/ |
|
81 |
@SuppressWarnings("UseSpecificCatch") |
|
82 |
public class VCSGisSwingServicesImpl implements VCSGisSwingServices { |
|
83 |
|
|
84 |
private static final org.slf4j.Logger LOGGER = LoggerFactory.getLogger(VCSGisSwingServicesImpl.class); |
|
85 |
|
|
86 |
private static final String VCSGISMODELS_PROJECT_PROPERTY = "VCSGisModels"; |
|
87 |
|
|
88 |
private Map<Integer,ISymbol> highlightedPolygonSymbols; |
|
89 |
private Map<Integer,ISymbol> highlightedLineSymbols; |
|
90 |
private Map<Integer,ISymbol> highlightedPointSymbols; |
|
91 |
|
|
92 |
@Override |
|
93 |
public TreeModel getFeatureStoresTreeModel() { |
|
94 |
return new FeatureStoresTreeModel(); |
|
95 |
} |
|
96 |
|
|
97 |
@Override |
|
98 |
public ListModel getFeatureStoresListModel() { |
|
99 |
DefaultListModel<FeatureStore> model = new DefaultListModel(); |
|
100 |
|
|
101 |
ApplicationManager appManager = ApplicationLocator.getApplicationManager(); |
|
102 |
Project project = appManager.getCurrentProject(); |
|
103 |
List<Document> tables = project.getDocuments(TableManager.TYPENAME); |
|
104 |
for (Document document : tables) { |
|
105 |
TableDocument table = (TableDocument) document; |
|
106 |
FeatureStore tableStore = table.getFeatureStore(); |
|
107 |
if( tableStore!=null ) { |
|
108 |
model.addElement(tableStore); |
|
109 |
} |
|
110 |
} |
|
111 |
return model; |
|
112 |
} |
|
113 |
|
|
114 |
@Override |
|
115 |
public void addTableToProject(VCSGisWorkspace ws, FeatureStore store) { |
|
116 |
ApplicationManager appManager = ApplicationLocator.getApplicationManager(); |
|
117 |
|
|
118 |
DocumentManager tableManager = appManager.getProjectManager().getDocumentManager( |
|
119 |
TableManager.TYPENAME |
|
120 |
); |
|
121 |
|
|
122 |
Project project = appManager.getCurrentProject(); |
|
123 |
TableDocument tableDoc = (TableDocument) tableManager.createDocument(); |
|
124 |
|
|
125 |
tableDoc.setName(store.getName()); |
|
126 |
tableDoc.setStore(store); |
|
127 |
project.addDocument(tableDoc); |
|
128 |
} |
|
129 |
|
|
130 |
@Override |
|
131 |
public ComboBoxModel getViewDocumentsComboBoxModel() { |
|
132 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
|
133 |
DefaultComboBoxModel<LabeledValue> model = new DefaultComboBoxModel(); |
|
134 |
model.addElement(new LabeledValueImpl(i18n.getTranslation("_Select_a_view"), null)); |
|
135 |
ApplicationManager appManager = ApplicationLocator.getApplicationManager(); |
|
136 |
Project project = appManager.getCurrentProject(); |
|
137 |
List<Document> views = project.getDocuments(ViewManager.TYPENAME); |
|
138 |
for (Document document : views) { |
|
139 |
ViewDocument view = (ViewDocument) document; |
|
140 |
model.addElement(new LabeledValueImpl(view.getName(), view)); |
|
141 |
} |
|
142 |
return model; |
|
143 |
} |
|
144 |
|
|
145 |
// @Override |
|
146 |
// public void addLayerToView(FeatureStore store, LabeledValue labeledView) { |
|
147 |
// addLayerToView(store, labeledView, null, null, false); |
|
148 |
// } |
|
149 |
// |
|
150 |
@Override |
|
151 |
public void addLayerToView(FeatureStore store, LabeledValue labeledView, String groupName, String name, boolean replaceLayerIfExists) { |
|
152 |
ViewDocument view; |
|
153 |
if( labeledView == null ) { |
|
154 |
view = null; |
|
155 |
} else if (labeledView.getValue() == null){ |
|
156 |
view = null; |
|
157 |
} else { |
|
158 |
view = (ViewDocument) labeledView.getValue(); |
|
159 |
} |
|
160 |
addLayerToView(store, view, groupName, name, replaceLayerIfExists); |
|
161 |
} |
|
162 |
|
|
163 |
|
|
164 |
private void addLayerToView(FeatureStore store, ViewDocument view, String groupName, String name, boolean replaceLayerIfExists) { |
|
165 |
try { |
|
166 |
if( store == null ) { |
|
167 |
return; |
|
168 |
} |
|
169 |
if( view==null ) { |
|
170 |
IView viewWin = getActiveView(); |
|
171 |
if(viewWin == null){ |
|
172 |
return; |
|
173 |
} |
|
174 |
view = viewWin.getViewDocument(); |
|
175 |
} |
|
176 |
String layerName = name; |
|
177 |
if(StringUtils.isBlank(layerName)){ |
|
178 |
layerName = store.getName(); |
|
179 |
} |
|
180 |
FLayer layer = MapContextLocator.getMapContextManager().createLayer(layerName, store); |
|
181 |
LayersWithGroup helper = new LayersWithGroup(view.getMapContext()); |
|
182 |
helper.add(groupName, name, layer); |
|
183 |
helper.updateMapContext(true, replaceLayerIfExists); |
|
184 |
} catch (Exception ex) { |
|
185 |
VCSGisManager manager = VCSGisLocator.getManager(); |
|
186 |
throw new VCSGisRuntimeException( |
|
187 |
VCSGisManager.ERR_CANT_ADD_LAYER, |
|
188 |
manager.getErrorMessage(VCSGisManager.ERR_CANT_ADD_LAYER), |
|
189 |
ex); |
|
190 |
} |
|
191 |
} |
|
192 |
|
|
193 |
@Override |
|
194 |
public void highlight(int mode, Geometry geom) { |
|
195 |
highlight(mode, geom, null); |
|
196 |
} |
|
197 |
|
|
198 |
@Override |
|
199 |
public void highlight(int mode, Geometry geom, FeatureStore store) { |
|
200 |
if (this.highlightedPointSymbols == null) { |
|
201 |
this.highlightedPointSymbols = new HashMap<>(); |
|
202 |
this.highlightedLineSymbols = new HashMap<>(); |
|
203 |
this.highlightedPolygonSymbols = new HashMap<>(); |
|
204 |
try { |
|
205 |
File pluginfolder = PluginsLocator.getManager().getPlugin(this).getPluginDirectory(); |
|
206 |
File folder = new File(pluginfolder, "symbols"); |
|
207 |
ISymbol[] symbols = MapContextLocator.getSymbolManager().loadSymbols(folder); |
|
208 |
for (ISymbol symbol : symbols) { |
|
209 |
if (symbol instanceof ISymbol_v2) { |
|
210 |
String symbolid = ((ISymbol_v2) symbol).getID(); |
|
211 |
switch(symbolid) { |
|
212 |
case "vcsgis-repository-polygon": |
|
213 |
this.highlightedPolygonSymbols.put(HIGHLIGHT_REPOSITORY, symbol); |
|
214 |
break; |
|
215 |
case "vcsgis-repository-line": |
|
216 |
this.highlightedLineSymbols.put(HIGHLIGHT_REPOSITORY, symbol); |
|
217 |
break; |
|
218 |
case "vcsgis-repository-point": |
|
219 |
this.highlightedPointSymbols.put(HIGHLIGHT_REPOSITORY, symbol); |
|
220 |
break; |
|
221 |
|
|
222 |
case "vcsgis-workspace-polygon": |
|
223 |
this.highlightedPolygonSymbols.put(HIGHLIGHT_WORKSPACE, symbol); |
|
224 |
break; |
|
225 |
case "vcsgis-workspace-line": |
|
226 |
this.highlightedLineSymbols.put(HIGHLIGHT_WORKSPACE, symbol); |
|
227 |
break; |
|
228 |
case "vcsgis-workspace-point": |
|
229 |
this.highlightedPointSymbols.put(HIGHLIGHT_WORKSPACE, symbol); |
|
230 |
break; |
|
231 |
|
|
232 |
case "vcsgis-workspace-previous-polygon": |
|
233 |
this.highlightedPolygonSymbols.put(HIGHLIGHT_WORKSPACE_PREVIOUS, symbol); |
|
234 |
break; |
|
235 |
case "vcsgis-workspace-previous-line": |
|
236 |
this.highlightedLineSymbols.put(HIGHLIGHT_WORKSPACE_PREVIOUS, symbol); |
|
237 |
break; |
|
238 |
case "vcsgis-workspace-previous-point": |
|
239 |
this.highlightedPointSymbols.put(HIGHLIGHT_WORKSPACE_PREVIOUS, symbol); |
|
240 |
break; |
|
241 |
} |
|
242 |
} |
|
243 |
} |
|
244 |
} catch (Exception ex) { |
|
245 |
} |
|
246 |
} |
|
247 |
List<ViewDocument> viewList; |
|
248 |
if(store == null){ |
|
249 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
250 |
ViewDocument viewdoc = (ViewDocument) application.getActiveDocument(ViewManager.TYPENAME); |
|
251 |
viewList = new ArrayList<>(); |
|
252 |
viewList.add(viewdoc); |
|
253 |
} else { |
|
254 |
viewList = getViewDocumentsHavingAStore(store); |
|
255 |
} |
|
256 |
for (ViewDocument viewDoc : viewList) { |
|
257 |
MapContext mapContext = viewDoc.getMapContext(); |
|
258 |
GraphicLayer gl = mapContext.getGraphicsLayer(); |
|
259 |
if (geom != null) { |
|
260 |
ISymbol symbol = null; |
|
261 |
if (geom instanceof Point || geom instanceof MultiPoint) { |
|
262 |
symbol = this.highlightedPointSymbols.get(mode); |
|
263 |
} else if (geom instanceof Curve || geom instanceof MultiCurve) { |
|
264 |
symbol = this.highlightedLineSymbols.get(mode); |
|
265 |
} else if (geom instanceof Surface || geom instanceof MultiSurface) { |
|
266 |
symbol = this.highlightedPolygonSymbols.get(mode); |
|
267 |
} |
|
268 |
if (symbol != null) { |
|
269 |
int symbolid = gl.getSymbolId(symbol); |
|
270 |
if (symbolid < 0) { |
|
271 |
gl.addSymbol(symbol); |
|
272 |
symbolid = gl.getSymbolId(symbol); |
|
273 |
} |
|
274 |
gl.addGraphic("vcsgis-highlighted", geom, symbolid); |
|
275 |
} |
|
276 |
} |
|
277 |
mapContext.invalidate(); |
|
278 |
} |
|
279 |
} |
|
280 |
|
|
281 |
@Override |
|
282 |
public void centerActiveViewToGeometry(Geometry geometry) { |
|
283 |
if(geometry != null){ |
|
284 |
IView view = getActiveView(); |
|
285 |
if(view != null){ |
|
286 |
ViewDocument viewDocument = view.getViewDocument(); |
|
287 |
viewDocument.center(geometry.getEnvelope()); |
|
288 |
} |
|
289 |
} |
|
290 |
} |
|
291 |
|
|
292 |
@Override |
|
293 |
public void centerViewsHavingAStoreToGeometry(FeatureStore store, Geometry geometry) { |
|
294 |
if(geometry != null){ |
|
295 |
List<ViewDocument> views = getViewDocumentsHavingAStore(store); |
|
296 |
for (ViewDocument view : views) { |
|
297 |
if(view != null){ |
|
298 |
view.center(geometry.getEnvelope()); |
|
299 |
} |
|
300 |
} |
|
301 |
} |
|
302 |
} |
|
303 |
|
|
304 |
@Override |
|
305 |
public void zoomActiveViewToGeometry(Geometry geometry) { |
|
306 |
if(geometry != null){ |
|
307 |
IView view = getActiveView(); |
|
308 |
if(view != null){ |
|
309 |
ViewDocument viewDocument = view.getViewDocument(); |
|
310 |
viewDocument.getMapContext().getViewPort().setEnvelope(geometry.getEnvelope()); |
|
311 |
} |
|
312 |
} |
|
313 |
} |
|
314 |
|
|
315 |
@Override |
|
316 |
public void zoomViewsHavingAStoreToGeometry(FeatureStore store, Geometry geometry) { |
|
317 |
if(geometry != null){ |
|
318 |
List<ViewDocument> views = getViewDocumentsHavingAStore(store); |
|
319 |
for (ViewDocument view : views) { |
|
320 |
if(view != null){ |
|
321 |
view.getMapContext().getViewPort().setEnvelope(geometry.getEnvelope()); |
|
322 |
} |
|
323 |
} |
|
324 |
} |
|
325 |
} |
|
326 |
|
|
327 |
private IView getActiveView() { |
|
328 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
329 |
IView view = (IView) application.getActiveComponent(ViewDocument.class); |
|
330 |
return view; |
|
331 |
} |
|
332 |
|
|
333 |
@Override |
|
334 |
public void cleanHighligthed() { |
|
335 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
336 |
ProjectManager projectManager = application.getProjectManager(); |
|
337 |
Project project = projectManager.getCurrentProject(); |
|
338 |
List<Document> views = project.getDocuments(ViewManager.TYPENAME); |
|
339 |
for (Document doc : views) { |
|
340 |
ViewDocument viewdoc = (ViewDocument)doc; |
|
341 |
MapContext mapContext = viewdoc.getMapContext(); |
|
342 |
GraphicLayer gl = mapContext.getGraphicsLayer(); |
|
343 |
//FIXME: Refrescar el mapContext solo cuando se ha borrado el graphics |
|
344 |
if(gl.removeGraphics("vcsgis-highlighted")) { |
|
345 |
mapContext.invalidate(); |
|
346 |
} |
|
347 |
} |
|
348 |
} |
|
349 |
|
|
350 |
@Override |
|
351 |
public void cleanActiveViewHighligthed() { |
|
352 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
353 |
ViewDocument viewdoc = (ViewDocument) application.getActiveDocument(ViewManager.TYPENAME); |
|
354 |
if(viewdoc != null){ |
|
355 |
MapContext mapContext = viewdoc.getMapContext(); |
|
356 |
GraphicLayer gl = mapContext.getGraphicsLayer(); |
|
357 |
gl.removeGraphics("vcsgis-highlighted"); |
|
358 |
mapContext.invalidate(); |
|
359 |
} |
|
360 |
} |
|
361 |
|
|
362 |
@Override |
|
363 |
public void refreshDocuments() { |
|
364 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
365 |
ProjectManager projectManager = application.getProjectManager(); |
|
366 |
Project project = projectManager.getCurrentProject(); |
|
367 |
|
|
368 |
List<Document> views = project.getDocuments(ViewManager.TYPENAME); |
|
369 |
for (Document doc : views) { |
|
370 |
doc.refresh(); |
|
371 |
} |
|
372 |
List<Document> tables = project.getDocuments(TableManager.TYPENAME); |
|
373 |
for (Document doc : tables) { |
|
374 |
doc.refresh(); |
|
375 |
} |
|
376 |
} |
|
377 |
|
|
378 |
@Override |
|
379 |
public void refreshDocument(FeatureStore store){ |
|
380 |
if(store == null){ |
|
381 |
return; |
|
382 |
} |
|
383 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
384 |
ProjectManager projectManager = application.getProjectManager(); |
|
385 |
Project project = projectManager.getCurrentProject(); |
|
386 |
|
|
387 |
String storeFullName = store.getFullName(); |
|
388 |
List<Document> views = project.getDocuments(ViewManager.TYPENAME); |
|
389 |
for (Document doc : views) { |
|
390 |
ViewDocument view = (ViewDocument)doc; |
|
391 |
for (Iterator<FLayer> it = view.deepiterator(); it.hasNext();) { |
|
392 |
FLayer layer = it.next(); |
|
393 |
if(layer instanceof FLyrVect){ |
|
394 |
FeatureStore layerStore = ((FLyrVect) layer).getFeatureStore(); |
|
395 |
if( layerStore!=null && StringUtils.equals(layerStore.getFullName(), storeFullName)){ |
|
396 |
try { |
|
397 |
layerStore.refresh(); |
|
398 |
} catch(Exception ex) { |
|
399 |
LOGGER.warn("Can't refresh store from layer '"+layer.getName()+"'.", ex); |
|
400 |
} |
|
401 |
view.getMapContext().invalidate(); |
|
402 |
break; |
|
403 |
} |
|
404 |
} |
|
405 |
} |
|
406 |
} |
|
407 |
List<Document> tables = project.getDocuments(TableManager.TYPENAME); |
|
408 |
for (Document doc : tables) { |
|
409 |
TableDocument table = (TableDocument)doc; |
|
410 |
FeatureStore featureStore = table.getStore(); |
|
411 |
if( StringUtils.equals(featureStore.getFullName(), storeFullName)){ |
|
412 |
try { |
|
413 |
featureStore.refresh(); |
|
414 |
} catch (DataException e) { |
|
415 |
LOGGER.warn("Error refreshing table", e); |
|
416 |
} |
|
417 |
} |
|
418 |
} |
|
419 |
} |
|
420 |
|
|
421 |
@Override |
|
422 |
public void refreshDocument(Set<FeatureStore> stores){ |
|
423 |
if(stores == null || stores.isEmpty()){ |
|
424 |
return; |
|
425 |
} |
|
426 |
|
|
427 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
428 |
ProjectManager projectManager = application.getProjectManager(); |
|
429 |
Project project = projectManager.getCurrentProject(); |
|
430 |
|
|
431 |
Set<ViewDocument> viewsToRefresh = new HashSet<>(); |
|
432 |
for (FeatureStore store : stores) { |
|
433 |
String storeFullName = store.getFullName(); |
|
434 |
List<Document> views = project.getDocuments(ViewManager.TYPENAME); |
|
435 |
for (Document doc : views) { |
|
436 |
ViewDocument view = (ViewDocument)doc; |
|
437 |
for (Iterator<FLayer> it = view.deepiterator(); it.hasNext();) { |
|
438 |
FLayer layer = it.next(); |
|
439 |
if(layer instanceof FLyrVect){ |
|
440 |
FeatureStore layerStore = ((FLyrVect) layer).getFeatureStore(); |
|
441 |
if( layerStore!=null && StringUtils.equals(layerStore.getFullName(), storeFullName)){ |
|
442 |
viewsToRefresh.add(view); |
|
443 |
break; |
|
444 |
} |
|
445 |
} |
|
446 |
} |
|
447 |
} |
|
448 |
|
|
449 |
List<Document> tables = project.getDocuments(TableManager.TYPENAME); |
|
450 |
for (Document doc : tables) { |
|
451 |
TableDocument table = (TableDocument)doc; |
|
452 |
FeatureStore featureStore = table.getStore(); |
|
453 |
if( StringUtils.equals(featureStore.getFullName(), storeFullName)){ |
|
454 |
try { |
|
455 |
featureStore.refresh(); |
|
456 |
} catch (DataException e) { |
|
457 |
LOGGER.warn("Error refreshing table", e); |
|
458 |
} |
|
459 |
} |
|
460 |
} |
|
461 |
} |
|
462 |
|
|
463 |
for (ViewDocument viewDocument : viewsToRefresh) { |
|
464 |
viewDocument.getMapContext().invalidate(); |
|
465 |
} |
|
466 |
|
|
467 |
} |
|
468 |
|
|
469 |
|
|
470 |
public List<ViewDocument> getViewDocumentsHavingAStore(FeatureStore store){ |
|
471 |
if(store == null){ |
|
472 |
return null; |
|
473 |
} |
|
474 |
List<ViewDocument> viewList = new ArrayList<>(); |
|
475 |
|
|
476 |
String storeFullName = store.getFullName(); |
|
477 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
478 |
ProjectManager projectManager = application.getProjectManager(); |
|
479 |
Project project = projectManager.getCurrentProject(); |
|
480 |
List<Document> views = project.getDocuments(ViewManager.TYPENAME); |
|
481 |
for (Document doc : views) { |
|
482 |
ViewDocument view = (ViewDocument) doc; |
|
483 |
for (Iterator<FLayer> it = view.deepiterator(); it.hasNext();) { |
|
484 |
FLayer layer = it.next(); |
|
485 |
if (layer instanceof FLyrVect) { |
|
486 |
FeatureStore layerStore = ((FLyrVect) layer).getFeatureStore(); |
|
487 |
if ( layerStore!=null && StringUtils.equals(layerStore.getFullName(),store.getFullName() )) { |
|
488 |
viewList.add(view); |
|
489 |
break; |
|
490 |
} |
|
491 |
} |
|
492 |
} |
|
493 |
} |
|
494 |
return viewList; |
|
495 |
} |
|
496 |
|
|
497 |
// @Override |
|
498 |
// public void addLayerToActiveView(FeatureStore store, String name) { |
|
499 |
// if(store != null && StringUtils.isNotBlank(name)){ |
|
500 |
// IView view = getActiveView(); |
|
501 |
// if(view != null){ |
|
502 |
// ViewDocument viewDocument = view.getViewDocument(); |
|
503 |
// this.addLayerToView(store, viewDocument, null, name, false); |
|
504 |
// } |
|
505 |
// } |
|
506 |
// } |
|
507 |
// |
|
508 |
@Override |
|
509 |
public boolean isThereAnyActiveView() { |
|
510 |
return this.getActiveView() != null; |
|
511 |
} |
|
512 |
|
|
513 |
@Override |
|
514 |
public void addTableToProject(VCSGisWorkspace ws, FeatureStore store, String tableName) { |
|
515 |
ApplicationManager appManager = ApplicationLocator.getApplicationManager(); |
|
516 |
|
|
517 |
DocumentManager tableManager = appManager.getProjectManager().getDocumentManager( |
|
518 |
TableManager.TYPENAME |
|
519 |
); |
|
520 |
|
|
521 |
Project project = appManager.getCurrentProject(); |
|
522 |
TableDocument tableDoc = (TableDocument) tableManager.createDocument(); |
|
523 |
|
|
524 |
tableDoc.setName(tableName); |
|
525 |
tableDoc.setStore(store); |
|
526 |
project.addDocument(tableDoc); |
|
527 |
} |
|
528 |
|
|
529 |
@Override |
|
530 |
public Icon getFeatureStoresTreeModelIcon(TreeModel model, Object obj) { |
|
531 |
if( model instanceof FeatureStoresTreeModel ) { |
|
532 |
return ((FeatureStoresTreeModel)model).getIcon(obj); |
|
533 |
} |
|
534 |
return null; |
|
535 |
} |
|
536 |
|
|
537 |
@Override |
|
538 |
public void connectedToModel(VCSGisWorkspace workspace, String model) { |
|
539 |
String previousProjectModelInfo = null; |
|
540 |
try { |
|
541 |
ApplicationManager application = ApplicationLocator.getApplicationManager(); |
|
542 |
Project project = application.getCurrentProject(); |
|
543 |
|
|
544 |
Map<String,JsonObject> models = new HashMap<>(); |
|
545 |
previousProjectModelInfo = (String) project.getProperty(VCSGISMODELS_PROJECT_PROPERTY); |
|
546 |
if( previousProjectModelInfo != null ) { |
|
547 |
JsonArray array = Json.createArray(previousProjectModelInfo); |
|
548 |
for (JsonValue value : array) { |
|
549 |
JsonObject item = (JsonObject) value; |
|
550 |
String modelName = item.getString("model", null); |
|
551 |
JDBCServerExplorerParameters wsparameters = (JDBCServerExplorerParameters) Json.toObject(item.getJsonObject("parameters")); |
|
552 |
String url = wsparameters.getUrl(); |
|
553 |
String key = modelName; //+ "("+ url + ")"; |
|
554 |
models.put(key, item); |
|
555 |
} |
|
556 |
} |
|
557 |
JDBCServerExplorerParameters parameters = workspace.getExplorerParameters(); |
|
558 |
String url = parameters.getUrl(); |
|
559 |
String key = model;// + "("+ url + ")"; |
|
560 |
JsonObjectBuilder item = Json.createObjectBuilder(); |
|
561 |
item.add("model", model); |
|
562 |
item.add("parameters", parameters); |
|
563 |
models.put(key, item.build()); |
|
564 |
JsonArrayBuilder array = Json.createArrayBuilder(); |
|
565 |
for (JsonObject n : models.values()) { |
|
566 |
array.add(n); |
|
567 |
} |
|
568 |
String s = array.build().toString(); |
|
569 |
project.setProperty(VCSGISMODELS_PROJECT_PROPERTY, s); |
|
570 |
LOGGER.info("Added information of vcsgis model to project properties."); |
|
571 |
LOGGER.debug(s); |
|
572 |
} catch(Exception ex) { |
|
573 |
LOGGER.warn("Can't add information of vcsgis model to project properties. Previous model info='"+previousProjectModelInfo+"'", ex); |
|
574 |
} |
|
575 |
} |
|
576 |
|
|
577 |
public void projectLoaded(Project project) { |
|
578 |
String projectModelInfo = null; |
|
579 |
try { |
|
580 |
projectModelInfo = (String) project.getProperty(VCSGISMODELS_PROJECT_PROPERTY); |
|
581 |
if (projectModelInfo == null) { |
|
582 |
LOGGER.info("Project loaded without information of vcsgis models."); |
|
583 |
return; |
|
584 |
} |
|
585 |
// TODO: El projecto se guardo cuando estaba conectado a uno o mas |
|
586 |
// modelos de datos... |
|
587 |
// ¿ Preguntamos al usuario si nos reconectamos automaticamente |
|
588 |
// o nos reconectamos sin decirle nada ? |
|
589 |
// Si preguntamos que recuerde la respuesta. |
|
590 |
|
|
591 |
VCSGisManager manager = VCSGisLocator.getVCSGisManager(); |
|
592 |
DataManager dataManager = DALLocator.getDataManager(); |
|
593 |
JsonArray array = Json.createArray(projectModelInfo); |
|
594 |
for (JsonValue value : array) { |
|
595 |
String modelName = "unkbown"; |
|
596 |
String url = "unknown"; |
|
597 |
try { |
|
598 |
JsonObject item = (JsonObject) value; |
|
599 |
modelName = item.getString("model", null); |
|
600 |
JDBCServerExplorerParameters wsparameters = (JDBCServerExplorerParameters) Json.toObject(item.get("parameters")); |
|
601 |
url = wsparameters.getUrl(); |
|
602 |
|
|
603 |
JDBCServerExplorer wsexplorer = (JDBCServerExplorer) dataManager.openServerExplorer(wsparameters.getProviderName(), wsparameters); |
|
604 |
VCSGisWorkspace workspace = manager.openWorkspace(wsexplorer); |
|
605 |
|
|
606 |
workspace.registerDataModelRepository(modelName); |
|
607 |
LOGGER.info("Conected to vcsgis model '"+modelName+"' (workspace="+url+")."); |
|
608 |
} catch (Exception ex) { |
|
609 |
LOGGER.warn("Can't register data model '" + modelName + "' of workspace '" + url + "'.", ex); |
|
610 |
// TODO: ¿ avisar al usuario o basta con lo que saca en la linea de mensajes del MDI ? |
|
611 |
} |
|
612 |
} |
|
613 |
} catch(Exception ex) { |
|
614 |
LOGGER.warn("Can't add information of vcsgis model to project properties ("+projectModelInfo+").", ex); |
|
615 |
} |
|
616 |
} |
|
617 |
|
|
618 |
@Override |
|
619 |
public Geometry getExtentOfCurrentDocument() { |
|
620 |
ApplicationManager application = ApplicationLocator.getApplicationManager(); |
|
621 |
Project project = application.getCurrentProject(); |
|
622 |
|
|
623 |
ViewDocument view = (ViewDocument) project.getActiveDocument(ViewDocument.class); |
|
624 |
if( view == null ) { |
|
625 |
return null; |
|
626 |
} |
|
627 |
return view.getMapContext().getViewPort().getEnvelope().getBox2D(); |
|
628 |
} |
|
629 |
|
|
630 |
@Override |
|
631 |
public boolean isInSomeDocument(FeatureStore store) { |
|
632 |
if(store == null){ |
|
633 |
return false; |
|
634 |
} |
|
635 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
636 |
ProjectManager projectManager = application.getProjectManager(); |
|
637 |
Project project = projectManager.getCurrentProject(); |
|
638 |
|
|
639 |
String storeFullName = store.getFullName(); |
|
640 |
List<Document> views = project.getDocuments(ViewManager.TYPENAME); |
|
641 |
for (Document doc : views) { |
|
642 |
ViewDocument view = (ViewDocument)doc; |
|
643 |
for (Iterator<FLayer> it = view.deepiterator(); it.hasNext();) { |
|
644 |
FLayer layer = it.next(); |
|
645 |
if(layer instanceof FLyrVect){ |
|
646 |
FeatureStore layerStore = ((FLyrVect) layer).getFeatureStore(); |
|
647 |
if( layerStore!=null && StringUtils.equals(layerStore.getFullName(), storeFullName)){ |
|
648 |
return true; |
|
649 |
} |
|
650 |
} |
|
651 |
} |
|
652 |
} |
|
653 |
List<Document> tables = project.getDocuments(TableManager.TYPENAME); |
|
654 |
for (Document doc : tables) { |
|
655 |
TableDocument table = (TableDocument)doc; |
|
656 |
FeatureStore featureStore = table.getStore(); |
|
657 |
if( StringUtils.equals(featureStore.getFullName(), storeFullName)){ |
|
658 |
return true; |
|
659 |
} |
|
660 |
} |
|
661 |
return false; |
|
662 |
} |
|
663 |
|
|
664 |
@Override |
|
665 |
public LabeledValue<MapControl> getActiveMapControl() { |
|
666 |
try { |
|
667 |
ApplicationManager application = ApplicationLocator.getApplicationManager(); |
|
668 |
Project project = application.getCurrentProject(); |
|
669 |
|
|
670 |
ViewDocument viewDoc = (ViewDocument) project.getActiveDocument(ViewDocument.class); |
|
671 |
if( viewDoc == null ) { |
|
672 |
return null; |
|
673 |
} |
|
674 |
IView view = (IView) viewDoc.getMainComponent(); |
|
675 |
return new LabeledValueImpl<>(viewDoc.getName(), view.getMapControl()); |
|
676 |
} catch(Throwable t) { |
|
677 |
return null; |
|
678 |
} |
|
679 |
} |
|
680 |
|
|
681 |
public List<LabeledValue<MapControl>> getMapControls() { |
|
682 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
683 |
ProjectManager projectManager = application.getProjectManager(); |
|
684 |
Project project = projectManager.getCurrentProject(); |
|
685 |
|
|
686 |
List<LabeledValue<MapControl>> mapControls = new ArrayList<>(); |
|
687 |
List<Document> views = project.getDocuments(ViewManager.TYPENAME); |
|
688 |
for (Document doc : views) { |
|
689 |
ViewDocument viewDoc = (ViewDocument)doc; |
|
690 |
IView view = (IView) viewDoc.getMainComponent(); |
|
691 |
mapControls.add(new LabeledValueImpl<>(viewDoc.getName(), view.getMapControl())); |
|
692 |
} |
|
693 |
return mapControls; |
|
694 |
} |
|
695 |
|
|
696 |
private static class ListDisposable<T> extends ArrayList<T> implements Disposable { |
|
697 |
|
|
698 |
@Override |
|
699 |
public void dispose() { |
|
700 |
for (T element : this) { |
|
701 |
DisposeUtils.dispose(element); |
|
702 |
} |
|
703 |
this.clear(); |
|
704 |
} |
|
705 |
|
|
706 |
} |
|
707 |
|
|
708 |
public List<FeatureStore> getFeatureStores() { |
|
709 |
ListDisposable<FeatureStore> stores = new ListDisposable<>(); |
|
710 |
|
|
711 |
ApplicationManager appManager = ApplicationLocator.getApplicationManager(); |
|
712 |
Project project = appManager.getCurrentProject(); |
|
713 |
List<Document> docs = project.getDocuments(); |
|
714 |
for (Document document : docs) { |
|
715 |
if( document instanceof TableDocument ) { |
|
716 |
TableDocument table = (TableDocument) document; |
|
717 |
FeatureStore store = table.getFeatureStore(); |
|
718 |
if( store!=null ) { |
|
719 |
DisposeUtils.bind(store); |
|
720 |
stores.add(store); |
|
721 |
} |
|
722 |
} else if( document instanceof ViewDocument ) { |
|
723 |
ViewDocument view = (ViewDocument) document; |
|
724 |
Iterator<FLayer> it = view.getMapContext().deepiterator(); |
|
725 |
while (it.hasNext()) { |
|
726 |
FLayer layer = it.next(); |
|
727 |
if( layer instanceof VectorLayer ) { |
|
728 |
FeatureStore store = ((VectorLayer) layer).getFeatureStore(); |
|
729 |
if( store!=null ) { |
|
730 |
DisposeUtils.bind(store); |
|
731 |
stores.add(store); |
|
732 |
} |
|
733 |
} |
|
734 |
} |
|
735 |
} |
|
736 |
} |
|
737 |
return stores; |
|
738 |
} |
|
739 |
} |
org.gvsig.vcsgis/tags/org.gvsig.vcsgis-1.0.118/org.gvsig.vcsgis.app/org.gvsig.vcsgis.app.mainplugin/src/main/java/org/gvsig/vcsgis/app/VCSGisDialogsHelper.java | ||
---|---|---|
1 |
/* |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2020 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, see <https://www.gnu.org/licenses/>. |
|
18 |
* |
|
19 |
* For any additional information, do not hesitate to contact us |
|
20 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
21 |
*/ |
|
22 |
|
|
23 |
package org.gvsig.vcsgis.app; |
|
24 |
|
|
25 |
import java.awt.event.ActionEvent; |
|
26 |
import java.awt.event.ComponentAdapter; |
|
27 |
import java.awt.event.ComponentEvent; |
|
28 |
import java.util.HashMap; |
|
29 |
import java.util.Map; |
|
30 |
import javax.swing.JPanel; |
|
31 |
import javax.swing.SwingUtilities; |
|
32 |
import org.gvsig.andami.ui.mdiManager.IWindow; |
|
33 |
import org.gvsig.andami.ui.mdiManager.MDIManager; |
|
34 |
import org.gvsig.app.ApplicationLocator; |
|
35 |
import org.gvsig.tools.ToolsLocator; |
|
36 |
import org.gvsig.tools.i18n.I18nManager; |
|
37 |
import org.gvsig.tools.swing.api.Component; |
|
38 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
|
39 |
import org.gvsig.tools.swing.api.windowmanager.Dialog; |
|
40 |
import org.gvsig.tools.swing.api.windowmanager.WindowManager; |
|
41 |
import org.gvsig.tools.swing.api.windowmanager.WindowManager_v2; |
|
42 |
import org.gvsig.vcsgis.swing.VCSGisPanel; |
|
43 |
import org.slf4j.Logger; |
|
44 |
import org.slf4j.LoggerFactory; |
|
45 |
|
|
46 |
/** |
|
47 |
* |
|
48 |
* @author gvSIG Team |
|
49 |
*/ |
|
50 |
public class VCSGisDialogsHelper { |
|
51 |
private static final Logger LOGGER = LoggerFactory.getLogger(VCSGisDialogsHelper.class); |
|
52 |
|
|
53 |
public static class VCSGisDialogInfo { |
|
54 |
|
|
55 |
private VCSGisPanel panel; |
|
56 |
private final String name; |
|
57 |
private final String title; |
|
58 |
private String header; |
|
59 |
private String okLabel; |
|
60 |
private boolean closed; |
|
61 |
private Runnable action; |
|
62 |
private Dialog dialog; |
|
63 |
private boolean autoclose; |
|
64 |
|
|
65 |
public VCSGisDialogInfo(String name, VCSGisPanel thePanel, String title) { |
|
66 |
this.name = name; |
|
67 |
this.panel = thePanel; |
|
68 |
this.title = title; |
|
69 |
this.closed = true; |
|
70 |
this.autoclose = false; |
|
71 |
|
|
72 |
this.panel.asJComponent().addComponentListener(new ComponentAdapter() { |
|
73 |
@Override |
|
74 |
public void componentHidden(ComponentEvent e) { |
|
75 |
closed = true; |
|
76 |
} |
|
77 |
}); |
|
78 |
} |
|
79 |
|
|
80 |
public VCSGisDialogInfo(String name, VCSGisPanel thePanel, String title, String header, String okLabel) { |
|
81 |
this(name, thePanel, title); |
|
82 |
this.header = header; |
|
83 |
this.okLabel = okLabel; |
|
84 |
} |
|
85 |
|
|
86 |
private void performDialogAction() { |
|
87 |
action.run(); |
|
88 |
} |
|
89 |
|
|
90 |
public void setAction(Runnable action) { |
|
91 |
this.action = action; |
|
92 |
} |
|
93 |
|
|
94 |
public Component getPanel() { |
|
95 |
return this.panel; |
|
96 |
} |
|
97 |
|
|
98 |
public boolean isClosed() { |
|
99 |
return this.closed; |
|
100 |
} |
|
101 |
|
|
102 |
public String getName() { |
|
103 |
return this.name; |
|
104 |
} |
|
105 |
|
|
106 |
public void setAutoclose(boolean autoclose) { |
|
107 |
this.autoclose = autoclose; |
|
108 |
} |
|
109 |
|
|
110 |
private Dialog createDialog() { |
|
111 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
|
112 |
WindowManager_v2 winManager = (WindowManager_v2) ToolsSwingLocator.getWindowManager(); |
|
113 |
|
|
114 |
Dialog theDialog = winManager.createDialog( |
|
115 |
this.panel.asJComponent(), |
|
116 |
i18n.getTranslation(title), |
|
117 |
i18n.getTranslation(header), |
|
118 |
WindowManager_v2.BUTTONS_OK_CANCEL |
|
119 |
); |
|
120 |
theDialog.setAutoclose(false); |
|
121 |
|
|
122 |
this.panel.setDialog(theDialog); |
|
123 |
theDialog.setButtonLabel( |
|
124 |
WindowManager_v2.BUTTON_OK, |
|
125 |
i18n.getTranslation(okLabel) |
|
126 |
); |
|
127 |
theDialog.setButtonLabel( |
|
128 |
WindowManager_v2.BUTTON_CANCEL, |
|
129 |
i18n.getTranslation("_Close") |
|
130 |
); |
|
131 |
if (this.panel.isProcessing()) { |
|
132 |
theDialog.setButtonEnabled(WindowManager_v2.BUTTON_OK, false); |
|
133 |
} |
|
134 |
theDialog.addActionListener((ActionEvent e) -> { |
|
135 |
switch (theDialog.getAction()) { |
|
136 |
case WindowManager_v2.BUTTON_OK: |
|
137 |
Thread task = new Thread(() -> { |
|
138 |
if(this.autoclose){ |
|
139 |
this.dialog.setButtonEnabled(WindowManager_v2.BUTTON_OK, false); |
|
140 |
} |
|
141 |
performDialogAction(); |
|
142 |
if(this.autoclose){ |
|
143 |
close(); |
|
144 |
} |
|
145 |
}, "VCSGis" + name); |
|
146 |
task.start(); |
|
147 |
break; |
|
148 |
case WindowManager_v2.BUTTON_CANCEL: |
|
149 |
close(); |
|
150 |
break; |
|
151 |
} |
|
152 |
}); |
|
153 |
return theDialog; |
|
154 |
} |
|
155 |
|
|
156 |
public void show() { |
|
157 |
show(null); |
|
158 |
} |
|
159 |
|
|
160 |
public void show(Map<String,Object> props) { |
|
161 |
if (!this.closed) { |
|
162 |
MDIManager manager = ApplicationLocator.getApplicationManager().getUIManager(); |
|
163 |
manager.moveToFrom(manager.getWindow((JPanel) this.panel.asJComponent())); |
|
164 |
return; |
|
165 |
} |
|
166 |
this.closed = false; |
|
167 |
if( this.action==null ) { |
|
168 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
|
169 |
WindowManager_v2 winManager = (WindowManager_v2) ToolsSwingLocator.getWindowManager(); |
|
170 |
winManager.showWindow( |
|
171 |
this.panel.asJComponent(), |
|
172 |
i18n.getTranslation(this.title), |
|
173 |
WindowManager.MODE.WINDOW, |
|
174 |
props |
|
175 |
); |
|
176 |
} else { |
|
177 |
this.dialog = this.createDialog(); |
|
178 |
this.dialog.show(WindowManager.MODE.WINDOW, props); |
|
179 |
} |
|
180 |
} |
|
181 |
|
|
182 |
private void close() { |
|
183 |
if (this.closed || this.dialog == null) { |
|
184 |
this.panel = null; |
|
185 |
this.dialog = null; |
|
186 |
return; |
|
187 |
} |
|
188 |
if(!SwingUtilities.isEventDispatchThread()){ |
|
189 |
SwingUtilities.invokeLater(this::close); |
|
190 |
return; |
|
191 |
} |
|
192 |
this.dialog.asJComponent().setVisible(false); |
|
193 |
this.panel = null; |
|
194 |
this.dialog = null; |
|
195 |
} |
|
196 |
} |
|
197 |
|
|
198 |
private Map<String, VCSGisDialogInfo> dialogsInfo; |
|
199 |
|
|
200 |
public VCSGisDialogInfo getDialog(String name) { |
|
201 |
if (this.dialogsInfo == null) { |
|
202 |
return null; |
|
203 |
} |
|
204 |
VCSGisDialogInfo info = this.dialogsInfo.get(name); |
|
205 |
return info; |
|
206 |
} |
|
207 |
|
|
208 |
public VCSGisDialogInfo getOrCreateDialog(String name, VCSGisPanel panel, String title, String header, String okLabel, Runnable action) { |
|
209 |
if (this.dialogsInfo == null) { |
|
210 |
this.dialogsInfo = new HashMap<>(); |
|
211 |
} |
|
212 |
VCSGisDialogInfo info = this.dialogsInfo.get(name); |
|
213 |
if (info == null || info.isClosed() ) { |
|
214 |
info = new VCSGisDialogInfo(name, panel, title, header, okLabel); |
|
215 |
info.setAction(action); |
|
216 |
this.dialogsInfo.put(name, info); |
|
217 |
} |
|
218 |
return info; |
|
219 |
} |
|
220 |
|
|
221 |
public VCSGisDialogInfo getOrCreateDialog(String name, VCSGisPanel panel, String title) { |
|
222 |
if (this.dialogsInfo == null) { |
|
223 |
this.dialogsInfo = new HashMap<>(); |
|
224 |
} |
|
225 |
VCSGisDialogInfo info = this.dialogsInfo.get(name); |
|
226 |
if (info == null || info.isClosed()) { |
|
227 |
info = new VCSGisDialogInfo(name, panel, title); |
|
228 |
this.dialogsInfo.put(name, info); |
|
229 |
} |
|
230 |
return info; |
|
231 |
} |
|
232 |
|
|
233 |
} |
org.gvsig.vcsgis/tags/org.gvsig.vcsgis-1.0.118/org.gvsig.vcsgis.app/org.gvsig.vcsgis.app.mainplugin/src/main/java/org/gvsig/vcsgis/app/preferencespages/VCSGisPage.java | ||
---|---|---|
1 |
/* |
|
2 |
* To change this license header, choose License Headers in Project Properties. |
|
3 |
* To change this template file, choose Tools | Templates |
|
4 |
* and open the template in the editor. |
|
5 |
*/ |
|
6 |
package org.gvsig.vcsgis.app.preferencespages; |
|
7 |
|
|
8 |
import com.jgoodies.forms.layout.CellConstraints; |
|
9 |
import javax.swing.DefaultComboBoxModel; |
|
10 |
import javax.swing.ImageIcon; |
|
11 |
import javax.swing.JPanel; |
|
12 |
import org.gvsig.andami.IconThemeHelper; |
|
13 |
import org.gvsig.andami.preferences.IPreference; |
|
14 |
import org.gvsig.andami.preferences.StoreException; |
|
15 |
import org.gvsig.fmap.dal.swing.featuretype.FeatureTypePanel; |
|
16 |
import org.gvsig.tools.ToolsLocator; |
|
17 |
import org.gvsig.tools.i18n.I18nManager; |
|
18 |
import org.gvsig.tools.swing.api.ListElement; |
|
19 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
|
20 |
import org.gvsig.tools.swing.api.ToolsSwingManager; |
|
21 |
import org.gvsig.tools.util.LabeledValue; |
|
22 |
import org.gvsig.tools.util.LabeledValueImpl; |
|
23 |
import org.gvsig.vcsgis.swing.VCSGisJRegisterWorkspace; |
|
24 |
import org.gvsig.vcsgis.swing.VCSGisSwingLocator; |
|
25 |
import org.gvsig.vcsgis.swing.VCSGisSwingManager; |
|
26 |
|
|
27 |
/** |
|
28 |
* |
|
29 |
* @author jjdelcerro |
|
30 |
*/ |
|
31 |
public class VCSGisPage extends VCSGisPageView implements IPreference { |
|
32 |
// |
|
33 |
// The class VCSGisPage can extend from AbstractPreferencePage, not JPanel, |
|
34 |
// if recreate it from the GUI builder change te class declaration to: |
|
35 |
// public abstract class VCSGisPageView extends AbstractPreferencePage |
|
36 |
|
|
37 |
private ImageIcon icon; |
|
38 |
public static String id = VCSGisPage.class.getName(); |
|
39 |
|
|
40 |
public VCSGisPage() { |
|
41 |
setParentID("org.gvsig.coreplugin.preferences.general.GeneralPage"); |
|
42 |
icon = IconThemeHelper.getImageIcon("vcsgis-preferences"); |
|
43 |
initComponents(); |
|
44 |
} |
|
45 |
|
|
46 |
private void initComponents() { |
|
47 |
VCSGisSwingManager swingManager = VCSGisSwingLocator.getVCSGisSwingManager(); |
|
48 |
|
|
49 |
this.translateAll(); |
|
50 |
|
|
51 |
VCSGisJRegisterWorkspace workspacesPanel = swingManager.createRegisterWorkspacePanel(); |
|
52 |
CellConstraints cc = new CellConstraints(); |
|
53 |
this.gridWorkspaces.add(workspacesPanel.asJComponent(),cc.xy(1,1)); |
|
54 |
DefaultComboBoxModel<LabeledValue<Integer>> model = new DefaultComboBoxModel(); |
|
55 |
model.addElement(new LabeledValueImpl<>("Edit only metadata", FeatureTypePanel.MODE_EDIT_ONLY_METADATA)); |
|
56 |
model.addElement(new LabeledValueImpl<>("Edit all", FeatureTypePanel.MODE_EDIT_ALL)); |
|
57 |
model.addElement(new LabeledValueImpl<>("Show only", FeatureTypePanel.MODE_SHOW_ONLY)); |
|
58 |
|
|
59 |
this.cboRepositoryEntityFeatureTypeEditorMode.setModel(model); |
|
60 |
|
|
61 |
} |
|
62 |
|
|
63 |
private void translateAll() { |
|
64 |
ToolsSwingManager manager = ToolsSwingLocator.getToolsSwingManager(); |
|
65 |
|
|
66 |
manager.translate(tabPreferences); |
|
67 |
manager.translate(chkCurrentDateAsEffectiveDateByDefaultInCommitPanel); |
|
68 |
manager.translate(chkEmptyEffectiveDateAllowedInCommitPanel); |
|
69 |
manager.translate(lblAdvanced); |
|
70 |
manager.translate(lblChangesPanel); |
|
71 |
manager.translate(lblRepositoryEntityFeatureTypeEditorMode); |
|
72 |
} |
|
73 |
|
|
74 |
@Override |
|
75 |
public void storeValues() throws StoreException { |
|
76 |
VCSGisSwingManager swingManager = VCSGisSwingLocator.getVCSGisSwingManager(); |
|
77 |
swingManager.setEmptyEffectiveDateAllowed(this.chkEmptyEffectiveDateAllowedInCommitPanel.isSelected()); |
|
78 |
swingManager.setCurrentDateAsEffectiveDateByDefault(this.chkCurrentDateAsEffectiveDateByDefaultInCommitPanel.isSelected()); |
|
79 |
LabeledValue<Integer> selectedMode = (LabeledValue<Integer>)this.cboRepositoryEntityFeatureTypeEditorMode.getSelectedItem(); |
|
80 |
if(selectedMode != null){ |
|
81 |
swingManager.setRepositoryEntityFeatureTypeEditorMode(selectedMode.getValue()); |
|
82 |
|
|
83 |
} |
|
84 |
} |
|
85 |
|
|
86 |
@Override |
|
87 |
public void setChangesApplied() { |
|
88 |
} |
|
89 |
|
|
90 |
@Override |
|
91 |
public String getID() { |
|
92 |
return id; |
|
93 |
} |
|
94 |
|
|
95 |
@Override |
|
96 |
public String getTitle() { |
|
97 |
I18nManager i18nManager = ToolsLocator.getI18nManager(); |
|
98 |
return i18nManager.getTranslation("_VCSGis"); |
|
99 |
} |
|
100 |
|
|
101 |
@Override |
|
102 |
public JPanel getPanel() { |
|
103 |
return this; |
|
104 |
} |
|
105 |
|
|
106 |
@Override |
|
107 |
public void initializeValues() { |
|
108 |
VCSGisSwingManager swingManager = VCSGisSwingLocator.getVCSGisSwingManager(); |
|
109 |
this.chkEmptyEffectiveDateAllowedInCommitPanel.setSelected(swingManager.getEmptyEffectiveDateAllowed()); |
|
110 |
this.chkCurrentDateAsEffectiveDateByDefaultInCommitPanel.setSelected(swingManager.getCurrentDateAsEffectiveDateByDefault()); |
|
111 |
ListElement.setSelected(cboRepositoryEntityFeatureTypeEditorMode, swingManager.getRepositoryEntityFeatureTypeEditorMode()); |
|
112 |
} |
|
113 |
|
|
114 |
@Override |
|
115 |
public void initializeDefaults() { |
|
116 |
} |
|
117 |
|
|
118 |
@Override |
|
119 |
public ImageIcon getIcon() { |
|
120 |
return this.icon; |
|
121 |
} |
|
122 |
|
|
123 |
@Override |
|
124 |
public boolean isValueChanged() { |
|
125 |
return true; |
|
126 |
} |
|
127 |
|
|
128 |
@Override |
|
129 |
public boolean isResizeable() { |
|
130 |
return true; |
|
131 |
} |
|
132 |
} |
org.gvsig.vcsgis/tags/org.gvsig.vcsgis-1.0.118/org.gvsig.vcsgis.app/org.gvsig.vcsgis.app.mainplugin/src/main/java/org/gvsig/vcsgis/app/preferencespages/VCSGisPageView.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
|
|
3 |
<object classname="com.jeta.forms.store.memento.FormPackage"> |
|
4 |
<at name="fileversion"> |
|
5 |
<object classname="com.jeta.forms.store.memento.FormsVersion2"> |
|
6 |
<at name="major">2</at> |
|
7 |
<at name="minor">0</at> |
|
8 |
<at name="sub">0</at> |
|
9 |
</object> |
|
10 |
</at> |
|
11 |
<at name="form"> |
|
12 |
<object classname="com.jeta.forms.store.memento.FormMemento"> |
|
13 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
14 |
<at name="cellconstraints"> |
|
15 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
16 |
<at name="column">1</at> |
|
17 |
<at name="row">1</at> |
|
18 |
<at name="colspan">1</at> |
|
19 |
<at name="rowspan">1</at> |
|
20 |
<at name="halign">default</at> |
|
21 |
<at name="valign">default</at> |
|
22 |
<at name="insets" object="insets">0,0,0,0</at> |
|
23 |
</object> |
|
24 |
</at> |
|
25 |
<at name="componentclass">com.jeta.forms.gui.form.FormComponent</at> |
|
26 |
</super> |
|
27 |
<at name="id">/home/fdiaz/projects/gvSIG/org.gvsig.vcsgis/org.gvsig.vcsgis.app/org.gvsig.vcsgis.app.mainplugin/src/main/java/org/gvsig/vcsgis/app/preferencespages/VCSGisPageView.xml</at> |
|
28 |
<at name="rowspecs">CENTER:2DLU:NONE,FILL:DEFAULT:GROW(1.0),CENTER:2DLU:NONE</at> |
|
29 |
<at name="colspecs">FILL:4DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE</at> |
|
30 |
<at name="components"> |
|
31 |
<object classname="java.util.LinkedList"> |
|
32 |
<item > |
|
33 |
<at name="value"> |
|
34 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
35 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
36 |
<at name="cellconstraints"> |
|
37 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
38 |
<at name="column">2</at> |
|
39 |
<at name="row">2</at> |
|
40 |
<at name="colspan">1</at> |
|
41 |
<at name="rowspan">1</at> |
|
42 |
<at name="halign">default</at> |
|
43 |
<at name="valign">default</at> |
|
44 |
<at name="insets" object="insets">0,0,0,0</at> |
|
45 |
</object> |
|
46 |
</at> |
|
47 |
<at name="componentclass">com.jeta.forms.gui.form.FormContainerComponent</at> |
|
48 |
</super> |
|
49 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
50 |
<at name="beanclass">javax.swing.JTabbedPane</at> |
|
51 |
<at name="beanproperties"> |
|
52 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
53 |
<at name="classname">javax.swing.JTabbedPane</at> |
|
54 |
<at name="properties"> |
|
55 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
56 |
<at name="border"> |
|
57 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
58 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
59 |
<at name="name">border</at> |
|
60 |
</super> |
|
61 |
<at name="borders"> |
|
62 |
<object classname="java.util.LinkedList"> |
|
63 |
<item > |
|
64 |
<at name="value"> |
|
65 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
66 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
67 |
<at name="name">border</at> |
|
68 |
</super> |
|
69 |
</object> |
|
70 |
</at> |
|
71 |
</item> |
|
72 |
</object> |
|
73 |
</at> |
|
74 |
</object> |
|
75 |
</at> |
|
76 |
<at name="componentCount">2</at> |
|
77 |
<at name="name">tabPreferences</at> |
|
78 |
<at name="tabs"> |
|
79 |
<object classname="com.jeta.forms.store.properties.TabbedPaneProperties"> |
|
80 |
<at name="name">tabs</at> |
|
81 |
<at name="items"> |
|
82 |
<object classname="java.util.LinkedList"> |
|
83 |
<item > |
|
84 |
<at name="value"> |
|
85 |
<object classname="com.jeta.forms.store.properties.TabProperty"> |
|
86 |
<at name="name">tab</at> |
|
87 |
<at name="title">_General</at> |
|
88 |
<at name="icon"> |
|
89 |
<object classname="com.jeta.forms.store.properties.IconProperty"> |
|
90 |
<at name="embedded">false</at> |
|
91 |
<at name="width">0</at> |
|
92 |
<at name="height">0</at> |
|
93 |
</object> |
|
94 |
</at> |
|
95 |
<at name="form"> |
|
96 |
<object classname="com.jeta.forms.store.memento.FormMemento"> |
|
97 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
98 |
<at name="cellconstraints"> |
|
99 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
100 |
<at name="column">1</at> |
|
101 |
<at name="row">1</at> |
|
102 |
<at name="colspan">1</at> |
|
103 |
<at name="rowspan">1</at> |
|
104 |
<at name="halign">default</at> |
|
105 |
<at name="valign">default</at> |
|
106 |
<at name="insets" object="insets">0,0,0,0</at> |
|
107 |
</object> |
|
108 |
</at> |
|
109 |
<at name="componentclass">com.jeta.forms.gui.form.FormComponent</at> |
|
110 |
</super> |
|
111 |
<at name="id">embedded.739377025</at> |
|
112 |
<at name="rowspecs">CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:4DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE</at> |
|
113 |
<at name="colspecs">FILL:4DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE</at> |
|
114 |
<at name="components"> |
|
115 |
<object classname="java.util.LinkedList"> |
|
116 |
<item > |
|
117 |
<at name="value"> |
|
118 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
119 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
120 |
<at name="cellconstraints"> |
|
121 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
122 |
<at name="column">2</at> |
|
123 |
<at name="row">4</at> |
|
124 |
<at name="colspan">1</at> |
|
125 |
<at name="rowspan">1</at> |
|
126 |
<at name="halign">default</at> |
|
127 |
<at name="valign">default</at> |
|
128 |
<at name="insets" object="insets">0,0,0,0</at> |
|
129 |
</object> |
|
130 |
</at> |
|
131 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
132 |
</super> |
|
133 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
134 |
<at name="beanclass">javax.swing.JCheckBox</at> |
|
135 |
<at name="beanproperties"> |
|
136 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
137 |
<at name="classname">javax.swing.JCheckBox</at> |
|
138 |
<at name="properties"> |
|
139 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
140 |
<at name="border"> |
|
141 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
142 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
143 |
<at name="name">border</at> |
|
144 |
</super> |
|
145 |
<at name="borders"> |
|
146 |
<object classname="java.util.LinkedList"> |
|
147 |
<item > |
|
148 |
<at name="value"> |
|
149 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
150 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
Also available in: Unified diff