method getStatusIcon added to NetworkMapImageProvider interface
authorVictor Kirhenshtein <victor@netxms.org>
Sat, 20 Apr 2013 11:17:21 +0000 (11:17 +0000)
committerVictor Kirhenshtein <victor@netxms.org>
Sat, 20 Apr 2013 11:17:21 +0000 (11:17 +0000)
COPYING
src/java/netxms-eclipse/NetworkMaps/src/org/netxms/ui/eclipse/networkmaps/MapImageProvidersManager.java
src/java/netxms-eclipse/NetworkMaps/src/org/netxms/ui/eclipse/networkmaps/api/NetworkMapImageProvider.java
src/java/netxms-eclipse/NetworkMaps/src/org/netxms/ui/eclipse/networkmaps/views/helpers/MapLabelProvider.java
webui/webapp/ObjectTools/META-INF/MANIFEST.MF

diff --git a/COPYING b/COPYING
index af3354d..1fb4e5b 100644 (file)
--- a/COPYING
+++ b/COPYING
@@ -41,7 +41,6 @@ all SMS drivers GPL
 
 Third party components bundled with NetXMS:
 
-freetype        BSD-like
 libexpat        BSD-like
 libipfix        LGPL
 libtre          BSD-like
index da01781..4adf465 100644 (file)
@@ -109,4 +109,20 @@ public class MapImageProvidersManager
                }
                return null;
        }
+       
+       /**
+        * Get status icon for given status code.
+        * 
+        * @return icon for given status code or null.
+        */
+       public Image getStatusIcon(int status)
+       {
+               for(NetworkMapImageProvider p : providers.values())
+               {
+                       Image i = p.getStatusIcon(status);
+                       if (i != null)
+                               return i;
+               }
+               return null;
+       }
 }
index 555d212..5257e16 100644 (file)
@@ -33,4 +33,12 @@ public interface NetworkMapImageProvider
         * @return image for given object or null to continue search
         */
        public Image getMapImage(AbstractObject object);
+       
+       /**
+        * Get status icon (shown on top of map image) for given status.
+        * 
+        * @param status status code
+        * @return icon for given status or null to continue search
+        */
+       public Image getStatusIcon(int status);
 }
index 2971525..a50699b 100644 (file)
@@ -267,13 +267,16 @@ public class MapLabelProvider extends LabelProvider implements IFigureProvider,
         */\r
        public Image getStatusImage(AbstractObject object)\r
        {\r
-               Image image = null;\r
-               try\r
-               {\r
-                       image = statusImages[object.getStatus()];\r
-               }\r
-               catch(IndexOutOfBoundsException e)\r
+               Image image = MapImageProvidersManager.getInstance().getStatusIcon(object.getStatus());\r
+               if (image == null)\r
                {\r
+                       try\r
+                       {\r
+                               image = statusImages[object.getStatus()];\r
+                       }\r
+                       catch(IndexOutOfBoundsException e)\r
+                       {\r
+                       }\r
                }\r
                return image;\r
        }\r
index 497daac..1fa59c1 100644 (file)
@@ -2,15 +2,15 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: NXMC Object Tools plugin
 Bundle-SymbolicName: org.netxms.ui.eclipse.objecttools;singleton:=true
-Bundle-Version: 1.1.10
+Bundle-Version: 1.2.7
 Bundle-Activator: org.netxms.ui.eclipse.objecttools.Activator
 Bundle-Vendor: netxms.org
-Require-Bundle: org.eclipse.core.runtime,
- org.eclipse.core.expressions;bundle-version="3.4.101",
- org.netxms.ui.eclipse.usermanager;bundle-version="1.1.8",
- org.netxms.ui.eclipse.snmp;bundle-version="1.1.0",
- org.eclipse.rap.ui;bundle-version="1.5.0",
- org.netxms.webui.core;bundle-version="1.1.10"
+Require-Bundle: org.eclipse.core.runtime;bundle-version="3.8.0",
+ org.eclipse.core.expressions;bundle-version="3.4.401",
+ org.netxms.ui.eclipse.usermanager;bundle-version="1.2.1",
+ org.netxms.ui.eclipse.snmp;bundle-version="1.2.7",
+ org.eclipse.rap.ui;bundle-version="2.0.0",
+ org.netxms.webui.core;bundle-version="1.2.7"
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Bundle-ActivationPolicy: lazy
 Export-Package: org.netxms.ui.eclipse.objecttools.api