*/
package jalview.gui;
-import jalview.datamodel.AlignmentAnnotation;
-import jalview.datamodel.Sequence;
-import jalview.datamodel.SequenceFeature;
-import jalview.datamodel.SequenceGroup;
-import jalview.datamodel.SequenceI;
-import jalview.gui.SeqPanel.MousePos;
-import jalview.io.SequenceAnnotationReport;
-import jalview.util.MessageManager;
-import jalview.util.Platform;
-import jalview.viewmodel.AlignmentViewport;
-import jalview.viewmodel.ViewportRanges;
-
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.Timer;
import javax.swing.ToolTipManager;
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.Sequence;
+import jalview.datamodel.SequenceGroup;
+import jalview.datamodel.SequenceI;
+import jalview.gui.SeqPanel.MousePos;
+import jalview.io.SequenceAnnotationReport;
+import jalview.util.MessageManager;
+import jalview.util.Platform;
+import jalview.viewmodel.AlignmentViewport;
+import jalview.viewmodel.ViewportRanges;
+
/**
* This panel hosts alignment sequence ids and responds to mouse clicks on them,
* as well as highlighting ids matched by a search from the Find menu.
ScrollThread scrollThread = null;
- String linkImageURL;
-
int offy;
// int width;
this.av = av;
alignPanel = parent;
setIdCanvas(new IdCanvas(av));
- linkImageURL = getClass().getResource("/images/link.gif").toString();
- seqAnnotReport = new SequenceAnnotationReport(linkImageURL);
+ seqAnnotReport = new SequenceAnnotationReport(true);
setLayout(new BorderLayout());
add(getIdCanvas(), BorderLayout.CENTER);
addMouseListener(this);
StringBuilder text = new StringBuilder();
text.append("Sequence ").append(String.valueOf(seq + 1))
- .append(" ID: ")
- .append(sequence.getName());
+ .append(" ID: ").append(sequence.getName());
alignPanel.alignFrame.setStatus(text.toString());
}
}
if (scrollThread != null)
{
scrollThread.stopScrolling();
+ scrollThread = null;
}
}
void startScrolling(boolean up)
{
scrollThread = new ScrollThread(up);
- if (!Platform.isJS())
- {
- /*
- * Java - run in a new thread
- */
- scrollThread.start();
- }
- else
+ if (Platform.isJS())
{
/*
* for JalviewJS using Swing Timer
{
if (scrollThread == null)
{
- // finished and nulled itself
+ // IdPanel.stopScrolling called
t.stop();
}
}
});
t.start();
}
+ else
+ /**
+ * Java only
+ *
+ * @j2sIgnore
+ */
+ {
+ scrollThread.start();
+ }
}
/**
}
MousePos pos = alignPanel.getSeqPanel().findMousePosition(e);
-
+
if (e.isPopupTrigger()) // Mac reports this in mousePressed
{
showPopupMenu(e, pos);
}
Sequence sq = (Sequence) av.getAlignment().getSequenceAt(pos.seqIndex);
-
- /*
- * build a new links menu based on the current links
- * and any non-positional features
- */
- List<SequenceFeature> features = null;
if (sq != null)
{
- List<String> nlinks = Preferences.sequenceUrlLinks.getLinksForMenu();
- features = sq.getFeatures().getNonPositionalFeatures();
- for (SequenceFeature sf : features)
- {
- if (sf.links != null)
- {
- nlinks.addAll(sf.links);
- }
- }
+ PopupMenu pop = new PopupMenu(alignPanel, sq,
+ Preferences.getGroupURLLinks());
+ pop.show(this, e.getX(), e.getY());
}
-
- PopupMenu pop = new PopupMenu(alignPanel, sq, features,
- Preferences.getGroupURLLinks());
- pop.show(this, e.getX(), e.getY());
}
/**
{
if (scrollThread != null)
{
- scrollThread.stopScrolling();
+ stopScrolling();
}
MousePos pos = alignPanel.getSeqPanel().findMousePosition(e);
{
this.up = up;
setName("IdPanel$ScrollThread$" + String.valueOf(up));
- start();
}
/**