import jalview.datamodel.AlignmentI;
import jalview.io.DataSourceType;
import jalview.io.FileLoader;
import jalview.datamodel.AlignmentI;
import jalview.io.DataSourceType;
import jalview.io.FileLoader;
import org.testng.annotations.Test;
import junit.extensions.PA;
public class SeqCanvasTest
{
import org.testng.annotations.Test;
import junit.extensions.PA;
public class SeqCanvasTest
{
/**
* Test the method that computes wrapped width in residues, height of wrapped
* widths in pixels, and the number of widths visible
/**
* Test the method that computes wrapped width in residues, height of wrapped
* widths in pixels, and the number of widths visible
av.setFont(new Font("SansSerif", Font.PLAIN, 14), true);
int charHeight = av.getCharHeight();
int charWidth = av.getCharWidth();
av.setFont(new Font("SansSerif", Font.PLAIN, 14), true);
int charHeight = av.getCharHeight();
int charWidth = av.getCharWidth();
- assertEquals(charHeight, 17);
- assertEquals(charWidth, 12);
+ assertEquals(charHeight, Platform.isMac() ? 17 : 19);
+ assertEquals(charWidth, Platform.isMac() ? 12 : 11);
av.setScaleRightWrapped(true);
FontMetrics fm = testee.getFontMetrics(av.getFont());
int labelWidth = fm.stringWidth("000") + charWidth;
av.setScaleRightWrapped(true);
FontMetrics fm = testee.getFontMetrics(av.getFont());
int labelWidth = fm.stringWidth("000") + charWidth;
av.setFont(new Font("SansSerif", Font.PLAIN, 14), true);
int charHeight = av.getCharHeight();
int charWidth = av.getCharWidth();
av.setFont(new Font("SansSerif", Font.PLAIN, 14), true);
int charHeight = av.getCharHeight();
int charWidth = av.getCharWidth();
- assertEquals(charHeight, 17);
- assertEquals(charWidth, 12);
-
+
+ assertEquals(charHeight, Platform.isMac() ? 17 : 19);
+ assertEquals(charWidth, Platform.isMac() ? 12 : 11);
+
av.setScaleAboveWrapped(true);
av.setScaleLeftWrapped(true);
av.setScaleRightWrapped(true);
av.setScaleAboveWrapped(true);
av.setScaleLeftWrapped(true);
av.setScaleRightWrapped(true);
FontMetrics fm = testee.getFontMetrics(av.getFont());
int labelWidth = fm.stringWidth("000") + charWidth;
FontMetrics fm = testee.getFontMetrics(av.getFont());
int labelWidth = fm.stringWidth("000") + charWidth;
av.setWrapAlignment(true);
av.setFont(new Font("SansSerif", Font.PLAIN, 14), true);
int charHeight = av.getCharHeight();
int charWidth = av.getCharWidth();
av.setWrapAlignment(true);
av.setFont(new Font("SansSerif", Font.PLAIN, 14), true);
int charHeight = av.getCharHeight();
int charWidth = av.getCharWidth();
- assertEquals(charHeight, 17);
- assertEquals(charWidth, 12);
+ // Windows h=19, w=11.
+ assertEquals(charHeight, Platform.isMac() ? 17 : 19);
+ assertEquals(charWidth, Platform.isMac() ? 12 : 11);