X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAnnotationPanel.java;h=e77fbed98c4853d257bfbe7d59b3be09c829f5df;hb=e7ddb4e421ed93f92b6a94f13f11c6f5677e2a0b;hp=eb0189eee5b29fb84c19818ef1cbfe0c59b129e9;hpb=298c2b85845dbaabda7e3304751cc856e7b0ad30;p=jalview.git diff --git a/src/jalview/gui/AnnotationPanel.java b/src/jalview/gui/AnnotationPanel.java index eb0189e..e77fbed 100755 --- a/src/jalview/gui/AnnotationPanel.java +++ b/src/jalview/gui/AnnotationPanel.java @@ -169,7 +169,7 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI, public int calcPanelHeight() { // setHeight of panels - AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation(); + AlignmentAnnotation[] aa = av.getAlignment().getAlignmentAnnotation(); int height = 0; if (aa != null) @@ -227,7 +227,7 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI, */ public void actionPerformed(ActionEvent evt) { - AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation(); + AlignmentAnnotation[] aa = av.getAlignment().getAlignmentAnnotation(); if (aa == null) { return; @@ -269,7 +269,7 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI, { int index = av.getColumnSelection().columnAt(i); - if (!av.colSel.isVisible(index)) + if (!av.getColumnSelection().isVisible(index)) continue; if (anot[index] == null) @@ -294,7 +294,7 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI, { int index = av.getColumnSelection().columnAt(i); - if (!av.colSel.isVisible(index)) + if (!av.getColumnSelection().isVisible(index)) continue; if (anot[index] == null) @@ -350,7 +350,7 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI, { int index = av.getColumnSelection().columnAt(i); - if (!av.colSel.isVisible(index)) + if (!av.getColumnSelection().isVisible(index)) continue; if (anot[index] == null) @@ -374,11 +374,12 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI, { String collatedInput = ""; String last = ""; + // TODO: refactor and save av.getColumnSelection for efficiency for (int i = 0; i < columnSelection.size(); i++) { int index = columnSelection.columnAt(i); // always check for current display state - just in case - if (!av.colSel.isVisible(index)) + if (!av.getColumnSelection().isVisible(index)) continue; String tlabel = null; if (anot[index] != null) @@ -422,7 +423,7 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI, public void mousePressed(MouseEvent evt) { - AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation(); + AlignmentAnnotation[] aa = av.getAlignment().getAlignmentAnnotation(); if (aa == null) { return; @@ -467,7 +468,7 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI, /* * Just display the needed structure options */ - if (av.alignment.isNucleotide() == true) + if (av.getAlignment().isNucleotide() == true) { item = new JMenuItem(STEM); item.addActionListener(this); @@ -551,11 +552,11 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI, { if (graphStretch > -1) { - av.alignment.getAlignmentAnnotation()[graphStretch].graphHeight += graphStretchY + av.getAlignment().getAlignmentAnnotation()[graphStretch].graphHeight += graphStretchY - evt.getY(); - if (av.alignment.getAlignmentAnnotation()[graphStretch].graphHeight < 0) + if (av.getAlignment().getAlignmentAnnotation()[graphStretch].graphHeight < 0) { - av.alignment.getAlignmentAnnotation()[graphStretch].graphHeight = 0; + av.getAlignment().getAlignmentAnnotation()[graphStretch].graphHeight = 0; } graphStretchY = evt.getY(); adjustPanelHeight(); @@ -575,7 +576,7 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI, */ public void mouseMoved(MouseEvent evt) { - AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation(); + AlignmentAnnotation[] aa = av.getAlignment().getAlignmentAnnotation(); if (aa == null) { @@ -609,7 +610,7 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI, int res = (evt.getX() / av.getCharWidth()) + av.getStartRes(); - if (av.hasHiddenColumns) + if (av.hasHiddenColumns()) { res = av.getColumnSelection().adjustForHiddenColumns(res); } @@ -676,7 +677,7 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI, { if (activeRow != -1) { - AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation(); + AlignmentAnnotation[] aa = av.getAlignment().getAlignmentAnnotation(); AlignmentAnnotation anot = aa[activeRow]; if (anot.description.equals("secondary structure")) @@ -765,9 +766,9 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI, { if ((horizontal == 0) || gg == null - || av.alignment.getAlignmentAnnotation() == null - || av.alignment.getAlignmentAnnotation().length < 1 - || av.updatingConsensus || av.updatingConservation) + || av.getAlignment().getAlignmentAnnotation() == null + || av.getAlignment().getAlignmentAnnotation().length < 1 + || av.isCalcInProgress()) { repaint(); return; @@ -811,7 +812,7 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI, */ public void drawComponent(Graphics g, int startRes, int endRes) { - if (av.updatingConsensus || av.updatingConservation) + if (av.isCalcInProgress()) { if (image == null) { @@ -852,8 +853,8 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI, fm = g.getFontMetrics(); } - if ((av.alignment.getAlignmentAnnotation() == null) - || (av.alignment.getAlignmentAnnotation().length < 1)) + if ((av.getAlignment().getAlignmentAnnotation() == null) + || (av.getAlignment().getAlignmentAnnotation().length < 1)) { g.setColor(Color.white); g.fillRect(0, 0, getWidth(), getHeight());