wrapMenuItem_actionPerformed();
}
}
+ param = applet.getParameter("centrecolumnlabels");
+ if (param != null)
+ {
+ centreColumnLabelFlag.setState(true);
+ centreColumnLabelFlag_stateChanged();
+ }
try
{
else if (evt.getSource() == autoCalculate)
{
viewport.autocalculateConsensus = autoCalculate.getState();
+ } else if (evt.getSource() == this.centreColumnLabelFlag)
+ {
+ centreColumnLabelFlag_stateChanged();
}
-
+
alignPanel.paintAlignment(true);
}
+ private void centreColumnLabelFlag_stateChanged()
+ {
+ viewport.centreColumnLabels = centreColumnLabelFlag.getState();
+ this.alignPanel.annotationPanel.repaint();
+ }
+
public void actionPerformed(ActionEvent evt)
{
Object source = evt.getSource();
MenuItem documentation = new MenuItem();
MenuItem about = new MenuItem();
CheckboxMenuItem seqLimits = new CheckboxMenuItem();
+ CheckboxMenuItem centreColumnLabelFlag = new CheckboxMenuItem();
private void jbInit()
throws Exception
autoCalculate.addItemListener(this);
inputText.setLabel("Input from textbox");
inputText.addActionListener(this);
-
+ centreColumnLabelFlag.setLabel("Centre column labels");
+ centreColumnLabelFlag.addItemListener(this);
+
helpMenu.setLabel("Help");
documentation.setLabel("Documentation");
documentation.addActionListener(this);
formatMenu.add(viewTextMenuItem);
formatMenu.add(colourTextMenuItem);
formatMenu.add(renderGapsMenuItem);
+ formatMenu.add(centreColumnLabelFlag);
selectMenu.add(findMenuItem);
selectMenu.addSeparator();
selectMenu.add(selectAllSequenceMenuItem);
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;
public AnnotationPanel(AlignmentPanel ap)
{
MAC = new jalview.util.Platform().isAMac();
-
this.ap = ap;
av = ap.av;
setLayout(null);
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);