X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FJalview2XML_V1.java;h=b17d060599d4f8f8fa4c3bcadef3297dc6741352;hb=807f5945ffa954c38f07cbf9d2a4ebc22cfe5eb9;hp=4a582def1721f231777a555723bf7037dc2d4035;hpb=8b27085fa7fc5f2877e078421284c2636b85b8c6;p=jalview.git diff --git a/src/jalview/gui/Jalview2XML_V1.java b/src/jalview/gui/Jalview2XML_V1.java index 4a582de..b17d060 100755 --- a/src/jalview/gui/Jalview2XML_V1.java +++ b/src/jalview/gui/Jalview2XML_V1.java @@ -20,6 +20,7 @@ */ package jalview.gui; +import jalview.analysis.Conservation; import jalview.binding.Annotation; import jalview.binding.AnnotationElement; import jalview.binding.Features; @@ -35,10 +36,10 @@ import jalview.binding.Tree; import jalview.binding.UserColours; import jalview.binding.Viewport; import jalview.datamodel.PDBEntry; +import jalview.datamodel.SequenceFeature; import jalview.io.FileFormat; import jalview.schemes.ColourSchemeI; import jalview.schemes.ColourSchemeProperty; -import jalview.schemes.ResidueProperties; import jalview.structure.StructureSelectionManager; import jalview.util.MessageManager; import jalview.util.jarInputStreamProvider; @@ -52,8 +53,6 @@ import java.util.Vector; import java.util.jar.JarEntry; import java.util.jar.JarInputStream; -import javax.swing.JOptionPane; - /** * DOCUMENT ME! * @@ -156,11 +155,11 @@ public class Jalview2XML_V1 System.err.println("Couldn't locate Jalview XML file : " + ex + "\n"); - JOptionPane.showInternalMessageDialog(Desktop.desktop, + JvOptionPane.showInternalMessageDialog(Desktop.desktop, MessageManager.formatMessage("label.couldnt_locate", new String[] { file }), MessageManager .getString("label.url_not_found"), - JOptionPane.WARNING_MESSAGE); + JvOptionPane.WARNING_MESSAGE); } }); } @@ -177,12 +176,12 @@ public class Jalview2XML_V1 public void run() { - JOptionPane.showInternalMessageDialog(Desktop.desktop, + JvOptionPane.showInternalMessageDialog(Desktop.desktop, MessageManager.formatMessage( "label.error_loading_file_params", new String[] { file }), MessageManager .getString("label.error_loading_jalview_file"), - JOptionPane.WARNING_MESSAGE); + JvOptionPane.WARNING_MESSAGE); } }); } @@ -226,11 +225,10 @@ public class Jalview2XML_V1 Features[] features = JSEQ[i].getFeatures(); for (int f = 0; f < features.length; f++) { - jalview.datamodel.SequenceFeature sf = new jalview.datamodel.SequenceFeature( - features[f].getType(), features[f].getDescription(), - features[f].getStatus(), features[f].getBegin(), + SequenceFeature sf = new SequenceFeature(features[f].getType(), + features[f].getDescription(), features[f].getBegin(), features[f].getEnd(), null); - + sf.setStatus(features[f].getStatus()); al.getSequenceAt(i).getDatasetSequence().addSequenceFeature(sf); } } @@ -333,15 +331,10 @@ public class Jalview2XML_V1 } else { - cs = ColourSchemeProperty.getColour(al, groups[i].getColour()); - } - - if (cs != null) - { - cs.setThreshold(groups[i].getPidThreshold(), true); + cs = ColourSchemeProperty.getColourScheme(al, groups[i].getColour()); } - } + int pidThreshold = groups[i].getPidThreshold(); Vector seqs = new Vector(); int[] ids = groups[i].getSeq(); @@ -355,14 +348,14 @@ public class Jalview2XML_V1 seqs, groups[i].getName(), cs, groups[i].getDisplayBoxes(), groups[i].getDisplayText(), groups[i].getColourText(), groups[i].getStart(), groups[i].getEnd()); + sg.getGroupColourScheme().setThreshold(pidThreshold, true); sg.setOutlineColour(new java.awt.Color(groups[i].getOutlineColour())); if (groups[i].getConsThreshold() != 0) { - jalview.analysis.Conservation c = new jalview.analysis.Conservation( - "All", ResidueProperties.propHash, 3, - sg.getSequences(null), 0, sg.getWidth() - 1); + Conservation c = new Conservation("All", sg.getSequences(null), + 0, sg.getWidth() - 1); c.calculate(); c.verdict(false, 25); sg.cs.setConservation(c); @@ -374,8 +367,8 @@ public class Jalview2XML_V1 af.setBounds(view.getXpos(), view.getYpos(), view.getWidth(), view.getHeight()); - af.viewport.setStartRes(view.getStartRes()); - af.viewport.setStartSeq(view.getStartSeq()); + af.viewport.getRanges().setStartRes(view.getStartRes()); + af.viewport.getRanges().setStartSeq(view.getStartSeq()); af.viewport.setShowAnnotation(view.getShowAnnotation()); af.viewport.setAbovePIDThreshold(view.getPidSelected()); af.viewport.setColourText(view.getShowColourText()); @@ -402,23 +395,27 @@ public class Jalview2XML_V1 } else { - cs = ColourSchemeProperty.getColour(al, view.getBgColour()); + cs = ColourSchemeProperty.getColourScheme(al, view.getBgColour()); } - if (cs != null) - { - cs.setThreshold(view.getPidThreshold(), true); - cs.setConsensus(af.viewport.getSequenceConsensusHash()); - } + // if (cs != null) + // { + // cs.setThreshold(view.getPidThreshold(), true); + // cs.setConsensus(af.viewport.getSequenceConsensusHash()); + // } } - af.viewport.setGlobalColourScheme(cs); + af.viewport.getResidueShading().setThreshold( + view.getPidThreshold(), true); + af.viewport.getResidueShading().setConsensus( + af.viewport.getSequenceConsensusHash()); af.viewport.setColourAppliesToAllGroups(false); af.alignPanel.updateLayout(); af.changeColour(cs); if (view.getConservationSelected() && cs != null) { - cs.setConservationInc(view.getConsThreshold()); + af.viewport.getResidueShading().setConservationInc( + view.getConsThreshold()); } af.viewport.setColourAppliesToAllGroups(true); @@ -467,7 +464,7 @@ public class Jalview2XML_V1 Tree tree = jms.getTree(t); - TreePanel tp = af.ShowNewickTree( + TreePanel tp = af.showNewickTree( new jalview.io.NewickFile(tree.getNewick()), tree.getTitle(), tree.getWidth(), tree.getHeight(), tree.getXpos(), tree.getYpos());