Revision: 5924
http://sourceforge.net/p/jump-pilot/code/5924
Author: michaudm
Date: 2018-08-24 06:08:20 +0000 (Fri, 24 Aug 2018)
Log Message:
-----------
Improve LayerView naming and saving, allow views based on view
Modified Paths:
--------------
core/trunk/ChangeLog
core/trunk/src/com/vividsolutions/jump/workbench/model/LayerView.java
core/trunk/src/com/vividsolutions/jump/workbench/ui/LayerNameRenderer.java
core/trunk/src/language/jump_fr.properties
core/trunk/src/org/openjump/core/ui/plugin/file/SaveLayersWithoutDataSourcePlugIn.java
core/trunk/src/org/openjump/core/ui/plugin/file/open/OpenProjectWizard.java
Modified: core/trunk/ChangeLog
===================================================================
--- core/trunk/ChangeLog 2018-08-22 17:02:04 UTC (rev 5923)
+++ core/trunk/ChangeLog 2018-08-24 06:08:20 UTC (rev 5924)
@@ -3,6 +3,9 @@
# 2. make sure that lines break at 80 chars for constricted display situations
#<-------------------------------- 80 chars
---------------------------------->#
+2018-08-24 mmichaud <[email protected]>
+ * Improve LayerView naming and saving, allow views based on view
+
2018-08-22 Giuseppe Aruta
* WMSLegendPlugIn. Added capability to export WMS legend to PNG image file
Modified: core/trunk/src/com/vividsolutions/jump/workbench/model/LayerView.java
===================================================================
--- core/trunk/src/com/vividsolutions/jump/workbench/model/LayerView.java
2018-08-22 17:02:04 UTC (rev 5923)
+++ core/trunk/src/com/vividsolutions/jump/workbench/model/LayerView.java
2018-08-24 06:08:20 UTC (rev 5924)
@@ -33,6 +33,8 @@
this.layer = layerManager.getLayer(getLayerName());
}
+ //private String properName = "v";
+
public LayerView(final String layerName, LayerManager layerManager) {
super(layerName,
layerManager.generateLayerFillColor(),
@@ -43,13 +45,35 @@
boolean firingEvents = getLayerManager().isFiringEvents();
getLayerManager().setFiringEvents(false);
try {
- setName(getName().replaceAll(this.layer.getName(),"").trim());
+ setName("v");
+ //this.properName = layerManager.uniqueLayerName(properName);
+ //setName(getName().replaceAll(this.layer.getName(),"").trim());
+ //setName(properName);
+ setName(layerManager.uniqueLayerName(getName()));
} finally {
getLayerManager().setFiringEvents(firingEvents);
}
}
+ //@Override
+ //public String getName() {
+ // return properName;
+ //}
+ //public void setName(String properName) {
+ // this.properName = properName;
+ //}
+
+ public String getFullName() {
+ //if (layer == null)
+ // return "-> " + getLayerName() + " - " + getName();
+ if (layer instanceof LayerView)
+ return ((LayerView) layer).getFullName() + " - " + getName();
+ else
+ return "-> " + getLayerName() + " - " + getName();
+ }
+
+
@Override
public void setFeatureCollection(FeatureCollection featureCollection) {
Modified:
core/trunk/src/com/vividsolutions/jump/workbench/ui/LayerNameRenderer.java
===================================================================
--- core/trunk/src/com/vividsolutions/jump/workbench/ui/LayerNameRenderer.java
2018-08-22 17:02:04 UTC (rev 5923)
+++ core/trunk/src/com/vividsolutions/jump/workbench/ui/LayerNameRenderer.java
2018-08-24 06:08:20 UTC (rev 5924)
@@ -276,8 +276,9 @@
Layerable layerable = (Layerable) value;
if (layerable instanceof LayerView) {
LayerView view = (LayerView)layerable;
- label.setText("-> " + view.getLayerName() + " - " +
- view.getName().replaceAll(view.getLayerName(), ""));
+ //label.setText("-> " + view.getLayerName() + " - " +
+ // view.getName().replaceAll(view.getLayerName(), ""));
+ label.setText(view.getFullName());
} else {
label.setText(layerable.getName());
}
Modified: core/trunk/src/language/jump_fr.properties
===================================================================
--- core/trunk/src/language/jump_fr.properties 2018-08-22 17:02:04 UTC (rev
5923)
+++ core/trunk/src/language/jump_fr.properties 2018-08-24 06:08:20 UTC (rev
5924)
@@ -2868,7 +2868,7 @@
org.openjump.core.ui.plugin.raster.ProfileGraphTool.draw-linstring-as-trace =
Dessiner la ligne devant servir au calcul du profil
org.openjump.core.ui.plugin.raster.ProfileGraphTool.use-selected-linstring-as-trace
= Utiliser la ligne s\xE9lectionn\xE9e pour le profil
org.openjump.core.ui.plugin.raster.ProfileGraphTool.select-one-linstring =
S\xE9lectionner une ligne
-com.vividsolutions.jump.workbench.ui.plugin.AddNewLayerViewPlugIn=Ajouter une
vue
+com.vividsolutions.jump.workbench.ui.plugin.AddNewLayerViewPlugIn = Cr\xE9er
une vue sur la couche
com.vividsolutions.jump.util.StatisticIndices.Coefficient-of-variation =
Coefficient de variation
com.vividsolutions.jump.util.StatisticIndices.Root-mean-squared= Moyenne
quadratique
com.vividsolutions.jump.util.StatisticIndices.25-percentile = 25 percentile
Modified:
core/trunk/src/org/openjump/core/ui/plugin/file/SaveLayersWithoutDataSourcePlugIn.java
===================================================================
---
core/trunk/src/org/openjump/core/ui/plugin/file/SaveLayersWithoutDataSourcePlugIn.java
2018-08-22 17:02:04 UTC (rev 5923)
+++
core/trunk/src/org/openjump/core/ui/plugin/file/SaveLayersWithoutDataSourcePlugIn.java
2018-08-24 06:08:20 UTC (rev 5924)
@@ -38,10 +38,12 @@
import javax.swing.ImageIcon;
import javax.swing.JFileChooser;
+import
com.vividsolutions.jump.io.datasource.StandardReaderWriterFileDataSource;
+import com.vividsolutions.jump.workbench.Logger;
+import com.vividsolutions.jump.workbench.model.LayerView;
import org.openjump.core.ui.plugin.file.open.JFCWithEnterAction;
import com.vividsolutions.jump.I18N;
-import com.vividsolutions.jump.io.DriverProperties;
import com.vividsolutions.jump.io.datasource.DataSource;
import com.vividsolutions.jump.io.datasource.DataSourceQuery;
import com.vividsolutions.jump.task.DummyTaskMonitor;
@@ -139,18 +141,22 @@
DataSource dataSource = null;
if (dialog.getBoolean(SAVEASJML)) {
ext = "jml";
- dataSource = new
com.vividsolutions.jump.io.datasource.StandardReaderWriterFileDataSource.JML();
+ dataSource = new
StandardReaderWriterFileDataSource.JML();
}
else if (dialog.getBoolean(SAVEASSHP)) {
ext = "shp";
- dataSource = new
com.vividsolutions.jump.io.datasource.StandardReaderWriterFileDataSource.Shapefile();
+ dataSource = new
StandardReaderWriterFileDataSource.Shapefile();
}
- if (file.exists()) {
- if
(GUIUtil.showConfirmOverwriteDialog(context.getWorkbenchFrame(), file)) {
+ if (dataSource != null) {
+ if (file.exists()) {
+ if
(GUIUtil.showConfirmOverwriteDialog(context.getWorkbenchFrame(), file)) {
+ saveLayer(layer, dir, dataSource, ext);
+ }
+ } else {
saveLayer(layer, dir, dataSource, ext);
}
} else {
- saveLayer(layer, dir, dataSource, ext);
+ Logger.warn("Data source (jml or shp) could not be
instanciated to save dataset on disk");
}
}
return true;
@@ -168,9 +174,13 @@
dp.put(DataSource.URI_KEY, file.toURI().toString());
dp.put(DataSource.FILE_KEY, path);
dataSource.setProperties(dp);
-
DataSourceQuery dsq = new DataSourceQuery(dataSource, path, path);
layer.setDataSourceQuery(dsq).setFeatureCollectionModified(false);
+ // Do not write the dataset used by a LayerView on disk (it is already
written
+ // for the underlying layer)
+ // LayerView writing is excluded there because we need
layer.setDataSourceQuery
+ // (without it, the LayerView is not written into xml at all)
+ if (layer instanceof LayerView) return;
dataSource.getConnection().executeUpdate("",
layer.getFeatureCollectionWrapper(), new DummyTaskMonitor());
}
Modified:
core/trunk/src/org/openjump/core/ui/plugin/file/open/OpenProjectWizard.java
===================================================================
--- core/trunk/src/org/openjump/core/ui/plugin/file/open/OpenProjectWizard.java
2018-08-22 17:02:04 UTC (rev 5923)
+++ core/trunk/src/org/openjump/core/ui/plugin/file/open/OpenProjectWizard.java
2018-08-24 06:08:20 UTC (rev 5924)
@@ -299,7 +299,7 @@
layerable.setLayerManager(newLayerManager);
if (layerable instanceof LayerView) {
- layerable.setLayerManager(newLayerManager);
+ //layerable.setLayerManager(newLayerManager);
}
else if (layerable instanceof Layer) {
Layer layer = (Layer) layerable;
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Jump-pilot-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel