Re: [JPP-Devel] Charset choise
Hi I meant to have a checkbox in the general OJ options under CustomizeOptions... Thanks for clarifying that. This is an alternative. Let's see what Matthias say. Michaël stefan Michaël Michaud schrieb: Hi, I'm not sure I understand the benefit of this checkbox. Currently, if you're in the open dialog and you want the default charset, you have to click next, see the charset combobox, then OK If you have a checkbox in the first panel, you have to click the checkbox, then OK, which is about the same thing. Or maybe I missed something. To save one click, it seems to me that you should have the choice between ok (means use default option) and more options in the first panel This way, one click can be avoided. Just trying to understand and find the best general solution, but the way it works now is already fine for me Michaël Le 09/09/2010 19:12, Stefan Steiniger a écrit : So if I understand right we should have a checkbox in the options pannel that makes the charset choice dialog to be displayed or not when loading a shape file, otherwise a default charset is chosen. And the default checkbox setting may be to not show the dialog. sounds like a good idea to me. What do you think Matthias? stefan Larry Becker wrote: Hi Stefan, Having one charset choice doesn't support multiple charsets per project as the current method does. I'm not sure how often this happens, but it isn't too unusual to use datasets from multiple sources. Instead of commenting out the dialogs, it might be better to have a workbench blackboard option to skip them and use the default instead. Surely we are all going to run into an Umlaute or similar in our data eventually. regards, Larry On Wed, Sep 8, 2010 at 6:54 PM, Stefan Steinigersst...@geo.uzh.ch mailto:sst...@geo.uzh.ch wrote: I like the charset choice, thanks Matthias. However, I wonder what users feel having every time to chose (even it is only one more click) and probably not knowing what it means. So one thought I had is to comment out the dialog call and put the dialog options in (a new?) options tab instead and store it the blackboard? Then the currently set value is read while loading the shp (i.e. exposing the option in a different way to the user). I know its additional work but may be more user friendly for those who never care about charsets and have to load quite a bit of data during a day? Like I do ;) Actually my co-worker just suggested the option to have a checkbox for the additional dialog asking Do you want to use that value every time. so it doesn't pop up all the time during one session. my 2 cents... stefan Michaël Michaud wrote: Hi Matthias, Can you give me some information about how it is supposed to work. Am I supposed to get a panel with a charset option for any shapefile loading ? Sorry for that question, I did not launch the new compiled version. I know get the charset choice dialog. Thanks, Michaël 2) if we want to keep java 5 compatibility, you have to use new String(byte[], int, int, String) instead of new String(byte[], int, int, Charset) on line 264 3) about your proposition of saving the charset in the project when different from default jvm charset : Seems a good idea to me. Michaël Le 03/09/2010 20:34, Matthias Scholz a écrit : Hi, sorry my mistake. I have it only tested with open and open recent ;-) In the SVN it is fixed for the first time, but there is a general question and I want to hear the other developers/users. If I open a shapefile with a special charset setting for the first time, it would be logic for me, if we save the charset setting for this file in the project. So if the user opens this file again with the project, the file will be opened with the same charset. Should I implement this or have anyone an other suggestion? Regards Matthias Nice feature, but it is going to take a little more work. It currently breaks shapefile loading from a project file and the lright-click on layer legacy method Load Dataset. I think you need to set a default charset on start up. regards, Larry java.lang.IllegalArgumentException: Null charset name at java.nio.charset.Charset.lookup(Charset.java:430) at java.nio.charset.Charset.forName(Charset.java:503) at
Re: [JPP-Devel] Charset choise
Hi Stefan, Having one charset choice doesn't support multiple charsets per project as the current method does. I'm not sure how often this happens, but it isn't too unusual to use datasets from multiple sources. Instead of commenting out the dialogs, it might be better to have a workbench blackboard option to skip them and use the default instead. Surely we are all going to run into an Umlaute or similar in our data eventually. regards, Larry On Wed, Sep 8, 2010 at 6:54 PM, Stefan Steiniger sst...@geo.uzh.ch wrote: I like the charset choice, thanks Matthias. However, I wonder what users feel having every time to chose (even it is only one more click) and probably not knowing what it means. So one thought I had is to comment out the dialog call and put the dialog options in (a new?) options tab instead and store it the blackboard? Then the currently set value is read while loading the shp (i.e. exposing the option in a different way to the user). I know its additional work but may be more user friendly for those who never care about charsets and have to load quite a bit of data during a day? Like I do ;) Actually my co-worker just suggested the option to have a checkbox for the additional dialog asking Do you want to use that value every time. so it doesn't pop up all the time during one session. my 2 cents... stefan Michaël Michaud wrote: Hi Matthias, Can you give me some information about how it is supposed to work. Am I supposed to get a panel with a charset option for any shapefile loading ? Sorry for that question, I did not launch the new compiled version. I know get the charset choice dialog. Thanks, Michaël 2) if we want to keep java 5 compatibility, you have to use new String(byte[], int, int, String) instead of new String(byte[], int, int, Charset) on line 264 3) about your proposition of saving the charset in the project when different from default jvm charset : Seems a good idea to me. Michaël Le 03/09/2010 20:34, Matthias Scholz a écrit : Hi, sorry my mistake. I have it only tested with open and open recent ;-) In the SVN it is fixed for the first time, but there is a general question and I want to hear the other developers/users. If I open a shapefile with a special charset setting for the first time, it would be logic for me, if we save the charset setting for this file in the project. So if the user opens this file again with the project, the file will be opened with the same charset. Should I implement this or have anyone an other suggestion? Regards Matthias Nice feature, but it is going to take a little more work. It currently breaks shapefile loading from a project file and the lright-click on layer legacy method Load Dataset. I think you need to set a default charset on start up. regards, Larry java.lang.IllegalArgumentException: Null charset name at java.nio.charset.Charset.lookup(Charset.java:430) at java.nio.charset.Charset.forName(Charset.java:503) at com.vividsolutions.jump.io.ShapefileReader.read(ShapefileReader.java:137) at com.vividsolutions.jump.io.datasource.DelegatingCompressedFileHandler.read(DelegatingCompressedFileHandler.java:79) at com.vividsolutions.jump.io.datasource.ReaderWriterFileDataSource$1.executeQuery(ReaderWriterFileDataSource.java:61) at com.vividsolutions.jump.io.datasource.ReaderWriterFileDataSource$1.executeQuery(ReaderWriterFileDataSource.java:79) at org.openjump.core.ui.plugin.file.open.OpenProjectWizard.executeQuery(OpenProjectWizard.java:282) at org.openjump.core.ui.plugin.file.open.OpenProjectWizard.load(OpenProjectWizard.java:271) at org.openjump.core.ui.plugin.file.open.OpenProjectWizard.loadLayers(OpenProjectWizard.java:208) at org.openjump.core.ui.plugin.file.open.OpenProjectWizard.open(OpenProjectWizard.java:152) at org.openjump.core.ui.plugin.file.open.OpenProjectWizard.open(OpenProjectWizard.java:107) at org.openjump.core.ui.plugin.file.open.OpenProjectWizard.run(OpenProjectWizard.java:99) at org.openjump.core.ui.plugin.AbstractWizardPlugin.run(AbstractWizardPlugin.java:71) at com.vividsolutions.jump.workbench.ui.task.TaskMonitorManager$TaskWrapper.run(TaskMonitorManager.java:151) at java.lang.Thread.run(Thread.java:619) On Fri, Sep 3, 2010 at 4:46 AM, Matthias Scholzm...@jammerhund.de mailto:m...@jammerhund.de wrote: Hi, I've commited some little changes for selecting an other charset while opening an ESRI shapefile. Thank you Michael and Stefan for your hints to the wizard framework. Thereby the code changes was very small and consitent :-) On the other hand Michael is right with his opinion about the wizard framework. Without good documentation you need many hours to understand and
Re: [JPP-Devel] Charset choise
So if I understand right we should have a checkbox in the options pannel that makes the charset choice dialog to be displayed or not when loading a shape file, otherwise a default charset is chosen. And the default checkbox setting may be to not show the dialog. sounds like a good idea to me. What do you think Matthias? stefan Larry Becker wrote: Hi Stefan, Having one charset choice doesn't support multiple charsets per project as the current method does. I'm not sure how often this happens, but it isn't too unusual to use datasets from multiple sources. Instead of commenting out the dialogs, it might be better to have a workbench blackboard option to skip them and use the default instead. Surely we are all going to run into an Umlaute or similar in our data eventually. regards, Larry On Wed, Sep 8, 2010 at 6:54 PM, Stefan Steiniger sst...@geo.uzh.ch mailto:sst...@geo.uzh.ch wrote: I like the charset choice, thanks Matthias. However, I wonder what users feel having every time to chose (even it is only one more click) and probably not knowing what it means. So one thought I had is to comment out the dialog call and put the dialog options in (a new?) options tab instead and store it the blackboard? Then the currently set value is read while loading the shp (i.e. exposing the option in a different way to the user). I know its additional work but may be more user friendly for those who never care about charsets and have to load quite a bit of data during a day? Like I do ;) Actually my co-worker just suggested the option to have a checkbox for the additional dialog asking Do you want to use that value every time. so it doesn't pop up all the time during one session. my 2 cents... stefan Michaël Michaud wrote: Hi Matthias, Can you give me some information about how it is supposed to work. Am I supposed to get a panel with a charset option for any shapefile loading ? Sorry for that question, I did not launch the new compiled version. I know get the charset choice dialog. Thanks, Michaël 2) if we want to keep java 5 compatibility, you have to use new String(byte[], int, int, String) instead of new String(byte[], int, int, Charset) on line 264 3) about your proposition of saving the charset in the project when different from default jvm charset : Seems a good idea to me. Michaël Le 03/09/2010 20:34, Matthias Scholz a écrit : Hi, sorry my mistake. I have it only tested with open and open recent ;-) In the SVN it is fixed for the first time, but there is a general question and I want to hear the other developers/users. If I open a shapefile with a special charset setting for the first time, it would be logic for me, if we save the charset setting for this file in the project. So if the user opens this file again with the project, the file will be opened with the same charset. Should I implement this or have anyone an other suggestion? Regards Matthias Nice feature, but it is going to take a little more work. It currently breaks shapefile loading from a project file and the lright-click on layer legacy method Load Dataset. I think you need to set a default charset on start up. regards, Larry java.lang.IllegalArgumentException: Null charset name at java.nio.charset.Charset.lookup(Charset.java:430) at java.nio.charset.Charset.forName(Charset.java:503) at com.vividsolutions.jump.io.ShapefileReader.read(ShapefileReader.java:137) at com.vividsolutions.jump.io.datasource.DelegatingCompressedFileHandler.read(DelegatingCompressedFileHandler.java:79) at com.vividsolutions.jump.io.datasource.ReaderWriterFileDataSource$1.executeQuery(ReaderWriterFileDataSource.java:61) at com.vividsolutions.jump.io.datasource.ReaderWriterFileDataSource$1.executeQuery(ReaderWriterFileDataSource.java:79) at org.openjump.core.ui.plugin.file.open.OpenProjectWizard.executeQuery(OpenProjectWizard.java:282) at org.openjump.core.ui.plugin.file.open.OpenProjectWizard.load(OpenProjectWizard.java:271) at org.openjump.core.ui.plugin.file.open.OpenProjectWizard.loadLayers(OpenProjectWizard.java:208) at org.openjump.core.ui.plugin.file.open.OpenProjectWizard.open(OpenProjectWizard.java:152) at org.openjump.core.ui.plugin.file.open.OpenProjectWizard.open(OpenProjectWizard.java:107) at
Re: [JPP-Devel] Charset choise
Hi, I'm not sure I understand the benefit of this checkbox. Currently, if you're in the open dialog and you want the default charset, you have to click next, see the charset combobox, then OK If you have a checkbox in the first panel, you have to click the checkbox, then OK, which is about the same thing. Or maybe I missed something. To save one click, it seems to me that you should have the choice between ok (means use default option) and more options in the first panel This way, one click can be avoided. Just trying to understand and find the best general solution, but the way it works now is already fine for me Michaël Le 09/09/2010 19:12, Stefan Steiniger a écrit : So if I understand right we should have a checkbox in the options pannel that makes the charset choice dialog to be displayed or not when loading a shape file, otherwise a default charset is chosen. And the default checkbox setting may be to not show the dialog. sounds like a good idea to me. What do you think Matthias? stefan Larry Becker wrote: Hi Stefan, Having one charset choice doesn't support multiple charsets per project as the current method does. I'm not sure how often this happens, but it isn't too unusual to use datasets from multiple sources. Instead of commenting out the dialogs, it might be better to have a workbench blackboard option to skip them and use the default instead. Surely we are all going to run into an Umlaute or similar in our data eventually. regards, Larry On Wed, Sep 8, 2010 at 6:54 PM, Stefan Steinigersst...@geo.uzh.ch mailto:sst...@geo.uzh.ch wrote: I like the charset choice, thanks Matthias. However, I wonder what users feel having every time to chose (even it is only one more click) and probably not knowing what it means. So one thought I had is to comment out the dialog call and put the dialog options in (a new?) options tab instead and store it the blackboard? Then the currently set value is read while loading the shp (i.e. exposing the option in a different way to the user). I know its additional work but may be more user friendly for those who never care about charsets and have to load quite a bit of data during a day? Like I do ;) Actually my co-worker just suggested the option to have a checkbox for the additional dialog asking Do you want to use that value every time. so it doesn't pop up all the time during one session. my 2 cents... stefan Michaël Michaud wrote: Hi Matthias, Can you give me some information about how it is supposed to work. Am I supposed to get a panel with a charset option for any shapefile loading ? Sorry for that question, I did not launch the new compiled version. I know get the charset choice dialog. Thanks, Michaël 2) if we want to keep java 5 compatibility, you have to use new String(byte[], int, int, String) instead of new String(byte[], int, int, Charset) on line 264 3) about your proposition of saving the charset in the project when different from default jvm charset : Seems a good idea to me. Michaël Le 03/09/2010 20:34, Matthias Scholz a écrit : Hi, sorry my mistake. I have it only tested with open and open recent ;-) In the SVN it is fixed for the first time, but there is a general question and I want to hear the other developers/users. If I open a shapefile with a special charset setting for the first time, it would be logic for me, if we save the charset setting for this file in the project. So if the user opens this file again with the project, the file will be opened with the same charset. Should I implement this or have anyone an other suggestion? Regards Matthias Nice feature, but it is going to take a little more work. It currently breaks shapefile loading from a project file and the lright-click on layer legacy method Load Dataset. I think you need to set a default charset on start up. regards, Larry java.lang.IllegalArgumentException: Null charset name at java.nio.charset.Charset.lookup(Charset.java:430) at java.nio.charset.Charset.forName(Charset.java:503) at com.vividsolutions.jump.io.ShapefileReader.read(ShapefileReader.java:137) at com.vividsolutions.jump.io.datasource.DelegatingCompressedFileHandler.read(DelegatingCompressedFileHandler.java:79) at
Re: [JPP-Devel] Charset choise
I like the charset choice, thanks Matthias. However, I wonder what users feel having every time to chose (even it is only one more click) and probably not knowing what it means. So one thought I had is to comment out the dialog call and put the dialog options in (a new?) options tab instead and store it the blackboard? Then the currently set value is read while loading the shp (i.e. exposing the option in a different way to the user). I know its additional work but may be more user friendly for those who never care about charsets and have to load quite a bit of data during a day? Like I do ;) Actually my co-worker just suggested the option to have a checkbox for the additional dialog asking Do you want to use that value every time. so it doesn't pop up all the time during one session. my 2 cents... stefan Michaël Michaud wrote: Hi Matthias, Can you give me some information about how it is supposed to work. Am I supposed to get a panel with a charset option for any shapefile loading ? Sorry for that question, I did not launch the new compiled version. I know get the charset choice dialog. Thanks, Michaël 2) if we want to keep java 5 compatibility, you have to use new String(byte[], int, int, String) instead of new String(byte[], int, int, Charset) on line 264 3) about your proposition of saving the charset in the project when different from default jvm charset : Seems a good idea to me. Michaël Le 03/09/2010 20:34, Matthias Scholz a écrit : Hi, sorry my mistake. I have it only tested with open and open recent ;-) In the SVN it is fixed for the first time, but there is a general question and I want to hear the other developers/users. If I open a shapefile with a special charset setting for the first time, it would be logic for me, if we save the charset setting for this file in the project. So if the user opens this file again with the project, the file will be opened with the same charset. Should I implement this or have anyone an other suggestion? Regards Matthias Nice feature, but it is going to take a little more work. It currently breaks shapefile loading from a project file and the lright-click on layer legacy method Load Dataset. I think you need to set a default charset on start up. regards, Larry java.lang.IllegalArgumentException: Null charset name at java.nio.charset.Charset.lookup(Charset.java:430) at java.nio.charset.Charset.forName(Charset.java:503) at com.vividsolutions.jump.io.ShapefileReader.read(ShapefileReader.java:137) at com.vividsolutions.jump.io.datasource.DelegatingCompressedFileHandler.read(DelegatingCompressedFileHandler.java:79) at com.vividsolutions.jump.io.datasource.ReaderWriterFileDataSource$1.executeQuery(ReaderWriterFileDataSource.java:61) at com.vividsolutions.jump.io.datasource.ReaderWriterFileDataSource$1.executeQuery(ReaderWriterFileDataSource.java:79) at org.openjump.core.ui.plugin.file.open.OpenProjectWizard.executeQuery(OpenProjectWizard.java:282) at org.openjump.core.ui.plugin.file.open.OpenProjectWizard.load(OpenProjectWizard.java:271) at org.openjump.core.ui.plugin.file.open.OpenProjectWizard.loadLayers(OpenProjectWizard.java:208) at org.openjump.core.ui.plugin.file.open.OpenProjectWizard.open(OpenProjectWizard.java:152) at org.openjump.core.ui.plugin.file.open.OpenProjectWizard.open(OpenProjectWizard.java:107) at org.openjump.core.ui.plugin.file.open.OpenProjectWizard.run(OpenProjectWizard.java:99) at org.openjump.core.ui.plugin.AbstractWizardPlugin.run(AbstractWizardPlugin.java:71) at com.vividsolutions.jump.workbench.ui.task.TaskMonitorManager$TaskWrapper.run(TaskMonitorManager.java:151) at java.lang.Thread.run(Thread.java:619) On Fri, Sep 3, 2010 at 4:46 AM, Matthias Scholzm...@jammerhund.de mailto:m...@jammerhund.de wrote: Hi, I've commited some little changes for selecting an other charset while opening an ESRI shapefile. Thank you Michael and Stefan for your hints to the wizard framework. Thereby the code changes was very small and consitent :-) On the other hand Michael is right with his opinion about the wizard framework. Without good documentation you need many hours to understand and implement such options for file loading. Please take a look at my changes and tell me your opinion. In the language files (en and de) I've added a org.openjump.core.ui.plugin.file.charset key. Regards Matthias Le 30/08/2010 18:50, Stefan Steiniger a écrit : Hei, not sure, but wasn't the idea of the wizard that several dialogs can be displayed after each other? http://sourceforge.net/apps/mediawiki/jump-pilot/index.php?title=How_to_Create_an_Open_Wizard You're right Stefan, this is the idea of
Re: [JPP-Devel] Charset choise
Matthias, I wonder if it might be worth checking out the current GeoTools code for loading shapefiles, which already works with Charsets? I have done some work on code that allows you to obtain JUMP feature objects from th GeoTools shapefile driver. It seems logical to store the last used charset with the project file. Did we decide to set a default charset? The Sunburned Surveyor On Mon, Sep 6, 2010 at 3:01 PM, Matthias Scholz m...@jammerhund.de wrote: Hi Michaël, hi all other, sorry for my delay, but my internet connection was down at the weekend, so it was not possible for me to answer or commit any changes. 1. Charset setting for filednames I've seen, that my enhanchements do not include the fieldnames in the dbf header. To integrate the charset stuff for the filednames I had to change some method signatures (add Charset parameter). Because I do not know how is using the methods, I have build the old methods as a wrapper which is calling the new one with charset option. I hope thats the right way. As example please see the constructor of org.geotools.dbffile.DbfFile. In DbfFile I've removed the get/setCharset methods because the filednames will be read within the constructor(DbfFile-init-for() loop at the end). And to read the fieldnames with one charset, then set an other one and read the data with that makes no sense for me. 2. Save dataset as shapefile with charset settings If we have an option while opening, we should have an equivalent one while saving. But the save mechanism is not so simple as the open wizard. So there are more code changes required. In org.geotools.dbffile.DbfFileWriter added charset stuff. In com.vividsolutions.jump.workbench.datasource.InstallStandardDataSourceQueryChoosersPlugIn.addFileDataSourceQueryChoosers() I've added a combobox for the charset if we saving shapefiles. I don't if this is the right place or if this is a little bit ugly. In the future we should go a uniform way for such options. For GML as example we have a separate installer plugin. I would suggest a kind of save wizard(as the open file wizard and FileLoader options) where you can add simply options for save. 3. org.openjump.OpenJumpConfiguration I've changed the key of the charset option. Now we use a non localized key. This is better for saving in the project configuration. On the other hand in org.openjump.core.ui.plugin.file.open.SelectFileOptionsPanel.addIndividualSettingsFields() there is a nice mechanism for translating the option keys. But this was not used/activated in line 168. I hope no one have a problem with the change in line 168. As a consquence I had to change the language key from org.openjump.core.ui.plugin.file.charset to org.openjump.core.ui.io.file.DataSourceFileLayerLoader.charset. 4. org.openjump.core.ui.plugin.layer.LayerPropertiesPlugIn I've added the view of the charset settings, if the datasource is a shapefile. 5. com.vividsolutions.jump.io.ShapefileReader In the read() method I've moved back the charset code outsite the if ( mydbf == null ) brunch, for reading the fieldnames with charset. The new code is non-dbf save too. I do not know before, that Shape files without Dbf files are possible. This was a new fact for me ;-) The getDbfFile() method I had to change for reading the fieldnames with a charset. 6. Save/restore charset setting to/from project configuration I had nothing to do for that. The Option mechanism for FileLayerLoaders in combination with the OpenFileWizard do this automatically, if you add an Option :-) Regards Matthias Hi Matthias, I just moved the setCharset statement of ShapefileReader after the dbf != null test, because otherwise it broke the reading of shapefiles without dbf (which is not a very common case, but still a nice feature) If you want to check, I just commited. Michaël Le 03/09/2010 23:50, Michaël Michaud a écrit : Hi Matthias, Can you give me some information about how it is supposed to work. Am I supposed to get a panel with a charset option for any shapefile loading ? Sorry for that question, I did not launch the new compiled version. I know get the charset choice dialog. Thanks, Michaël 2) if we want to keep java 5 compatibility, you have to use new String(byte[], int, int, String) instead of new String(byte[], int, int, Charset) on line 264 3) about your proposition of saving the charset in the project when different from default jvm charset : Seems a good idea to me. Michaël Le 03/09/2010 20:34, Matthias Scholz a écrit : Hi, sorry my mistake. I have it only tested with open and open recent ;-) In the SVN it is fixed for the first time, but there is a general question and I want to hear the other developers/users. If I open a shapefile with a special charset setting for the first time, it would be logic for me, if we save the charset setting for this file in the project. So if the user opens this file again with
Re: [JPP-Devel] Charset choise
On 07.09.2010 16:25, Sunburned Surveyor wrote: I wonder if it might be worth checking out the current GeoTools code for loading shapefiles, which already works with Charsets? I have done some work on code that allows you to obtain JUMP feature objects from th GeoTools shapefile driver. I once did a geotools read/write extension. Maybe someone wants to update it to work with the latest geotools2? http://soldin.de/about/2004-jump_plugins/ ..ede -- This SF.net Dev2Dev email is sponsored by: Show off your parallel programming skills. Enter the Intel(R) Threading Challenge 2010. http://p.sf.net/sfu/intel-thread-sfd ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
Re: [JPP-Devel] Charset choise
Hi Michaël, hi all other, sorry for my delay, but my internet connection was down at the weekend, so it was not possible for me to answer or commit any changes. 1. Charset setting for filednames I've seen, that my enhanchements do not include the fieldnames in the dbf header. To integrate the charset stuff for the filednames I had to change some method signatures (add Charset parameter). Because I do not know how is using the methods, I have build the old methods as a wrapper which is calling the new one with charset option. I hope thats the right way. As example please see the constructor of org.geotools.dbffile.DbfFile. In DbfFile I've removed the get/setCharset methods because the filednames will be read within the constructor(DbfFile-init-for() loop at the end). And to read the fieldnames with one charset, then set an other one and read the data with that makes no sense for me. 2. Save dataset as shapefile with charset settings If we have an option while opening, we should have an equivalent one while saving. But the save mechanism is not so simple as the open wizard. So there are more code changes required. In org.geotools.dbffile.DbfFileWriter added charset stuff. In com.vividsolutions.jump.workbench.datasource.InstallStandardDataSourceQueryChoosersPlugIn.addFileDataSourceQueryChoosers() I've added a combobox for the charset if we saving shapefiles. I don't if this is the right place or if this is a little bit ugly. In the future we should go a uniform way for such options. For GML as example we have a separate installer plugin. I would suggest a kind of save wizard(as the open file wizard and FileLoader options) where you can add simply options for save. 3. org.openjump.OpenJumpConfiguration I've changed the key of the charset option. Now we use a non localized key. This is better for saving in the project configuration. On the other hand in org.openjump.core.ui.plugin.file.open.SelectFileOptionsPanel.addIndividualSettingsFields() there is a nice mechanism for translating the option keys. But this was not used/activated in line 168. I hope no one have a problem with the change in line 168. As a consquence I had to change the language key from org.openjump.core.ui.plugin.file.charset to org.openjump.core.ui.io.file.DataSourceFileLayerLoader.charset. 4. org.openjump.core.ui.plugin.layer.LayerPropertiesPlugIn I've added the view of the charset settings, if the datasource is a shapefile. 5. com.vividsolutions.jump.io.ShapefileReader In the read() method I've moved back the charset code outsite the if ( mydbf == null ) brunch, for reading the fieldnames with charset. The new code is non-dbf save too. I do not know before, that Shape files without Dbf files are possible. This was a new fact for me ;-) The getDbfFile() method I had to change for reading the fieldnames with a charset. 6. Save/restore charset setting to/from project configuration I had nothing to do for that. The Option mechanism for FileLayerLoaders in combination with the OpenFileWizard do this automatically, if you add an Option :-) Regards Matthias Hi Matthias, I just moved the setCharset statement of ShapefileReader after the dbf != null test, because otherwise it broke the reading of shapefiles without dbf (which is not a very common case, but still a nice feature) If you want to check, I just commited. Michaël Le 03/09/2010 23:50, Michaël Michaud a écrit : Hi Matthias, Can you give me some information about how it is supposed to work. Am I supposed to get a panel with a charset option for any shapefile loading ? Sorry for that question, I did not launch the new compiled version. I know get the charset choice dialog. Thanks, Michaël 2) if we want to keep java 5 compatibility, you have to use new String(byte[], int, int, String) instead of new String(byte[], int, int, Charset) on line 264 3) about your proposition of saving the charset in the project when different from default jvm charset : Seems a good idea to me. Michaël Le 03/09/2010 20:34, Matthias Scholz a écrit : Hi, sorry my mistake. I have it only tested with open and open recent ;-) In the SVN it is fixed for the first time, but there is a general question and I want to hear the other developers/users. If I open a shapefile with a special charset setting for the first time, it would be logic for me, if we save the charset setting for this file in the project. So if the user opens this file again with the project, the file will be opened with the same charset. Should I implement this or have anyone an other suggestion? Regards Matthias Nice feature, but it is going to take a little more work. It currently breaks shapefile loading from a project file and the lright-click on layer legacy method Load Dataset. I think you need to set a default charset on start up. regards, Larry java.lang.IllegalArgumentException: Null
Re: [JPP-Devel] Charset choise
Hi Matthias, I just moved the setCharset statement of ShapefileReader after the dbf != null test, because otherwise it broke the reading of shapefiles without dbf (which is not a very common case, but still a nice feature) If you want to check, I just commited. Michaël Le 03/09/2010 23:50, Michaël Michaud a écrit : Hi Matthias, Can you give me some information about how it is supposed to work. Am I supposed to get a panel with a charset option for any shapefile loading ? Sorry for that question, I did not launch the new compiled version. I know get the charset choice dialog. Thanks, Michaël 2) if we want to keep java 5 compatibility, you have to use new String(byte[], int, int, String) instead of new String(byte[], int, int, Charset) on line 264 3) about your proposition of saving the charset in the project when different from default jvm charset : Seems a good idea to me. Michaël Le 03/09/2010 20:34, Matthias Scholz a écrit : Hi, sorry my mistake. I have it only tested with open and open recent ;-) In the SVN it is fixed for the first time, but there is a general question and I want to hear the other developers/users. If I open a shapefile with a special charset setting for the first time, it would be logic for me, if we save the charset setting for this file in the project. So if the user opens this file again with the project, the file will be opened with the same charset. Should I implement this or have anyone an other suggestion? Regards Matthias Nice feature, but it is going to take a little more work. It currently breaks shapefile loading from a project file and the lright-click on layer legacy method Load Dataset. I think you need to set a default charset on start up. regards, Larry java.lang.IllegalArgumentException: Null charset name at java.nio.charset.Charset.lookup(Charset.java:430) at java.nio.charset.Charset.forName(Charset.java:503) at com.vividsolutions.jump.io.ShapefileReader.read(ShapefileReader.java:137) at com.vividsolutions.jump.io.datasource.DelegatingCompressedFileHandler.read(DelegatingCompressedFileHandler.java:79) at com.vividsolutions.jump.io.datasource.ReaderWriterFileDataSource$1.executeQuery(ReaderWriterFileDataSource.java:61) at com.vividsolutions.jump.io.datasource.ReaderWriterFileDataSource$1.executeQuery(ReaderWriterFileDataSource.java:79) at org.openjump.core.ui.plugin.file.open.OpenProjectWizard.executeQuery(OpenProjectWizard.java:282) at org.openjump.core.ui.plugin.file.open.OpenProjectWizard.load(OpenProjectWizard.java:271) at org.openjump.core.ui.plugin.file.open.OpenProjectWizard.loadLayers(OpenProjectWizard.java:208) at org.openjump.core.ui.plugin.file.open.OpenProjectWizard.open(OpenProjectWizard.java:152) at org.openjump.core.ui.plugin.file.open.OpenProjectWizard.open(OpenProjectWizard.java:107) at org.openjump.core.ui.plugin.file.open.OpenProjectWizard.run(OpenProjectWizard.java:99) at org.openjump.core.ui.plugin.AbstractWizardPlugin.run(AbstractWizardPlugin.java:71) at com.vividsolutions.jump.workbench.ui.task.TaskMonitorManager$TaskWrapper.run(TaskMonitorManager.java:151) at java.lang.Thread.run(Thread.java:619) On Fri, Sep 3, 2010 at 4:46 AM, Matthias Scholzm...@jammerhund.de mailto:m...@jammerhund.dewrote: Hi, I've commited some little changes for selecting an other charset while opening an ESRI shapefile. Thank you Michael and Stefan for your hints to the wizard framework. Thereby the code changes was very small and consitent :-) On the other hand Michael is right with his opinion about the wizard framework. Without good documentation you need many hours to understand and implement such options for file loading. Please take a look at my changes and tell me your opinion. In the language files (en and de) I've added a org.openjump.core.ui.plugin.file.charset key. Regards Matthias Le 30/08/2010 18:50, Stefan Steiniger a écrit : Hei, not sure, but wasn't the idea of the wizard that several dialogs can be displayed after each other? http://sourceforge.net/apps/mediawiki/jump-pilot/index.php?title=How_to_Create_an_Open_Wizard You're right Stefan, this is the idea of this wizard wouldn't that work for you too? I found it was not very easy to use the wizard framework to add options to an open file dialog box, but I think this is the way to go if we want to have something consistent in OpenJUMP Though I am not sure which loader uses that option currently. But it looks like the WMS Layer option does that. (you see not a
Re: [JPP-Devel] Charset choise
I don't see any problems with your approach. Is the idea to allow the charset of the shapefile to be selected from the new JComboBox? Landon On Sat, Aug 28, 2010 at 3:03 AM, Matthias Scholz m...@jammerhund.de wrote: Hi, in the last few weeks i had some problems with different charsets in shape/dbf files. In the openjump.bat or openjump.sh file I have inserted the java system property file.encoding= My problems are the german Umlaute in the attributes. I would like to add a JComboBox to the org.openjump.core.ui.plugin.file.open.SelectFilesPanel. Because the SelectFilesPanel extends JFileChooser I don't know any possibility to add any other widget. I would prefer to change public class SelectFilesPanel extends JFileChooser implements WizardPanel to public class SelectFilesPanel extends JPanel implements WizardPanel then add the JFileChooser and a JComboBox to the JPanel. I don't know if this have impacts to other classes? Before I start to code, I would like to hear from the other developers. Regards Matthias -- Sell apps to millions through the Intel(R) Atom(Tm) Developer Program Be part of this innovative community and reach millions of netbook users worldwide. Take advantage of special opportunities to increase revenue and speed time-to-market. Join now, and jumpstart your future. http://p.sf.net/sfu/intel-atom-d2d ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel -- Sell apps to millions through the Intel(R) Atom(Tm) Developer Program Be part of this innovative community and reach millions of netbook users worldwide. Take advantage of special opportunities to increase revenue and speed time-to-market. Join now, and jumpstart your future. http://p.sf.net/sfu/intel-atom-d2d ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
Re: [JPP-Devel] Charset choise
Hei, not sure, but wasn't the idea of the wizard that several dialogs can be displayed after each other? http://sourceforge.net/apps/mediawiki/jump-pilot/index.php?title=How_to_Create_an_Open_Wizard wouldn't that work for you too? Though I am not sure which loader uses that option currently. But it looks like the WMS Layer option does that. (you see not a finish but a next button) stefan Sunburned Surveyor wrote: I don't see any problems with your approach. Is the idea to allow the charset of the shapefile to be selected from the new JComboBox? Landon On Sat, Aug 28, 2010 at 3:03 AM, Matthias Scholz m...@jammerhund.de wrote: Hi, in the last few weeks i had some problems with different charsets in shape/dbf files. In the openjump.bat or openjump.sh file I have inserted the java system property file.encoding= My problems are the german Umlaute in the attributes. I would like to add a JComboBox to the org.openjump.core.ui.plugin.file.open.SelectFilesPanel. Because the SelectFilesPanel extends JFileChooser I don't know any possibility to add any other widget. I would prefer to change public class SelectFilesPanel extends JFileChooser implements WizardPanel to public class SelectFilesPanel extends JPanel implements WizardPanel then add the JFileChooser and a JComboBox to the JPanel. I don't know if this have impacts to other classes? Before I start to code, I would like to hear from the other developers. Regards Matthias -- Sell apps to millions through the Intel(R) Atom(Tm) Developer Program Be part of this innovative community and reach millions of netbook users worldwide. Take advantage of special opportunities to increase revenue and speed time-to-market. Join now, and jumpstart your future. http://p.sf.net/sfu/intel-atom-d2d ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel -- Sell apps to millions through the Intel(R) Atom(Tm) Developer Program Be part of this innovative community and reach millions of netbook users worldwide. Take advantage of special opportunities to increase revenue and speed time-to-market. Join now, and jumpstart your future. http://p.sf.net/sfu/intel-atom-d2d ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel -- This SF.net Dev2Dev email is sponsored by: Show off your parallel programming skills. Enter the Intel(R) Threading Challenge 2010. http://p.sf.net/sfu/intel-thread-sfd ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
Re: [JPP-Devel] Charset choise
Le 30/08/2010 18:50, Stefan Steiniger a écrit : Hei, not sure, but wasn't the idea of the wizard that several dialogs can be displayed after each other? http://sourceforge.net/apps/mediawiki/jump-pilot/index.php?title=How_to_Create_an_Open_Wizard You're right Stefan, this is the idea of this wizard wouldn't that work for you too? I found it was not very easy to use the wizard framework to add options to an open file dialog box, but I think this is the way to go if we want to have something consistent in OpenJUMP Though I am not sure which loader uses that option currently. But it looks like the WMS Layer option does that. (you see not a finish but a next button) I used it to make a text/csv/wkt format driver with some options. You can also find my code here : http://geo.michaelm.free.fr/OpenJUMP/resources/drivers/txt-driver-src-0.2.1.zip Michaël stefan Sunburned Surveyor wrote: I don't see any problems with your approach. Is the idea to allow the charset of the shapefile to be selected from the new JComboBox? Landon On Sat, Aug 28, 2010 at 3:03 AM, Matthias Scholzm...@jammerhund.de wrote: Hi, in the last few weeks i had some problems with different charsets in shape/dbf files. In the openjump.bat or openjump.sh file I have inserted the java system property file.encoding= My problems are the german Umlaute in the attributes. I would like to add a JComboBox to the org.openjump.core.ui.plugin.file.open.SelectFilesPanel. Because the SelectFilesPanel extends JFileChooser I don't know any possibility to add any other widget. I would prefer to change public class SelectFilesPanel extends JFileChooser implements WizardPanel to public class SelectFilesPanel extends JPanel implements WizardPanel then add the JFileChooser and a JComboBox to the JPanel. I don't know if this have impacts to other classes? Before I start to code, I would like to hear from the other developers. Regards Matthias -- Sell apps to millions through the Intel(R) Atom(Tm) Developer Program Be part of this innovative community and reach millions of netbook users worldwide. Take advantage of special opportunities to increase revenue and speed time-to-market. Join now, and jumpstart your future. http://p.sf.net/sfu/intel-atom-d2d ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel -- Sell apps to millions through the Intel(R) Atom(Tm) Developer Program Be part of this innovative community and reach millions of netbook users worldwide. Take advantage of special opportunities to increase revenue and speed time-to-market. Join now, and jumpstart your future. http://p.sf.net/sfu/intel-atom-d2d ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel -- This SF.net Dev2Dev email is sponsored by: Show off your parallel programming skills. Enter the Intel(R) Threading Challenge 2010. http://p.sf.net/sfu/intel-thread-sfd ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel -- This SF.net Dev2Dev email is sponsored by: Show off your parallel programming skills. Enter the Intel(R) Threading Challenge 2010. http://p.sf.net/sfu/intel-thread-sfd ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
[JPP-Devel] Charset choise
Hi, in the last few weeks i had some problems with different charsets in shape/dbf files. In the openjump.bat or openjump.sh file I have inserted the java system property file.encoding= My problems are the german Umlaute in the attributes. I would like to add a JComboBox to the org.openjump.core.ui.plugin.file.open.SelectFilesPanel. Because the SelectFilesPanel extends JFileChooser I don't know any possibility to add any other widget. I would prefer to change public class SelectFilesPanel extends JFileChooser implements WizardPanel to public class SelectFilesPanel extends JPanel implements WizardPanel then add the JFileChooser and a JComboBox to the JPanel. I don't know if this have impacts to other classes? Before I start to code, I would like to hear from the other developers. Regards Matthias -- Sell apps to millions through the Intel(R) Atom(Tm) Developer Program Be part of this innovative community and reach millions of netbook users worldwide. Take advantage of special opportunities to increase revenue and speed time-to-market. Join now, and jumpstart your future. http://p.sf.net/sfu/intel-atom-d2d ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel