import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
-import java.awt.font.LineMetrics;
import java.awt.geom.AffineTransform;
import java.awt.image.ImageObserver;
import java.util.BitSet;
if (validCharWidth && validRes && displayChar != null
&& (displayChar.length() > 0))
{
-
+ Graphics2D gg = ((Graphics2D) g);
+ AffineTransform t = gg.getTransform();
fmWidth = fm.charsWidth(displayChar.toCharArray(), 0,
displayChar.length());
if (/* centreColLabels || */scaleColLabel)
// scale only if the current font isn't already small enough
fmScaling = charWidth;
fmScaling /= fmWidth;
- g.setFont(ofont.deriveFont(AffineTransform
- .getScaleInstance(fmScaling, 1.0)));
+ gg.setFont(ofont);
+ gg.transform(
+ AffineTransform.getScaleInstance(fmScaling, 1.0));
// and update the label's width to reflect the scaling.
fmWidth = charWidth;
}
if (row_annotations[column].colour == null)
{
- g.setColor(Color.black);
+ gg.setColor(Color.black);
}
else
{
- g.setColor(row_annotations[column].colour);
+ gg.setColor(row_annotations[column].colour);
}
if (column == 0 || row.graph > 0)
{
- g.drawString(displayChar, (x * charWidth) + charOffset,
+ gg.drawString(displayChar, (x * charWidth) + charOffset,
y + iconOffset);
}
else if (row_annotations[column - 1] == null || (labelAllCols
|| (displayChar.length() < 2
&& row_annotations[column].secondaryStructure == ' ')))
{
- g.drawString(displayChar, x * charWidth + charOffset,
+ gg.drawString(displayChar, x * charWidth + charOffset,
y + iconOffset);
}
g.setFont(ofont);
+ gg.setTransform(t);
}
}
if (row.hasIcons)