*/
package jalview.appletgui;
+import jalview.datamodel.SequenceI;
import jalview.viewmodel.OverviewDimensions;
import java.awt.Color;
private Frame nullFrame;
- public OverviewPanel(AlignmentPanel ap)
+ public OverviewPanel(AlignmentPanel alPanel)
{
- this.av = ap.av;
- this.ap = ap;
+ this.av = alPanel.av;
+ this.ap = alPanel;
setLayout(null);
nullFrame = new Frame();
nullFrame.addNotify();
sr.forOverview = true;
fr = new FeatureRenderer(av);
- boolean showAnnotation = true;
- // TODO: in applet this was getSequenceConsensusHash()
- // check if it makes any functional difference: hconsensus or conservation
- if (av.getAlignmentConservationAnnotation() == null)
- {
- showAnnotation = false;
- }
-
- od = new OverviewDimensions(av.getPosProps(), showAnnotation);
+ od = new OverviewDimensions(av.getPosProps(), av.isShowAnnotation());
setSize(new Dimension(od.getWidth(), od.getHeight()));
addComponentListener(new ComponentAdapter()
}
/**
- * DOCUMENT ME!
+ * Updates the overview image when the related alignment panel is updated
*/
public void updateOverviewImage()
{
if ((getWidth() > 0) && (getHeight() > 0))
{
- od.setWidth(getWidth()); // width = getWidth();
- od.setHeight(getHeight()); // sequencesHeight = getHeight() - graphHeight;
+ od.setWidth(getWidth());
+ od.setHeight(getHeight());
}
setSize(new Dimension(od.getWidth(), od.getHeight()));
Graphics mg = miniMe.getGraphics();
- // od.updateScales();
-
int alwidth = av.getAlignment().getWidth();
int alheight = av.getAlignment().getAbsoluteHeight();
float sampleCol = alwidth / (float) od.getWidth();
buildImage(sampleRow, sampleCol, mg);
- if (av.getAlignmentConservationAnnotation() != null)
+ if (av.isShowAnnotation())
{
for (int col = 0; col < od.getWidth() && !resizeAgain; col++)
{
}
}
+ /*
+ * Build the overview panel image
+ */
private void buildImage(float sampleRow, float sampleCol, Graphics mg)
{
int lastcol = 0;
int sameRow = 0;
int sameCol = 0;
- jalview.datamodel.SequenceI seq = null;
+ SequenceI seq = null;
final boolean hasHiddenCols = av.hasHiddenColumns();
boolean hiddenRow = false;
sameRow = 1;
}
}
-
}
/*
}
else
{
- color = Color.white; // White
+ color = Color.white;
}
if (hiddenRow