From 10691d9d1d27afa8fae3dc0f8331dc2d0b70679e Mon Sep 17 00:00:00 2001 From: luukkainen Date: Thu, 31 Jan 2013 11:24:48 +0000 Subject: [PATCH] fixes #4041 git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@26714 ac1ea38d-2e2b-0410-8846-a27921b304fc --- .../jfreechart/chart/properties/ChartVariable.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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); + } } -- 2.47.1