Revision 24759
branches/v2_0_0_prep/applications/appgvSIG/src/com/prodevelop/cit/gvsig/vectorialdb/wizard/VectorialDBConnectionTreeLeaf.java | ||
---|---|---|
45 | 45 |
import javax.swing.tree.DefaultMutableTreeNode; |
46 | 46 |
|
47 | 47 |
import org.apache.log4j.Logger; |
48 |
import org.gvsig.fmap.data.DataExplorerParameters; |
|
49 |
import org.gvsig.fmap.data.feature.db.DBParameters; |
|
48 |
import org.gvsig.fmap.dal.DataExplorerParameters; |
|
50 | 49 |
|
51 | 50 |
|
52 | 51 |
|
branches/v2_0_0_prep/applications/appgvSIG/src/com/prodevelop/cit/gvsig/vectorialdb/wizard/VectorialDBConnectionManagerDialog.java | ||
---|---|---|
45 | 45 |
import java.awt.Component; |
46 | 46 |
import java.awt.event.ActionEvent; |
47 | 47 |
import java.awt.event.ActionListener; |
48 |
import java.util.ArrayList; |
|
49 | 48 |
import java.util.HashMap; |
50 |
import java.util.Iterator; |
|
51 | 49 |
|
52 | 50 |
import javax.swing.JButton; |
53 | 51 |
import javax.swing.JOptionPane; |
... | ... | |
58 | 56 |
import javax.swing.tree.TreeCellRenderer; |
59 | 57 |
|
60 | 58 |
import org.apache.log4j.Logger; |
61 |
import org.gvsig.fmap.data.DataExplorerParameters; |
|
62 |
import org.gvsig.fmap.data.DataManager; |
|
63 |
import org.gvsig.fmap.data.InitializeException; |
|
59 |
import org.gvsig.fmap.dal.DataExplorerParameters; |
|
64 | 60 |
import org.gvsig.fmap.data.feature.db.DBExplorerParameters; |
65 |
import org.gvsig.fmap.data.feature.db.DBParameters; |
|
66 | 61 |
|
67 | 62 |
import com.iver.andami.PluginServices; |
68 | 63 |
import com.iver.andami.ui.mdiManager.IWindow; |
branches/v2_0_0_prep/applications/appgvSIG/src/com/prodevelop/cit/gvsig/vectorialdb/wizard/UserSelectedFieldsPanel.java | ||
---|---|---|
50 | 50 |
import javax.swing.JPanel; |
51 | 51 |
import javax.swing.JScrollPane; |
52 | 52 |
|
53 |
import org.gvsig.fmap.data.feature.FeatureAttributeDescriptor;
|
|
53 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor;
|
|
54 | 54 |
import org.gvsig.gui.beans.swing.JButton; |
55 | 55 |
|
56 | 56 |
import com.iver.andami.PluginServices; |
... | ... | |
123 | 123 |
int size = arr.length; |
124 | 124 |
ArrayList aux = new ArrayList(); |
125 | 125 |
|
126 |
for (int i = 0; i < size; i++) |
|
127 |
aux.add(arr[i]); |
|
126 |
for (int i = 0; i < size; i++) { |
|
127 |
aux.add(arr[i]); |
|
128 |
} |
|
128 | 129 |
|
129 | 130 |
aux.remove(item); |
130 | 131 |
|
branches/v2_0_0_prep/applications/appgvSIG/src/com/prodevelop/cit/gvsig/vectorialdb/wizard/WizardVectorialDB.java | ||
---|---|---|
58 | 58 |
import javax.swing.event.ListSelectionListener; |
59 | 59 |
|
60 | 60 |
import org.apache.log4j.Logger; |
61 |
import org.gvsig.fmap.data.DALLocator;
|
|
62 |
import org.gvsig.fmap.data.DataManager;
|
|
63 |
import org.gvsig.fmap.data.DataStoreParameters;
|
|
64 |
import org.gvsig.fmap.data.exceptions.InitializeException;
|
|
65 |
import org.gvsig.fmap.data.exceptions.ReadException;
|
|
61 |
import org.gvsig.fmap.dal.DALLocator;
|
|
62 |
import org.gvsig.fmap.dal.DataManager;
|
|
63 |
import org.gvsig.fmap.dal.DataStoreParameters;
|
|
64 |
import org.gvsig.fmap.dal.exception.InitializeException;
|
|
65 |
import org.gvsig.fmap.dal.exception.ReadException;
|
|
66 | 66 |
import org.gvsig.fmap.data.feature.db.DBExplorer; |
67 | 67 |
import org.gvsig.fmap.data.feature.db.DBExplorerParameters; |
68 | 68 |
import org.gvsig.fmap.data.feature.db.DBStoreParameters; |
... | ... | |
330 | 330 |
if (src==null) { |
331 | 331 |
return; |
332 | 332 |
} |
333 |
DataManager dm=DataManager.getManager();
|
|
333 |
DataManager dm = DALLocator.getDataManager();
|
|
334 | 334 |
DBExplorer dbExplorer; |
335 | 335 |
try { |
336 | 336 |
dbExplorer = (DBExplorer)dm.createDataExplorer(src); |
branches/v2_0_0_prep/applications/appgvSIG/src/com/prodevelop/cit/gvsig/vectorialdb/wizard/FieldsListItem.java | ||
---|---|---|
44 | 44 |
|
45 | 45 |
import javax.swing.JCheckBox; |
46 | 46 |
|
47 |
import org.gvsig.fmap.data.feature.FeatureAttributeDescriptor;
|
|
47 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor;
|
|
48 | 48 |
|
49 | 49 |
|
50 | 50 |
/** |
... | ... | |
60 | 60 |
public FieldsListItem(FeatureAttributeDescriptor descriptor) { |
61 | 61 |
|
62 | 62 |
name = descriptor.getName(); |
63 |
type = descriptor.getDataType(); |
|
63 |
type = descriptor.getDataTypeName();
|
|
64 | 64 |
setText(toString()); |
65 | 65 |
setSelected(true); |
66 | 66 |
} |
branches/v2_0_0_prep/applications/appgvSIG/src/com/prodevelop/cit/gvsig/vectorialdb/wizard/VectorialDBConnectionParamsDialog.java | ||
---|---|---|
47 | 47 |
import java.awt.event.ActionListener; |
48 | 48 |
import java.awt.event.KeyEvent; |
49 | 49 |
import java.awt.event.KeyListener; |
50 |
import java.util.List; |
|
50 | 51 |
|
51 | 52 |
import javax.swing.JButton; |
52 | 53 |
import javax.swing.JCheckBox; |
... | ... | |
57 | 58 |
import javax.swing.JTextField; |
58 | 59 |
|
59 | 60 |
import org.apache.log4j.Logger; |
60 |
import org.gvsig.fmap.data.DataExplorerParameters; |
|
61 |
import org.gvsig.fmap.data.DataManager; |
|
62 |
import org.gvsig.fmap.data.InitializeException; |
|
61 |
import org.gvsig.fmap.dal.DALLocator; |
|
62 |
import org.gvsig.fmap.dal.DataExplorerParameters; |
|
63 |
import org.gvsig.fmap.dal.DataManager; |
|
64 |
import org.gvsig.fmap.dal.exception.InitializeException; |
|
63 | 65 |
import org.gvsig.fmap.data.feature.db.DBExplorerParameters; |
64 |
import org.gvsig.fmap.data.feature.db.DBParameters; |
|
65 | 66 |
|
66 | 67 |
import com.iver.andami.PluginServices; |
67 | 68 |
import com.iver.andami.messages.NotificationManager; |
... | ... | |
243 | 244 |
if (driverComboBox == null) { |
244 | 245 |
driverComboBox = new JComboBox(); |
245 | 246 |
driverComboBox.addActionListener(this); |
246 |
DataManager dm = DataManager.getManager();
|
|
247 |
String[] drvName = dm.getRegistersExplorers();
|
|
247 |
DataManager dm = DALLocator.getDataManager();
|
|
248 |
List drvName = dm.getExplorerProviders();
|
|
248 | 249 |
DataExplorerParameters params; |
249 | 250 |
for (int i = 0; i < drvName.length; i++){ |
250 | 251 |
try { |
branches/v2_0_0_prep/applications/appgvSIG/src/com/prodevelop/cit/gvsig/vectorialdb/wizard/TablesListItem.java | ||
---|---|---|
48 | 48 |
import javax.swing.JCheckBox; |
49 | 49 |
|
50 | 50 |
import org.cresques.cts.IProjection; |
51 |
import org.gvsig.fmap.data.ReadException;
|
|
52 |
import org.gvsig.fmap.data.feature.FeatureAttributeDescriptor;
|
|
53 |
import org.gvsig.fmap.data.feature.FeatureType;
|
|
51 |
import org.gvsig.fmap.dal.exception.ReadException;
|
|
52 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor;
|
|
53 |
import org.gvsig.fmap.dal.feature.FeatureType;
|
|
54 | 54 |
import org.gvsig.fmap.data.feature.db.DBAttributeDescriptor; |
55 | 55 |
import org.gvsig.fmap.data.feature.db.DBExplorer; |
56 | 56 |
import org.gvsig.fmap.data.feature.db.DBStoreParameters; |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/RemoveTableUnion.java | ||
---|---|---|
1 | 1 |
package com.iver.cit.gvsig; |
2 | 2 |
|
3 |
import org.gvsig.fmap.data.CloseException; |
|
4 |
import org.gvsig.fmap.data.DataManager; |
|
5 |
import org.gvsig.fmap.data.DataStoreParameters; |
|
6 |
import org.gvsig.fmap.data.InitializeException; |
|
7 |
import org.gvsig.fmap.data.feature.FeatureStore; |
|
8 |
import org.gvsig.fmap.data.feature.joinstore.JoinFeatureStore; |
|
9 |
import org.gvsig.fmap.data.feature.joinstore.JoinFeatureStoreParameters; |
|
3 |
import org.gvsig.fmap.dal.DataManager; |
|
4 |
import org.gvsig.fmap.dal.DataStoreParameters; |
|
5 |
import org.gvsig.fmap.dal.exception.CloseException; |
|
6 |
import org.gvsig.fmap.dal.exception.InitializeException; |
|
7 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
10 | 8 |
|
11 | 9 |
import com.iver.andami.PluginServices; |
12 | 10 |
import com.iver.andami.messages.NotificationManager; |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/TableManageFields.java | ||
---|---|---|
46 | 46 |
*/ |
47 | 47 |
package com.iver.cit.gvsig; |
48 | 48 |
|
49 |
import org.gvsig.fmap.data.feature.FeatureStore;
|
|
49 |
import org.gvsig.fmap.dal.feature.FeatureStore;
|
|
50 | 50 |
|
51 | 51 |
import com.iver.andami.PluginServices; |
52 | 52 |
import com.iver.andami.plugins.Extension; |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/FFrameViewExtension.java | ||
---|---|---|
40 | 40 |
*/ |
41 | 41 |
package com.iver.cit.gvsig; |
42 | 42 |
|
43 |
import org.gvsig.fmap.data.ReadException;
|
|
43 |
import org.gvsig.fmap.dal.exception.ReadException;
|
|
44 | 44 |
|
45 | 45 |
import com.iver.andami.PluginServices; |
46 | 46 |
import com.iver.andami.messages.NotificationManager; |
... | ... | |
116 | 116 |
public boolean isEnabled() { |
117 | 117 |
Layout l = (Layout)PluginServices.getMDIManager().getActiveWindow(); |
118 | 118 |
IFFrame[] fframes = l.getLayoutContext().getFFrameSelected(); |
119 |
if (!l.getLayoutContext().isEditable()) |
|
119 |
if (!l.getLayoutContext().isEditable()) {
|
|
120 | 120 |
return false; |
121 |
} |
|
121 | 122 |
for (int i = 0; i < fframes.length; i++) { |
122 | 123 |
if (fframes[i] instanceof FFrameView) { |
123 |
if (((FFrameView)fframes[i]).getView()!=null) |
|
124 |
return true; |
|
124 |
if (((FFrameView)fframes[i]).getView()!=null) { |
|
125 |
return true; |
|
126 |
} |
|
125 | 127 |
} |
126 | 128 |
} |
127 | 129 |
|
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/TableFieldOperations.java | ||
---|---|---|
1 | 1 |
package com.iver.cit.gvsig; |
2 | 2 |
|
3 |
import java.io.IOException; |
|
4 | 3 |
import java.util.BitSet; |
5 | 4 |
|
6 |
import org.gvsig.fmap.data.feature.FeatureAttributeDescriptor;
|
|
7 |
import org.gvsig.fmap.data.feature.FeatureStore;
|
|
5 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor;
|
|
6 |
import org.gvsig.fmap.dal.feature.FeatureStore;
|
|
8 | 7 |
|
9 | 8 |
import com.iver.andami.PluginServices; |
10 |
import com.iver.andami.messages.NotificationManager; |
|
11 | 9 |
import com.iver.andami.plugins.Extension; |
12 | 10 |
import com.iver.andami.ui.mdiManager.IWindow; |
13 | 11 |
import com.iver.cit.gvsig.project.documents.table.gui.Table; |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/TableEditChangeColumnsExtension.java | ||
---|---|---|
40 | 40 |
*/ |
41 | 41 |
package com.iver.cit.gvsig; |
42 | 42 |
|
43 |
import java.sql.Types;
|
|
43 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor;
|
|
44 | 44 |
|
45 |
import org.gvsig.fmap.data.feature.AttributeDescriptor; |
|
46 |
import org.gvsig.fmap.data.feature.FeatureAttributeDescriptor; |
|
47 |
import org.gvsig.fmap.data.feature.FeatureType; |
|
48 |
import org.gvsig.fmap.data.feature.IsNotAttributeSettingException; |
|
49 |
|
|
50 | 45 |
import com.iver.andami.PluginServices; |
51 | 46 |
import com.iver.andami.plugins.Extension; |
52 | 47 |
import com.iver.andami.ui.mdiManager.IWindow; |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/TableEditCutExtension.java | ||
---|---|---|
40 | 40 |
*/ |
41 | 41 |
package com.iver.cit.gvsig; |
42 | 42 |
|
43 |
import org.gvsig.fmap.data.ReadException;
|
|
43 |
import org.gvsig.fmap.dal.exception.ReadException;
|
|
44 | 44 |
|
45 | 45 |
import com.iver.andami.PluginServices; |
46 | 46 |
import com.iver.andami.messages.NotificationManager; |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/IntializeApplicationExtension.java | ||
---|---|---|
10 | 10 |
import java.util.Properties; |
11 | 11 |
|
12 | 12 |
import org.apache.log4j.Logger; |
13 |
import org.gvsig.fmap.data.Resource; |
|
14 |
import org.gvsig.fmap.data.ResourceManager; |
|
15 |
import org.gvsig.fmap.data.feature.db.jdbc.postgresql.PostgresqlStore; |
|
16 |
import org.gvsig.fmap.mapcontext.layers.LayerFactory; |
|
13 |
import org.gvsig.fmap.dal.DALLocator; |
|
14 |
import org.gvsig.fmap.dal.resource.ResourceManager; |
|
17 | 15 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLayerFileVectorial; |
18 | 16 |
import org.gvsig.tools.observer.Observer; |
19 | 17 |
|
... | ... | |
52 | 50 |
registerObservers(); |
53 | 51 |
} |
54 | 52 |
private void registerObservers() { |
55 |
ResourceManager resMan = ResourceManager.getResourceManager();//.getResource(PostgresqlStore.DATASTORE_NAME);
|
|
53 |
ResourceManager resMan = DALLocator.getResourceManager();//.getResource(PostgresqlStore.DATASTORE_NAME);
|
|
56 | 54 |
dbPasswordResorceObserver = new DBResourceManager(); |
57 | 55 |
resMan.addObserver(dbPasswordResorceObserver); |
58 | 56 |
} |
... | ... | |
180 | 178 |
InputStream is = p.getInputStream(); |
181 | 179 |
BufferedReader reader = new BufferedReader(new InputStreamReader(is)); |
182 | 180 |
String line; |
183 |
while ( (line = reader.readLine()) != null) |
|
181 |
while ( (line = reader.readLine()) != null) {
|
|
184 | 182 |
writer.write(" "+line+"\n"); |
183 |
} |
|
185 | 184 |
} |
186 | 185 |
catch (Exception ex) { |
187 | 186 |
|
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/TableNumericFieldOperations.java | ||
---|---|---|
1 | 1 |
package com.iver.cit.gvsig; |
2 | 2 |
|
3 | 3 |
import java.math.BigDecimal; |
4 |
import java.sql.Types; |
|
5 | 4 |
import java.util.BitSet; |
6 | 5 |
import java.util.Iterator; |
7 | 6 |
|
8 |
import org.gvsig.fmap.data.ReadException; |
|
9 |
import org.gvsig.fmap.data.feature.Feature; |
|
10 |
import org.gvsig.fmap.data.feature.FeatureAttributeDescriptor; |
|
11 |
import org.gvsig.fmap.data.feature.FeatureCollection; |
|
12 |
import org.gvsig.fmap.data.feature.FeatureStore; |
|
7 |
import org.gvsig.fmap.dal.exception.ReadException; |
|
8 |
import org.gvsig.fmap.dal.feature.Feature; |
|
9 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
|
10 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
13 | 11 |
import org.gvsig.fmap.mapcontext.rendering.legend.NullValue; |
12 |
import org.opengis.feature.FeatureCollection; |
|
14 | 13 |
|
15 | 14 |
import com.iver.andami.PluginServices; |
16 |
import com.iver.andami.messages.NotificationManager; |
|
17 | 15 |
import com.iver.andami.plugins.Extension; |
18 | 16 |
import com.iver.andami.ui.mdiManager.IWindow; |
19 | 17 |
import com.iver.cit.gvsig.project.documents.table.gui.Statistics; |
... | ... | |
88 | 86 |
double d=number.doubleValue(); |
89 | 87 |
numRows++; |
90 | 88 |
suma = suma.add(new BigDecimal(d)); |
91 |
if (d < min.doubleValue()) min = new BigDecimal(d); |
|
92 |
if (d > max.doubleValue()) max = new BigDecimal(d); |
|
89 |
if (d < min.doubleValue()) { |
|
90 |
min = new BigDecimal(d); |
|
91 |
} |
|
92 |
if (d > max.doubleValue()) { |
|
93 |
max = new BigDecimal(d); |
|
94 |
} |
|
93 | 95 |
} |
94 | 96 |
}else{ |
95 | 97 |
|
... | ... | |
110 | 112 |
double d=number.doubleValue(); |
111 | 113 |
numRows++; |
112 | 114 |
suma = suma.add(new BigDecimal(d)); |
113 |
if (d < min.doubleValue()) min = new BigDecimal(d); |
|
114 |
if (d > max.doubleValue()) max = new BigDecimal(d); |
|
115 |
if (d < min.doubleValue()) { |
|
116 |
min = new BigDecimal(d); |
|
117 |
} |
|
118 |
if (d > max.doubleValue()) { |
|
119 |
max = new BigDecimal(d); |
|
120 |
} |
|
115 | 121 |
} |
116 | 122 |
} |
117 | 123 |
Statistics st = new Statistics(); |
... | ... | |
224 | 230 |
if (indices.cardinality() == 1){ |
225 | 231 |
// try { |
226 | 232 |
int index=indices.nextSetBit(0); |
227 |
if (table.getModel().getModel().getDefaultFeatureType().size()<index+1) |
|
233 |
if (table.getModel().getModel().getDefaultFeatureType().size()<index+1) {
|
|
228 | 234 |
return false; |
235 |
} |
|
229 | 236 |
String type = ((FeatureAttributeDescriptor)table.getModel().getModel().getDefaultFeatureType().get(index)).getDataType(); |
230 | 237 |
if ((type.equals(FeatureAttributeDescriptor.TYPE_LONG)) || |
231 | 238 |
(type.equals(FeatureAttributeDescriptor.TYPE_DOUBLE)) || |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/ProjectFactory.java | ||
---|---|---|
40 | 40 |
*/ |
41 | 41 |
package com.iver.cit.gvsig.project; |
42 | 42 |
|
43 |
import org.gvsig.fmap.data.feature.FeatureStore;
|
|
43 |
import org.gvsig.fmap.dal.feature.FeatureStore;
|
|
44 | 44 |
|
45 | 45 |
import com.iver.cit.gvsig.project.documents.ProjectDocumentFactory; |
46 | 46 |
import com.iver.cit.gvsig.project.documents.layout.ProjectMap; |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/ProjectDocument.java | ||
---|---|---|
48 | 48 |
import java.util.HashMap; |
49 | 49 |
import java.util.Iterator; |
50 | 50 |
|
51 |
import org.gvsig.fmap.data.ReadException; |
|
51 |
import org.gvsig.fmap.dal.exception.ReadException; |
|
52 |
import org.gvsig.tools.exception.DriverException; |
|
52 | 53 |
|
53 | 54 |
import com.iver.andami.PluginServices; |
54 | 55 |
import com.iver.andami.messages.NotificationManager; |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/table/ProjectTable.java | ||
---|---|---|
42 | 42 |
|
43 | 43 |
import java.util.ArrayList; |
44 | 44 |
|
45 |
import org.gvsig.fmap.data.ReadException;
|
|
46 |
import org.gvsig.fmap.data.feature.AbstractFeatureStore;
|
|
47 |
import org.gvsig.fmap.data.feature.FeatureStore;
|
|
48 |
import org.gvsig.fmap.data.feature.FeatureType;
|
|
45 |
import org.gvsig.fmap.dal.exception.DataException;
|
|
46 |
import org.gvsig.fmap.dal.exception.ReadException;
|
|
47 |
import org.gvsig.fmap.dal.feature.FeatureStore;
|
|
48 |
import org.gvsig.fmap.dal.feature.FeatureType;
|
|
49 | 49 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
50 | 50 |
import org.gvsig.fmap.mapcontext.layers.FLayers; |
51 | 51 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
52 |
import org.gvsig.tools.exception.DriverException; |
|
52 | 53 |
|
53 | 54 |
import com.iver.andami.messages.NotificationManager; |
54 | 55 |
import com.iver.andami.ui.mdiManager.IWindow; |
... | ... | |
151 | 152 |
|
152 | 153 |
|
153 | 154 |
|
154 |
public void createAlias() throws ReadException {
|
|
155 |
public void createAlias() throws DataException {
|
|
155 | 156 |
FeatureType sds = esModel.getDefaultFeatureType(); |
156 | 157 |
// mapping = new int[sds.getFieldCount()+1]; |
157 | 158 |
// alias = new String[sds.getFieldCount()+1]; |
... | ... | |
162 | 163 |
alias = new String[size]; |
163 | 164 |
for (int i = 0; i < size; i++) { |
164 | 165 |
mapping[i]=i; |
165 |
alias[i]=sds.getByOrder(i).getName();
|
|
166 |
alias[i] = sds.getAttributeDescriptor(i).getName();
|
|
166 | 167 |
|
167 | 168 |
// if (i==0){ |
168 | 169 |
// mapping[i]=i; |
... | ... | |
660 | 661 |
|
661 | 662 |
public void setModel(FeatureStore fstore) { |
662 | 663 |
setTheModel(fstore); |
663 |
((AbstractFeatureStore)fstore).notifyResourceChange(); |
|
664 |
//((AbstractFeatureStore)fstore).notifyResourceChange();
|
|
664 | 665 |
try { |
665 | 666 |
// if (mapping==null) { |
666 | 667 |
createAlias(); |
667 | 668 |
// } |
668 |
} catch (ReadException e) {
|
|
669 |
} catch (DataException e) {
|
|
669 | 670 |
e.printStackTrace(); |
670 | 671 |
NotificationManager.addError(e); |
671 | 672 |
} |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/table/ProjectTableFactory.java | ||
---|---|---|
4 | 4 |
import java.text.DateFormat; |
5 | 5 |
import java.util.Date; |
6 | 6 |
import java.util.Hashtable; |
7 |
import java.util.List; |
|
7 | 8 |
|
8 | 9 |
import javax.swing.ImageIcon; |
9 | 10 |
import javax.swing.JPanel; |
10 | 11 |
|
11 |
import org.gvsig.fmap.data.DataManager;
|
|
12 |
import org.gvsig.fmap.data.DataStoreParameters;
|
|
13 |
import org.gvsig.fmap.data.ReadException;
|
|
14 |
import org.gvsig.fmap.data.feature.FeatureStore;
|
|
12 |
import org.gvsig.fmap.dal.DALLocator;
|
|
13 |
import org.gvsig.fmap.dal.DataManager;
|
|
14 |
import org.gvsig.fmap.dal.DataStoreParameters;
|
|
15 |
import org.gvsig.fmap.dal.exception.ReadException;
|
|
15 | 16 |
import org.gvsig.fmap.data.feature.db.DBParameters; |
16 | 17 |
import org.gvsig.fmap.data.feature.db.DBStoreParameters; |
17 |
import org.gvsig.fmap.data.feature.file.FileStoreParameters; |
|
18 | 18 |
|
19 | 19 |
import com.iver.andami.PluginServices; |
20 | 20 |
import com.iver.cit.gvsig.AddLayer; |
... | ... | |
92 | 92 |
PluginServices.getMDIManager().addWindow(fopen); |
93 | 93 |
wp.setMapCtrl(null); |
94 | 94 |
wp.execute(); |
95 |
DataManager dm=DataManager.getManager();
|
|
95 |
DataManager dm = DALLocator.getDataManager();
|
|
96 | 96 |
if (fopen.isAccepted()) { |
97 | 97 |
JPanel panel = fopen.getSelectedTab(); |
98 | 98 |
|
... | ... | |
102 | 102 |
ProjectTable projectTable=null; |
103 | 103 |
for (int i = 0; i < files.length; i++) { |
104 | 104 |
String name = files[i].getName(); |
105 |
String[] stores=dm.getRegistersStores();
|
|
106 |
for (int j=0;j<stores.length;j++){
|
|
105 |
List stores = dm.getStoreProviders();
|
|
106 |
for (int j = 0; j < stores.size(); j++) {
|
|
107 | 107 |
DataStoreParameters dsp=dm.createDataStoreParameters(stores[j]); |
108 | 108 |
if (dsp.getDescription().equals(driverNames[i])){ |
109 | 109 |
FileStoreParameters fileParameters=(FileStoreParameters)dsp; |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/view/ProjectView.java | ||
---|---|---|
46 | 46 |
import java.util.TreeMap; |
47 | 47 |
import java.util.Map.Entry; |
48 | 48 |
|
49 |
import org.gvsig.fmap.data.ReadException; |
|
50 | 49 |
import org.gvsig.fmap.mapcontext.MapContext; |
51 | 50 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
52 | 51 |
import org.gvsig.fmap.mapcontext.layers.FLayers; |
53 | 52 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
53 |
import org.gvsig.tools.exception.DriverException; |
|
54 | 54 |
|
55 | 55 |
import com.iver.andami.PluginServices; |
56 | 56 |
import com.iver.andami.ui.mdiManager.IWindow; |
... | ... | |
90 | 90 |
XMLEntity xml = super.getXMLEntity(); |
91 | 91 |
//xml.putProperty("nameClass", this.getClass().getName()); |
92 | 92 |
try{ |
93 |
int numViews=((Integer)ProjectDocument.NUMS.get(ProjectViewFactory.registerName)).intValue();
|
|
93 |
int numViews=(ProjectDocument.NUMS.get(ProjectViewFactory.registerName)).intValue(); |
|
94 | 94 |
|
95 | 95 |
xml.putProperty("numViews", numViews); |
96 | 96 |
xml.putProperty("m_selectedField", m_selectedField); |
... | ... | |
134 | 134 |
int numViews = xml.getIntProperty("numViews"); |
135 | 135 |
ProjectDocument.NUMS.put(ProjectViewFactory.registerName,new Integer(numViews)); |
136 | 136 |
|
137 |
if (xml.contains("m_selectedField")) |
|
137 |
if (xml.contains("m_selectedField")) {
|
|
138 | 138 |
m_selectedField = xml.getStringProperty("m_selectedField"); |
139 |
} |
|
139 | 140 |
m_typeLink = xml.getIntProperty("m_typeLink"); |
140 |
if (xml.contains("m_extLink")) |
|
141 |
if (xml.contains("m_extLink")) {
|
|
141 | 142 |
m_extLink = xml.getStringProperty("m_extLink"); |
143 |
} |
|
142 | 144 |
|
143 | 145 |
setMapContext(MapContext.createFromXML(xml.getChild(currentChild))); |
144 | 146 |
currentChild++; |
... | ... | |
175 | 177 |
|
176 | 178 |
public IWindow createWindow() { |
177 | 179 |
com.iver.cit.gvsig.project.documents.view.gui.View view = new com.iver.cit.gvsig.project.documents.view.gui.View(); |
178 |
if (windowData != null) |
|
180 |
if (windowData != null) {
|
|
179 | 181 |
view.setWindowData(windowData); |
182 |
} |
|
180 | 183 |
view.initialize(); |
181 | 184 |
view.setModel(this); |
182 | 185 |
return view; |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/view/MapOverview.java | ||
---|---|---|
57 | 57 |
import java.awt.image.BufferedImage; |
58 | 58 |
|
59 | 59 |
import org.cresques.cts.IProjection; |
60 |
import org.gvsig.fmap.data.ReadException;
|
|
60 |
import org.gvsig.fmap.dal.exception.ReadException;
|
|
61 | 61 |
import org.gvsig.fmap.geom.primitive.Envelope; |
62 | 62 |
import org.gvsig.fmap.mapcontext.MapContext; |
63 | 63 |
import org.gvsig.fmap.mapcontext.ViewPort; |
... | ... | |
228 | 228 |
ViewPort vp = getMapContext().getViewPort(); |
229 | 229 |
Envelope extentView=vp.getAdjustedExtent(); |
230 | 230 |
ViewPort vpOrig = m_MapAssoc.getMapContext().getViewPort(); |
231 |
if (extent==null) |
|
231 |
if (extent==null) {
|
|
232 | 232 |
extent=vpOrig.getAdjustedExtent(); |
233 |
} |
|
233 | 234 |
// Dibujamos el extent del mapa asociado. |
234 | 235 |
Graphics2D g2 = (Graphics2D) image.getGraphics(); |
235 | 236 |
g2.setTransform(vp.getAffineTransform()); |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/view/gui/General.java | ||
---|---|---|
53 | 53 |
import javax.swing.ButtonGroup; |
54 | 54 |
import javax.swing.JPanel; |
55 | 55 |
|
56 |
import org.gvsig.fmap.data.ReadException;
|
|
56 |
import org.gvsig.fmap.dal.exception.ReadException;
|
|
57 | 57 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
58 | 58 |
import org.gvsig.fmap.mapcontext.layers.operations.ClassifiableVectorial; |
59 | 59 |
import org.gvsig.fmap.mapcontext.layers.operations.SingleLayer; |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/view/toc/actions/CopyPasteLayersUtiles.java | ||
---|---|---|
2 | 2 |
|
3 | 3 |
import java.util.ArrayList; |
4 | 4 |
|
5 |
import org.gvsig.fmap.data.ReadException; |
|
6 | 5 |
import org.gvsig.fmap.mapcontext.layers.CancelationException; |
7 | 6 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
8 | 7 |
import org.gvsig.fmap.mapcontext.layers.FLayers; |
9 |
import org.gvsig.fmap.mapcontext.layers.LayerFactory; |
|
10 | 8 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
11 | 9 |
|
12 | 10 |
import com.iver.andami.PluginServices; |
... | ... | |
15 | 13 |
import com.iver.cit.gvsig.project.Project; |
16 | 14 |
import com.iver.cit.gvsig.project.documents.ProjectDocument; |
17 | 15 |
import com.iver.cit.gvsig.project.documents.exceptions.OpenException; |
18 |
import com.iver.cit.gvsig.project.documents.exceptions.SaveException; |
|
19 | 16 |
import com.iver.cit.gvsig.project.documents.table.ProjectTable; |
20 | 17 |
import com.iver.cit.gvsig.project.documents.table.ProjectTableFactory; |
21 | 18 |
import com.iver.utiles.XMLEntity; |
... | ... | |
40 | 37 |
XMLEntity xmlDataSources = this.newDataSourcesNode(); |
41 | 38 |
|
42 | 39 |
for (int i=0;i < actives.length; i++) { |
43 |
if (!this.addToXMLLayer(actives[i],xmlLayers ,xmlTables,xmlDataSources)) return null; |
|
40 |
if (!this.addToXMLLayer(actives[i],xmlLayers ,xmlTables,xmlDataSources)) { |
|
41 |
return null; |
|
42 |
} |
|
44 | 43 |
|
45 | 44 |
} |
46 | 45 |
|
... | ... | |
75 | 74 |
XMLEntity xmlTables = xml.firstChild("type","tables"); |
76 | 75 |
XMLEntity xmlDataSources = xml.firstChild("type","dataSources"); |
77 | 76 |
|
78 |
if (xmlLayers == null ) return false; |
|
77 |
if (xmlLayers == null ) { |
|
78 |
return false; |
|
79 |
} |
|
79 | 80 |
|
80 | 81 |
// Se pegan las tablas igualmente |
81 | 82 |
/* |
... | ... | |
86 | 87 |
|
87 | 88 |
|
88 | 89 |
if (xmlDataSources != null) { |
89 |
if (!this.registerDataSources(xmlDataSources)) return false; |
|
90 |
if (!this.registerDataSources(xmlDataSources)) { |
|
91 |
return false; |
|
92 |
} |
|
90 | 93 |
} |
91 | 94 |
|
92 |
if (!this.addLayers(xmlLayers,root)) return false; |
|
95 |
if (!this.addLayers(xmlLayers,root)) { |
|
96 |
return false; |
|
97 |
} |
|
93 | 98 |
|
94 | 99 |
if (xmlTables != null) { |
95 |
if (!this.addTables(xmlTables)) return false; |
|
100 |
if (!this.addTables(xmlTables)) { |
|
101 |
return false; |
|
102 |
} |
|
96 | 103 |
} |
97 | 104 |
|
98 | 105 |
return true; |
... | ... | |
104 | 111 |
XMLEntity xmlDataSources = xml.firstChild("type","dataSources"); |
105 | 112 |
|
106 | 113 |
|
107 |
if (xmlTables == null ) return false; |
|
114 |
if (xmlTables == null ) { |
|
115 |
return false; |
|
116 |
} |
|
108 | 117 |
|
109 | 118 |
/* |
110 | 119 |
Project project = this.getProject(); |
... | ... | |
113 | 122 |
*/ |
114 | 123 |
|
115 | 124 |
if (xmlDataSources != null) { |
116 |
if (!this.registerDataSources(xmlDataSources)) return false; |
|
125 |
if (!this.registerDataSources(xmlDataSources)) { |
|
126 |
return false; |
|
127 |
} |
|
117 | 128 |
} |
118 | 129 |
|
119 | 130 |
|
... | ... | |
123 | 134 |
|
124 | 135 |
|
125 | 136 |
public boolean checkXMLRootNode(XMLEntity xml) { |
126 |
if (!xml.contains("applicationName")) return false; |
|
127 |
if (!xml.getStringProperty("applicationName").equalsIgnoreCase("gvSIG")) return false; |
|
137 |
if (!xml.contains("applicationName")) { |
|
138 |
return false; |
|
139 |
} |
|
140 |
if (!xml.getStringProperty("applicationName").equalsIgnoreCase("gvSIG")) { |
|
141 |
return false; |
|
142 |
} |
|
128 | 143 |
|
129 |
if (!xml.contains("version")) return false; |
|
130 |
if (!xml.getStringProperty("version").equalsIgnoreCase(Version.format())) return false; |
|
144 |
if (!xml.contains("version")) { |
|
145 |
return false; |
|
146 |
} |
|
147 |
if (!xml.getStringProperty("version").equalsIgnoreCase(Version.format())) { |
|
148 |
return false; |
|
149 |
} |
|
131 | 150 |
|
132 | 151 |
return true; |
133 | 152 |
} |
... | ... | |
192 | 211 |
private boolean addTables(XMLEntity xmlTables) { |
193 | 212 |
try { |
194 | 213 |
int numTables = xmlTables.getChildrenCount(); |
195 |
if (numTables == 0) return true; |
|
214 |
if (numTables == 0) { |
|
215 |
return true; |
|
216 |
} |
|
196 | 217 |
|
197 | 218 |
Project project = this.getProject(); |
198 | 219 |
|
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/view/toc/actions/ZoomAlTemaTocMenuEntry.java | ||
---|---|---|
1 | 1 |
package com.iver.cit.gvsig.project.documents.view.toc.actions; |
2 | 2 |
|
3 |
import java.awt.geom.Rectangle2D; |
|
4 |
|
|
5 |
import org.gvsig.fmap.data.ReadException; |
|
3 |
import org.gvsig.fmap.dal.exception.ReadException; |
|
6 | 4 |
import org.gvsig.fmap.geom.primitive.DefaultEnvelope; |
7 | 5 |
import org.gvsig.fmap.geom.primitive.Envelope; |
8 | 6 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
... | ... | |
117 | 115 |
|
118 | 116 |
if (selectedItems.length==1) { |
119 | 117 |
try { |
120 |
if (!selectedItems[0].isAvailable()) return; |
|
118 |
if (!selectedItems[0].isAvailable()) { |
|
119 |
return; |
|
120 |
} |
|
121 | 121 |
getMapContext().zoomToEnvelope(selectedItems[0].getFullEnvelope()); |
122 | 122 |
} catch (ReadException e1) { |
123 | 123 |
e1.printStackTrace(); |
... | ... | |
150 | 150 |
double maxYVar = extVar.getMaximum(1); |
151 | 151 |
double maxXVar = extVar.getMaximum(0); |
152 | 152 |
double minYVar = extVar.getMinimum(1); |
153 |
if (minXVar <= minXRef) |
|
153 |
if (minXVar <= minXRef) {
|
|
154 | 154 |
minXRef = minXVar; |
155 |
if (maxYVar >= maxYRef) |
|
155 |
} |
|
156 |
if (maxYVar >= maxYRef) { |
|
156 | 157 |
maxYRef = maxYVar; |
157 |
if (maxXVar >= maxXRef) |
|
158 |
} |
|
159 |
if (maxXVar >= maxXRef) { |
|
158 | 160 |
maxXRef = maxXVar; |
159 |
if (minYVar <= minYRef) |
|
161 |
} |
|
162 |
if (minYVar <= minYRef) { |
|
160 | 163 |
minYRef = minYVar; |
164 |
} |
|
161 | 165 |
extRef=new DefaultEnvelope(2,new double[]{minXRef, minYRef},new double[]{ maxXRef, maxYRef}); |
162 | 166 |
} |
163 | 167 |
} |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/view/toc/actions/ChangeSymbolTocMenuEntry.java | ||
---|---|---|
1 | 1 |
package com.iver.cit.gvsig.project.documents.view.toc.actions; |
2 | 2 |
|
3 | 3 |
import org.apache.log4j.Logger; |
4 |
import org.gvsig.fmap.data.ReadException;
|
|
4 |
import org.gvsig.fmap.dal.exception.ReadException;
|
|
5 | 5 |
import org.gvsig.fmap.mapcontext.MapContext; |
6 | 6 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
7 | 7 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
... | ... | |
127 | 127 |
|
128 | 128 |
boolean showDialog = isTocItemLeaf(item); |
129 | 129 |
|
130 |
if (!showDialog) return; |
|
130 |
if (!showDialog) { |
|
131 |
return; |
|
132 |
} |
|
131 | 133 |
|
132 | 134 |
try { |
133 | 135 |
FLyrVect layer = (FLyrVect) selectedItems[0]; |
... | ... | |
172 | 174 |
PluginServices.getMDIManager().addWindow(symSel); |
173 | 175 |
ISymbol newSymbol = (ISymbol) symSel.getSelectedObject(); |
174 | 176 |
|
175 |
if (newSymbol == null) |
|
177 |
if (newSymbol == null) {
|
|
176 | 178 |
return; |
179 |
} |
|
177 | 180 |
|
178 | 181 |
newSymbol.setDescription(oldSymbol.getDescription()); |
179 | 182 |
|
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/view/toc/gui/TOC.java | ||
---|---|---|
77 | 77 |
import javax.swing.tree.TreePath; |
78 | 78 |
import javax.swing.tree.TreeSelectionModel; |
79 | 79 |
|
80 |
import org.gvsig.fmap.data.ReadException;
|
|
80 |
import org.gvsig.fmap.dal.exception.ReadException;
|
|
81 | 81 |
import org.gvsig.fmap.mapcontext.MapContext; |
82 | 82 |
import org.gvsig.fmap.mapcontext.events.AtomicEvent; |
83 | 83 |
import org.gvsig.fmap.mapcontext.events.listeners.AtomicEventListener; |
... | ... | |
308 | 308 |
|
309 | 309 |
for (int i = theLayers.getLayersCount() - 1; i >= 0; i--) { |
310 | 310 |
FLayer lyr = theLayers.getLayer(i); |
311 |
if (!lyr.isInTOC()) |
|
311 |
if (!lyr.isInTOC()) {
|
|
312 | 312 |
continue; |
313 |
} |
|
313 | 314 |
TocItemBranch elTema = new TocItemBranch(lyr); |
314 | 315 |
elTema.setSize(sizeBranch); |
315 | 316 |
|
... | ... | |
907 | 908 |
boolean isSelected = false; |
908 | 909 |
for (int i = 0; i < layers.getLayersCount(); i++) { |
909 | 910 |
FLayer layer = layers.getLayer(i); |
910 |
if (!isSelected) |
|
911 |
if (!isSelected) {
|
|
911 | 912 |
isSelected = layer.isActive(); |
912 |
else { |
|
913 |
} else {
|
|
913 | 914 |
updateActive(layer, true); |
914 | 915 |
if (lyr.equals(layer)) { |
915 | 916 |
isSelected = false; |
... | ... | |
924 | 925 |
boolean isSelected = false; |
925 | 926 |
for (int i = layers.getLayersCount() - 1; i >= 0; i--) { |
926 | 927 |
FLayer layer = layers.getLayer(i); |
927 |
if (!isSelected) |
|
928 |
if (!isSelected) {
|
|
928 | 929 |
isSelected = layer.isActive(); |
929 |
else { |
|
930 |
} else {
|
|
930 | 931 |
updateActive(layer, true); |
931 | 932 |
if (lyr.equals(layer)) { |
932 | 933 |
isSelected = false; |
... | ... | |
1013 | 1014 |
* Capa a actualizar. |
1014 | 1015 |
*/ |
1015 | 1016 |
private void updateVisibleParent(FLayer lyr) { |
1016 |
FLayers parent = (FLayers) lyr.getParentLayer();
|
|
1017 |
FLayers parent = lyr.getParentLayer(); |
|
1017 | 1018 |
|
1018 | 1019 |
if (parent != null) { |
1019 | 1020 |
boolean parentVisible = false; |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/view/toolListeners/InfoListener.java | ||
---|---|---|
40 | 40 |
*/ |
41 | 41 |
package com.iver.cit.gvsig.project.documents.view.toolListeners; |
42 | 42 |
|
43 |
import java.awt.Cursor; |
|
44 | 43 |
import java.awt.Image; |
45 | 44 |
import java.awt.Point; |
46 |
import java.awt.Toolkit; |
|
47 | 45 |
import java.awt.geom.Point2D; |
48 | 46 |
import java.util.Vector; |
49 | 47 |
|
... | ... | |
53 | 51 |
import javax.swing.tree.TreePath; |
54 | 52 |
|
55 | 53 |
import org.apache.log4j.Logger; |
56 |
import org.gvsig.fmap.data.ReadException;
|
|
57 |
import org.gvsig.fmap.data.feature.FeatureCollection;
|
|
58 |
import org.gvsig.fmap.data.feature.FeatureStore;
|
|
54 |
import org.gvsig.fmap.dal.exception.DataException;
|
|
55 |
import org.gvsig.fmap.dal.exception.ReadException;
|
|
56 |
import org.gvsig.fmap.dal.feature.FeatureSelection;
|
|
59 | 57 |
import org.gvsig.fmap.mapcontext.exceptions.LoadLayerException; |
60 |
import org.gvsig.fmap.mapcontext.layers.FBitSet; |
|
61 | 58 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
62 | 59 |
import org.gvsig.fmap.mapcontext.layers.operations.InfoByPoint; |
63 | 60 |
import org.gvsig.fmap.mapcontext.layers.operations.VectorialXMLItem; |
... | ... | |
147 | 144 |
final XMLItem[] items = new XMLItem[sel.length]; |
148 | 145 |
|
149 | 146 |
for (int i = 0; i < sel.length; i++) { |
150 |
FLayer laCapa = (FLayer) sel[i];
|
|
147 |
FLayer laCapa = sel[i]; |
|
151 | 148 |
|
152 | 149 |
if (laCapa instanceof FLyrVect) |
153 | 150 |
{ |
154 | 151 |
FLyrVect lyrVect = (FLyrVect) laCapa; |
155 |
FeatureCollection newSelection=null;
|
|
152 |
FeatureSelection newSelection = null;
|
|
156 | 153 |
// try { |
157 | 154 |
try { |
158 | 155 |
newSelection = lyrVect.queryByPoint(pReal, tol,lyrVect.getFeatureStore().getDefaultFeatureType()); |
159 |
} catch (ReadException e) {
|
|
156 |
} catch (DataException e) {
|
|
160 | 157 |
throw new BehaviorException(laCapa.getName(),e); |
161 | 158 |
} |
162 | 159 |
items[i] = new VectorialXMLItem(newSelection, laCapa); |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/view/toolListeners/LinkListener.java | ||
---|---|---|
41 | 41 |
package com.iver.cit.gvsig.project.documents.view.toolListeners; |
42 | 42 |
|
43 | 43 |
import java.awt.Component; |
44 |
import java.awt.Cursor; |
|
45 | 44 |
import java.awt.Image; |
46 |
import java.awt.Point; |
|
47 |
import java.awt.Toolkit; |
|
48 | 45 |
import java.awt.geom.Point2D; |
49 | 46 |
import java.net.URI; |
50 |
import javax.swing.ImageIcon; |
|
47 |
|
|
51 | 48 |
import javax.swing.JOptionPane; |
52 | 49 |
|
53 | 50 |
import org.apache.log4j.Logger; |
54 |
import org.gvsig.fmap.data.ReadException;
|
|
51 |
import org.gvsig.fmap.dal.exception.ReadException;
|
|
55 | 52 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
56 | 53 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
57 | 54 |
import org.gvsig.fmap.mapcontrol.MapControl; |
... | ... | |
60 | 57 |
import org.gvsig.fmap.mapcontrol.tools.Listeners.PointListener; |
61 | 58 |
|
62 | 59 |
import com.iver.andami.PluginServices; |
63 |
import com.iver.andami.persistence.generate.PluginsStatus; |
|
64 | 60 |
import com.iver.cit.gvsig.gui.panels.LinkPanel; |
65 | 61 |
import com.iver.cit.gvsig.project.documents.view.gui.View; |
66 | 62 |
|
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/view/toolListeners/MapOverviewPanListener.java | ||
---|---|---|
40 | 40 |
*/ |
41 | 41 |
package com.iver.cit.gvsig.project.documents.view.toolListeners; |
42 | 42 |
|
43 |
import java.awt.Cursor; |
|
44 | 43 |
import java.awt.Image; |
45 |
import java.awt.Point; |
|
46 |
import java.awt.Toolkit; |
|
47 | 44 |
import java.awt.event.InputEvent; |
48 | 45 |
import java.awt.event.MouseEvent; |
49 | 46 |
import java.awt.geom.Point2D; |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/view/toolListeners/MapOverviewListener.java | ||
---|---|---|
40 | 40 |
*/ |
41 | 41 |
package com.iver.cit.gvsig.project.documents.view.toolListeners; |
42 | 42 |
|
43 |
import java.awt.Cursor; |
|
44 | 43 |
import java.awt.Image; |
45 |
import java.awt.Point; |
|
46 |
import java.awt.Toolkit; |
|
47 | 44 |
import java.awt.event.MouseEvent; |
48 | 45 |
import java.awt.geom.Point2D; |
49 | 46 |
import java.awt.geom.Rectangle2D; |
50 | 47 |
|
51 |
import javax.swing.ImageIcon; |
|
52 |
|
|
53 | 48 |
import org.gvsig.fmap.geom.primitive.DefaultEnvelope; |
54 | 49 |
import org.gvsig.fmap.mapcontext.ViewPort; |
55 |
import org.gvsig.fmap.mapcontrol.MapControl; |
|
56 | 50 |
import org.gvsig.fmap.mapcontrol.tools.BehaviorException; |
57 | 51 |
import org.gvsig.fmap.mapcontrol.tools.Events.PointEvent; |
58 | 52 |
import org.gvsig.fmap.mapcontrol.tools.Listeners.PointListener; |
... | ... | |
117 | 111 |
p.getY() - (r.getHeight() / 2), r.getWidth(), r.getHeight()); |
118 | 112 |
|
119 | 113 |
if (event.getEvent().getButton()!=MouseEvent.BUTTON1) { |
120 |
((MapOverview) this.mapControl).getAssociatedMapContext()
|
|
114 |
(this.mapControl).getAssociatedMapContext() |
|
121 | 115 |
.getViewPort().setEnvelope(new DefaultEnvelope(2,new double[]{r.getX(),r.getY()},new double[]{r.getMaxX(),r.getMaxY()})); |
122 | 116 |
PluginServices.getMainFrame().enableControls(); |
123 | 117 |
} |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/view/toolListeners/StatusBarListener.java | ||
---|---|---|
40 | 40 |
*/ |
41 | 41 |
package com.iver.cit.gvsig.project.documents.view.toolListeners; |
42 | 42 |
|
43 |
import java.awt.Cursor; |
|
44 | 43 |
import java.awt.Image; |
45 | 44 |
import java.awt.geom.Point2D; |
46 | 45 |
import java.text.NumberFormat; |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/view/toolListeners/MapOverviewChangeZoomListener.java | ||
---|---|---|
3 | 3 |
*/ |
4 | 4 |
package com.iver.cit.gvsig.project.documents.view.toolListeners; |
5 | 5 |
|
6 |
import java.awt.Cursor; |
|
7 | 6 |
import java.awt.Image; |
8 |
import java.awt.Point; |
|
9 |
import java.awt.Toolkit; |
|
10 | 7 |
import java.awt.event.InputEvent; |
11 | 8 |
import java.awt.event.MouseEvent; |
12 | 9 |
import java.awt.geom.Point2D; |
13 | 10 |
import java.awt.geom.Rectangle2D; |
14 | 11 |
|
15 |
import javax.swing.ImageIcon; |
|
16 |
|
|
17 | 12 |
import org.gvsig.fmap.geom.primitive.DefaultEnvelope; |
18 | 13 |
import org.gvsig.fmap.geom.primitive.Envelope; |
19 | 14 |
import org.gvsig.fmap.mapcontext.ViewPort; |
20 | 15 |
import org.gvsig.fmap.mapcontrol.MapControl; |
21 | 16 |
import org.gvsig.fmap.mapcontrol.tools.BehaviorException; |
22 |
import org.gvsig.fmap.mapcontrol.tools.Events.MoveEvent; |
|
23 | 17 |
import org.gvsig.fmap.mapcontrol.tools.Events.EnvelopeEvent; |
18 |
import org.gvsig.fmap.mapcontrol.tools.Events.MoveEvent; |
|
24 | 19 |
import org.gvsig.fmap.mapcontrol.tools.Listeners.PanListener; |
25 | 20 |
import org.gvsig.fmap.mapcontrol.tools.Listeners.RectangleListener; |
26 | 21 |
|
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/view/toolListeners/SelectImageListener.java | ||
---|---|---|
41 | 41 |
package com.iver.cit.gvsig.project.documents.view.toolListeners; |
42 | 42 |
|
43 | 43 |
import java.awt.geom.Point2D; |
44 |
import java.awt.geom.Rectangle2D; |
|
45 | 44 |
|
46 |
import org.gvsig.fmap.data.ReadException;
|
|
45 |
import org.gvsig.fmap.dal.exception.ReadException;
|
|
47 | 46 |
import org.gvsig.fmap.geom.primitive.Envelope; |
48 | 47 |
import org.gvsig.fmap.mapcontext.ViewPort; |
49 | 48 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
... | ... | |
94 | 93 |
|
95 | 94 |
Point2D pointSelect = event.getPoint(); |
96 | 95 |
|
97 |
if (PluginServices.getMainFrame() != null) |
|
98 |
PluginServices.getMainFrame().enableControls(); |
|
96 |
if (PluginServices.getMainFrame() != null) { |
|
97 |
PluginServices.getMainFrame().enableControls(); |
|
98 |
} |
|
99 | 99 |
|
100 | 100 |
ViewPort vp = mapCtrl.getMapContext().getViewPort(); |
101 | 101 |
|
102 | 102 |
wcPoint = vp.toMapPoint((int)pointSelect.getX(), (int)pointSelect.getY()); |
103 | 103 |
|
104 | 104 |
FLayers layers = mapCtrl.getMapContext().getLayers(); |
105 |
for(int i=0;i<layers.getLayersCount();i++) |
|
105 |
for(int i=0;i<layers.getLayersCount();i++) {
|
|
106 | 106 |
layers.getLayer(i).setActive(false); |
107 |
} |
|
107 | 108 |
|
108 | 109 |
for(int i=layers.getLayersCount()-1;i>=0;i--){ |
109 |
if (select(layers.getLayer(i))) break; |
|
110 |
if (select(layers.getLayer(i))) { |
|
111 |
break; |
|
112 |
} |
|
110 | 113 |
} |
111 | 114 |
} |
112 | 115 |
|
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/view/toolListeners/CircleMeasureListener.java | ||
---|---|---|
41 | 41 |
package com.iver.cit.gvsig.project.documents.view.toolListeners; |
42 | 42 |
|
43 | 43 |
|
44 |
import java.awt.Cursor; |
|
45 | 44 |
import java.awt.Image; |
46 |
import java.awt.Point; |
|
47 |
import java.awt.Toolkit; |
|
48 | 45 |
import java.awt.geom.Point2D; |
49 | 46 |
import java.text.NumberFormat; |
50 | 47 |
|
51 |
import javax.swing.ImageIcon; |
|
52 |
|
|
53 | 48 |
import org.gvsig.fmap.mapcontext.MapContext; |
54 | 49 |
import org.gvsig.fmap.mapcontext.ViewPort; |
55 | 50 |
import org.gvsig.fmap.mapcontrol.MapControl; |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/view/legend/gui/VectorialInterval.java | ||
---|---|---|
61 | 61 |
import javax.swing.JTextField; |
62 | 62 |
|
63 | 63 |
import org.apache.log4j.Logger; |
64 |
import org.gvsig.fmap.data.ReadException; |
|
65 |
import org.gvsig.fmap.data.feature.FeatureAttributeDescriptor; |
|
66 |
import org.gvsig.fmap.data.feature.FeatureStore; |
|
67 |
import org.gvsig.fmap.data.feature.FeatureType; |
|
64 |
import org.gvsig.fmap.dal.DataTypes; |
|
65 |
import org.gvsig.fmap.dal.exception.DataException; |
|
66 |
import org.gvsig.fmap.dal.exception.ReadException; |
|
67 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
|
68 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
69 |
import org.gvsig.fmap.dal.feature.FeatureType; |
|
68 | 70 |
import org.gvsig.fmap.mapcontext.exceptions.LegendLayerException; |
69 | 71 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
70 | 72 |
import org.gvsig.fmap.mapcontext.layers.operations.ClassifiableVectorial; |
... | ... | |
396 | 398 |
|
397 | 399 |
try { |
398 | 400 |
FInterval[] arrayIntervalos = calculateIntervals(); |
399 |
if (arrayIntervalos == null) |
|
400 |
return; |
|
401 |
if (arrayIntervalos == null) { |
|
402 |
return; |
|
403 |
} |
|
401 | 404 |
|
402 | 405 |
FInterval interval; |
403 | 406 |
NumberFormat.getInstance().setMaximumFractionDigits(2); |
... | ... | |
517 | 520 |
intervalCount, |
518 | 521 |
layer.getShapeType() |
519 | 522 |
); |
520 |
} catch (ReadException e) {
|
|
523 |
} catch (DataException e) {
|
|
521 | 524 |
return null; |
522 | 525 |
} |
523 | 526 |
} |
... | ... | |
531 | 534 |
NotificationManager.addError(PluginServices.getText(this, "generating_intervals"), e); |
532 | 535 |
} |
533 | 536 |
|
534 |
if (symbolTable != null) |
|
535 |
pnlCenter.remove(symbolTable); |
|
537 |
if (symbolTable != null) { |
|
538 |
pnlCenter.remove(symbolTable); |
|
539 |
} |
|
536 | 540 |
|
537 | 541 |
getDefaultSymbolPrev(shapeType); |
538 | 542 |
|
... | ... | |
602 | 606 |
|
603 | 607 |
nomFields = new ArrayList(); |
604 | 608 |
|
605 |
String type;
|
|
609 |
int type;
|
|
606 | 610 |
Iterator iterator=((FeatureType)rs.getFeatureTypes().get(0)).iterator(); |
607 | 611 |
while (iterator.hasNext()) { |
608 | 612 |
FeatureAttributeDescriptor descriptor = (FeatureAttributeDescriptor) iterator.next(); |
... | ... | |
615 | 619 |
// continue; |
616 | 620 |
// } |
617 | 621 |
|
618 |
if (type.equals(FeatureAttributeDescriptor.TYPE_INT) || |
|
619 |
type.equals(FeatureAttributeDescriptor.TYPE_DOUBLE) || |
|
620 |
type.equals(FeatureAttributeDescriptor.TYPE_FLOAT) || |
|
621 |
type.equals(FeatureAttributeDescriptor.TYPE_LONG)) { |
|
622 |
nomFields.add(descriptor.getName().trim()); |
|
622 |
if (type == DataTypes.INT || |
|
623 |
type == DataTypes.DOUBLE || |
|
624 |
type == DataTypes.FLOAT || |
|
625 |
type == DataTypes.LONG) |
|
626 |
{ |
|
627 |
nomFields.add(descriptor.getName().trim()); |
|
623 | 628 |
} |
624 | 629 |
} |
625 | 630 |
|
626 | 631 |
// rs.stop(); |
627 |
} catch (ReadException e) {
|
|
632 |
} catch (DataException e) {
|
|
628 | 633 |
NotificationManager.addError(PluginServices.getText(this, "recovering_recordset"), e); |
629 | 634 |
} |
630 | 635 |
|
... | ... | |
639 | 644 |
*/ |
640 | 645 |
public ILegend getLegend() { |
641 | 646 |
fillSymbolListFromTable(); |
642 |
if(defaultSymbolPrev.getSymbol() != null) |
|
647 |
if(defaultSymbolPrev.getSymbol() != null) {
|
|
643 | 648 |
auxLegend.setDefaultSymbol(defaultSymbolPrev.getSymbol()); |
649 |
} |
|
644 | 650 |
|
645 | 651 |
auxLegend.useDefaultSymbol(chkdefaultvalues.isSelected()); |
646 | 652 |
|
... | ... | |
712 | 718 |
rs = ((FLyrVect) layer).getFeatureStore(); |
713 | 719 |
// rs.start(); |
714 | 720 |
FeatureType featureType=rs.getDefaultFeatureType(); |
715 |
auxLegend.setClassifyingFieldTypes(new String[]{((FeatureAttributeDescriptor)featureType.get(featureType.getFieldIndex(fieldName))).getDataType()}); |
|
721 |
auxLegend |
|
722 |
.setClassifyingFieldTypes(new Integer[] { new Integer( |
|
723 |
featureType.getAttributeDescriptor(fieldName) |
|
724 |
.getDataType()) }); |
|
716 | 725 |
logger.debug("rs.start()"); |
717 | 726 |
// rs.stop(); |
718 | 727 |
|
... | ... | |
870 | 879 |
return VectorialIntervalLegend.class; |
871 | 880 |
} |
872 | 881 |
|
873 |
private boolean isNumericField(String fieldType) { |
|
874 |
if (fieldType.equals(FeatureAttributeDescriptor.TYPE_DOUBLE) || |
|
875 |
fieldType.equals(FeatureAttributeDescriptor.TYPE_FLOAT) || |
|
876 |
fieldType.equals(FeatureAttributeDescriptor.TYPE_LONG) || |
|
877 |
fieldType.equals(FeatureAttributeDescriptor.TYPE_INT)){ |
|
882 |
private boolean isNumericField(int fieldType) { |
|
883 |
if (fieldType == DataTypes.DOUBLE || fieldType == DataTypes.FLOAT |
|
884 |
|| fieldType == DataTypes.LONG || fieldType == DataTypes.INT) { |
|
878 | 885 |
return true; |
879 | 886 |
}else{ |
880 | 887 |
return false; |
... | ... | |
912 | 919 |
return true; |
913 | 920 |
} |
914 | 921 |
} |
915 |
} catch (ReadException e) {
|
|
922 |
} catch (DataException e) {
|
|
916 | 923 |
return false; |
917 | 924 |
} |
918 | 925 |
} |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/view/legend/gui/SingleSymbol.java | ||
---|---|---|
58 | 58 |
import javax.swing.JTextField; |
59 | 59 |
import javax.swing.border.TitledBorder; |
60 | 60 |
|
61 |
import org.gvsig.fmap.data.ReadException;
|
|
61 |
import org.gvsig.fmap.dal.exception.ReadException;
|
|
62 | 62 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
63 | 63 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
64 | 64 |
import org.gvsig.fmap.mapcontext.rendering.legend.ILegend; |
... | ... | |
227 | 227 |
legend.setDefaultSymbol(symbol); |
228 | 228 |
} |
229 | 229 |
txtLabel.setText(symbol.getDescription()); |
230 |
if(symbol.getDescription() != null) |
|
230 |
if(symbol.getDescription() != null) {
|
|
231 | 231 |
txtLabel.setText(symbol.getDescription()); |
232 |
} |
|
232 | 233 |
} |
233 | 234 |
|
234 | 235 |
public ISymbol getSymbol() { |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/view/legend/gui/AttrInTableLabeling.java | ||
---|---|---|
55 | 55 |
import javax.swing.JRadioButton; |
56 | 56 |
import javax.swing.JTextField; |
57 | 57 |
|
58 |
import org.gvsig.fmap.data.ReadException; |
|
59 |
import org.gvsig.fmap.data.feature.FeatureAttributeDescriptor; |
|
60 |
import org.gvsig.fmap.data.feature.FeatureType; |
|
58 |
import org.gvsig.fmap.dal.DataTypes; |
|
59 |
import org.gvsig.fmap.dal.exception.ReadException; |
|
60 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
|
61 |
import org.gvsig.fmap.dal.feature.FeatureType; |
|
61 | 62 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
62 | 63 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
63 | 64 |
import org.gvsig.fmap.mapcontext.rendering.legend.styling.AttrInTableLabelingStrategy; |
... | ... | |
300 | 301 |
AttrInTableLabelingStrategy strategy = new AttrInTableLabelingStrategy(); |
301 | 302 |
strategy.setLayer(layer); |
302 | 303 |
|
303 |
if(getCmbHeightField().getItemCount() > 0) |
|
304 |
if(getCmbHeightField().getItemCount() > 0) {
|
|
304 | 305 |
strategy.setHeightField( |
305 | 306 |
(String) getCmbHeightField().getSelectedItem()); |
306 |
if(getCmbRotationField().getItemCount() > 0) |
|
307 |
if(!getCmbRotationField().getSelectedItem().equals(NO_FIELD_ITEM)) |
|
307 |
} |
|
308 |
if(getCmbRotationField().getItemCount() > 0) { |
|
309 |
if(!getCmbRotationField().getSelectedItem().equals(NO_FIELD_ITEM)) { |
|
308 | 310 |
strategy.setRotationField( |
309 | 311 |
(String) getCmbRotationField().getSelectedItem()); |
310 |
else
|
|
312 |
} else {
|
|
311 | 313 |
strategy.setRotationField(null); |
314 |
} |
|
315 |
} |
|
312 | 316 |
|
313 |
if(getCmbTextField().getItemCount() > 0) |
|
317 |
if(getCmbTextField().getItemCount() > 0) {
|
|
314 | 318 |
strategy.setTextField( |
315 | 319 |
(String) getCmbTextField().getSelectedItem()); |
320 |
} |
|
316 | 321 |
|
317 | 322 |
strategy.setUsesFixedSize(getRdBtnFixedHeight().isSelected()); |
318 | 323 |
strategy.setFixedSize(fixedSize); |
319 | 324 |
|
320 |
if(getCmbUnits().getItemCount() > 0) |
|
325 |
if(getCmbUnits().getItemCount() > 0) {
|
|
321 | 326 |
strategy.setUnit(getCmbUnits().getSelectedUnitIndex()); |
327 |
} |
|
322 | 328 |
|
323 | 329 |
strategy.setUsesFixedColor(getRdBtnFixedColor().isSelected()); |
324 | 330 |
strategy.setFixedColor(colorChooser.getColor()); |
325 | 331 |
|
326 |
if(getCmbColorField().getItemCount() > 0) |
|
332 |
if(getCmbColorField().getItemCount() > 0) {
|
|
327 | 333 |
strategy.setColorField((String) getCmbColorField().getSelectedItem()); |
334 |
} |
|
328 | 335 |
|
329 | 336 |
|
330 | 337 |
strategy.setFont(labelFont); |
... | ... | |
345 | 352 |
ArrayList<String> lColors = new ArrayList<String>(); |
346 | 353 |
while (iterator.hasNext()) { |
347 | 354 |
FeatureAttributeDescriptor descriptor = (FeatureAttributeDescriptor) iterator.next(); |
348 |
if (descriptor.getDataType().equals(FeatureAttributeDescriptor.TYPE_DOUBLE)||
|
|
349 |
descriptor.getDataType().equals(FeatureAttributeDescriptor.TYPE_FLOAT)||
|
|
350 |
descriptor.getDataType().equals(FeatureAttributeDescriptor.TYPE_LONG)/*||
|
|
355 |
if (descriptor.getDataType() == DataTypes.DOUBLE ||
|
|
356 |
descriptor.getDataType() == DataTypes.FLOAT ||
|
|
357 |
descriptor.getDataType() == DataTypes.LONG)/*||
|
|
351 | 358 |
descriptor.getDataType().equals(FeatureAttributeDescriptor.TYPE_INT)*/){ |
352 | 359 |
l.add(descriptor.getName()); |
353 | 360 |
} |
354 |
if(descriptor.getDataType().equals(FeatureAttributeDescriptor.TYPE_INT)){
|
|
361 |
if (descriptor.getDataType() == DataTypes.INT) {
|
|
355 | 362 |
l.add(descriptor.getName()); |
356 | 363 |
lColors.add(descriptor.getName()); |
357 | 364 |
} |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/view/legend/gui/VectorialUniqueValue.java | ||
---|---|---|
60 | 60 |
import javax.swing.JPanel; |
61 | 61 |
|
62 | 62 |
import org.apache.log4j.Logger; |
63 |
import org.gvsig.fmap.data.ReadException; |
|
64 |
import org.gvsig.fmap.data.feature.Feature; |
|
65 |
import org.gvsig.fmap.data.feature.FeatureAttributeDescriptor; |
|
66 |
import org.gvsig.fmap.data.feature.FeatureStore; |
|
63 |
import org.gvsig.fmap.dal.exception.DataException; |
|
64 |
import org.gvsig.fmap.dal.exception.ReadException; |
|
65 |
import org.gvsig.fmap.dal.feature.Feature; |
|
66 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
|
67 |
import org.gvsig.fmap.dal.feature.FeatureSet; |
|
68 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
67 | 69 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
68 | 70 |
import org.gvsig.fmap.mapcontext.layers.operations.ClassifiableVectorial; |
69 | 71 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
... | ... | |
251 | 253 |
|
252 | 254 |
Random rand = new Random(System.currentTimeMillis()); |
253 | 255 |
|
254 |
Iterator iterator=elRs.getDataCollection().iterator(); |
|
256 |
FeatureSet set = elRs.getFeatureSet(); |
|
257 |
|
|
258 |
if (set.getSize() > 100) { |
|
259 |
int resp = JOptionPane.showConfirmDialog(this, PluginServices |
|
260 |
.getText(this, "mas_de_100_simbolos"), PluginServices |
|
261 |
.getText(this, "quiere_continuar"), |
|
262 |
JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE); |
|
263 |
|
|
264 |
if ((resp == JOptionPane.NO_OPTION) |
|
265 |
|| (resp == JOptionPane.DEFAULT_OPTION)) { |
|
266 |
set.dispose(); |
|
267 |
return; |
|
268 |
} |
|
269 |
} |
|
270 |
|
|
271 |
Iterator iterator = set.iterator(); |
|
255 | 272 |
while (iterator.hasNext()) { |
256 | 273 |
Feature feature = (Feature) iterator.next(); |
257 | 274 |
clave = feature.get(fieldName); |
... | ... | |
273 | 290 |
theSymbol.setDescription(clave.toString()); |
274 | 291 |
auxLegend.addSymbol(clave, theSymbol); |
275 | 292 |
|
276 |
numSymbols++; |
|
277 | 293 |
|
278 |
if (numSymbols == 100) { |
|
279 |
int resp = JOptionPane.showConfirmDialog(this, |
|
280 |
PluginServices.getText(this, |
|
281 |
"mas_de_100_simbolos"), |
|
282 |
PluginServices.getText(this, "quiere_continuar"), |
|
283 |
JOptionPane.YES_NO_OPTION, |
|
284 |
JOptionPane.WARNING_MESSAGE); |
|
285 |
|
|
286 |
if ((resp == JOptionPane.NO_OPTION) || |
|
287 |
(resp == JOptionPane.DEFAULT_OPTION)) { |
|
288 |
return; |
|
289 |
} |
|
290 |
} |
|
291 | 294 |
} |
292 | 295 |
} // for |
293 | 296 |
|
294 | 297 |
symbolTable.fillTableFromSymbolList(auxLegend.getSymbols(), |
295 | 298 |
auxLegend.getValues(), auxLegend.getDescriptions()); |
296 | 299 |
// elRs.stop(); |
297 |
} catch (ReadException e) { |
|
300 |
set.dispose(); |
|
301 |
} catch (DataException e) { |
|
298 | 302 |
NotificationManager.addError(PluginServices.getText(this, "recovering_recordset"), e); |
299 | 303 |
} |
300 | 304 |
|
... | ... | |
317 | 321 |
FLyrVect m = (FLyrVect) layer; |
318 | 322 |
|
319 | 323 |
try { |
320 |
String fieldType=m.getFeatureStore().getDefaultFeatureType().getByOrder((int)cmbFields.getSelectedIndex()).getName(); |
|
324 |
String fieldType = m.getFeatureStore().getDefaultFeatureType() |
|
325 |
.getAttributeDescriptor(cmbFields.getSelectedIndex()) |
|
326 |
.getName(); |
|
321 | 327 |
// int fieldType = m.getSource().getRecordset().getFieldType((int)cmbFields.getSelectedIndex()); |
322 | 328 |
auxLegend.setClassifyingFieldTypes(new String[] {fieldType}); |
323 |
} catch (ReadException e) {
|
|
329 |
} catch (DataException e) {
|
|
324 | 330 |
NotificationManager.addError(PluginServices.getText(this, "could_not_setup_legend"), e); |
325 | 331 |
} |
326 | 332 |
|
327 | 333 |
auxLegend.clear(); |
328 | 334 |
|
329 | 335 |
for (int row = 0; row < symbolTable.getRowCount(); row++) { |
330 |
clave = (Object) symbolTable.getFieldValue(row, 1);
|
|
336 |
clave = symbolTable.getFieldValue(row, 1); |
|
331 | 337 |
theSymbol = (ISymbol) symbolTable.getFieldValue(row, 0); |
332 | 338 |
theSymbol.setDescription((String) symbolTable.getFieldValue(row, 2)); |
333 | 339 |
auxLegend.addSymbol(clave, theSymbol); |
... | ... | |
367 | 373 |
// |
368 | 374 |
// rs.stop(); |
369 | 375 |
|
370 |
DefaultComboBoxModel cM = new DefaultComboBoxModel((String[])names.toArray(new String[0]));
|
|
376 |
DefaultComboBoxModel cM = new DefaultComboBoxModel(names.toArray(new String[0])); |
|
371 | 377 |
cmbFields.setModel(cM); |
372 | 378 |
|
373 | 379 |
// fieldsListValor.setSelectedIndex(0); |
374 |
} catch (ReadException e) {
|
|
380 |
} catch (DataException e) {
|
|
375 | 381 |
NotificationManager.addError(PluginServices.getText(this, "recovering_recordset"), e); |
376 | 382 |
} |
377 | 383 |
} |
... | ... | |
387 | 393 |
|
388 | 394 |
getDefaultSymbolPrev(shapeType); |
389 | 395 |
|
390 |
if (symbolTable != null) |
|
391 |
pnlCenter.remove(symbolTable); |
|
396 |
if (symbolTable != null) { |
|
397 |
pnlCenter.remove(symbolTable); |
|
398 |
} |
|
392 | 399 |
symbolTable = new SymbolTable(this, SymbolTable.VALUES_TYPE, shapeType); |
393 | 400 |
pnlCenter.add(symbolTable, BorderLayout.CENTER); |
394 | 401 |
|
... | ... | |
444 | 451 |
auxLegend.setClassifyingFieldNames( |
445 | 452 |
new String[] {(String) cmbFields.getSelectedItem()}); |
446 | 453 |
|
447 |
if(defaultSymbolPrev.getSymbol() != null) |
|
454 |
if(defaultSymbolPrev.getSymbol() != null) {
|
|
448 | 455 |
auxLegend.setDefaultSymbol(defaultSymbolPrev.getSymbol()); |
456 |
} |
|
449 | 457 |
|
450 | 458 |
auxLegend.useDefaultSymbol(chbUseDefault.isSelected()); |
451 | 459 |
|
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/view/legend/gui/General.java | ||
---|---|---|
51 | 51 |
import java.awt.SystemColor; |
Also available in: Unified diff