Revision: 4435
          http://sourceforge.net/p/jump-pilot/code/4435
Author:   michaudm
Date:     2015-05-12 06:37:53 +0000 (Tue, 12 May 2015)
Log Message:
-----------
Version 0.5 including Jukka's suggestion about error messages and feature 
geometry restriction

Modified Paths:
--------------
    
plug-ins/SetAttributesPlugin/trunk/resources/set_attributes/language/jump.properties
    
plug-ins/SetAttributesPlugin/trunk/resources/set_attributes/language/jump_fr.properties
    
plug-ins/SetAttributesPlugin/trunk/src/org/openjump/ext/setattributes/SetAttribute.java
    
plug-ins/SetAttributesPlugin/trunk/src/org/openjump/ext/setattributes/SetAttributesExtension.java
    
plug-ins/SetAttributesPlugin/trunk/src/org/openjump/ext/setattributes/SetAttributesToolbox.java
    
plug-ins/SetAttributesPlugin/trunk/src/org/openjump/ext/setattributes/SetOfAttributes.java

Modified: 
plug-ins/SetAttributesPlugin/trunk/resources/set_attributes/language/jump.properties
===================================================================
--- 
plug-ins/SetAttributesPlugin/trunk/resources/set_attributes/language/jump.properties
        2015-05-11 15:52:42 UTC (rev 4434)
+++ 
plug-ins/SetAttributesPlugin/trunk/resources/set_attributes/language/jump.properties
        2015-05-12 06:37:53 UTC (rev 4435)
@@ -1,3 +1,4 @@
 SetAttributesPlugIn = SetAttributes
-SetAttributesPlugIn.no-feature-found = No selected feature found in a matching 
editable layers
+SetAttributesPlugIn.no-feature-found = No selected feature in an editable layer
+SetAttributesPlugIn.no-feature-found-in-layer = No selected feature in an 
editable layer matching mask ''{0}''
 SetAttributesPlugIn.not-consistent-with-schema = Set Attributes : 
inconsistency between attribute ''{0}'' and feature ''{1}'' #{2}
\ No newline at end of file

Modified: 
plug-ins/SetAttributesPlugin/trunk/resources/set_attributes/language/jump_fr.properties
===================================================================
--- 
plug-ins/SetAttributesPlugin/trunk/resources/set_attributes/language/jump_fr.properties
     2015-05-11 15:52:42 UTC (rev 4434)
+++ 
plug-ins/SetAttributesPlugin/trunk/resources/set_attributes/language/jump_fr.properties
     2015-05-12 06:37:53 UTC (rev 4435)
@@ -1,3 +1,4 @@
 SetAttributesPlugIn = Jeu d'attributs
-SetAttributesPlugIn.no-feature-found = Aucun objet s\xE9lectionn\xE9 dans une 
couche modifiable \xE9ligible
+SetAttributesPlugIn.no-feature-found = Aucun objet s\xE9lectionn\xE9 dans une 
couche modifiable
+SetAttributesPlugIn.no-feature-found-in-layer = Aucun objet s\xE9lectionn\xE9 
dans une couche modifiable de la forme ''{0}''
 SetAttributesPlugIn.not-consistent-with-schema = Jeu d''attributs : 
incoh\xE9rence entre l''attribut ''{0}'' et l''objet ''{1}'' #{2}
\ No newline at end of file

Modified: 
plug-ins/SetAttributesPlugin/trunk/src/org/openjump/ext/setattributes/SetAttribute.java
===================================================================
--- 
plug-ins/SetAttributesPlugin/trunk/src/org/openjump/ext/setattributes/SetAttribute.java
     2015-05-11 15:52:42 UTC (rev 4434)
+++ 
plug-ins/SetAttributesPlugin/trunk/src/org/openjump/ext/setattributes/SetAttribute.java
     2015-05-12 06:37:53 UTC (rev 4435)
@@ -20,9 +20,10 @@
     @XmlAttribute (name="value", required=false)
     String value;
 
-    @XmlAttribute
+    @XmlAttribute (name="prerequisite", required=false)
     String prerequisite;
 
+
     public SetAttribute() {}
 
     public String getName() {
@@ -56,4 +57,5 @@
             return true;
         } else return true;
     }
+
 }

Modified: 
plug-ins/SetAttributesPlugin/trunk/src/org/openjump/ext/setattributes/SetAttributesExtension.java
===================================================================
--- 
plug-ins/SetAttributesPlugin/trunk/src/org/openjump/ext/setattributes/SetAttributesExtension.java
   2015-05-11 15:52:42 UTC (rev 4434)
+++ 
plug-ins/SetAttributesPlugin/trunk/src/org/openjump/ext/setattributes/SetAttributesExtension.java
   2015-05-12 06:37:53 UTC (rev 4435)
@@ -15,7 +15,7 @@
     }
 
     public String getVersion() {
-        return "0.4 (2015-05-11)";
+        return "0.5 (2015-05-12)";
     }
 
     public void configure(PlugInContext context) throws Exception {

Modified: 
plug-ins/SetAttributesPlugin/trunk/src/org/openjump/ext/setattributes/SetAttributesToolbox.java
===================================================================
--- 
plug-ins/SetAttributesPlugin/trunk/src/org/openjump/ext/setattributes/SetAttributesToolbox.java
     2015-05-11 15:52:42 UTC (rev 4434)
+++ 
plug-ins/SetAttributesPlugin/trunk/src/org/openjump/ext/setattributes/SetAttributesToolbox.java
     2015-05-12 06:37:53 UTC (rev 4435)
@@ -109,8 +109,20 @@
                             mapSource.put(lyr,srcLayerMap);
                             mapTarget.put(lyr,tgtLayerMap);
                         }
-                        if (editableLayers == 0 || editableFeatures == 0) {
-                            
pluginContext.getWorkbenchFrame().warnUser(I18N_.getText("set_attributes","SetAttributesPlugIn.no-feature-found"));
+                        if (editableLayers == 0 && setOfAttributes.getLayer() 
== null) {
+                            
pluginContext.getWorkbenchFrame().warnUser(I18N_.getText("set_attributes",
+                                    "SetAttributesPlugIn.no-feature-found"));
+                        } else if (editableLayers == 0) {
+                            
pluginContext.getWorkbenchFrame().warnUser(I18N_.getMessage("set_attributes",
+                                    
"SetAttributesPlugIn.no-feature-found-in-layer",
+                                    new Object[]{setOfAttributes.getLayer()}));
+                        } else if (editableFeatures == 0 && 
setOfAttributes.getLayer() == null) {
+                            
pluginContext.getWorkbenchFrame().warnUser(I18N_.getText("set_attributes",
+                                    "SetAttributesPlugIn.no-feature-found"));
+                        } else if (editableFeatures == 0) {
+                            
pluginContext.getWorkbenchFrame().warnUser(I18N_.getMessage("set_attributes",
+                                    
"SetAttributesPlugIn.no-feature-found-in-layer",
+                                    new Object[]{setOfAttributes.getLayer()}));
                         } else {
                             UndoableCommand command =
                                     new 
UndoableCommand(I18N.get(SetAttributesPlugIn.class.getName())) {

Modified: 
plug-ins/SetAttributesPlugin/trunk/src/org/openjump/ext/setattributes/SetOfAttributes.java
===================================================================
--- 
plug-ins/SetAttributesPlugin/trunk/src/org/openjump/ext/setattributes/SetOfAttributes.java
  2015-05-11 15:52:42 UTC (rev 4434)
+++ 
plug-ins/SetAttributesPlugin/trunk/src/org/openjump/ext/setattributes/SetOfAttributes.java
  2015-05-12 06:37:53 UTC (rev 4435)
@@ -44,6 +44,9 @@
     @XmlAttribute
     String layer;
 
+    @XmlAttribute (name="dimension", required=false)
+    int dimension = -1;
+
     @XmlElement (name="attribute")
     List<SetAttribute> attributes;
 
@@ -63,6 +66,10 @@
         return layer;
     }
 
+    public int getDimension() {
+        return dimension;
+    }
+
     public List<SetAttribute> getAttributes() {
         return attributes;
     }
@@ -97,6 +104,9 @@
                     if (!setAtt.checkPrerequisite(feature.getAttribute(name))) 
{
                         continue;
                     }
+                    if (!checkDimension(feature)) {
+                        continue;
+                    }
                     //Feature newFeature = map.get(feature);
                     AttributeType type = schema.getAttributeType(name);
                     if (type == AttributeType.STRING) {
@@ -131,4 +141,10 @@
         return map;
     }
 
+    boolean checkDimension(Feature feature) {
+        if (dimension > -1) {
+            return feature.getGeometry().getDimension() == dimension;
+        } else return true;
+    }
+
 }


------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to