X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fext%2Frbvi%2Fchimera%2FAtomSpecModel.java;h=39d6704f144ea39000ca26c95b99ddd03faece7f;hb=653e250e0a2a5dd455ae4c52794c4ce0de340418;hp=9d45e5e562a22b425089a29ef40e76b8ef1be3db;hpb=3d0101179759ef157b088ea135423cd909512d9f;p=jalview.git diff --git a/src/jalview/ext/rbvi/chimera/AtomSpecModel.java b/src/jalview/ext/rbvi/chimera/AtomSpecModel.java index 9d45e5e..39d6704 100644 --- a/src/jalview/ext/rbvi/chimera/AtomSpecModel.java +++ b/src/jalview/ext/rbvi/chimera/AtomSpecModel.java @@ -1,6 +1,26 @@ +/* + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ The Jalview Authors + * + * This file is part of Jalview. + * + * Jalview is free software: you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation, either version 3 + * of the License, or (at your option) any later version. + * + * Jalview is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Jalview. If not, see . + * The Jalview Authors are detailed in the 'AUTHORS' file. + */ package jalview.ext.rbvi.chimera; -import jalview.util.RangeComparator; +import jalview.util.IntRangeComparator; import java.util.ArrayList; import java.util.Collections; @@ -100,14 +120,14 @@ public class AtomSpecModel for (String chain : modelData.keySet()) { - chain = chain.trim(); + chain = " ".equals(chain) ? chain : chain.trim(); List rangeList = modelData.get(chain); /* * sort ranges into ascending start position order */ - Collections.sort(rangeList, new RangeComparator(true)); + Collections.sort(rangeList, IntRangeComparator.ASCENDING); int start = rangeList.isEmpty() ? 0 : rangeList.get(0)[0]; int end = rangeList.isEmpty() ? 0 : rangeList.get(0)[1]; @@ -172,9 +192,10 @@ public class AtomSpecModel { sb.append(start).append("-").append(end); } - if (chain.length() > 0) - { - sb.append(".").append(chain); + + sb.append("."); + if (!" ".equals(chain)) { + sb.append(chain); } } }