.createArray().cast();
int numOfChartAxisPlotBands = chartAxisPlotBands.length();
int numOfUIDLAxisPlotBands = uidlAxisPlotBands.length();
boolean updatedAxisPlotBands = false;
for (int indOuter = 0; indOuter < numOfChartAxisPlotBands; indOuter++) {
GwtPlotBands chartPlotBand = chartAxisPlotBands.get(indOuter);
String plotBandId = chartPlotBand.getId();
boolean found = false;
for (int indInner = 0; indInner < numOfUIDLAxisPlotBands; indInner++) {
GwtPlotBands uidlPlotBand = uidlAxisPlotBands.get(indInner);
if (uidlPlotBand != null
&& uidlPlotBand.getId().equals(plotBandId)) {
if (chartPlotBand.getFrom() == uidlPlotBand.getFrom()
&& chartPlotBand.getTo() == uidlPlotBand.getTo()) {
VConsole.log("Plotband id "
+ plotBandId
+ " exists in chart as well as in UIDL from the server.");
// PlotBand exists and from/to values are same so
// nothing to be done.
// The UIDL plotband is set to null so that remaining
// plotbands
// can be safely added to the chart
uidlAxisPlotBands.set(indInner, null);
updatedChartAxisPlotBands.push(chartPlotBand);
VConsole.log("Plotband id " + plotBandId
+ " exists in both.");
found = true;
}
break;
}
}
if (!found) {
// remove plot band as it is not found in UIDL received from the
// server
VConsole.log("Plotband id " + plotBandId + " removed.");
updatedAxisPlotBands = true;
chartAxis.removePlotBand(plotBandId);
}
}
// Add all remaining plot bands in UIDL to the chart
for (int ind = 0; ind < numOfUIDLAxisPlotBands; ind++) {
GwtPlotBands uidlPlotBand = uidlAxisPlotBands.get(ind);
if (uidlPlotBand != null) {
updatedAxisPlotBands = true;
VConsole.log("Plotband id " + uidlPlotBand.getId()
+ " added with from : " + uidlPlotBand.getFrom()
+ " and to: " + uidlPlotBand.getTo());
chartAxis.addPlotBand(uidlPlotBand);
updatedChartAxisPlotBands.push(uidlPlotBand);
}
}