/*
- * Jalview - A Sequence Alignment Editor and Viewer (Development Version 2.4.1)
- * Copyright (C) 2009 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6)
+ * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
*
- * This program 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 2
- * of the License, or (at your option) any later version.
+ * This file is part of Jalview.
*
- * This program 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.
+ * 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.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ * 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 <http://www.gnu.org/licenses/>.
*/
package jalview.gui;
protected AlignmentPanel alignPanel;
ScrollThread scrollThread = null;
+
String linkImageURL;
-
+
int offy;
// int width;
* Creates a new IdPanel object.
*
* @param av
- * DOCUMENT ME!
+ * DOCUMENT ME!
* @param parent
- * DOCUMENT ME!
+ * DOCUMENT ME!
*/
public IdPanel(AlignViewport av, AlignmentPanel parent)
{
* DOCUMENT ME!
*
* @param e
- * DOCUMENT ME!
+ * DOCUMENT ME!
*/
public void mouseMoved(MouseEvent e)
{
{
int sz = -tip.length();
tfeat[0] = features[i];
- sp.appendFeatures(tip, linkImageURL, 0, tfeat,sp.seqCanvas.fr.minmax);
- sz+=tip.length();
+ sp.appendFeatures(tip, linkImageURL, 0, tfeat,
+ sp.seqCanvas.fr.minmax);
+ sz += tip.length();
maxWidth = Math.max(maxWidth, sz);
}
}
tip.append("</html>");
- setToolTipText("<html>" + sequence.getDisplayId(true)
+ setToolTipText("<html>" + sequence.getDisplayId(true) + " "
+ tip.toString());
}
}
* DOCUMENT ME!
*
* @param e
- * DOCUMENT ME!
+ * DOCUMENT ME!
*/
public void mouseDragged(MouseEvent e)
{
* DOCUMENT ME!
*
* @param e
- * DOCUMENT ME!
+ * DOCUMENT ME!
*/
public void mouseClicked(MouseEvent e)
{
* DOCUMENT ME!
*
* @param e
- * DOCUMENT ME!
+ * DOCUMENT ME!
*/
public void mouseEntered(MouseEvent e)
{
* DOCUMENT ME!
*
* @param e
- * DOCUMENT ME!
+ * DOCUMENT ME!
*/
public void mouseExited(MouseEvent e)
{
* DOCUMENT ME!
*
* @param e
- * DOCUMENT ME!
+ * DOCUMENT ME!
*/
public void mousePressed(MouseEvent e)
{
if (javax.swing.SwingUtilities.isRightMouseButton(e))
{
- Sequence sq = (Sequence) av
- .getAlignment().getSequenceAt(seq);
- // build a new links menu based on the current links + any non-positional features
+ Sequence sq = (Sequence) av.getAlignment().getSequenceAt(seq);
+ // build a new links menu based on the current links + any non-positional
+ // features
Vector nlinks = new Vector(Preferences.sequenceURLLinks);
SequenceFeature sf[] = sq.getDatasetSequence().getSequenceFeatures();
- for (int sl=0;sf!=null && sl<sf.length;sl++)
+ for (int sl = 0; sf != null && sl < sf.length; sl++)
{
- if (sf[sl].begin==sf[sl].end && sf[sl].begin==0)
+ if (sf[sl].begin == sf[sl].end && sf[sl].begin == 0)
{
- if (sf[sl].links!=null && sf[sl].links.size()>0)
+ if (sf[sl].links != null && sf[sl].links.size() > 0)
{
- for (int l=0, lSize=sf[sl].links.size(); l<lSize; l++)
- {
+ for (int l = 0, lSize = sf[sl].links.size(); l < lSize; l++)
+ {
nlinks.addElement(sf[sl].links.elementAt(l));
}
}
}
}
-
- jalview.gui.PopupMenu pop = new jalview.gui.PopupMenu(alignPanel,
- sq,
- nlinks);
+
+ jalview.gui.PopupMenu pop = new jalview.gui.PopupMenu(alignPanel, sq,
+ nlinks, new Vector(Preferences.getGroupURLLinks()));
pop.show(this, e.getX(), e.getY());
return;
{
selectSeq(seq);
}
- av.sendSelection();
alignPanel.paintAlignment(true);
}
* DOCUMENT ME!
*
* @param seq
- * DOCUMENT ME!
+ * DOCUMENT ME!
*/
void selectSeq(int seq)
{
* DOCUMENT ME!
*
* @param start
- * DOCUMENT ME!
+ * DOCUMENT ME!
* @param end
- * DOCUMENT ME!
+ * DOCUMENT ME!
*/
void selectSeqs(int start, int end)
{
* DOCUMENT ME!
*
* @param e
- * DOCUMENT ME!
+ * DOCUMENT ME!
*/
public void mouseReleased(MouseEvent e)
{
mouseDragging = false;
PaintRefresher.Refresh(this, av.getSequenceSetId());
+ // always send selection message when mouse is released
+ av.sendSelection();
}
/**
* DOCUMENT ME!
*
* @param found
- * DOCUMENT ME!
+ * DOCUMENT ME!
*/
public void highlightSearchResults(java.util.Vector found)
{