git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Disable memory checker for now
[jalview.git]
/
src
/
jalview
/
appletgui
/
IdPanel.java
diff --git
a/src/jalview/appletgui/IdPanel.java
b/src/jalview/appletgui/IdPanel.java
index
ed86488
..
fee5dd4
100755
(executable)
--- a/
src/jalview/appletgui/IdPanel.java
+++ b/
src/jalview/appletgui/IdPanel.java
@@
-1,6
+1,6
@@
/*
\r
* Jalview - A Sequence Alignment Editor and Viewer
\r
/*
\r
* Jalview - A Sequence Alignment Editor and Viewer
\r
- * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
\r
+ * Copyright (C) 2007 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
\r
*
\r
* This program is free software; you can redistribute it and/or
\r
* modify it under the terms of the GNU General Public License
\r
*
\r
* This program is free software; you can redistribute it and/or
\r
* modify it under the terms of the GNU General Public License
\r
@@
-50,15
+50,17
@@
public class IdPanel
idCanvas.addMouseMotionListener(this);
\r
\r
String label, url;
\r
idCanvas.addMouseMotionListener(this);
\r
\r
String label, url;
\r
- if(parent.alignFrame.applet!=null)
\r
+ if (av.applet != null)
\r
{
\r
for (int i = 1; i < 10; i++)
\r
{
\r
{
\r
for (int i = 1; i < 10; i++)
\r
{
\r
- label = parent.alignFrame.applet.getParameter("linkLabel_" + i);
\r
- url = parent.alignFrame.applet.getParameter("linkURL_" + i);
\r
+ label = av.applet.getParameter("linkLabel_" + i);
\r
+ url = av.applet.getParameter("linkURL_" + i);
\r
\r
if (label != null && url != null)
\r
\r
if (label != null && url != null)
\r
+ {
\r
links.addElement(label + "|" + url);
\r
links.addElement(label + "|" + url);
\r
+ }
\r
\r
}
\r
}
\r
\r
}
\r
}
\r
@@
-72,55
+74,38
@@
public class IdPanel
Tooltip tooltip;
\r
public void mouseMoved(MouseEvent e)
\r
{
\r
Tooltip tooltip;
\r
public void mouseMoved(MouseEvent e)
\r
{
\r
- int y = e.getY();
\r
- if (av.getWrapAlignment())
\r
- {
\r
- y -= 2 * av.charHeight;
\r
- }
\r
-
\r
- int seq = av.getIndex(y);
\r
- if (seq == -1)
\r
- {
\r
- return;
\r
- }
\r
+ int seq = alignPanel.seqPanel.findSeq(e);
\r
\r
SequenceI sequence = av.getAlignment().getSequenceAt(seq);
\r
\r
\r
SequenceI sequence = av.getAlignment().getSequenceAt(seq);
\r
\r
- if(sequence.getDescription()==null)
\r
+ if (sequence.getDescription() == null)
\r
{
\r
{
\r
- if(tooltip!=null)
\r
+ if (tooltip != null)
\r
+ {
\r
tooltip.setVisible(false);
\r
tooltip.setVisible(false);
\r
+ }
\r
tooltip = null;
\r
return;
\r
}
\r
\r
if (tooltip == null)
\r
tooltip = null;
\r
return;
\r
}
\r
\r
if (tooltip == null)
\r
+ {
\r
tooltip = new Tooltip(
\r
sequence.getDisplayId(true)
\r
+ "\n" + sequence.getDescription(), idCanvas);
\r
tooltip = new Tooltip(
\r
sequence.getDisplayId(true)
\r
+ "\n" + sequence.getDescription(), idCanvas);
\r
+ }
\r
else
\r
else
\r
+ {
\r
tooltip.setTip(sequence.getDisplayId(true)
\r
+ "\n" + sequence.getDescription());
\r
tooltip.setTip(sequence.getDisplayId(true)
\r
+ "\n" + sequence.getDescription());
\r
-
\r
- tooltip.repaint();
\r
-
\r
+ }
\r
}
\r
\r
public void mouseDragged(MouseEvent e)
\r
{
\r
mouseDragging = true;
\r
\r
}
\r
\r
public void mouseDragged(MouseEvent e)
\r
{
\r
mouseDragging = true;
\r
\r
- int y = e.getY();
\r
- if (av.getWrapAlignment())
\r
- {
\r
- y -= 2 * av.charHeight;
\r
- }
\r
- int seq = av.getIndex(y);
\r
-
\r
- if (seq < 0)
\r
- {
\r
- return;
\r
- }
\r
+ int seq = Math.max(0, alignPanel.seqPanel.findSeq(e));
\r
\r
if (seq < lastid)
\r
{
\r
\r
if (seq < lastid)
\r
{
\r
@@
-132,34
+117,31
@@
public class IdPanel
}
\r
\r
lastid = seq;
\r
}
\r
\r
lastid = seq;
\r
- alignPanel.repaint();
\r
+ alignPanel.paintAlignment(true);
\r
}
\r
\r
public void mouseClicked(MouseEvent e)
\r
{
\r
if (e.getClickCount() < 2)
\r
}
\r
\r
public void mouseClicked(MouseEvent e)
\r
{
\r
if (e.getClickCount() < 2)
\r
- return;
\r
-
\r
- int y = e.getY();
\r
-
\r
- if (av.getWrapAlignment())
\r
{
\r
{
\r
- y -= (2 * av.charHeight);
\r
+ return;
\r
}
\r
\r
//DEFAULT LINK IS FIRST IN THE LINK LIST
\r
}
\r
\r
//DEFAULT LINK IS FIRST IN THE LINK LIST
\r
- int seq = av.getIndex(y);
\r
+ int seq = alignPanel.seqPanel.findSeq(e);
\r
String id = av.getAlignment().getSequenceAt(seq).getName();
\r
if (id.indexOf("|") > -1)
\r
String id = av.getAlignment().getSequenceAt(seq).getName();
\r
if (id.indexOf("|") > -1)
\r
- id = id.substring(id.lastIndexOf("|") + 1);
\r
+ {
\r
+ id = id.substring(id.lastIndexOf("|") + 1);
\r
+ }
\r
\r
String target = links.elementAt(0).toString();
\r
target = target.substring(0, target.indexOf("|"));
\r
String url = links.elementAt(0).toString();
\r
\r
String target = links.elementAt(0).toString();
\r
target = target.substring(0, target.indexOf("|"));
\r
String url = links.elementAt(0).toString();
\r
- url = url.substring(url.indexOf("|")+1);
\r
+ url = url.substring(url.indexOf("|") + 1);
\r
\r
int index = url.indexOf("$SEQUENCE_ID$");
\r
\r
int index = url.indexOf("$SEQUENCE_ID$");
\r
- url = url.substring(0, index)+ id + url.substring(index+13);
\r
+ url = url.substring(0, index) + id + url.substring(index + 13);
\r
\r
try
\r
{
\r
\r
try
\r
{
\r
@@
-201,7
+183,7
@@
public class IdPanel
\r
public void mousePressed(MouseEvent e)
\r
{
\r
\r
public void mousePressed(MouseEvent e)
\r
{
\r
- if (e.getClickCount() >1 )
\r
+ if (e.getClickCount() > 1)
\r
{
\r
return;
\r
}
\r
{
\r
return;
\r
}
\r
@@
-212,31
+194,27
@@
public class IdPanel
y -= 2 * av.charHeight;
\r
}
\r
\r
y -= 2 * av.charHeight;
\r
}
\r
\r
- int seq = av.getIndex(y);
\r
- if (seq == -1)
\r
- {
\r
- return;
\r
- }
\r
+ int seq = alignPanel.seqPanel.findSeq(e);
\r
\r
if ( (e.getModifiers() & InputEvent.BUTTON3_MASK) ==
\r
InputEvent.BUTTON3_MASK)
\r
{
\r
\r
if ( (e.getModifiers() & InputEvent.BUTTON3_MASK) ==
\r
InputEvent.BUTTON3_MASK)
\r
{
\r
- APopupMenu popup = new APopupMenu(alignPanel, (Sequence) av.getAlignment().getSequenceAt(seq), links);
\r
+ APopupMenu popup = new APopupMenu(alignPanel,
\r
+ (Sequence) av.getAlignment().
\r
+ getSequenceAt(seq), links);
\r
this.add(popup);
\r
popup.show(this, e.getX(), e.getY());
\r
return;
\r
}
\r
\r
this.add(popup);
\r
popup.show(this, e.getX(), e.getY());
\r
return;
\r
}
\r
\r
-
\r
- if ((av.getSelectionGroup() == null) ||
\r
- ((!e.isControlDown() && !e.isShiftDown()) && av.getSelectionGroup() != null))
\r
+ if ( (av.getSelectionGroup() == null) ||
\r
+ ( (!e.isControlDown() && !e.isShiftDown()) && av.getSelectionGroup() != null))
\r
{
\r
av.setSelectionGroup(new SequenceGroup());
\r
av.getSelectionGroup().setStartRes(0);
\r
av.getSelectionGroup().setEndRes(av.alignment.getWidth() - 1);
\r
}
\r
\r
{
\r
av.setSelectionGroup(new SequenceGroup());
\r
av.getSelectionGroup().setStartRes(0);
\r
av.getSelectionGroup().setEndRes(av.alignment.getWidth() - 1);
\r
}
\r
\r
-
\r
if (e.isShiftDown() && lastid != -1)
\r
{
\r
selectSeqs(lastid, seq);
\r
if (e.isShiftDown() && lastid != -1)
\r
{
\r
selectSeqs(lastid, seq);
\r
@@
-246,7
+224,7
@@
public class IdPanel
selectSeq(seq);
\r
}
\r
\r
selectSeq(seq);
\r
}
\r
\r
- alignPanel.repaint();
\r
+ alignPanel.paintAlignment(true);
\r
}
\r
\r
void selectSeq(int seq)
\r
}
\r
\r
void selectSeq(int seq)
\r
@@
-260,6
+238,12
@@
public class IdPanel
{
\r
\r
lastid = start;
\r
{
\r
\r
lastid = start;
\r
+
\r
+ if (end >= av.getAlignment().getHeight())
\r
+ {
\r
+ end = av.getAlignment().getHeight() - 1;
\r
+ }
\r
+
\r
if (end < start)
\r
{
\r
int tmp = start;
\r
if (end < start)
\r
{
\r
int tmp = start;
\r
@@
-282,11
+266,13
@@
public class IdPanel
scrollThread.running = false;
\r
}
\r
\r
scrollThread.running = false;
\r
}
\r
\r
- if(av.getSelectionGroup()!=null)
\r
+ if (av.getSelectionGroup() != null)
\r
+ {
\r
av.getSelectionGroup().recalcConservation();
\r
av.getSelectionGroup().recalcConservation();
\r
+ }
\r
\r
mouseDragging = false;
\r
\r
mouseDragging = false;
\r
- PaintRefresher.Refresh(this, av.alignment);
\r
+ PaintRefresher.Refresh(this, av.getSequenceSetId());
\r
}
\r
\r
public void highlightSearchResults(java.util.Vector found)
\r
}
\r
\r
public void highlightSearchResults(java.util.Vector found)
\r
@@
-342,7
+328,7
@@
public class IdPanel
{
\r
selectSeqs(lastid - 1, seq);
\r
}
\r
{
\r
selectSeqs(lastid - 1, seq);
\r
}
\r
- else if (seq > lastid)
\r
+ else if (seq > lastid && seq < av.alignment.getHeight())
\r
{
\r
selectSeqs(lastid + 1, seq);
\r
}
\r
{
\r
selectSeqs(lastid + 1, seq);
\r
}
\r
@@
-354,7
+340,7
@@
public class IdPanel
running = false;
\r
}
\r
\r
running = false;
\r
}
\r
\r
- alignPanel.repaint();
\r
+ alignPanel.paintAlignment(true);
\r
try
\r
{
\r
Thread.sleep(100);
\r
try
\r
{
\r
Thread.sleep(100);
\r