int getCharHeight();
+ /**
+ * calculate the height for visible annotation, revalidating bounds where
+ * necessary ABSTRACT GUI METHOD
+ *
+ * @return total height of annotation
+ */
+ public int calcPanelHeight();
+
boolean hasHiddenColumns();
boolean isValidCharWidth();
*/
protected void validateAnnotationDimensions(boolean adjustPanelHeight) {
boolean modified=false;
- int height = annotationPanel.calcPanelHeight();
+ int height = av.calcPanelHeight();
int minsize=0;
if (hscroll.isVisible())
{
ap.annotationPanelHolder.setSize(new Dimension(d.width, d.height
- dif));
ap.apvscroll.setValues(ap.apvscroll.getValue(), d.height - dif, 0,
- ap.annotationPanel.calcPanelHeight());
+ av.calcPanelHeight());
f.height += dif;
ap.seqPanelHolder.setPreferredSize(f);
ap.setScrollValues(av.getStartRes(), av.getStartSeq());
av.getAlignment().getAlignmentAnnotation()[graphStretch].graphHeight = 0;
}
graphStretchY = evt.getY();
- calcPanelHeight();
+ av.calcPanelHeight();
needValidating = true;
ap.paintAlignment(true);
}
public int adjustPanelHeight(boolean repaint)
{
- int height = calcPanelHeight();
+ int height = av.calcPanelHeight();
this.setSize(new Dimension(getSize().width, height));
if (repaint)
{
* ABSTRACT GUI METHOD
* @return total height of annotation
*/
- public int calcPanelHeight()
- {
- // setHeight of panels
- AlignmentAnnotation[] aa = av.getAlignment().getAlignmentAnnotation();
- int height = 0;
-
- if (aa != null)
- {
- for (int i = 0; i < aa.length; i++)
- {
- if (!aa[i].visible)
- {
- continue;
- }
-
- aa[i].height = 0;
-
- if (aa[i].hasText)
- {
- aa[i].height += av.charHeight;
- }
-
- if (aa[i].hasIcons)
- {
- aa[i].height += 16;
- }
-
- if (aa[i].graph > 0)
- {
- aa[i].height += aa[i].graphHeight;
- }
-
- if (aa[i].height == 0)
- {
- aa[i].height = 20;
- }
-
- height += aa[i].height;
- }
- }
- if (height == 0)
- {
- height = 20;
- }
-
- return height;
-
- }
public void addEditableColumn(int i)
{
*/
public int adjustPanelHeight()
{
- int height = calcPanelHeight();
+ int height = av.calcPanelHeight();
this.setPreferredSize(new Dimension(1, height));
if (ap != null)
{
}
/**
- * calculate the height for visible annotation, revalidating bounds where
- * necessary ABSTRACT GUI METHOD
- *
- * @return total height of annotation
- */
- public int calcPanelHeight()
- {
- // setHeight of panels
- AlignmentAnnotation[] aa = av.getAlignment().getAlignmentAnnotation();
- int height = 0;
-
- if (aa != null)
- {
- for (int i = 0; i < aa.length; i++)
- {
- if (aa[i] == null)
- {
- System.err.println("Null annotation row: ignoring.");
- continue;
- }
- if (!aa[i].visible)
- {
- continue;
- }
-
- aa[i].height = 0;
-
- if (aa[i].hasText)
- {
- aa[i].height += av.charHeight;
- }
-
- if (aa[i].hasIcons)
- {
- aa[i].height += 16;
- }
-
- if (aa[i].graph > 0)
- {
- aa[i].height += aa[i].graphHeight;
- }
-
- if (aa[i].height == 0)
- {
- aa[i].height = 20;
- }
-
- height += aa[i].height;
- }
- }
- if (height == 0)
- {
- // set minimum
- height = 20;
- }
- return height;
- }
-
- /**
* DOCUMENT ME!
*
* @param evt
}
}
+ /*
+ * (non-Javadoc)
+ * @see jalview.api.AlignViewportI#calcPanelHeight()
+ */
+ public int calcPanelHeight()
+ {
+ // setHeight of panels
+ AlignmentAnnotation[] aa = getAlignment().getAlignmentAnnotation();
+ int height = 0;
+ int charHeight=getCharHeight();
+ if (aa != null)
+ {
+ boolean graphgrp[] = null;
+ for (int i = 0; i < aa.length; i++)
+ {
+ if (aa[i] == null)
+ {
+ System.err.println("Null annotation row: ignoring.");
+ continue;
+ }
+ if (!aa[i].visible)
+ {
+ continue;
+ }
+ if (aa[i].graphGroup > -1)
+ {
+ if (graphgrp == null)
+ {
+ graphgrp = new boolean[aa.length];
+ }
+ if (graphgrp[aa[i].graphGroup])
+ {
+ continue;
+ }
+ else
+ {
+ graphgrp[aa[i].graphGroup] = true;
+ }
+ }
+ aa[i].height = 0;
+
+ if (aa[i].hasText)
+ {
+ aa[i].height += charHeight;
+ }
+
+ if (aa[i].hasIcons)
+ {
+ aa[i].height += 16;
+ }
+
+ if (aa[i].graph > 0)
+ {
+ aa[i].height += aa[i].graphHeight;
+ }
+
+ if (aa[i].height == 0)
+ {
+ aa[i].height = 20;
+ }
+
+ height += aa[i].height;
+ }
+ }
+ if (height == 0)
+ {
+ // set minimum
+ height = 20;
+ }
+ return height;
+ }
}