JsArray<GwtPointOptions> pointsArr = JavaScriptObject.createArray()
.cast();
for (int cnt = 0; cnt < pointsUIDL.getChildCount(); cnt++) {
UIDL pointUIDL = pointsUIDL.getChildUIDL(cnt);
GwtPointOptions pointOptions = GwtPointOptions.create();
// If a point doesn't have any attributes then
// consider it as a null since a user might want to represent
// no activity graph
if (pointUIDL.getAttributeNames().size() == 0) {
pointOptions.setNullY();
} else {
if (pointUIDL.hasAttribute("id")) {
pointOptions.setId(pointUIDL.getStringAttribute("id"));
}
if (pointUIDL.hasAttribute("name")) {
pointOptions.setName(pointUIDL.getStringAttribute("name"));
}
if (pointUIDL.hasAttribute("color")) {
pointOptions
.setColor(pointUIDL.getStringAttribute("color"));
}
if (pointUIDL.hasAttribute("sliced")) {
pointOptions.setSliced(pointUIDL
.getBooleanAttribute("sliced"));
}
if (pointUIDL.hasAttribute("selected")) {
pointOptions.setSelected(pointUIDL
.getBooleanAttribute("selected"));
}
if (pointUIDL.hasAttribute("x")) {
pointOptions.setX(pointUIDL.getIntAttribute("x"));
} else {
pointOptions.setNullX();
}
if (pointUIDL.hasAttribute("y")) {
pointOptions.setY(pointUIDL.getIntAttribute("y"));
} else {
pointOptions.setNullY();
}
if (pointUIDL.hasAttribute("isShift")) {
pointOptions.setShift(pointUIDL
.getBooleanAttribute("isShift"));
}
GwtMarker markerOptions = getMarkerOptions(pointUIDL
.getChildUIDL(0));
if (markerOptions != null) {
pointOptions.setMarker(markerOptions);
}
}
pointsArr.push(pointOptions);
}