Re: [JPP-Devel] Icons for Data Store Layers

2018-01-03 Thread Nicolas Ribot
Hi Ede,

Ok, I commit.
Yes, I tested it against several spatial databases.

Nicolas

On 3 January 2018 at 15:35,  wrote:

> On 03.01.2018 15:17, Nicolas Ribot wrote:
> > Hi,
> >
> > Happy new year !
> >
> > I have added code to display icons according to layer geometric type, in
> the Datastore Layer Panel, instead of default JTree one:
> >
> > Inline images 1
> >
> > I understood a new release is coming, is it wise to commit the code now ?
> > (few changes in the code: icon loading from OJ set of icons, and a test
> in the getIcon method of the Outline table instead of returning null.
>
> hey Nic,
>
> welcome to 2018. no problem in committing your code, as it seems to be
> cosmetic anyway. i assume you have tested it properly of course.
>
> the new release is on it's way albeit slowly as i am struggling to find
> time to commit some changes i have in the pipeline still. currently i
> assume there will be a release candidate by the middle/end of january and
> the proper release one/two weeks later?
>
> ..ede
>
> 
> --
> 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
> Jump-pilot-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>
--
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
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel


[JPP-Devel] SVN: [5656] core/trunk

2018-01-03 Thread jump-pilot-svn--- via Jump-pilot-devel
Revision: 5656
  http://sourceforge.net/p/jump-pilot/code/5656
Author:   elnico
Date: 2018-01-03 16:00:38 + (Wed, 03 Jan 2018)
Log Message:
---
Icons for layers according to geometry type in the Data Store Layer panel

Modified Paths:
--
core/trunk/ChangeLog

core/trunk/src/com/vividsolutions/jump/workbench/ui/plugin/datastore/DataStoreLayerRenderData.java

Modified: core/trunk/ChangeLog
===
--- core/trunk/ChangeLog2017-12-26 17:42:23 UTC (rev 5655)
+++ core/trunk/ChangeLog2018-01-03 16:00:38 UTC (rev 5656)
@@ -3,6 +3,9 @@
 # 2. make sure that lines break at 80 chars for constricted display situations
 #< 80 chars 
-->#
 
+2018-01-03 Nicolas Ribot 
+  * Icons for layers according to geometry type in the Data Store Layer panel
+
 2017-12-10 ede
   * final bugfix: "#463 Starting OJ with java9 throws several exceptions"
 OJ should be generally java 9 ready now

Modified: 
core/trunk/src/com/vividsolutions/jump/workbench/ui/plugin/datastore/DataStoreLayerRenderData.java
===
--- 
core/trunk/src/com/vividsolutions/jump/workbench/ui/plugin/datastore/DataStoreLayerRenderData.java
  2017-12-26 17:42:23 UTC (rev 5655)
+++ 
core/trunk/src/com/vividsolutions/jump/workbench/ui/plugin/datastore/DataStoreLayerRenderData.java
  2018-01-03 16:00:38 UTC (rev 5656)
@@ -7,10 +7,24 @@
 
 import com.vividsolutions.jump.datastore.DataStoreLayer;
 import java.awt.Color;
+
+import com.vividsolutions.jump.workbench.ui.images.IconLoader;
 import org.netbeans.swing.outline.RenderDataProvider;
 
+import javax.swing.*;
+
 public class DataStoreLayerRenderData implements RenderDataProvider {
 
+// icons to display according to node geometry type
+private ImageIcon gc = IconLoader.icon("EditGeometryCollection.gif");
+private ImageIcon point = IconLoader.icon("EditPoint.gif");
+private ImageIcon mpoint = IconLoader.icon("EditMultiPoint.gif");
+private ImageIcon line = IconLoader.icon("EditLineString.gif");
+private ImageIcon mline = IconLoader.icon("EditMultiLineString.gif");
+private ImageIcon poly = IconLoader.icon("EditPolygon.gif");
+private ImageIcon mpoly = IconLoader.icon("EditMultiPolygon.gif");
+private ImageIcon lring = IconLoader.icon("EditLinearRing.gif");
+
 @Override
 public java.awt.Color getBackground(Object o) {
 if (!(o instanceof String)) {
@@ -41,8 +55,33 @@
 
 @Override
 public javax.swing.Icon getIcon(Object o) {
-return null;
-
+// Nicolas Ribot: 03 jan 2018: adds custom icons according to layer 
geometry type
+if (o instanceof DataStoreLayer) {
+switch (((DataStoreLayer) o).getGeoCol().getType().toLowerCase()) {
+case "geometrycollection":
+case "geometry":
+case "sdo_geometry":
+return this.gc;
+case "point":
+return this.point;
+case "multipoint":
+return this.mpoint;
+case "linestring":
+return this.line;
+case "multilinestring":
+return this.mline;
+case "polygon":
+return this.poly;
+case "multipolygon":
+return this.mpoly;
+case "linearring":
+return this.lring;
+default:
+return null;
+}
+} else {
+return null;
+}
 }
 
 @Override


--
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
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel


[JPP-Devel] Problems on projection file (shapefile) detection

2018-01-03 Thread Giuseppe Aruta
Hi Michael
I had this warning caming out on using Layer Properties plugin:

ava.lang.IllegalArgumentException: No enum constant
org.openjump.core.ccordsys.utils.SRSInfo.Registry.LOCAL_CoordinateReferenceSystem
at java.lang.Enum.valueOf(Unknown Source)
at
org.openjump.core.ccordsys.utils.SRSInfo$Registry.valueOf(SRSInfo.java:21)
at org.openjump.core.ccordsys.utils.SRSInfo.setRegistry(SRSInfo.java:61)
at
org.openjump.core.ccordsys.utils.ProjUtils.getSRSInfoFromAuxiliaryFile(ProjUtils.java:127)
at
org.openjump.core.ccordsys.utils.ProjUtils.getSRSInfoFromLayerSource(ProjUtils.java:380)
at
org.openjump.core.ccordsys.utils.ProjUtils.getSRSInfoFromLayerStyleOrSource(ProjUtils.java:275)
at
org.openjump.core.ui.plugin.layer.NewLayerPropertiesPlugIn$InfoPanel.setInfoProjection(NewLayerPropertiesPlugIn.java:705)
at
org.openjump.core.ui.plugin.layer.NewLayerPropertiesPlugIn$InfoPanel.(NewLayerPropertiesPlugIn.java:446)
at
org.openjump.core.ui.plugin.layer.NewLayerPropertiesPlugIn$InfoPanel.(NewLayerPropertiesPlugIn.java:343)
at
org.openjump.core.ui.plugin.layer.NewLayerPropertiesPlugIn.execute(NewLayerPropertiesPlugIn.java:205)

I tried with several .prj file using OJ 5639 and OJ 5655.
It seems to me that something is broken on SRSInfo class, maybe. I don't
have OJ source code to check here in Chile.


I just resume as projection detection was working since early ProjUtils
class. Maybe it can be useful to find the problem

1) projection WKT string is searched on a .prj file (or .aux file)  on
reading data
2) WKT string detected is "cleaned" to take only the PROJ definition.
3) PROJ definition is  decoded proj  according to main varieties (OGC and
ESRI) plus few extra codes to have unique readable definition
4) the definition is finally compared on a registry file to have back its
EPSG srid code and unit
5) if WKT string doesn't match any definition find on the registry. Layer
Property plugin outputs the entire WKT string. In this way the user can
find other way to find t the srid

Greetings from Santiago and Happy new year

Peppe
--
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
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel


Re: [JPP-Devel] Icons for Data Store Layers

2018-01-03 Thread edgar . soldin
On 03.01.2018 15:17, Nicolas Ribot wrote:
> Hi,
> 
> Happy new year !
> 
> I have added code to display icons according to layer geometric type, in the 
> Datastore Layer Panel, instead of default JTree one:
> 
> Inline images 1
> 
> I understood a new release is coming, is it wise to commit the code now ?
> (few changes in the code: icon loading from OJ set of icons, and a test in 
> the getIcon method of the Outline table instead of returning null.

hey Nic,

welcome to 2018. no problem in committing your code, as it seems to be cosmetic 
anyway. i assume you have tested it properly of course.

the new release is on it's way albeit slowly as i am struggling to find time to 
commit some changes i have in the pipeline still. currently i assume there will 
be a release candidate by the middle/end of january and the proper release 
one/two weeks later?

..ede

--
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
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel


[JPP-Devel] Icons for Data Store Layers

2018-01-03 Thread Nicolas Ribot
Hi,

Happy new year !

I have added code to display icons according to layer geometric type, in
the Datastore Layer Panel, instead of default JTree one:

[image: Inline images 1]

I understood a new release is coming, is it wise to commit the code now ?
(few changes in the code: icon loading from OJ set of icons, and a test in
the getIcon method of the Outline table instead of returning null.

Nicolas
--
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
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel


Re: [JPP-Devel] Distance Measurement

2018-01-03 Thread Rahkonen Jukka (MML)
Hi,

There is an option to change the units in the Measure toolbox that is included 
in the OpenJUMP Plus. The source seems to be in 
https://sourceforge.net/projects/opensit/files/Openjump/PlugIn/MeasureExtension/.
  Perhaps you can find some inspiration from there.

-Jukka Rahkonen-

Lähettäjä: Arun Bharathi [mailto:arunbharathi...@gmail.com]
Lähetetty: 3. tammikuuta 2018 12:12
Vastaanottaja: OpenJump develop and use 
Aihe: [JPP-Devel] Distance Measurement

Hi,
In OJ, the distance of two co-ordinates are measured in meters. I want to 
convert it into km programmatically. Is it possible? Can anybody help me?

Thanks and Regards.
P.Arun Bharathi

--
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
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel


[JPP-Devel] Distance Measurement

2018-01-03 Thread Arun Bharathi
Hi,
In OJ, the distance of two co-ordinates are measured in meters. I want to
convert it into km programmatically. Is it possible? Can anybody help me?

Thanks and Regards.
P.Arun Bharathi
--
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
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel