X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=inline;f=src%2Fjalview%2Fappletgui%2FAppletJmol.java;h=3d1442d5ac1952ca7a536f8bd23f0f49a9d620a7;hb=406c75985c3585f3c6bf8d6f4778d9fb28c7bf2c;hp=fb15c8253e57fd50706a67d52be19cae61f67b2a;hpb=b32b824388dea3107cd1598d63f8759f00b75e1f;p=jalview.git
diff --git a/src/jalview/appletgui/AppletJmol.java b/src/jalview/appletgui/AppletJmol.java
index fb15c82..3d1442d 100644
--- a/src/jalview/appletgui/AppletJmol.java
+++ b/src/jalview/appletgui/AppletJmol.java
@@ -1,78 +1,128 @@
/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * 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.
- *
+ * 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 .
+ * 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.appletgui;
-import java.util.*;
-import java.awt.*;
-import java.awt.event.*;
-
-import jalview.api.SequenceStructureBinding;
-import jalview.datamodel.*;
-import jalview.structure.*;
-import jalview.io.*;
-
-import org.jmol.api.*;
+import jalview.bin.JalviewLite;
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.PDBEntry;
+import jalview.datamodel.SequenceI;
+import jalview.io.DataSourceType;
+import jalview.io.FileParse;
+import jalview.io.StructureFile;
+import jalview.schemes.BuriedColourScheme;
+import jalview.schemes.HelixColourScheme;
+import jalview.schemes.HydrophobicColourScheme;
+import jalview.schemes.PurinePyrimidineColourScheme;
+import jalview.schemes.StrandColourScheme;
+import jalview.schemes.TaylorColourScheme;
+import jalview.schemes.TurnColourScheme;
+import jalview.schemes.UserColourScheme;
+import jalview.schemes.ZappoColourScheme;
+import jalview.structure.StructureSelectionManager;
+import jalview.util.MessageManager;
+
+import java.awt.BorderLayout;
+import java.awt.CheckboxMenuItem;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.Frame;
+import java.awt.Graphics;
+import java.awt.Menu;
+import java.awt.MenuBar;
+import java.awt.MenuItem;
+import java.awt.Panel;
+import java.awt.TextArea;
+import java.awt.TextField;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Vector;
+
+public class AppletJmol extends EmbmenuFrame implements
+ // StructureListener,
+ KeyListener, ActionListener, ItemListener
-import org.jmol.popup.*;
-import org.jmol.viewer.JmolConstants;
-
-import jalview.schemes.*;
+{
+ Menu fileMenu = new Menu(MessageManager.getString("action.file"));
-public class AppletJmol extends EmbmenuFrame implements
-// StructureListener,
- KeyListener, ActionListener, ItemListener, SequenceStructureBinding
+ Menu viewMenu = new Menu(MessageManager.getString("action.view"));
-{
- Menu fileMenu = new Menu("File");
+ Menu coloursMenu = new Menu(MessageManager.getString("action.colour"));
- Menu viewMenu = new Menu("View");
+ Menu chainMenu = new Menu(MessageManager.getString("action.show_chain"));
- Menu coloursMenu = new Menu("Colours");
+ Menu helpMenu = new Menu(MessageManager.getString("action.help"));
- Menu chainMenu = new Menu("Show Chain");
+ MenuItem mappingMenuItem = new MenuItem(
+ MessageManager.getString("label.view_mapping"));
- Menu helpMenu = new Menu("Help");
+ CheckboxMenuItem seqColour = new CheckboxMenuItem(
+ MessageManager.getString("action.by_sequence"), true);
- MenuItem mappingMenuItem = new MenuItem("View Mapping");
+ CheckboxMenuItem jmolColour = new CheckboxMenuItem(
+ MessageManager.getString("action.using_jmol"), false);
- CheckboxMenuItem seqColour = new CheckboxMenuItem("By Sequence", true);
+ MenuItem chain = new MenuItem(
+ MessageManager.getString("action.by_chain"));
- MenuItem chain = new MenuItem("By Chain");
+ MenuItem charge = new MenuItem(
+ MessageManager.getString("label.charge_cysteine"));
- MenuItem charge = new MenuItem("Charge & Cysteine");
+ MenuItem zappo = new MenuItem(
+ MessageManager.getString("label.colourScheme_zappo"));
- MenuItem zappo = new MenuItem("Zappo");
+ MenuItem taylor = new MenuItem(
+ MessageManager.getString("label.colourScheme_taylor"));
- MenuItem taylor = new MenuItem("Taylor");
+ MenuItem hydro = new MenuItem(
+ MessageManager.getString("label.colourScheme_hydrophobic"));
- MenuItem hydro = new MenuItem("Hydrophobicity");
+ MenuItem helix = new MenuItem(
+ MessageManager.getString("label.colourScheme_helix_propensity"));
- MenuItem helix = new MenuItem("Helix Propensity");
+ MenuItem strand = new MenuItem(
+ MessageManager.getString("label.colourScheme_strand_propensity"));
- MenuItem strand = new MenuItem("Strand Propensity");
+ MenuItem turn = new MenuItem(
+ MessageManager.getString("label.colourScheme_turn_propensity"));
- MenuItem turn = new MenuItem("Turn Propensity");
+ MenuItem buried = new MenuItem(
+ MessageManager.getString("label.colourScheme_buried_index"));
- MenuItem buried = new MenuItem("Buried Index");
+ MenuItem purinepyrimidine = new MenuItem(
+ MessageManager.getString("label.colourScheme_purine/pyrimidine"));
- MenuItem user = new MenuItem("User Defined Colours");
+ MenuItem user = new MenuItem(
+ MessageManager.getString("label.user_defined_colours"));
- MenuItem jmolHelp = new MenuItem("Jmol Help");
+ MenuItem jmolHelp = new MenuItem(
+ MessageManager.getString("label.jmol_help"));
Panel scriptWindow;
@@ -84,6 +134,9 @@ public class AppletJmol extends EmbmenuFrame implements
AlignmentPanel ap;
+ List _aps = new ArrayList<>(); // remove? never
+ // added to
+
String fileLoadingError;
boolean loadedInline;
@@ -99,19 +152,46 @@ public class AppletJmol extends EmbmenuFrame implements
*/
String protocol = null;
+ /**
+ * Load a bunch of pdb entries associated with sequences in the alignment and
+ * display them - aligning them if necessary.
+ *
+ * @param pdbentries
+ * each pdb file (at least one needed)
+ * @param boundseqs
+ * each set of sequences for each pdb file (must match number of pdb
+ * files)
+ * @param boundchains
+ * the target pdb chain corresponding with each sequence associated
+ * with each pdb file (may be null at any level)
+ * @param align
+ * true/false
+ * @param ap
+ * associated alignment
+ * @param protocol
+ * how to get pdb data
+ */
+ public AppletJmol(PDBEntry[] pdbentries, SequenceI[][] boundseqs,
+ String[][] boundchains, boolean align, AlignmentPanel ap,
+ String protocol)
+ {
+ throw new Error(MessageManager.getString("error.not_yet_implemented"));
+ }
+
public AppletJmol(PDBEntry pdbentry, SequenceI[] seq, String[] chains,
- AlignmentPanel ap, String protocol)
+ AlignmentPanel ap, DataSourceType protocol)
{
this.ap = ap;
- jmb = new AppletJmolBinding(this, new PDBEntry[]
- { pdbentry }, seq, chains, protocol);
+ jmb = new AppletJmolBinding(this, ap.getStructureSelectionManager(),
+ new PDBEntry[]
+ { pdbentry }, new SequenceI[][] { seq }, protocol);
jmb.setColourBySequence(true);
if (pdbentry.getId() == null || pdbentry.getId().length() < 1)
{
- if (protocol.equals(AppletFormatAdapter.PASTE))
+ if (protocol == DataSourceType.PASTE)
{
- pdbentry.setId("PASTED PDB"
- + (chains == null ? "_" : chains.toString()));
+ pdbentry.setId(
+ "PASTED PDB" + (chains == null ? "_" : chains.toString()));
}
else
{
@@ -119,20 +199,21 @@ public class AppletJmol extends EmbmenuFrame implements
}
}
- if (jalview.bin.JalviewLite.debug)
+ if (JalviewLite.debug)
{
System.err
.println("AppletJmol: PDB ID is '" + pdbentry.getId() + "'");
}
String alreadyMapped = StructureSelectionManager
- .getStructureSelectionManager().alreadyMappedToFile(
- pdbentry.getId());
- MCview.PDBfile reader = null;
+ .getStructureSelectionManager(ap.av.applet)
+ .alreadyMappedToFile(pdbentry.getId());
+ StructureFile reader = null;
if (alreadyMapped != null)
{
- reader = StructureSelectionManager.getStructureSelectionManager()
- .setMapping(seq, chains, pdbentry.getFile(), protocol);
+ reader = StructureSelectionManager
+ .getStructureSelectionManager(ap.av.applet)
+ .setMapping(seq, chains, pdbentry.getFile(), protocol, null);
// PROMPT USER HERE TO ADD TO NEW OR EXISTING VIEW?
// FOR NOW, LETS JUST OPEN A NEW WINDOW
}
@@ -149,12 +230,14 @@ public class AppletJmol extends EmbmenuFrame implements
hydro.addActionListener(this);
chain.addActionListener(this);
seqColour.addItemListener(this);
+ jmolColour.addItemListener(this);
zappo.addActionListener(this);
taylor.addActionListener(this);
helix.addActionListener(this);
strand.addActionListener(this);
turn.addActionListener(this);
buried.addActionListener(this);
+ purinepyrimidine.addActionListener(this);
user.addActionListener(this);
jmolHelp.addActionListener(this);
@@ -169,37 +252,60 @@ public class AppletJmol extends EmbmenuFrame implements
coloursMenu.add(strand);
coloursMenu.add(turn);
coloursMenu.add(buried);
+ coloursMenu.add(purinepyrimidine);
coloursMenu.add(user);
-
+ coloursMenu.add(jmolColour);
helpMenu.add(jmolHelp);
+ this.setLayout(new BorderLayout());
setMenuBar(menuBar);
renderPanel = new RenderPanel();
embedMenuIfNeeded(renderPanel);
this.add(renderPanel, BorderLayout.CENTER);
- jmb.allocateViewer(renderPanel,
- "jalviewJmol", ap.av.applet.getDocumentBase(), ap.av.applet
- .getCodeBase(), "");
- jmb.newJmolPopup(true, "Jmol", true);
+ scriptWindow = new Panel();
+ scriptWindow.setVisible(false);
+ // this.add(scriptWindow, BorderLayout.SOUTH);
+
+ try
+ {
+ jmb.allocateViewer(renderPanel, true,
+ ap.av.applet.getName() + "_jmol_",
+ ap.av.applet.getDocumentBase(), ap.av.applet.getCodeBase(),
+ "-applet", scriptWindow, null);
+ } catch (Exception e)
+ {
+ System.err.println(
+ "Couldn't create a jmol viewer. Args to allocate viewer were:\nDocumentBase="
+ + ap.av.applet.getDocumentBase() + "\nCodebase="
+ + ap.av.applet.getCodeBase());
+ e.printStackTrace();
+ dispose();
+ return;
+ }
+ // jmb.newJmolPopup(true, "Jmol", true);
this.addWindowListener(new WindowAdapter()
{
+ @Override
public void windowClosing(WindowEvent evt)
{
closeViewer();
}
});
-
+ pdbentry.setProperty("protocol", protocol);
if (pdbentry.getFile() != null)
+
{
// import structure data from pdbentry.getFile based on given protocol
- if (protocol.equals(AppletFormatAdapter.PASTE))
+ if (protocol == DataSourceType.PASTE)
{
+ // TODO: JAL-623 : correctly record file contents for matching up later
+ // pdbentry.getProperty().put("pdbfilehash",""+pdbentry.getFile().hashCode());
loadInline(pdbentry.getFile());
}
- else if (protocol.equals(AppletFormatAdapter.FILE)
- || protocol.equals(AppletFormatAdapter.URL))
+ else if (protocol == DataSourceType.FILE
+ || protocol == DataSourceType.URL)
{
jmb.viewer.openFile(pdbentry.getFile());
}
@@ -214,8 +320,8 @@ public class AppletJmol extends EmbmenuFrame implements
{
if (jalview.bin.JalviewLite.debug)
{
- System.err
- .println("AppletJmol:Trying to reuse existing PDBfile IO parser.");
+ System.err.println(
+ "AppletJmol:Trying to reuse existing PDBfile IO parser.");
}
// re-use the one we opened earlier
freader = reader.getReader();
@@ -224,8 +330,8 @@ public class AppletJmol extends EmbmenuFrame implements
{
if (jalview.bin.JalviewLite.debug)
{
- System.err
- .println("AppletJmol:Creating new PDBfile IO parser.");
+ System.err.println(
+ "AppletJmol:Creating new PDBfile IO parser.");
}
FileParse fp = new FileParse(pdbentry.getFile(), protocol);
fp.mark();
@@ -241,10 +347,11 @@ public class AppletJmol extends EmbmenuFrame implements
}
if (freader == null)
{
- throw new Exception(
- "Invalid datasource. Could not obtain Reader.");
+ throw new Exception(MessageManager.getString(
+ "exception.invalid_datasource_couldnt_obtain_reader"));
}
- jmb.viewer.openReader(pdbentry.getFile(), pdbentry.getId(), freader);
+ jmb.viewer.openReader(pdbentry.getFile(), pdbentry.getId(),
+ freader);
} catch (Exception e)
{
// give up!
@@ -259,44 +366,25 @@ public class AppletJmol extends EmbmenuFrame implements
jalview.bin.JalviewLite.addFrame(this, jmb.getViewerTitle(), 400, 400);
}
- /**
- * create a new binding between structures in an existing jmol viewer instance
- * and an alignpanel with sequences that have existing PDBFile entries. Note,
- * this does not open a new Jmol window, or modify the display of the
- * structures in the original jmol window.
- *
- * @param viewer2
- * @param alignPanel
- * @param seqs
- * - sequences to search for associations
- */
- public AppletJmol(JmolViewer viewer2, AlignmentPanel alignPanel,
- SequenceI[] seqs)
- {
-
- // TODO Auto-generated constructor stub
- }
-
public void loadInline(String string)
{
loadedInline = true;
- jmb.viewer.openStringInline(string);
+ jmb.loadInline(string);
}
- void setChainMenuItems(Vector chains)
+ void setChainMenuItems(List chains)
{
chainMenu.removeAll();
- MenuItem menuItem = new MenuItem("All");
+ MenuItem menuItem = new MenuItem(MessageManager.getString("label.all"));
menuItem.addActionListener(this);
chainMenu.add(menuItem);
CheckboxMenuItem menuItemCB;
- for (int c = 0; c < chains.size(); c++)
+ for (String ch : chains)
{
- menuItemCB = new CheckboxMenuItem(chains.elementAt(c).toString(),
- true);
+ menuItemCB = new CheckboxMenuItem(ch, true);
menuItemCB.addItemListener(this);
chainMenu.add(menuItemCB);
}
@@ -306,9 +394,7 @@ public class AppletJmol extends EmbmenuFrame implements
void centerViewer()
{
- Vector toshow = new Vector();
- String lbl;
- int mlength, p, mnum;
+ Vector toshow = new Vector<>();
for (int i = 0; i < chainMenu.getItemCount(); i++)
{
if (chainMenu.getItem(i) instanceof CheckboxMenuItem)
@@ -330,6 +416,7 @@ public class AppletJmol extends EmbmenuFrame implements
this.setVisible(false);
}
+ @Override
public void actionPerformed(ActionEvent evt)
{
if (evt.getSource() == mappingMenuItem)
@@ -339,15 +426,20 @@ public class AppletJmol extends EmbmenuFrame implements
Frame frame = new Frame();
frame.add(cap);
- jalview.bin.JalviewLite.addFrame(frame, "PDB - Sequence Mapping",
- 550, 600);
StringBuffer sb = new StringBuffer();
- for (int s = 0; s < jmb.pdbentry.length; s++)
+ try
{
- sb.append(StructureSelectionManager.getStructureSelectionManager()
- .printMapping(jmb.pdbentry[s].getFile()));
- sb.append("\n");
+ cap.setText(jmb.printMappings());
+ } catch (OutOfMemoryError ex)
+ {
+ frame.dispose();
+ System.err.println(
+ "Out of memory when trying to create dialog box with sequence-structure mapping.");
+ return;
}
+ jalview.bin.JalviewLite.addFrame(frame,
+ MessageManager.getString("label.pdb_sequence_mapping"), 550,
+ 600);
}
else if (evt.getSource() == charge)
{
@@ -395,6 +487,10 @@ public class AppletJmol extends EmbmenuFrame implements
setEnabled(buried);
jmb.setJalviewColourScheme(new BuriedColourScheme());
}
+ else if (evt.getSource() == purinepyrimidine)
+ {
+ jmb.setJalviewColourScheme(new PurinePyrimidineColourScheme());
+ }
else if (evt.getSource() == user)
{
setEnabled(user);
@@ -404,10 +500,10 @@ public class AppletJmol extends EmbmenuFrame implements
{
try
{
- ap.av.applet.getAppletContext().showDocument(
- new java.net.URL(
+ ap.av.applet.getAppletContext()
+ .showDocument(new java.net.URL(
"http://jmol.sourceforge.net/docs/JmolUserGuide/"),
- "jmolHelp");
+ "jmolHelp");
} catch (java.net.MalformedURLException ex)
{
}
@@ -418,7 +514,9 @@ public class AppletJmol extends EmbmenuFrame implements
for (int i = 0; i < chainMenu.getItemCount(); i++)
{
if (chainMenu.getItem(i) instanceof CheckboxMenuItem)
+ {
((CheckboxMenuItem) chainMenu.getItem(i)).setState(true);
+ }
}
centerViewer();
@@ -427,62 +525,74 @@ public class AppletJmol extends EmbmenuFrame implements
}
/**
- * tick or untick the seqColour menu entry depending upon if it was selected or not.
+ * tick or untick the seqColour menu entry or jmoColour entry depending upon
+ * if it was selected or not.
+ *
* @param itm
*/
private void setEnabled(MenuItem itm)
{
- seqColour.setState(itm==seqColour);
- jmb.setColourBySequence(itm==seqColour);
+ jmolColour.setState(itm == jmolColour);
+ seqColour.setState(itm == seqColour);
+ jmb.setColourBySequence(itm == seqColour);
}
+ @Override
public void itemStateChanged(ItemEvent evt)
{
- if (evt.getSource() == seqColour)
+ if (evt.getSource() == jmolColour)
+ {
+ setEnabled(jmolColour);
+ jmb.setColourBySequence(false);
+ }
+ else if (evt.getSource() == seqColour)
{
setEnabled(seqColour);
- jmb
- .colourBySequence(ap.av.getShowSequenceFeatures(),
- ap.av.alignment);
+ jmb.colourBySequence(ap);
}
else if (!allChainsSelected)
+ {
centerViewer();
+ }
}
+ @Override
public void keyPressed(KeyEvent evt)
{
if (evt.getKeyCode() == KeyEvent.VK_ENTER && scriptWindow.isVisible())
{
jmb.eval(inputLine.getText());
- history.append("\n$ " + inputLine.getText());
+ addToHistory("$ " + inputLine.getText());
inputLine.setText("");
}
}
+ @Override
public void keyTyped(KeyEvent evt)
{
}
+ @Override
public void keyReleased(KeyEvent evt)
{
}
public void updateColours(Object source)
{
- AlignmentPanel ap = (AlignmentPanel) source;
- jmb.colourBySequence(ap.av.getShowSequenceFeatures(), ap.av.alignment);
+ AlignmentPanel panel = (AlignmentPanel) source;
+ jmb.colourBySequence(panel);
}
public void updateTitleAndMenus()
{
- if (jmb.fileLoadingError != null && jmb.fileLoadingError.length() > 0)
+ if (jmb.hasFileLoadingError())
{
repaint();
return;
}
- setChainMenuItems(jmb.chainNames);
- jmb.colourBySequence(ap.av.getShowSequenceFeatures(), ap.av.alignment);
+ setChainMenuItems(jmb.getChainNames());
+ jmb.colourBySequence(ap);
setTitle(jmb.getViewerTitle());
}
@@ -498,22 +608,30 @@ public class AppletJmol extends EmbmenuFrame implements
}
}
+ Panel splitPane = null;
+
public void showConsole(boolean showConsole)
{
- if (scriptWindow == null)
- {
- scriptWindow = new Panel(new BorderLayout());
- inputLine = new TextField();
- history = new TextArea(5, 40);
- scriptWindow.add(history, BorderLayout.CENTER);
- scriptWindow.add(inputLine, BorderLayout.SOUTH);
- add(scriptWindow, BorderLayout.SOUTH);
+ if (showConsole)
+ {
+ remove(renderPanel);
+ splitPane = new Panel();
+
+ splitPane.setLayout(new java.awt.GridLayout(2, 1));
+ splitPane.add(renderPanel);
+ splitPane.add(scriptWindow);
+ scriptWindow.setVisible(true);
+ this.add(splitPane, BorderLayout.CENTER);
+ splitPane.setVisible(true);
+ splitPane.validate();
+ }
+ else
+ {
scriptWindow.setVisible(false);
- history.setEditable(false);
- inputLine.addKeyListener(this);
+ remove(splitPane);
+ add(renderPanel, BorderLayout.CENTER);
+ splitPane = null;
}
-
- scriptWindow.setVisible(!scriptWindow.isVisible());
validate();
}
@@ -529,17 +647,16 @@ public class AppletJmol extends EmbmenuFrame implements
{
Dimension currentSize = new Dimension();
- Rectangle rectClip = new Rectangle();
-
+ @Override
public void update(Graphics g)
{
paint(g);
}
+ @Override
public void paint(Graphics g)
{
currentSize = this.getSize();
- rectClip = g.getClipBounds();
if (jmb.viewer == null)
{
@@ -547,45 +664,63 @@ public class AppletJmol extends EmbmenuFrame implements
g.fillRect(0, 0, currentSize.width, currentSize.height);
g.setColor(Color.white);
g.setFont(new Font("Verdana", Font.BOLD, 14));
- g.drawString("Retrieving PDB data....", 20, currentSize.height / 2);
+ g.drawString(MessageManager.getString("label.retrieving_pdb_data"),
+ 20, currentSize.height / 2);
}
else
{
- jmb.viewer.renderScreenImage(g, currentSize, rectClip);
+ jmb.viewer.renderScreenImage(g, currentSize.width,
+ currentSize.height);
}
}
}
-/*
- @Override
- public Color getColour(int atomIndex, int pdbResNum, String chain,
- String pdbId)
- {
- return jmb.getColour(atomIndex, pdbResNum, chain, pdbId);
- }
- @Override
- public String[] getPdbFile()
+ /*
+ * @Override public Color getColour(int atomIndex, int pdbResNum, String
+ * chain, String pdbId) { return jmb.getColour(atomIndex, pdbResNum, chain,
+ * pdbId); }
+ *
+ * @Override public String[] getPdbFile() { return jmb.getPdbFile(); }
+ *
+ * @Override public void highlightAtom(int atomIndex, int pdbResNum, String
+ * chain, String pdbId) { jmb.highlightAtom(atomIndex, pdbResNum, chain,
+ * pdbId);
+ *
+ * }
+ *
+ * @Override public void mouseOverStructure(int atomIndex, String strInfo) {
+ * jmb.mouseOverStructure(atomIndex, strInfo);
+ *
+ * }
+ */
+ public void setJalviewColourScheme(UserColourScheme ucs)
{
- return jmb.getPdbFile();
+ jmb.setJalviewColourScheme(ucs);
}
- @Override
- public void highlightAtom(int atomIndex, int pdbResNum, String chain,
- String pdbId)
+ public AlignmentPanel getAlignmentPanelFor(AlignmentI alignment)
{
- jmb.highlightAtom(atomIndex, pdbResNum, chain, pdbId);
-
+ for (int i = 0; i < _aps.size(); i++)
+ {
+ if (_aps.get(i).av.getAlignment() == alignment)
+ {
+ return (_aps.get(i));
+ }
+ }
+ return ap;
}
- @Override
- public void mouseOverStructure(int atomIndex, String strInfo)
- {
- jmb.mouseOverStructure(atomIndex, strInfo);
-
- }
-*/
- public void setJalviewColourScheme(UserColourScheme ucs)
+ /**
+ * Append the given text to the history object
+ *
+ * @param text
+ */
+ public void addToHistory(String text)
{
- jmb.setJalviewColourScheme(ucs);
+ // actually currently never initialised
+ if (history != null)
+ {
+ history.append("\n" + text);
+ }
}
}