X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FChimeraViewFrame.java;h=e3c65da467fe22e84a4d8f6f11b60ed4234221e8;hb=789a8f2ab91523923a6fa307acb4323b2bd7e756;hp=24ac87a3b163460b49f2e474b359af9a90e7aacb;hpb=aa643d0f2f5f506df2771e216af1618549d32050;p=jalview.git diff --git a/src/jalview/gui/ChimeraViewFrame.java b/src/jalview/gui/ChimeraViewFrame.java index 24ac87a..e3c65da 100644 --- a/src/jalview/gui/ChimeraViewFrame.java +++ b/src/jalview/gui/ChimeraViewFrame.java @@ -25,10 +25,10 @@ import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.io.File; -import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.List; +import java.util.Map; import javax.swing.JInternalFrame; import javax.swing.JMenu; @@ -41,12 +41,14 @@ import jalview.api.FeatureRenderer; import jalview.bin.Cache; import jalview.datamodel.PDBEntry; import jalview.datamodel.SequenceI; +import jalview.datamodel.StructureViewerModel; +import jalview.datamodel.StructureViewerModel.StructureData; import jalview.ext.rbvi.chimera.JalviewChimeraBinding; import jalview.gui.StructureViewer.ViewerType; import jalview.io.DataSourceType; import jalview.io.StructureFile; import jalview.structures.models.AAStructureBindingModel; -import jalview.util.BrowserLauncher; +import jalview.util.ImageMaker.TYPE; import jalview.util.MessageManager; import jalview.util.Platform; @@ -79,16 +81,13 @@ public class ChimeraViewFrame extends StructureViewerBase { super.initMenus(); - viewerActionMenu.setText(MessageManager.getString("label.chimera")); - - helpItem.setText(MessageManager.getString("label.chimera_help")); savemenu.setVisible(false); // not yet implemented viewMenu.add(fitToWindow); JMenuItem writeFeatures = new JMenuItem( - MessageManager.getString("label.create_chimera_attributes")); + MessageManager.getString("label.create_viewer_attributes")); writeFeatures.setToolTipText(MessageManager - .getString("label.create_chimera_attributes_tip")); + .getString("label.create_viewer_attributes_tip")); writeFeatures.addActionListener(new ActionListener() { @Override @@ -116,8 +115,8 @@ public class ChimeraViewFrame extends StructureViewerBase } /** - * Query Chimera for its residue attribute names and add them as items off the - * attributes menu + * Query the structure viewer for its residue attribute names and add them as + * items off the attributes menu * * @param attributesMenu */ @@ -134,7 +133,11 @@ public class ChimeraViewFrame extends StructureViewerBase @Override public void actionPerformed(ActionEvent e) { - getChimeraAttributes(attName); + if (getBinding().copyStructureAttributesToFeatures(attName, + getAlignmentPanel()) > 0) + { + getAlignmentPanel().getFeatureRenderer().featuresAdded(); + } } }); attributesMenu.add(menuItem); @@ -142,25 +145,12 @@ public class ChimeraViewFrame extends StructureViewerBase } /** - * Read residues in Chimera with the given attribute name, and set as features - * on the corresponding sequence positions (if any) - * - * @param attName - */ - protected void getChimeraAttributes(String attName) - { - jmb.copyStructureAttributesToFeatures(attName, getAlignmentPanel()); - } - - /** - * Send a command to Chimera to create residue attributes for Jalview features - *
- * The syntax is: setattr r <attName> <attValue> <atomSpec> - *
- * For example: setattr r jv_chain "Ferredoxin-1, Chloroplastic" #0:94.A
+ * Sends command(s) to the structure viewer to create residue attributes for
+ * visible Jalview features
*/
protected void sendFeaturesToChimera()
{
+ // todo pull up?
int count = jmb.sendFeaturesToViewer(getAlignmentPanel());
statusBar.setText(
MessageManager.formatMessage("label.attributes_set", count));
@@ -246,22 +236,34 @@ public class ChimeraViewFrame extends StructureViewerBase
* @param colourBySequence
* @param newViewId
*/
- public ChimeraViewFrame(String chimeraSessionFile,
- AlignmentPanel alignPanel, PDBEntry[] pdbArray,
- SequenceI[][] seqsArray, boolean colourByChimera,
- boolean colourBySequence, String newViewId)
+ public ChimeraViewFrame(StructureViewerModel viewerData,
+ AlignmentPanel alignPanel, String sessionFile, String vid)
{
this();
- setViewId(newViewId);
- this.chimeraSessionFile = chimeraSessionFile;
+ setViewId(vid);
+ this.chimeraSessionFile = sessionFile;
+ Map