Revision 8656
org.gvsig.vcsgis/tags/org.gvsig.vcsgis-1.0.108/pom.xml | ||
---|---|---|
1 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
2 |
<modelVersion>4.0.0</modelVersion> |
|
3 |
<groupId>org.gvsig</groupId> |
|
4 |
<artifactId>org.gvsig.vcsgis</artifactId> |
|
5 |
<version>1.0.108</version> |
|
6 |
<packaging>pom</packaging> |
|
7 |
<name>${project.artifactId}</name> |
|
8 |
<description /> |
|
9 |
<parent> |
|
10 |
<groupId>org.gvsig</groupId> |
|
11 |
<artifactId>org.gvsig.desktop</artifactId> |
|
12 |
<version>2.0.425</version> |
|
13 |
</parent> |
|
14 |
|
|
15 |
<properties> |
|
16 |
<org.gvsig.h2spatial.provider>org.gvsig.h2spatial.h2gis132.provider</org.gvsig.h2spatial.provider> |
|
17 |
<org.gvsig.topology.version>1.0.150</org.gvsig.topology.version> |
|
18 |
<org.gvsig.oracle.version>2.0.134</org.gvsig.oracle.version> |
|
19 |
<org.gvsig.postgresql.version>2.0.256</org.gvsig.postgresql.version> |
|
20 |
</properties> |
|
21 |
|
|
22 |
<url>https://devel.gvsig.org/sites/org.gvsig.vcsgis/${project.version}</url> |
|
23 |
<scm> |
|
24 |
<connection>scm:svn:https://devel.gvsig.org/svn/gvsig-projects-pool/org.gvsig.vcsgis/tags/org.gvsig.vcsgis-1.0.108</connection> |
|
25 |
<developerConnection>scm:svn:https://devel.gvsig.org/svn/gvsig-projects-pool/org.gvsig.vcsgis/tags/org.gvsig.vcsgis-1.0.108</developerConnection> |
|
26 |
<url>https://devel.gvsig.org/svn/gvsig-projects-pool/org.gvsig.vcsgis/tags/org.gvsig.vcsgis-1.0.108</url> |
|
27 |
</scm> |
|
28 |
|
|
29 |
<repositories> |
|
30 |
<repository> |
|
31 |
<id>gvsig-public-http-repository</id> |
|
32 |
<name>gvSIG maven public HTTP repository</name> |
|
33 |
<url>http://devel.gvsig.org/m2repo/j2se</url> |
|
34 |
<releases> |
|
35 |
<enabled>true</enabled> |
|
36 |
<updatePolicy>daily</updatePolicy> |
|
37 |
<checksumPolicy>warn</checksumPolicy> |
|
38 |
</releases> |
|
39 |
<snapshots> |
|
40 |
<enabled>true</enabled> |
|
41 |
<updatePolicy>daily</updatePolicy> |
|
42 |
<checksumPolicy>warn</checksumPolicy> |
|
43 |
</snapshots> |
|
44 |
</repository> |
|
45 |
</repositories> |
|
46 |
|
|
47 |
<distributionManagement> |
|
48 |
<site> |
|
49 |
<id>gvsig-repository</id> |
|
50 |
<url>dav:https://devel.gvsig.org/download/projects/gvsig-vcsgis/pool/${project.artifactId}/${project.version}</url> |
|
51 |
</site> |
|
52 |
</distributionManagement> |
|
53 |
|
|
54 |
<build> |
|
55 |
<pluginManagement> |
|
56 |
<plugins> |
|
57 |
|
|
58 |
<plugin> |
|
59 |
<groupId>org.apache.maven.plugins</groupId> |
|
60 |
<artifactId>maven-compiler-plugin</artifactId> |
|
61 |
<configuration> |
|
62 |
<encoding>UTF-8</encoding> |
|
63 |
</configuration> |
|
64 |
</plugin> |
|
65 |
</plugins> |
|
66 |
</pluginManagement> |
|
67 |
<plugins> |
|
68 |
<plugin> |
|
69 |
<groupId>org.apache.maven.plugins</groupId> |
|
70 |
<artifactId>maven-release-plugin</artifactId> |
|
71 |
<configuration> |
|
72 |
<tagBase>https://devel.gvsig.org/svn/gvsig-projects-pool/${project.artifactId}/tags</tagBase> |
|
73 |
</configuration> |
|
74 |
</plugin> |
|
75 |
</plugins> |
|
76 |
</build> |
|
77 |
|
|
78 |
|
|
79 |
|
|
80 |
<dependencyManagement> |
|
81 |
<dependencies> |
|
82 |
<dependency> |
|
83 |
<groupId>org.apache.maven.plugins</groupId> |
|
84 |
<artifactId>maven-war-plugin</artifactId> |
|
85 |
<version>3.2.3</version> |
|
86 |
<type>maven-plugin</type> |
|
87 |
</dependency> |
|
88 |
<dependency> |
|
89 |
<groupId>org.apache.tomcat</groupId> |
|
90 |
<artifactId>tomcat-servlet-api</artifactId> |
|
91 |
<version>9.0.45</version> |
|
92 |
</dependency> |
|
93 |
<dependency> |
|
94 |
<groupId>javax.servlet</groupId> |
|
95 |
<artifactId>javax.servlet-api</artifactId> |
|
96 |
<version>3.1.0</version> |
|
97 |
</dependency> |
|
98 |
<dependency> |
|
99 |
<groupId>org.eclipse.jetty</groupId> |
|
100 |
<artifactId>jetty-server</artifactId> |
|
101 |
<version>9.4.34.v20201102</version> |
|
102 |
</dependency> |
|
103 |
<dependency> |
|
104 |
<groupId>org.eclipse.jetty</groupId> |
|
105 |
<artifactId>jetty-servlet</artifactId> |
|
106 |
<version>9.4.34.v20201102</version> |
|
107 |
</dependency> |
|
108 |
<dependency> |
|
109 |
<groupId>org.eclipse.jetty</groupId> |
|
110 |
<artifactId>jetty-webapp</artifactId> |
|
111 |
<version>9.4.34.v20201102</version> |
|
112 |
<exclusions> |
|
113 |
<exclusion> |
|
114 |
<groupId>javax.servlet</groupId> |
|
115 |
<artifactId>servlet-api</artifactId> |
|
116 |
</exclusion> |
|
117 |
</exclusions> |
|
118 |
</dependency> |
|
119 |
<dependency> |
|
120 |
<groupId>org.eclipse.jetty</groupId> |
|
121 |
<artifactId>jetty-util</artifactId> |
|
122 |
<version>9.4.34.v20201102</version> |
|
123 |
</dependency> |
|
124 |
<dependency> |
|
125 |
<groupId>org.eclipse.jetty</groupId> |
|
126 |
<artifactId>jetty-io</artifactId> |
|
127 |
<version>9.4.34.v20201102</version> |
|
128 |
</dependency> |
|
129 |
<dependency> |
|
130 |
<groupId>org.eclipse.jetty</groupId> |
|
131 |
<artifactId>jetty-jndi</artifactId> |
|
132 |
<version>9.4.34.v20201102</version> |
|
133 |
</dependency> |
|
134 |
|
|
135 |
|
|
136 |
|
|
137 |
|
|
138 |
<dependency> |
|
139 |
<groupId>org.gvsig</groupId> |
|
140 |
<artifactId>org.gvsig.topology</artifactId> |
|
141 |
<version>${org.gvsig.topology.version}</version> |
|
142 |
<type>pom</type> |
|
143 |
<scope>import</scope> |
|
144 |
</dependency> |
|
145 |
<dependency> |
|
146 |
<groupId>org.gvsig</groupId> |
|
147 |
<artifactId>${org.gvsig.h2spatial.provider}</artifactId> |
|
148 |
</dependency> |
|
149 |
<dependency> |
|
150 |
<groupId>org.gvsig</groupId> |
|
151 |
<artifactId>org.gvsig.oracle</artifactId> |
|
152 |
<version>${org.gvsig.oracle.version}</version> |
|
153 |
<type>pom</type> |
|
154 |
<scope>import</scope> |
|
155 |
</dependency> |
|
156 |
<dependency> |
|
157 |
<groupId>org.gvsig</groupId> |
|
158 |
<artifactId>org.gvsig.postgresql</artifactId> |
|
159 |
<version>${org.gvsig.postgresql.version}</version> |
|
160 |
<type>pom</type> |
|
161 |
<scope>import</scope> |
|
162 |
</dependency> |
|
163 |
<dependency> |
|
164 |
<groupId>org.gvsig</groupId> |
|
165 |
<artifactId>org.gvsig.vcsgis.lib.api</artifactId> |
|
166 |
<version>1.0.108</version> |
|
167 |
</dependency> |
|
168 |
<dependency> |
|
169 |
<groupId>org.gvsig</groupId> |
|
170 |
<artifactId>org.gvsig.vcsgis.lib.impl</artifactId> |
|
171 |
<version>1.0.108</version> |
|
172 |
</dependency> |
|
173 |
<dependency> |
|
174 |
<groupId>org.gvsig</groupId> |
|
175 |
<artifactId>org.gvsig.vcsgis.lib.impl</artifactId> |
|
176 |
<scope>test</scope> |
|
177 |
<type>test-jar</type> |
|
178 |
<version>1.0.108</version> |
|
179 |
</dependency> |
|
180 |
<dependency> |
|
181 |
<groupId>org.gvsig</groupId> |
|
182 |
<artifactId>org.gvsig.vcsgis.swing.api</artifactId> |
|
183 |
<version>1.0.108</version> |
|
184 |
</dependency> |
|
185 |
<dependency> |
|
186 |
<groupId>org.gvsig</groupId> |
|
187 |
<artifactId>org.gvsig.vcsgis.swing.impl</artifactId> |
|
188 |
<version>1.0.108</version> |
|
189 |
</dependency> |
|
190 |
<dependency> |
|
191 |
<groupId>org.gvsig</groupId> |
|
192 |
<artifactId>org.gvsig.vcsgis.tomcat.webapp</artifactId> |
|
193 |
<version>1.0.108</version> |
|
194 |
<type>war</type> |
|
195 |
</dependency> |
|
196 |
|
|
197 |
</dependencies> |
|
198 |
</dependencyManagement> |
|
199 |
|
|
200 |
<modules> |
|
201 |
<module>org.gvsig.vcsgis.lib</module> |
|
202 |
<module>org.gvsig.vcsgis.swing</module> |
|
203 |
<module>org.gvsig.vcsgis.app</module> |
|
204 |
<module>org.gvsig.vcsgis.tomcat</module> |
|
205 |
</modules> |
|
206 |
</project> |
org.gvsig.vcsgis/tags/org.gvsig.vcsgis-1.0.108/org.gvsig.vcsgis.app/org.gvsig.vcsgis.app.mainplugin/buildNumber.properties | ||
---|---|---|
1 |
#Sun Jul 09 23:55:48 CEST 2023 |
|
2 |
buildNumber=119 |
org.gvsig.vcsgis/tags/org.gvsig.vcsgis-1.0.108/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.108/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.rendering.symbols.ISymbol; |
|
57 |
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol_v2; |
|
58 |
import org.gvsig.fmap.mapcontrol.MapControl; |
|
59 |
import org.gvsig.json.Json; |
|
60 |
import org.gvsig.json.JsonArrayBuilder; |
|
61 |
import org.gvsig.json.JsonObjectBuilder; |
|
62 |
import org.gvsig.tools.ToolsLocator; |
|
63 |
import org.gvsig.tools.i18n.I18nManager; |
|
64 |
import org.gvsig.tools.util.LabeledValue; |
|
65 |
import org.gvsig.tools.util.LabeledValueImpl; |
|
66 |
import org.gvsig.vcsgis.app.addlayer.LayersWithGroup; |
|
67 |
import org.gvsig.vcsgis.lib.VCSGisLocator; |
|
68 |
import org.gvsig.vcsgis.lib.VCSGisManager; |
|
69 |
import org.gvsig.vcsgis.lib.VCSGisRuntimeException; |
|
70 |
import org.gvsig.vcsgis.lib.workspace.VCSGisWorkspace; |
|
71 |
import org.gvsig.vcsgis.swing.VCSGisSwingServices; |
|
72 |
import org.slf4j.LoggerFactory; |
|
73 |
|
|
74 |
/** |
|
75 |
* |
|
76 |
* @author gvSIG Team |
|
77 |
*/ |
|
78 |
@SuppressWarnings("UseSpecificCatch") |
|
79 |
public class VCSGisSwingServicesImpl implements VCSGisSwingServices { |
|
80 |
|
|
81 |
private static final org.slf4j.Logger LOGGER = LoggerFactory.getLogger(VCSGisSwingServicesImpl.class); |
|
82 |
|
|
83 |
private static final String VCSGISMODELS_PROJECT_PROPERTY = "VCSGisModels"; |
|
84 |
|
|
85 |
private Map<Integer,ISymbol> highlightedPolygonSymbols; |
|
86 |
private Map<Integer,ISymbol> highlightedLineSymbols; |
|
87 |
private Map<Integer,ISymbol> highlightedPointSymbols; |
|
88 |
|
|
89 |
@Override |
|
90 |
public TreeModel getFeatureStoresTreeModel() { |
|
91 |
return new FeatureStoresTreeModel(); |
|
92 |
} |
|
93 |
|
|
94 |
@Override |
|
95 |
public ListModel getFeatureStoresListModel() { |
|
96 |
DefaultListModel<FeatureStore> model = new DefaultListModel(); |
|
97 |
|
|
98 |
ApplicationManager appManager = ApplicationLocator.getApplicationManager(); |
|
99 |
Project project = appManager.getCurrentProject(); |
|
100 |
List<Document> tables = project.getDocuments(TableManager.TYPENAME); |
|
101 |
for (Document document : tables) { |
|
102 |
TableDocument table = (TableDocument) document; |
|
103 |
FeatureStore tableStore = table.getFeatureStore(); |
|
104 |
if( tableStore!=null ) { |
|
105 |
model.addElement(tableStore); |
|
106 |
} |
|
107 |
} |
|
108 |
return model; |
|
109 |
} |
|
110 |
|
|
111 |
@Override |
|
112 |
public void addTableToProject(VCSGisWorkspace ws, FeatureStore store) { |
|
113 |
ApplicationManager appManager = ApplicationLocator.getApplicationManager(); |
|
114 |
|
|
115 |
DocumentManager tableManager = appManager.getProjectManager().getDocumentManager( |
|
116 |
TableManager.TYPENAME |
|
117 |
); |
|
118 |
|
|
119 |
Project project = appManager.getCurrentProject(); |
|
120 |
TableDocument tableDoc = (TableDocument) tableManager.createDocument(); |
|
121 |
|
|
122 |
tableDoc.setName(store.getName()); |
|
123 |
tableDoc.setStore(store); |
|
124 |
project.addDocument(tableDoc); |
|
125 |
} |
|
126 |
|
|
127 |
@Override |
|
128 |
public ComboBoxModel getViewDocumentsComboBoxModel() { |
|
129 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
|
130 |
DefaultComboBoxModel<LabeledValue> model = new DefaultComboBoxModel(); |
|
131 |
model.addElement(new LabeledValueImpl(i18n.getTranslation("_Select_a_view"), null)); |
|
132 |
ApplicationManager appManager = ApplicationLocator.getApplicationManager(); |
|
133 |
Project project = appManager.getCurrentProject(); |
|
134 |
List<Document> views = project.getDocuments(ViewManager.TYPENAME); |
|
135 |
for (Document document : views) { |
|
136 |
ViewDocument view = (ViewDocument) document; |
|
137 |
model.addElement(new LabeledValueImpl(view.getName(), view)); |
|
138 |
} |
|
139 |
return model; |
|
140 |
} |
|
141 |
|
|
142 |
// @Override |
|
143 |
// public void addLayerToView(FeatureStore store, LabeledValue labeledView) { |
|
144 |
// addLayerToView(store, labeledView, null, null, false); |
|
145 |
// } |
|
146 |
// |
|
147 |
@Override |
|
148 |
public void addLayerToView(FeatureStore store, LabeledValue labeledView, String groupName, String name, boolean replaceLayerIfExists) { |
|
149 |
ViewDocument view; |
|
150 |
if( labeledView == null ) { |
|
151 |
view = null; |
|
152 |
} else if (labeledView.getValue() == null){ |
|
153 |
view = null; |
|
154 |
} else { |
|
155 |
view = (ViewDocument) labeledView.getValue(); |
|
156 |
} |
|
157 |
addLayerToView(store, view, groupName, name, replaceLayerIfExists); |
|
158 |
} |
|
159 |
|
|
160 |
|
|
161 |
private void addLayerToView(FeatureStore store, ViewDocument view, String groupName, String name, boolean replaceLayerIfExists) { |
|
162 |
try { |
|
163 |
if( store == null ) { |
|
164 |
return; |
|
165 |
} |
|
166 |
if( view==null ) { |
|
167 |
IView viewWin = getActiveView(); |
|
168 |
if(viewWin == null){ |
|
169 |
return; |
|
170 |
} |
|
171 |
view = viewWin.getViewDocument(); |
|
172 |
} |
|
173 |
String layerName = name; |
|
174 |
if(StringUtils.isBlank(layerName)){ |
|
175 |
layerName = store.getName(); |
|
176 |
} |
|
177 |
FLayer layer = MapContextLocator.getMapContextManager().createLayer(layerName, store); |
|
178 |
LayersWithGroup helper = new LayersWithGroup(view.getMapContext()); |
|
179 |
helper.add(groupName, name, layer); |
|
180 |
helper.updateMapContext(true, replaceLayerIfExists); |
|
181 |
} catch (Exception ex) { |
|
182 |
VCSGisManager manager = VCSGisLocator.getManager(); |
|
183 |
throw new VCSGisRuntimeException( |
|
184 |
VCSGisManager.ERR_CANT_ADD_LAYER, |
|
185 |
manager.getErrorMessage(VCSGisManager.ERR_CANT_ADD_LAYER), |
|
186 |
ex); |
|
187 |
} |
|
188 |
} |
|
189 |
|
|
190 |
@Override |
|
191 |
public void highlight(int mode, Geometry geom) { |
|
192 |
highlight(mode, geom, null); |
|
193 |
} |
|
194 |
|
|
195 |
@Override |
|
196 |
public void highlight(int mode, Geometry geom, FeatureStore store) { |
|
197 |
if (this.highlightedPointSymbols == null) { |
|
198 |
this.highlightedPointSymbols = new HashMap<>(); |
|
199 |
this.highlightedLineSymbols = new HashMap<>(); |
|
200 |
this.highlightedPolygonSymbols = new HashMap<>(); |
|
201 |
try { |
|
202 |
File pluginfolder = PluginsLocator.getManager().getPlugin(this).getPluginDirectory(); |
|
203 |
File folder = new File(pluginfolder, "symbols"); |
|
204 |
ISymbol[] symbols = MapContextLocator.getSymbolManager().loadSymbols(folder); |
|
205 |
for (ISymbol symbol : symbols) { |
|
206 |
if (symbol instanceof ISymbol_v2) { |
|
207 |
String symbolid = ((ISymbol_v2) symbol).getID(); |
|
208 |
switch(symbolid) { |
|
209 |
case "vcsgis-repository-polygon": |
|
210 |
this.highlightedPolygonSymbols.put(HIGHLIGHT_REPOSITORY, symbol); |
|
211 |
break; |
|
212 |
case "vcsgis-repository-line": |
|
213 |
this.highlightedLineSymbols.put(HIGHLIGHT_REPOSITORY, symbol); |
|
214 |
break; |
|
215 |
case "vcsgis-repository-point": |
|
216 |
this.highlightedPointSymbols.put(HIGHLIGHT_REPOSITORY, symbol); |
|
217 |
break; |
|
218 |
|
|
219 |
case "vcsgis-workspace-polygon": |
|
220 |
this.highlightedPolygonSymbols.put(HIGHLIGHT_WORKSPACE, symbol); |
|
221 |
break; |
|
222 |
case "vcsgis-workspace-line": |
|
223 |
this.highlightedLineSymbols.put(HIGHLIGHT_WORKSPACE, symbol); |
|
224 |
break; |
|
225 |
case "vcsgis-workspace-point": |
|
226 |
this.highlightedPointSymbols.put(HIGHLIGHT_WORKSPACE, symbol); |
|
227 |
break; |
|
228 |
|
|
229 |
case "vcsgis-workspace-previous-polygon": |
|
230 |
this.highlightedPolygonSymbols.put(HIGHLIGHT_WORKSPACE_PREVIOUS, symbol); |
|
231 |
break; |
|
232 |
case "vcsgis-workspace-previous-line": |
|
233 |
this.highlightedLineSymbols.put(HIGHLIGHT_WORKSPACE_PREVIOUS, symbol); |
|
234 |
break; |
|
235 |
case "vcsgis-workspace-previous-point": |
|
236 |
this.highlightedPointSymbols.put(HIGHLIGHT_WORKSPACE_PREVIOUS, symbol); |
|
237 |
break; |
|
238 |
} |
|
239 |
} |
|
240 |
} |
|
241 |
} catch (Exception ex) { |
|
242 |
} |
|
243 |
} |
|
244 |
List<ViewDocument> viewList; |
|
245 |
if(store == null){ |
|
246 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
247 |
ViewDocument viewdoc = (ViewDocument) application.getActiveDocument(ViewManager.TYPENAME); |
|
248 |
viewList = new ArrayList<>(); |
|
249 |
viewList.add(viewdoc); |
|
250 |
} else { |
|
251 |
viewList = getViewDocumentsHavingAStore(store); |
|
252 |
} |
|
253 |
for (ViewDocument viewDoc : viewList) { |
|
254 |
MapContext mapContext = viewDoc.getMapContext(); |
|
255 |
GraphicLayer gl = mapContext.getGraphicsLayer(); |
|
256 |
if (geom != null) { |
|
257 |
ISymbol symbol = null; |
|
258 |
if (geom instanceof Point || geom instanceof MultiPoint) { |
|
259 |
symbol = this.highlightedPointSymbols.get(mode); |
|
260 |
} else if (geom instanceof Curve || geom instanceof MultiCurve) { |
|
261 |
symbol = this.highlightedLineSymbols.get(mode); |
|
262 |
} else if (geom instanceof Surface || geom instanceof MultiSurface) { |
|
263 |
symbol = this.highlightedPolygonSymbols.get(mode); |
|
264 |
} |
|
265 |
if (symbol != null) { |
|
266 |
int symbolid = gl.getSymbolId(symbol); |
|
267 |
if (symbolid < 0) { |
|
268 |
gl.addSymbol(symbol); |
|
269 |
symbolid = gl.getSymbolId(symbol); |
|
270 |
} |
|
271 |
gl.addGraphic("vcsgis-highlighted", geom, symbolid); |
|
272 |
} |
|
273 |
} |
|
274 |
mapContext.invalidate(); |
|
275 |
} |
|
276 |
} |
|
277 |
|
|
278 |
@Override |
|
279 |
public void centerActiveViewToGeometry(Geometry geometry) { |
|
280 |
if(geometry != null){ |
|
281 |
IView view = getActiveView(); |
|
282 |
if(view != null){ |
|
283 |
ViewDocument viewDocument = view.getViewDocument(); |
|
284 |
viewDocument.center(geometry.getEnvelope()); |
|
285 |
} |
|
286 |
} |
|
287 |
} |
|
288 |
|
|
289 |
@Override |
|
290 |
public void centerViewsHavingAStoreToGeometry(FeatureStore store, Geometry geometry) { |
|
291 |
if(geometry != null){ |
|
292 |
List<ViewDocument> views = getViewDocumentsHavingAStore(store); |
|
293 |
for (ViewDocument view : views) { |
|
294 |
if(view != null){ |
|
295 |
view.center(geometry.getEnvelope()); |
|
296 |
} |
|
297 |
} |
|
298 |
} |
|
299 |
} |
|
300 |
|
|
301 |
@Override |
|
302 |
public void zoomActiveViewToGeometry(Geometry geometry) { |
|
303 |
if(geometry != null){ |
|
304 |
IView view = getActiveView(); |
|
305 |
if(view != null){ |
|
306 |
ViewDocument viewDocument = view.getViewDocument(); |
|
307 |
viewDocument.getMapContext().getViewPort().setEnvelope(geometry.getEnvelope()); |
|
308 |
} |
|
309 |
} |
|
310 |
} |
|
311 |
|
|
312 |
@Override |
|
313 |
public void zoomViewsHavingAStoreToGeometry(FeatureStore store, Geometry geometry) { |
|
314 |
if(geometry != null){ |
|
315 |
List<ViewDocument> views = getViewDocumentsHavingAStore(store); |
|
316 |
for (ViewDocument view : views) { |
|
317 |
if(view != null){ |
|
318 |
view.getMapContext().getViewPort().setEnvelope(geometry.getEnvelope()); |
|
319 |
} |
|
320 |
} |
|
321 |
} |
|
322 |
} |
|
323 |
|
|
324 |
private IView getActiveView() { |
|
325 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
326 |
IView view = (IView) application.getActiveComponent(ViewDocument.class); |
|
327 |
return view; |
|
328 |
} |
|
329 |
|
|
330 |
@Override |
|
331 |
public void cleanHighligthed() { |
|
332 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
333 |
ProjectManager projectManager = application.getProjectManager(); |
|
334 |
Project project = projectManager.getCurrentProject(); |
|
335 |
List<Document> views = project.getDocuments(ViewManager.TYPENAME); |
|
336 |
for (Document doc : views) { |
|
337 |
ViewDocument viewdoc = (ViewDocument)doc; |
|
338 |
MapContext mapContext = viewdoc.getMapContext(); |
|
339 |
GraphicLayer gl = mapContext.getGraphicsLayer(); |
|
340 |
//FIXME: Refrescar el mapContext solo cuando se ha borrado el graphics |
|
341 |
if(gl.removeGraphics("vcsgis-highlighted")) { |
|
342 |
mapContext.invalidate(); |
|
343 |
} |
|
344 |
} |
|
345 |
} |
|
346 |
|
|
347 |
@Override |
|
348 |
public void cleanActiveViewHighligthed() { |
|
349 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
350 |
ViewDocument viewdoc = (ViewDocument) application.getActiveDocument(ViewManager.TYPENAME); |
|
351 |
if(viewdoc != null){ |
|
352 |
MapContext mapContext = viewdoc.getMapContext(); |
|
353 |
GraphicLayer gl = mapContext.getGraphicsLayer(); |
|
354 |
gl.removeGraphics("vcsgis-highlighted"); |
|
355 |
mapContext.invalidate(); |
|
356 |
} |
|
357 |
} |
|
358 |
|
|
359 |
@Override |
|
360 |
public void refreshDocuments() { |
|
361 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
362 |
ProjectManager projectManager = application.getProjectManager(); |
|
363 |
Project project = projectManager.getCurrentProject(); |
|
364 |
|
|
365 |
List<Document> views = project.getDocuments(ViewManager.TYPENAME); |
|
366 |
for (Document doc : views) { |
|
367 |
doc.refresh(); |
|
368 |
} |
|
369 |
List<Document> tables = project.getDocuments(TableManager.TYPENAME); |
|
370 |
for (Document doc : tables) { |
|
371 |
doc.refresh(); |
|
372 |
} |
|
373 |
} |
|
374 |
|
|
375 |
@Override |
|
376 |
public void refreshDocument(FeatureStore store){ |
|
377 |
if(store == null){ |
|
378 |
return; |
|
379 |
} |
|
380 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
381 |
ProjectManager projectManager = application.getProjectManager(); |
|
382 |
Project project = projectManager.getCurrentProject(); |
|
383 |
|
|
384 |
String storeFullName = store.getFullName(); |
|
385 |
List<Document> views = project.getDocuments(ViewManager.TYPENAME); |
|
386 |
for (Document doc : views) { |
|
387 |
ViewDocument view = (ViewDocument)doc; |
|
388 |
for (Iterator<FLayer> it = view.deepiterator(); it.hasNext();) { |
|
389 |
FLayer layer = it.next(); |
|
390 |
if(layer instanceof FLyrVect){ |
|
391 |
FeatureStore layerStore = ((FLyrVect) layer).getFeatureStore(); |
|
392 |
if( layerStore!=null && StringUtils.equals(layerStore.getFullName(), storeFullName)){ |
|
393 |
view.getMapContext().invalidate(); |
|
394 |
break; |
|
395 |
} |
|
396 |
} |
|
397 |
} |
|
398 |
} |
|
399 |
List<Document> tables = project.getDocuments(TableManager.TYPENAME); |
|
400 |
for (Document doc : tables) { |
|
401 |
TableDocument table = (TableDocument)doc; |
|
402 |
FeatureStore featureStore = table.getStore(); |
|
403 |
if( StringUtils.equals(featureStore.getFullName(), storeFullName)){ |
|
404 |
try { |
|
405 |
featureStore.refresh(); |
|
406 |
} catch (DataException e) { |
|
407 |
LOGGER.warn("Error refreshing table", e); |
|
408 |
} |
|
409 |
} |
|
410 |
} |
|
411 |
} |
|
412 |
|
|
413 |
@Override |
|
414 |
public void refreshDocument(Set<FeatureStore> stores){ |
|
415 |
if(stores == null || stores.isEmpty()){ |
|
416 |
return; |
|
417 |
} |
|
418 |
|
|
419 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
420 |
ProjectManager projectManager = application.getProjectManager(); |
|
421 |
Project project = projectManager.getCurrentProject(); |
|
422 |
|
|
423 |
Set<ViewDocument> viewsToRefresh = new HashSet<>(); |
|
424 |
for (FeatureStore store : stores) { |
|
425 |
String storeFullName = store.getFullName(); |
|
426 |
List<Document> views = project.getDocuments(ViewManager.TYPENAME); |
|
427 |
for (Document doc : views) { |
|
428 |
ViewDocument view = (ViewDocument)doc; |
|
429 |
for (Iterator<FLayer> it = view.deepiterator(); it.hasNext();) { |
|
430 |
FLayer layer = it.next(); |
|
431 |
if(layer instanceof FLyrVect){ |
|
432 |
FeatureStore layerStore = ((FLyrVect) layer).getFeatureStore(); |
|
433 |
if( layerStore!=null && StringUtils.equals(layerStore.getFullName(), storeFullName)){ |
|
434 |
viewsToRefresh.add(view); |
|
435 |
break; |
|
436 |
} |
|
437 |
} |
|
438 |
} |
|
439 |
} |
|
440 |
|
|
441 |
List<Document> tables = project.getDocuments(TableManager.TYPENAME); |
|
442 |
for (Document doc : tables) { |
|
443 |
TableDocument table = (TableDocument)doc; |
|
444 |
FeatureStore featureStore = table.getStore(); |
|
445 |
if( StringUtils.equals(featureStore.getFullName(), storeFullName)){ |
|
446 |
try { |
|
447 |
featureStore.refresh(); |
|
448 |
} catch (DataException e) { |
|
449 |
LOGGER.warn("Error refreshing table", e); |
|
450 |
} |
|
451 |
} |
|
452 |
} |
|
453 |
} |
|
454 |
|
|
455 |
for (ViewDocument viewDocument : viewsToRefresh) { |
|
456 |
viewDocument.getMapContext().invalidate(); |
|
457 |
} |
|
458 |
|
|
459 |
} |
|
460 |
|
|
461 |
|
|
462 |
public List<ViewDocument> getViewDocumentsHavingAStore(FeatureStore store){ |
|
463 |
if(store == null){ |
|
464 |
return null; |
|
465 |
} |
|
466 |
List<ViewDocument> viewList = new ArrayList<>(); |
|
467 |
|
|
468 |
String storeFullName = store.getFullName(); |
|
469 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
470 |
ProjectManager projectManager = application.getProjectManager(); |
|
471 |
Project project = projectManager.getCurrentProject(); |
|
472 |
List<Document> views = project.getDocuments(ViewManager.TYPENAME); |
|
473 |
for (Document doc : views) { |
|
474 |
ViewDocument view = (ViewDocument) doc; |
|
475 |
for (Iterator<FLayer> it = view.deepiterator(); it.hasNext();) { |
|
476 |
FLayer layer = it.next(); |
|
477 |
if (layer instanceof FLyrVect) { |
|
478 |
FeatureStore layerStore = ((FLyrVect) layer).getFeatureStore(); |
|
479 |
if ( layerStore!=null && StringUtils.equals(layerStore.getFullName(),store.getFullName() )) { |
|
480 |
viewList.add(view); |
|
481 |
break; |
|
482 |
} |
|
483 |
} |
|
484 |
} |
|
485 |
} |
|
486 |
return viewList; |
|
487 |
} |
|
488 |
|
|
489 |
// @Override |
|
490 |
// public void addLayerToActiveView(FeatureStore store, String name) { |
|
491 |
// if(store != null && StringUtils.isNotBlank(name)){ |
|
492 |
// IView view = getActiveView(); |
|
493 |
// if(view != null){ |
|
494 |
// ViewDocument viewDocument = view.getViewDocument(); |
|
495 |
// this.addLayerToView(store, viewDocument, null, name, false); |
|
496 |
// } |
|
497 |
// } |
|
498 |
// } |
|
499 |
// |
|
500 |
@Override |
|
501 |
public boolean isThereAnyActiveView() { |
|
502 |
return this.getActiveView() != null; |
|
503 |
} |
|
504 |
|
|
505 |
@Override |
|
506 |
public void addTableToProject(VCSGisWorkspace ws, FeatureStore store, String tableName) { |
|
507 |
ApplicationManager appManager = ApplicationLocator.getApplicationManager(); |
|
508 |
|
|
509 |
DocumentManager tableManager = appManager.getProjectManager().getDocumentManager( |
|
510 |
TableManager.TYPENAME |
|
511 |
); |
|
512 |
|
|
513 |
Project project = appManager.getCurrentProject(); |
|
514 |
TableDocument tableDoc = (TableDocument) tableManager.createDocument(); |
|
515 |
|
|
516 |
tableDoc.setName(tableName); |
|
517 |
tableDoc.setStore(store); |
|
518 |
project.addDocument(tableDoc); |
|
519 |
} |
|
520 |
|
|
521 |
@Override |
|
522 |
public Icon getFeatureStoresTreeModelIcon(TreeModel model, Object obj) { |
|
523 |
if( model instanceof FeatureStoresTreeModel ) { |
|
524 |
return ((FeatureStoresTreeModel)model).getIcon(obj); |
|
525 |
} |
|
526 |
return null; |
|
527 |
} |
|
528 |
|
|
529 |
@Override |
|
530 |
public void connectedToModel(VCSGisWorkspace workspace, String model) { |
|
531 |
String previousProjectModelInfo = null; |
|
532 |
try { |
|
533 |
ApplicationManager application = ApplicationLocator.getApplicationManager(); |
|
534 |
Project project = application.getCurrentProject(); |
|
535 |
|
|
536 |
Map<String,JsonObject> models = new HashMap<>(); |
|
537 |
previousProjectModelInfo = (String) project.getProperty(VCSGISMODELS_PROJECT_PROPERTY); |
|
538 |
if( previousProjectModelInfo != null ) { |
|
539 |
JsonArray array = Json.createArray(previousProjectModelInfo); |
|
540 |
for (JsonValue value : array) { |
|
541 |
JsonObject item = (JsonObject) value; |
|
542 |
String modelName = item.getString("model", null); |
|
543 |
JDBCServerExplorerParameters wsparameters = (JDBCServerExplorerParameters) Json.toObject(item.getJsonObject("parameters")); |
|
544 |
String url = wsparameters.getUrl(); |
|
545 |
String key = modelName; //+ "("+ url + ")"; |
|
546 |
models.put(key, item); |
|
547 |
} |
|
548 |
} |
|
549 |
JDBCServerExplorerParameters parameters = workspace.getExplorerParameters(); |
|
550 |
String url = parameters.getUrl(); |
|
551 |
String key = model;// + "("+ url + ")"; |
|
552 |
JsonObjectBuilder item = Json.createObjectBuilder(); |
|
553 |
item.add("model", model); |
|
554 |
item.add("parameters", parameters); |
|
555 |
models.put(key, item.build()); |
|
556 |
JsonArrayBuilder array = Json.createArrayBuilder(); |
|
557 |
for (JsonObject n : models.values()) { |
|
558 |
array.add(n); |
|
559 |
} |
|
560 |
String s = array.build().toString(); |
|
561 |
project.setProperty(VCSGISMODELS_PROJECT_PROPERTY, s); |
|
562 |
LOGGER.info("Added information of vcsgis model to project properties."); |
|
563 |
LOGGER.debug(s); |
|
564 |
} catch(Exception ex) { |
|
565 |
LOGGER.warn("Can't add information of vcsgis model to project properties. Previous model info='"+previousProjectModelInfo+"'", ex); |
|
566 |
} |
|
567 |
} |
|
568 |
|
|
569 |
public void projectLoaded(Project project) { |
|
570 |
String projectModelInfo = null; |
|
571 |
try { |
|
572 |
projectModelInfo = (String) project.getProperty(VCSGISMODELS_PROJECT_PROPERTY); |
|
573 |
if (projectModelInfo == null) { |
|
574 |
LOGGER.info("Project loaded without information of vcsgis models."); |
|
575 |
return; |
|
576 |
} |
|
577 |
// TODO: El projecto se guardo cuando estaba conectado a uno o mas |
|
578 |
// modelos de datos... |
|
579 |
// ¿ Preguntamos al usuario si nos reconectamos automaticamente |
|
580 |
// o nos reconectamos sin decirle nada ? |
|
581 |
// Si preguntamos que recuerde la respuesta. |
|
582 |
|
|
583 |
VCSGisManager manager = VCSGisLocator.getVCSGisManager(); |
|
584 |
DataManager dataManager = DALLocator.getDataManager(); |
|
585 |
JsonArray array = Json.createArray(projectModelInfo); |
|
586 |
for (JsonValue value : array) { |
|
587 |
String modelName = "unkbown"; |
|
588 |
String url = "unknown"; |
|
589 |
try { |
|
590 |
JsonObject item = (JsonObject) value; |
|
591 |
modelName = item.getString("model", null); |
|
592 |
JDBCServerExplorerParameters wsparameters = (JDBCServerExplorerParameters) Json.toObject(item.get("parameters")); |
|
593 |
url = wsparameters.getUrl(); |
|
594 |
|
|
595 |
JDBCServerExplorer wsexplorer = (JDBCServerExplorer) dataManager.openServerExplorer(wsparameters.getProviderName(), wsparameters); |
|
596 |
VCSGisWorkspace workspace = manager.openWorkspace(wsexplorer); |
|
597 |
|
|
598 |
workspace.registerDataModelRepository(modelName); |
|
599 |
LOGGER.info("Conected to vcsgis model '"+modelName+"' (workspace="+url+")."); |
|
600 |
} catch (Exception ex) { |
|
601 |
LOGGER.warn("Can't register data model '" + modelName + "' of workspace '" + url + "'.", ex); |
|
602 |
// TODO: ¿ avisar al usuario o basta con lo que saca en la linea de mensajes del MDI ? |
|
603 |
} |
|
604 |
} |
|
605 |
} catch(Exception ex) { |
|
606 |
LOGGER.warn("Can't add information of vcsgis model to project properties ("+projectModelInfo+").", ex); |
|
607 |
} |
|
608 |
} |
|
609 |
|
|
610 |
@Override |
|
611 |
public Geometry getExtentOfCurrentDocument() { |
|
612 |
ApplicationManager application = ApplicationLocator.getApplicationManager(); |
|
613 |
Project project = application.getCurrentProject(); |
|
614 |
|
|
615 |
ViewDocument view = (ViewDocument) project.getActiveDocument(ViewDocument.class); |
|
616 |
if( view == null ) { |
|
617 |
return null; |
|
618 |
} |
|
619 |
return view.getMapContext().getViewPort().getEnvelope().getBox2D(); |
|
620 |
} |
|
621 |
|
|
622 |
@Override |
|
623 |
public boolean isInSomeDocument(FeatureStore store) { |
|
624 |
if(store == null){ |
|
625 |
return false; |
|
626 |
} |
|
627 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
628 |
ProjectManager projectManager = application.getProjectManager(); |
|
629 |
Project project = projectManager.getCurrentProject(); |
|
630 |
|
|
631 |
String storeFullName = store.getFullName(); |
|
632 |
List<Document> views = project.getDocuments(ViewManager.TYPENAME); |
|
633 |
for (Document doc : views) { |
|
634 |
ViewDocument view = (ViewDocument)doc; |
|
635 |
for (Iterator<FLayer> it = view.deepiterator(); it.hasNext();) { |
|
636 |
FLayer layer = it.next(); |
|
637 |
if(layer instanceof FLyrVect){ |
|
638 |
FeatureStore layerStore = ((FLyrVect) layer).getFeatureStore(); |
|
639 |
if( layerStore!=null && StringUtils.equals(layerStore.getFullName(), storeFullName)){ |
|
640 |
return true; |
|
641 |
} |
|
642 |
} |
|
643 |
} |
|
644 |
} |
|
645 |
List<Document> tables = project.getDocuments(TableManager.TYPENAME); |
|
646 |
for (Document doc : tables) { |
|
647 |
TableDocument table = (TableDocument)doc; |
|
648 |
FeatureStore featureStore = table.getStore(); |
|
649 |
if( StringUtils.equals(featureStore.getFullName(), storeFullName)){ |
|
650 |
return true; |
|
651 |
} |
|
652 |
} |
|
653 |
return false; |
|
654 |
} |
|
655 |
|
|
656 |
@Override |
|
657 |
public MapControl getActiveMapControl() { |
|
658 |
try { |
|
659 |
ApplicationManager application = ApplicationLocator.getApplicationManager(); |
|
660 |
Project project = application.getCurrentProject(); |
|
661 |
|
|
662 |
ViewDocument viewDoc = (ViewDocument) project.getActiveDocument(ViewDocument.class); |
|
663 |
if( viewDoc == null ) { |
|
664 |
return null; |
|
665 |
} |
|
666 |
IView view = (IView) viewDoc.getMainComponent(); |
|
667 |
return view.getMapControl(); |
|
668 |
} catch(Throwable t) { |
|
669 |
return null; |
|
670 |
} |
|
671 |
} |
|
672 |
|
|
673 |
} |
org.gvsig.vcsgis/tags/org.gvsig.vcsgis-1.0.108/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.108/org.gvsig.vcsgis.app/org.gvsig.vcsgis.app.mainplugin/src/main/java/org/gvsig/vcsgis/app/preferencespages/VCSGisPageView.java | ||
---|---|---|
1 |
package org.gvsig.vcsgis.app.preferencespages; |
|
2 |
|
|
3 |
import com.jeta.forms.components.separator.TitledSeparator; |
|
4 |
import com.jeta.open.i18n.I18NUtils; |
|
5 |
import com.jgoodies.forms.layout.CellConstraints; |
|
6 |
import com.jgoodies.forms.layout.FormLayout; |
|
7 |
import java.awt.BorderLayout; |
|
8 |
import java.awt.ComponentOrientation; |
|
9 |
import java.awt.Container; |
|
10 |
import java.awt.Dimension; |
|
11 |
import javax.swing.Box; |
|
12 |
import javax.swing.ImageIcon; |
|
13 |
import javax.swing.JCheckBox; |
|
14 |
import javax.swing.JComboBox; |
|
15 |
import javax.swing.JFrame; |
|
16 |
import javax.swing.JLabel; |
|
17 |
import javax.swing.JPanel; |
|
18 |
import javax.swing.JTabbedPane; |
|
19 |
import org.gvsig.andami.preferences.AbstractPreferencePage; |
|
20 |
|
|
21 |
|
|
22 |
public abstract class VCSGisPageView extends AbstractPreferencePage |
|
23 |
{ |
|
24 |
JTabbedPane tabPreferences = new JTabbedPane(); |
|
25 |
JPanel tabPreferences1 = new JPanel(); |
|
26 |
JCheckBox chkEmptyEffectiveDateAllowedInCommitPanel = new JCheckBox(); |
|
27 |
JCheckBox chkCurrentDateAsEffectiveDateByDefaultInCommitPanel = new JCheckBox(); |
|
28 |
TitledSeparator lblChangesPanel = new TitledSeparator(); |
|
29 |
TitledSeparator lblAdvanced = new TitledSeparator(); |
|
30 |
JLabel lblRepositoryEntityFeatureTypeEditorMode = new JLabel(); |
|
31 |
JComboBox cboRepositoryEntityFeatureTypeEditorMode = new JComboBox(); |
|
32 |
JPanel gridWorkspaces = new JPanel(); |
|
33 |
|
|
34 |
/** |
|
35 |
* Default constructor |
|
36 |
*/ |
|
37 |
public VCSGisPageView() |
|
38 |
{ |
|
39 |
initializePanel(); |
|
40 |
} |
|
41 |
|
|
42 |
/** |
|
43 |
* Adds fill components to empty cells in the first row and first column of the grid. |
|
44 |
* This ensures that the grid spacing will be the same as shown in the designer. |
|
45 |
* @param cols an array of column indices in the first row where fill components should be added. |
|
46 |
* @param rows an array of row indices in the first column where fill components should be added. |
|
47 |
*/ |
|
48 |
void addFillComponents( Container panel, int[] cols, int[] rows ) |
|
49 |
{ |
|
50 |
Dimension filler = new Dimension(10,10); |
|
51 |
|
|
52 |
boolean filled_cell_11 = false; |
|
53 |
CellConstraints cc = new CellConstraints(); |
|
54 |
if ( cols.length > 0 && rows.length > 0 ) |
|
55 |
{ |
|
56 |
if ( cols[0] == 1 && rows[0] == 1 ) |
|
57 |
{ |
|
58 |
/** add a rigid area */ |
|
59 |
panel.add( Box.createRigidArea( filler ), cc.xy(1,1) ); |
|
60 |
filled_cell_11 = true; |
|
61 |
} |
|
62 |
} |
|
63 |
|
|
64 |
for( int index = 0; index < cols.length; index++ ) |
|
65 |
{ |
|
66 |
if ( cols[index] == 1 && filled_cell_11 ) |
|
67 |
{ |
|
68 |
continue; |
|
69 |
} |
|
70 |
panel.add( Box.createRigidArea( filler ), cc.xy(cols[index],1) ); |
|
71 |
} |
|
72 |
|
|
73 |
for( int index = 0; index < rows.length; index++ ) |
|
74 |
{ |
|
75 |
if ( rows[index] == 1 && filled_cell_11 ) |
|
76 |
{ |
|
77 |
continue; |
|
78 |
} |
|
79 |
panel.add( Box.createRigidArea( filler ), cc.xy(1,rows[index]) ); |
|
80 |
} |
|
81 |
|
|
82 |
} |
|
83 |
|
|
84 |
/** |
|
85 |
* Helper method to load an image file from the CLASSPATH |
|
86 |
* @param imageName the package and name of the file to load relative to the CLASSPATH |
|
87 |
* @return an ImageIcon instance with the specified image file |
|
88 |
* @throws IllegalArgumentException if the image resource cannot be loaded. |
|
89 |
*/ |
|
90 |
public ImageIcon loadImage( String imageName ) |
|
91 |
{ |
|
92 |
try |
|
93 |
{ |
|
94 |
ClassLoader classloader = getClass().getClassLoader(); |
|
95 |
java.net.URL url = classloader.getResource( imageName ); |
|
96 |
if ( url != null ) |
|
97 |
{ |
|
98 |
ImageIcon icon = new ImageIcon( url ); |
|
99 |
return icon; |
|
100 |
} |
|
101 |
} |
|
102 |
catch( Exception e ) |
|
103 |
{ |
|
104 |
e.printStackTrace(); |
|
105 |
} |
|
106 |
throw new IllegalArgumentException( "Unable to load image: " + imageName ); |
|
107 |
} |
|
108 |
|
|
109 |
/** |
|
110 |
* Method for recalculating the component orientation for |
|
111 |
* right-to-left Locales. |
|
112 |
* @param orientation the component orientation to be applied |
|
113 |
*/ |
|
114 |
public void applyComponentOrientation( ComponentOrientation orientation ) |
|
115 |
{ |
|
116 |
// Not yet implemented... |
|
117 |
// I18NUtils.applyComponentOrientation(this, orientation); |
|
118 |
super.applyComponentOrientation(orientation); |
|
119 |
} |
|
120 |
|
|
121 |
public JPanel createPanel() |
|
122 |
{ |
|
123 |
JPanel jpanel1 = new JPanel(); |
|
124 |
FormLayout formlayout1 = new FormLayout("FILL:4DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE","CENTER:2DLU:NONE,FILL:DEFAULT:GROW(1.0),CENTER:2DLU:NONE"); |
|
125 |
CellConstraints cc = new CellConstraints(); |
|
126 |
jpanel1.setLayout(formlayout1); |
|
127 |
|
|
128 |
tabPreferences.setName("tabPreferences"); |
|
129 |
tabPreferences.addTab("_General",null,createtabPreferences()); |
|
130 |
tabPreferences.addTab("_Working_copies",null,createPanel1()); |
|
131 |
jpanel1.add(tabPreferences,cc.xy(2,2)); |
|
132 |
|
|
133 |
addFillComponents(jpanel1,new int[]{ 1,2,3 },new int[]{ 1,2,3 }); |
|
134 |
return jpanel1; |
|
135 |
} |
|
136 |
|
|
137 |
public JPanel createtabPreferences() |
|
138 |
{ |
|
139 |
tabPreferences1.setName("tabPreferences"); |
|
140 |
FormLayout formlayout1 = new FormLayout("FILL:4DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE","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"); |
|
141 |
CellConstraints cc = new CellConstraints(); |
|
142 |
tabPreferences1.setLayout(formlayout1); |
|
143 |
|
|
144 |
chkEmptyEffectiveDateAllowedInCommitPanel.setActionCommand("_Use_of_empty_effective_date_is_allowed"); |
|
145 |
chkEmptyEffectiveDateAllowedInCommitPanel.setName("chkEmptyEffectiveDateAllowedInCommitPanel"); |
|
146 |
chkEmptyEffectiveDateAllowedInCommitPanel.setText("_Use_of_empty_effective_date_is_allowed"); |
|
147 |
tabPreferences1.add(chkEmptyEffectiveDateAllowedInCommitPanel,cc.xy(2,4)); |
|
148 |
|
|
149 |
chkCurrentDateAsEffectiveDateByDefaultInCommitPanel.setActionCommand("_Use_current_date_as_effective_date_by_default"); |
|
150 |
chkCurrentDateAsEffectiveDateByDefaultInCommitPanel.setName("chkCurrentDateAsEffectiveDateByDefaultInCommitPanel"); |
|
151 |
chkCurrentDateAsEffectiveDateByDefaultInCommitPanel.setText("_Use_current_date_as_effective_date_by_default"); |
|
152 |
tabPreferences1.add(chkCurrentDateAsEffectiveDateByDefaultInCommitPanel,cc.xy(2,6)); |
|
153 |
|
|
154 |
lblChangesPanel.setName("lblChangesPanel"); |
|
155 |
lblChangesPanel.setText("_Changes_panel"); |
|
156 |
tabPreferences1.add(lblChangesPanel,cc.xy(2,2)); |
|
157 |
|
|
158 |
lblAdvanced.setName("lblAdvanced"); |
|
159 |
lblAdvanced.setText("_Advanced"); |
|
160 |
tabPreferences1.add(lblAdvanced,cc.xy(2,8)); |
|
161 |
|
|
162 |
lblRepositoryEntityFeatureTypeEditorMode.setName("lblRepositoryEntityFeatureTypeEditorMode"); |
|
163 |
lblRepositoryEntityFeatureTypeEditorMode.setText("_VCS_Repository_entity_feature_type_editor_mode"); |
|
164 |
tabPreferences1.add(lblRepositoryEntityFeatureTypeEditorMode,cc.xy(2,10)); |
|
165 |
|
|
166 |
cboRepositoryEntityFeatureTypeEditorMode.setName("cboRepositoryEntityFeatureTypeEditorMode"); |
|
167 |
tabPreferences1.add(cboRepositoryEntityFeatureTypeEditorMode,cc.xy(2,12)); |
|
168 |
|
|
169 |
addFillComponents(tabPreferences1,new int[]{ 1,2,3 },new int[]{ 1,2,3,4,5,6,7,8,9,10,11,12,13 }); |
|
170 |
return tabPreferences1; |
|
171 |
} |
|
172 |
|
|
173 |
public JPanel createPanel1() |
|
174 |
{ |
|
175 |
JPanel jpanel1 = new JPanel(); |
|
176 |
FormLayout formlayout1 = new FormLayout("FILL:4DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE","CENTER:2DLU:NONE,FILL:DEFAULT:GROW(1.0),CENTER:2DLU:NONE"); |
|
177 |
CellConstraints cc = new CellConstraints(); |
|
178 |
jpanel1.setLayout(formlayout1); |
|
179 |
|
|
180 |
jpanel1.add(creategridWorkspaces(),cc.xy(2,2)); |
|
181 |
addFillComponents(jpanel1,new int[]{ 1,2,3 },new int[]{ 1,2,3 }); |
|
182 |
return jpanel1; |
|
183 |
} |
|
184 |
|
|
185 |
public JPanel creategridWorkspaces() |
|
186 |
{ |
|
187 |
gridWorkspaces.setName("gridWorkspaces"); |
|
188 |
FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:GROW(1.0)","FILL:DEFAULT:GROW(1.0)"); |
|
189 |
CellConstraints cc = new CellConstraints(); |
|
190 |
gridWorkspaces.setLayout(formlayout1); |
|
191 |
|
|
192 |
addFillComponents(gridWorkspaces,new int[]{ 1 },new int[]{ 1 }); |
|
193 |
return gridWorkspaces; |
|
194 |
} |
|
195 |
|
|
196 |
/** |
|
197 |
* Initializer |
|
198 |
*/ |
|
199 |
protected void initializePanel() |
|
200 |
{ |
|
201 |
setLayout(new BorderLayout()); |
Also available in: Unified diff