*/
public void mouseClicked(MouseEvent evt)
{
+ AlignmentAnnotation[] aa = ap.av.alignment.getAlignmentAnnotation();
+ if (SwingUtilities.isLeftMouseButton(evt))
+ {
+ if (selectedRow < aa.length)
+ {
+ if (aa[selectedRow].groupRef!=null)
+ {
+ ap.seqPanel.ap.idPanel.highlightSearchResults(aa[selectedRow].groupRef.getSequences(null));
+ if (evt.getClickCount()>=2)
+ {
+ // todo: make the ap scroll to the selection
+ ap.av.setSelectionGroup(new SequenceGroup(aa[selectedRow].groupRef));
+ ap.paintAlignment(false);
+ }
+ return;
+ } else
+ if (aa[selectedRow].sequenceRef!=null){
+ Vector sr = new Vector();
+ sr.addElement(aa[selectedRow].sequenceRef);
+ if (evt.getClickCount()==1)
+ {
+ ap.seqPanel.ap.idPanel.highlightSearchResults(sr);
+ } else
+ if (evt.getClickCount()>=2)
+ {
+ ap.seqPanel.ap.idPanel.highlightSearchResults(null);
+ SequenceGroup sg = new SequenceGroup();
+ sg.addSequence(aa[selectedRow].sequenceRef,false);
+ ap.av.setSelectionGroup(sg);
+ ap.paintAlignment(false);
+ PaintRefresher.Refresh(ap, ap.av.getSequenceSetId());
+ }
+
+ }
+ }
+ }
if (!SwingUtilities.isRightMouseButton(evt))
{
return;
}
- AlignmentAnnotation[] aa = ap.av.alignment.getAlignmentAnnotation();
JPopupMenu pop = new JPopupMenu("Annotations");
JMenuItem item = new JMenuItem(ADDNEW);
pop.addSeparator();
// av and sequencegroup need to implement same interface for
final JCheckBoxMenuItem cbmi = new JCheckBoxMenuItem(
- "Ignore Gaps In Consensus", ap.av.getIgnoreGapsConsensus());
+ "Ignore Gaps In Consensus", (aa[selectedRow].groupRef!=null) ? aa[selectedRow].groupRef.getIgnoreGapsConsensus() : ap.av.getIgnoreGapsConsensus());
final AlignmentAnnotation aaa = aa[selectedRow];
cbmi.addActionListener(new ActionListener()
{
{
if (aaa.groupRef!=null)
{
- aaa.groupRef.setIgnoreGapsConsensus(cbmi.getState());
+ aaa.groupRef.setIgnoreGapsConsensus(cbmi.getState()); // TODO: pass on reference to ap so the view can be updated.
+ ap.annotationPanel.paint(ap.annotationPanel.getGraphics());
+ } else {
+ ap.av.setIgnoreGapsConsensus(cbmi.getState(), ap);
}
- ap.av.setIgnoreGapsConsensus(cbmi.getState(), ap);
}
});
pop.add(cbmi);
+ // av and sequencegroup need to implement same interface for
+ if (aaa.groupRef!=null) {
+ final JCheckBoxMenuItem cprof = new JCheckBoxMenuItem(
+ "Show Full Profile", aa[selectedRow].groupRef.isIncludeAllConsSymbols());
+ cprof.addActionListener(new ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ aaa.groupRef.setIncludeAllConsSymbols(cprof.getState()); // TODO: pass on reference to ap so the view can be updated.
+ ap.annotationPanel.paint(ap.annotationPanel.getGraphics());
+ }
+ });
+ pop.add(cprof);
+ }
final JMenuItem consclipbrd = new JMenuItem(COPYCONS_SEQ);
consclipbrd.addActionListener(this);
pop.add(consclipbrd);