void getSelectedRow(int y)
{
int height = 0;
- AlignmentAnnotation[] aa = ap.av.getAlignment().getAlignmentAnnotation();
+ AlignmentAnnotation[] aa = ap.av.getAlignment()
+ .getAlignmentAnnotation();
selectedRow = -2;
if (aa != null)
{
*/
public void actionPerformed(ActionEvent evt)
{
- AlignmentAnnotation[] aa = ap.av.getAlignment().getAlignmentAnnotation();
+ AlignmentAnnotation[] aa = ap.av.getAlignment()
+ .getAlignmentAnnotation();
if (evt.getActionCommand().equals(ADDNEW))
{
ap.validateAnnotationDimensions(false);
ap.addNotify();
ap.repaint();
- //validate();
- //ap.paintAlignment(true);
+ // validate();
+ // ap.paintAlignment(true);
}
/**
{
end = ap.av.getAlignment().getAlignmentAnnotation().length - 1;
}
- AlignmentAnnotation endAA = ap.av.getAlignment().getAlignmentAnnotation()[end];
+ AlignmentAnnotation endAA = ap.av.getAlignment()
+ .getAlignmentAnnotation()[end];
ap.av.getAlignment().getAlignmentAnnotation()[end] = startAA;
ap.av.getAlignment().getAlignmentAnnotation()[start] = endAA;
if (selectedRow > -1
&& ap.av.getAlignment().getAlignmentAnnotation().length > selectedRow)
{
- AlignmentAnnotation aa = ap.av.getAlignment().getAlignmentAnnotation()[selectedRow];
-
+ AlignmentAnnotation aa = ap.av.getAlignment()
+ .getAlignmentAnnotation()[selectedRow];
+
StringBuffer desc = new StringBuffer();
if (aa.description != null
&& !aa.description.equals("New description"))
{
- // TODO: we could refactor and merge this code with the code in jalview.gui.SeqPanel.mouseMoved(..) that formats sequence feature tooltips
+ // TODO: we could refactor and merge this code with the code in
+ // jalview.gui.SeqPanel.mouseMoved(..) that formats sequence feature
+ // tooltips
desc.append(aa.getDescription(true).trim());
// check to see if the description is an html fragment.
- if (desc.length()<6 || (desc.substring(0,6).toLowerCase().indexOf("<html>")<0))
+ if (desc.length() < 6
+ || (desc.substring(0, 6).toLowerCase().indexOf("<html>") < 0))
{
// clean the description ready for embedding in html
- desc = new StringBuffer(Pattern.compile("<").matcher(desc).replaceAll("<"));
+ desc = new StringBuffer(Pattern.compile("<").matcher(desc)
+ .replaceAll("<"));
desc.insert(0, "<html>");
- } else {
- // remove terminating html if any
- int i=desc.substring(desc.length()-7).toLowerCase().lastIndexOf("</html>");
- if (i>-1) {
- desc.setLength(desc.length()-7+i);
- }
+ }
+ else
+ {
+ // remove terminating html if any
+ int i = desc.substring(desc.length() - 7).toLowerCase()
+ .lastIndexOf("</html>");
+ if (i > -1)
+ {
+ desc.setLength(desc.length() - 7 + i);
+ }
}
if (aa.hasScore())
{
desc.append("<br/>");
}
-
-
- } else {
+
+ }
+ else
+ {
// begin the tooltip's html fragment
desc.append("<html>");
}
if (aa.hasScore())
{
- // TODO: limit precision of score to avoid noise from imprecise doubles (64.7 becomes 64.7+/some tiny value).
+ // TODO: limit precision of score to avoid noise from imprecise doubles
+ // (64.7 becomes 64.7+/some tiny value).
desc.append(" Score: " + aa.score);
}
*/
public void mouseClicked(MouseEvent evt)
{
- AlignmentAnnotation[] aa = ap.av.getAlignment().getAlignmentAnnotation();
+ AlignmentAnnotation[] aa = ap.av.getAlignment()
+ .getAlignmentAnnotation();
if (SwingUtilities.isLeftMouseButton(evt))
{
if (selectedRow > -1 && selectedRow < aa.length)
{
if (evt.getClickCount() >= 2)
{
- // todo: make the ap scroll to the selection - not necessary, first click highlights/scrolls, second selects
+ // todo: make the ap scroll to the selection - not necessary, first
+ // click highlights/scrolls, second selects
ap.seqPanel.ap.idPanel.highlightSearchResults(null);
ap.av.setSelectionGroup(// new SequenceGroup(
aa[selectedRow].groupRef); // );
{
public void actionPerformed(ActionEvent e)
{
-
+
// TODO: pass on reference
// to ap
// so the