]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
fixes #4041
authorluukkainen <luukkainen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Thu, 31 Jan 2013 11:24:48 +0000 (11:24 +0000)
committerluukkainen <luukkainen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Thu, 31 Jan 2013 11:24:48 +0000 (11:24 +0000)
git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@26714 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.jfreechart/src/org/simantics/jfreechart/chart/properties/ChartVariable.java

index 331f3fff3e16aeb1a65aa6d110e2c19403355a9b..fb3522775d4803ade162b277eeb3b02b8cf80cc5 100644 (file)
@@ -1,6 +1,6 @@
 package org.simantics.jfreechart.chart.properties;\r
 \r
-public class ChartVariable {\r
+public class ChartVariable implements Comparable<ChartVariable>{\r
        \r
        private String rvi;\r
        private String label;\r
@@ -43,5 +43,13 @@ public class ChartVariable {
                ChartVariable other = (ChartVariable)obj;\r
                return rvi.equals(other.rvi);\r
        }\r
+       \r
+       @Override\r
+       public int compareTo(ChartVariable o) {\r
+               if (label != null && o.label != null) {\r
+                       return label.compareTo(o.label);\r
+               }\r
+               return rvi.compareTo(o.rvi);\r
+       }\r
 \r
 }\r