- // for (Iterator<JSONObject> seqGrpIter = seqGrpJsonArray.iterator();
- // seqGrpIter
- // .hasNext();)
- // {
- // JSONObject seqGrpObj = seqGrpIter.next();
- // String grpName = seqGrpObj.get("groupName").toString();
- // String colourScheme = seqGrpObj.get("colourScheme").toString();
- // String description = (seqGrpObj.get("description") == null) ? null
- // : seqGrpObj.get("description").toString();
- // boolean displayBoxes = Boolean.valueOf(seqGrpObj
- // .get("displayBoxes").toString());
- // boolean displayText = Boolean.valueOf(seqGrpObj.get("displayText")
- // .toString());
- // boolean colourText = Boolean.valueOf(seqGrpObj.get("colourText")
- // .toString());
- // boolean showNonconserved = Boolean.valueOf(seqGrpObj.get(
- // "showNonconserved").toString());
- // int startRes = Integer
- // .valueOf(seqGrpObj.get("startRes").toString());
- // int endRes = Integer.valueOf(seqGrpObj.get("endRes").toString());
- // JSONArray seqsHashArray = (JSONArray) seqGrpObj.get("seqsHash");
- //
- // ArrayList<SequenceI> grpSeqs = new ArrayList<SequenceI>();
- // if (seqsHashArray.size() > 0)
- // {
- // Iterator<String> seqHashIter = seqsHashArray.iterator();
- //
- // while (seqHashIter.hasNext())
- // {
- // String seqHash = seqHashIter.next();
- // Sequence sequence = seqMap.get(seqHash);
- // if (sequence != null)
- // {
- // grpSeqs.add(sequence);
- // }
- // // System.out.println(">>>>>>>>>>>>>>>>>>>>>>> seqHash : "
- // // + seqHash);
- // }
- // }
- // System.out.println(">>>>>>>>>>>>>>>>>> scheme string : "
- // + colourScheme);
- // ColourSchemeI scheme = getJalviewColorScheme(colourScheme);
- // System.out.println(">>>>>>>>>>>>>>>>>> scheme: " + scheme);
- // SequenceGroup seqGrp = new SequenceGroup(grpSeqs, grpName, scheme,
- // displayBoxes, displayText, colourText, startRes, endRes);
- // this.seqGroups.add(seqGrp);
- //
- // }
+ for (Iterator<JSONObject> seqGrpIter = seqGrpJsonArray.iterator(); seqGrpIter
+ .hasNext();)
+ {
+ JSONObject seqGrpObj = seqGrpIter.next();
+ String grpName = seqGrpObj.get("groupName").toString();
+ String colourScheme = seqGrpObj.get("colourScheme").toString();
+ String description = (seqGrpObj.get("description") == null) ? null
+ : seqGrpObj.get("description").toString();
+ boolean displayBoxes = Boolean.valueOf(seqGrpObj
+ .get("displayBoxes").toString());
+ boolean displayText = Boolean.valueOf(seqGrpObj.get("displayText")
+ .toString());
+ boolean colourText = Boolean.valueOf(seqGrpObj.get("colourText")
+ .toString());
+ boolean showNonconserved = Boolean.valueOf(seqGrpObj.get(
+ "showNonconserved").toString());
+ int startRes = Integer
+ .valueOf(seqGrpObj.get("startRes").toString());
+ int endRes = Integer.valueOf(seqGrpObj.get("endRes").toString());
+ JSONArray seqsHashArray = (JSONArray) seqGrpObj.get("seqsHash");
+
+ ArrayList<SequenceI> grpSeqs = new ArrayList<SequenceI>();
+ if (seqsHashArray.size() > 0)
+ {
+ Iterator<String> seqHashIter = seqsHashArray.iterator();
+ while (seqHashIter.hasNext())
+ {
+ String seqHash = seqHashIter.next();
+ Sequence sequence = seqMap.get(seqHash);
+ if (sequence != null)
+ {
+ grpSeqs.add(sequence);
+ }
+ }
+ }
+ ColourSchemeI scheme = getJalviewColorScheme(colourScheme);
+ SequenceGroup seqGrp = new SequenceGroup(grpSeqs, grpName, scheme,
+ displayBoxes, displayText, colourText, startRes, endRes);
+ seqGrp.setShowNonconserved(showNonconserved);
+ seqGrp.setDescription(description);
+ this.seqGroups.add(seqGrp);
+
+ }