X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FChimeraViewFrame.java;h=37e84c7044be1e727066f53ba2102bbfc47ec8c0;hb=207b06de28859536277608ad94897eaa526b1279;hp=9b0d85be02c6756f1b53888aa04531b4b6cb17c0;hpb=4762b29420ed4df01b55a8afe5ab05467aaf41a9;p=jalview.git diff --git a/src/jalview/gui/ChimeraViewFrame.java b/src/jalview/gui/ChimeraViewFrame.java index 9b0d85b..37e84c7 100644 --- a/src/jalview/gui/ChimeraViewFrame.java +++ b/src/jalview/gui/ChimeraViewFrame.java @@ -20,6 +20,7 @@ */ package jalview.gui; +import jalview.api.FeatureRenderer; import jalview.bin.Cache; import jalview.datamodel.AlignmentI; import jalview.datamodel.PDBEntry; @@ -76,6 +77,10 @@ public class ChimeraViewFrame extends StructureViewerBase private Random random = new Random(); + private int myWidth = 500; + + private int myHeight = 150; + /** * Initialise menu options. */ @@ -185,7 +190,9 @@ public class ChimeraViewFrame extends StructureViewerBase */ protected void sendFeaturesToChimera() { - jmb.sendFeaturesToViewer(getAlignmentPanel()); + int count = jmb.sendFeaturesToViewer(getAlignmentPanel()); + statusBar.setText(MessageManager.formatMessage("label.attributes_set", + count)); } /** @@ -254,7 +261,7 @@ public class ChimeraViewFrame extends StructureViewerBase useAlignmentPanelForSuperposition(ap); } jmb.setColourBySequence(true); - setSize(400, 400); // probably should be a configurable/dynamic default here + setSize(myWidth, myHeight); initMenus(); addingStructures = false; @@ -477,7 +484,7 @@ public class ChimeraViewFrame extends StructureViewerBase StructureFile pdb = null; try { - String[] curfiles = jmb.getPdbFile(); // files currently in viewer + String[] curfiles = jmb.getStructureFiles(); // files currently in viewer // TODO: replace with reference fetching/transfer code (validate PDBentry // as a DBRef?) for (int pi = 0; pi < jmb.getPdbCount(); pi++) @@ -585,7 +592,8 @@ public class ChimeraViewFrame extends StructureViewerBase } // Explicitly map to the filename used by Chimera ; pdb = jmb.getSsm().setMapping(jmb.getSequence()[pos], - jmb.getChains()[pos], pe.getFile(), protocol); + jmb.getChains()[pos], pe.getFile(), protocol, + progressBar); stashFoundChains(pdb, pe.getFile()); } catch (OutOfMemoryError oomerror) { @@ -607,6 +615,16 @@ public class ChimeraViewFrame extends StructureViewerBase jmb.setFinishedInit(true); jmb.setLoadingFromArchive(false); + /* + * ensure that any newly discovered features (e.g. RESNUM) + * are added to any open feature settings dialog + */ + FeatureRenderer fr = getBinding().getFeatureRenderer(null); + if (fr != null) + { + fr.featuresAdded(); + } + // refresh the sequence colours for the new structure(s) for (AlignmentPanel ap : _colourwith) { @@ -633,7 +651,7 @@ public class ChimeraViewFrame extends StructureViewerBase /** * Fetch PDB data and save to a local file. Returns the full path to the file, - * or null if fetch fails. + * or null if fetch fails. TODO: refactor to common with Jmol ? duplication * * @param processingEntry * @return @@ -851,10 +869,31 @@ public class ChimeraViewFrame extends StructureViewerBase return "Chimera"; } + /** + * Sends commands to align structures according to associated alignment(s). + * + * @return + */ + @Override + protected String alignStructs_withAllAlignPanels() + { + String reply = super.alignStructs_withAllAlignPanels(); + if (reply != null) + { + statusBar.setText("Superposition failed: " + reply); + } + return reply; + } + @Override - public void updateTitleAndMenus() + protected IProgressIndicator getIProgressIndicator() { - super.updateTitleAndMenus(); - viewerActionMenu.setVisible(true); + return progressBar; + } + + @Override + protected AAStructureBindingModel getBindingModel() + { + return jmb; } }