From: luukkainen Date: Thu, 31 Jan 2013 11:24:48 +0000 (+0000) Subject: fixes #4041 X-Git-Tag: simantics-1.10.1~54 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=10691d9d1d27afa8fae3dc0f8331dc2d0b70679e;p=simantics%2Fsysdyn.git fixes #4041 git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@26714 ac1ea38d-2e2b-0410-8846-a27921b304fc --- diff --git a/org.simantics.jfreechart/src/org/simantics/jfreechart/chart/properties/ChartVariable.java b/org.simantics.jfreechart/src/org/simantics/jfreechart/chart/properties/ChartVariable.java index 331f3fff..fb352277 100644 --- a/org.simantics.jfreechart/src/org/simantics/jfreechart/chart/properties/ChartVariable.java +++ b/org.simantics.jfreechart/src/org/simantics/jfreechart/chart/properties/ChartVariable.java @@ -1,6 +1,6 @@ package org.simantics.jfreechart.chart.properties; -public class ChartVariable { +public class ChartVariable implements Comparable{ private String rvi; private String label; @@ -43,5 +43,13 @@ public class ChartVariable { ChartVariable other = (ChartVariable)obj; return rvi.equals(other.rvi); } + + @Override + public int compareTo(ChartVariable o) { + if (label != null && o.label != null) { + return label.compareTo(o.label); + } + return rvi.compareTo(o.rvi); + } }