import jalview.schemes.ResidueColourScheme;
import jalview.util.ColorUtils;
import jalview.util.Format;
import jalview.schemes.ResidueColourScheme;
import jalview.util.ColorUtils;
import jalview.util.Format;
public class JSONFile extends AlignFile implements ComplexAlignFile
{
private static String version = new BuildDetails().getVersion();
public class JSONFile extends AlignFile implements ComplexAlignFile
{
private static String version = new BuildDetails().getVersion();
for (SequenceFeature sf : seqFeatures)
{
SequenceFeaturesPojo jsonFeature = new SequenceFeaturesPojo(
String.valueOf(seq.hashCode()));
for (SequenceFeature sf : seqFeatures)
{
SequenceFeaturesPojo jsonFeature = new SequenceFeaturesPojo(
String.valueOf(seq.hashCode()));
- String featureColour = (fr == null) ? null : Format
- .getHexString(finder.findFeatureColour(Color.white, seq,
- seq.findIndex(sf.getBegin())));
+ String featureColour = (fr == null) ? null
+ : Format.getHexString(finder.findFeatureColour(Color.white,
+ seq, seq.findIndex(sf.getBegin())));
int xStart = sf.getBegin() == 0 ? 0
: seq.findIndex(sf.getBegin()) - 1;
int xEnd = sf.getEnd() == 0 ? 0 : seq.findIndex(sf.getEnd());
int xStart = sf.getBegin() == 0 ? 0
: seq.findIndex(sf.getBegin()) - 1;
int xEnd = sf.getEnd() == 0 ? 0 : seq.findIndex(sf.getEnd());
- JSONArray seqJsonArray = (JSONArray) alignmentJsonObj.get("seqs");
- JSONArray alAnnotJsonArray = (JSONArray) alignmentJsonObj
+ List<Object> seqJsonArray = (List<Object>) alignmentJsonObj
+ .get("seqs");
+ List<Object> alAnnotJsonArray = (List<Object>) alignmentJsonObj
String sequcenceString = sequence.get("seq").toString();
String sequenceName = sequence.get("name").toString();
String seqUniqueId = sequence.get("id").toString();
String sequcenceString = sequence.get("seq").toString();
String sequenceName = sequence.get("name").toString();
String seqUniqueId = sequence.get("id").toString();
String grpName = seqGrpObj.get("groupName").toString();
String colourScheme = seqGrpObj.get("colourScheme").toString();
String description = (seqGrpObj.get("description") == null) ? null
String grpName = seqGrpObj.get("groupName").toString();
String colourScheme = seqGrpObj.get("colourScheme").toString();
String description = (seqGrpObj.get("description") == null) ? null
int startRes = Integer
.valueOf(seqGrpObj.get("startRes").toString());
int endRes = Integer.valueOf(seqGrpObj.get("endRes").toString());
int startRes = Integer
.valueOf(seqGrpObj.get("startRes").toString());
int endRes = Integer.valueOf(seqGrpObj.get("endRes").toString());
- JSONObject alAnnot = alAnnotIter.next();
- JSONArray annotJsonArray = (JSONArray) alAnnot.get("annotations");
+ Map<String, Object> alAnnot = (Map<String, Object>) alAnnotIter
+ .next();
+ List<Object> annotJsonArray = (List<Object>) alAnnot
+ .get("annotations");
alignAnnot.graph = (alAnnot.get("graphType") == null) ? 0
: Integer.valueOf(alAnnot.get("graphType").toString());
alignAnnot.graph = (alAnnot.get("graphType") == null) ? 0
: Integer.valueOf(alAnnot.get("graphType").toString());
{
hiddenSeqRefs = new ArrayList<>();
String hiddenSeqs = (String) jvSettingsJson.get("hiddenSeqs");
if (hiddenSeqs != null && !hiddenSeqs.isEmpty())
{
String[] seqRefs = hiddenSeqs.split(";");
{
hiddenSeqRefs = new ArrayList<>();
String hiddenSeqs = (String) jvSettingsJson.get("hiddenSeqs");
if (hiddenSeqs != null && !hiddenSeqs.isEmpty())
{
String[] seqRefs = hiddenSeqs.split(";");
{
String hiddenCols = (String) jvSettingsJson.get("hiddenCols");
if (hiddenCols != null && !hiddenCols.isEmpty())
{
hiddenColumns = new HiddenColumns();
String[] rangeStrings = hiddenCols.split(";");
{
String hiddenCols = (String) jvSettingsJson.get("hiddenCols");
if (hiddenCols != null && !hiddenCols.isEmpty())
{
hiddenColumns = new HiddenColumns();
String[] rangeStrings = hiddenCols.split(";");
hiddenColumns.hideColumns(Integer.valueOf(range[0]),
Integer.valueOf(range[1]));
}
hiddenColumns.hideColumns(Integer.valueOf(range[0]),
Integer.valueOf(range[1]));
}
Long begin = (Long) jsonFeature.get("xStart");
Long end = (Long) jsonFeature.get("xEnd");
String type = (String) jsonFeature.get("type");
Long begin = (Long) jsonFeature.get("xStart");
Long end = (Long) jsonFeature.get("xEnd");
String type = (String) jsonFeature.get("type");
- int featureBegin = begin.intValue() == 0 ? 0 : seq
- .findPosition(begin.intValue());
- int featureEnd = end.intValue() == 0 ? 0 : seq.findPosition(end
- .intValue()) - 1;
+ int featureBegin = begin.intValue() == 0 ? 0
+ : seq.findPosition(begin.intValue());
+ int featureEnd = end.intValue() == 0 ? 0
+ : seq.findPosition(end.intValue()) - 1;
SequenceFeature sequenceFeature = new SequenceFeature(type,
description, featureBegin, featureEnd, score, featureGrp);
SequenceFeature sequenceFeature = new SequenceFeature(type,
description, featureBegin, featureEnd, score, featureGrp);