comparison flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java @ 2711:fa8ae7dbcb72

More stable legend item aggregation. flys-artifacts/trunk@4433 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Wed, 16 May 2012 20:23:29 +0000
parents 013882485011
children 1cb072d0978d
comparison
equal deleted inserted replaced
2710:013882485011 2711:fa8ae7dbcb72
1095 // String getURLText() 1095 // String getURLText()
1096 // boolean isLineVisible() 1096 // boolean isLineVisible()
1097 // boolean isShapeFilled() 1097 // boolean isShapeFilled()
1098 // boolean isShapeOutlineVisible() 1098 // boolean isShapeOutlineVisible()
1099 // boolean isShapeVisible() 1099 // boolean isShapeVisible()
1100 return li.getLinePaint().toString(); 1100 String hash = li.getLinePaint().toString();
1101 String label = li.getLabel();
1102 if (label.startsWith("W (") || label.startsWith("W(")) {
1103 hash += "-W-";
1104 }
1105 else if (label.startsWith("Q(") || label.startsWith("Q (")) {
1106 hash += "-Q-";
1107 }
1108
1109 // WQ.java holds example of using regex Matcher/Pattern.
1110
1111 return hash;
1101 } 1112 }
1102 1113
1103 1114
1104 /** 1115 /**
1105 * Create a label for multiple items. 1116 * Create a label for multiple items.
1148 name += ", "; 1159 name += ", ";
1149 } 1160 }
1150 else { 1161 else {
1151 first = false; 1162 first = false;
1152 } 1163 }
1153 name += item.getLabel().substring(startPattern.length(), 1164 // Possible case in differences
1154 item.getLabel().length() - endPattern.length()); 1165 if (startPattern.length() + endPattern.length() < item.getLabel().length()) {
1166 // Note that we do not really want this.
1167 logger.error("Legend aggregation does not cover case: " +
1168 startPattern + " -- " + item.getLabel() + " -- " + endPattern);
1169 name += item.getLabel();
1170 }
1171 else {
1172 name += item.getLabel().substring(startPattern.length(),
1173 item.getLabel().length() - endPattern.length());
1174 }
1155 } 1175 }
1156 name += "} "; 1176 name += "} ";
1157 name += endPattern; 1177 name += endPattern;
1158 1178
1159 return name; 1179 return name;

http://dive4elements.wald.intevation.org