]> gerrit.simantics Code Review - simantics/district.git/blobdiff - org.simantics.district.selection/src/org/simantics/district/selection/ElementSelector.java
Selection of highlight color for District Finder queries
[simantics/district.git] / org.simantics.district.selection / src / org / simantics / district / selection / ElementSelector.java
index 9015b7117605674dd56bcaa9385e3116ccaedf43..ff978059dab381aaf86d651fede0f3815613f181 100644 (file)
@@ -56,6 +56,8 @@ public class ElementSelector {
        Selector selector;
        Condition condition;
        
+       private float[] color;
+       
        static Logger LOG = LoggerFactory.getLogger(ElementSelector.class);
        
        static ElementSelectionResource ES;
@@ -81,6 +83,9 @@ public class ElementSelector {
                try {
                        this.name = graph.getRelatedValue(resource, L0.HasLabel);
                        this.expression = getExpression(graph, resource);
+                       
+                       float[] color = graph.getPossibleRelatedValue(resource, ES.Selection_HasHighlightColor);
+                       this.color = color;
                } catch (DatabaseException e) {
                        LOG.error("Error reading element selector", e);
                        throw e;
@@ -149,6 +154,13 @@ public class ElementSelector {
        public Condition getCondition() {
                return condition;
        }
+       
+       /**
+        * Get the selection highlight color as a four element BGRA array.
+        */
+       public float[] getColor() {
+               return color;
+       }
 
        /**
         *