X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fappletgui%2FAnnotationPanel.java;h=ec5fbd8e84176b18362e5673d76668744b61eaa8;hb=f8534ee55f528a291d8802b1b4461296bf9ff460;hp=d4055a55bbc07e073f8f01a8442be52b1de31ce9;hpb=fb1cdebe4a9d93839c81a2d3eb39e8da9cb83d64;p=jalview.git diff --git a/src/jalview/appletgui/AnnotationPanel.java b/src/jalview/appletgui/AnnotationPanel.java index d4055a5..ec5fbd8 100755 --- a/src/jalview/appletgui/AnnotationPanel.java +++ b/src/jalview/appletgui/AnnotationPanel.java @@ -42,14 +42,13 @@ public class AnnotationPanel static String COLOUR = "Colour"; static Color HELIX_COLOUR = Color.red.darker(); static Color SHEET_COLOUR = Color.green.darker().darker(); - + Image image; Graphics gg; FontMetrics fm; int imgWidth = 0; boolean fastPaint = false; - public static int GRAPH_HEIGHT = 40; boolean MAC = false; @@ -57,7 +56,6 @@ public class AnnotationPanel public AnnotationPanel(AlignmentPanel ap) { MAC = new jalview.util.Platform().isAMac(); - this.ap = ap; av = ap.av; setLayout(null); @@ -648,10 +646,13 @@ public class AnnotationPanel if (av.validCharWidth && validRes && (row.annotations[column].displayCharacter!=null && row.annotations[column].displayCharacter.length() > 0)) { - int charOffset = (av.charWidth - - fm.charWidth(row.annotations[column]. - displayCharacter.charAt( - 0))) / 2; + int charOffset = (av.getCentreColumnLabels()) ? ((av.charWidth - + fm.charsWidth(row.annotations[column]. + displayCharacter.toCharArray(),0, + row.annotations[column]. + displayCharacter.length())) / 2) + : (av.charWidth - fm.charWidth(row.annotations[column]. + displayCharacter.charAt(0))) / 2; if (row.annotations[column].colour == null) g.setColor(Color.black);