* </li><li>SHOW_QUALITY show alignment quality annotation
* </li><li>SHOW_ANNOTATIONS show alignment annotation rows
* </li><li>SHOW_CONSERVATION show alignment conservation annotation
+ * </li><li>CENTRE_COLUMN_LABELS centre the labels at each column in a displayed annotation row
* </li><li>DEFAULT_COLOUR default colour scheme to apply for a new alignment
* </li><li>DEFAULT_FILE_FORMAT file format used to save
* </li><li>STARTUP_FILE file loaded on startup (may be a fully qualified url)
*/
String fileName = null;
+
+
/**
* Creates a new AlignFrame object.
conservationMenuItem.setSelected(av.getConservationSelected());
seqLimits.setSelected(av.getShowJVSuffix());
idRightAlign.setSelected(av.rightAlignIds);
+ centreColumnLabelsMenuItem.setState(av.centreColumnLabels);
renderGapsMenuItem.setSelected(av.renderGaps);
wrapMenuItem.setSelected(av.wrapAlignment);
scaleAbove.setVisible(av.wrapAlignment);
alignPanel.paintAlignment(true);
}
+ public void centreColumnLabels_actionPerformed(ActionEvent e)
+ {
+ viewport.centreColumnLabels = centreColumnLabelsMenuItem.getState();
+ alignPanel.paintAlignment(true);
+ }
+
/**
// TODO: refactor to allow list of AbstractName/Handler bindings to be stored or retrieved from elsewhere
Vector msaws = (Vector) Discoverer.services.get("MsaWS");
Vector secstrpr = (Vector) Discoverer.services.get("SecStrPred");
+ Vector seqsrch = (Vector) Discoverer.services.get("SeqSearch");
// TODO: move GUI generation code onto service implementation - so a client instance attaches itself to the GUI with method call like jalview.ws.MsaWSClient.bind(servicehandle, Desktop.instance, alignframe)
Vector wsmenu = new Vector();
final AlignFrame af = this;
secstrmenu.add(method);
}
wsmenu.add(secstrmenu);
+/* }
+ if (seqsrch!=null)
+ {
+ // Add any secondary structure prediction services
+ final JMenu seqsrchmenu = new JMenu("Sequence Database Search");
+ Hashtable dbsrchs = new Hashtable();
+ JMenu defmenu;
+ dbsrchs.put("<default>", defmenu = new JMenu("Default Database"));
+ for (int i = 0, j = seqsrch.size(); i < j; i++)
+ {
+ final ext.vamsas.ServiceHandle sh = (ext.vamsas.ServiceHandle)
+ seqsrch.elementAt(i);
+
+ String dbs[] = null;
+ try {
+ dbs = new jalview.ws.SeqSearchWSClient(sh).getSupportedDatabases();
+ } catch (Exception e)
+ {
+ jalview.bin.Cache.log.warn("Database list request failed, so disabling SeqSearch Service client "+sh.getName()+" at "+sh.getEndpointURL(), e);
+ continue;
+ }
+ JMenuItem method;
+ // do default entry
+ defmenu.add(method = new JMenuItem(sh.getName()));
+ method.addActionListener(new ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ // use same input gatherer as for secondary structure prediction
+ // we could actually parameterise the gatherer method here...
+ AlignmentView msa = gatherSeqOrMsaForSecStrPrediction();
+ new jalview.ws.SeqSearchWSClient(sh, title, msa, null,
+ viewport.getAlignment().getDataset(),
+ af);
+ }
+ }
+ );
+ // add entry for each database the service supports
+ for (int db=0; dbs!=null && db<dbs.length; db++)
+ {
+ JMenu dbmenu = (JMenu) dbsrchs.get(dbs[db]);
+ if (dbmenu==null)
+ {
+ dbsrchs.put(dbs[db], dbmenu = new JMenu(dbs[db]));
+ }
+ // add the client handler code for this service
+ dbmenu.add(method = new JMenuItem(sh.getName()));
+ final String searchdb = dbs[db];
+ method.addActionListener(new ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ AlignmentView msa = gatherSeqOrMsaForSecStrPrediction();
+ new jalview.ws.SeqSearchWSClient(sh, title, msa, searchdb,
+ viewport.getAlignment().getDataset(),
+ af);
+ }
+ });
+ }
+ }
+ // add the databases onto the seqsearch menu
+ Enumeration e = dbsrchs.elements();
+ while (e.hasMoreElements())
+ {
+ Object el = e.nextElement();
+ if (el instanceof JMenu)
+ {
+ seqsrchmenu.add((JMenu) el);
+ } else {
+ seqsrchmenu.add((JMenuItem) el);
+ }
+ }
+ // finally, add the whole shebang onto the webservices menu
+ wsmenu.add(seqsrchmenu); */
}
resetWebServiceMenu();
for (int i = 0, j = wsmenu.size(); i < j; i++)
showAnnotation = Cache.getDefault("SHOW_ANNOTATIONS", true);
rightAlignIds = Cache.getDefault("RIGHT_ALIGN_IDS", false);
-
+ centreColumnLabels = Cache.getDefault("CENTRE_COLUMN_LABELS", false);
autoCalculateConsensus = Cache.getDefault("AUTO_CALC_CONSENSUS", true);
padGaps = Cache.getDefault("PAD_GAPS", true);
boolean updatingConsensus = false;
boolean updatingConservation = false;
+ /**
+ * centre columnar annotation labels in displayed alignment annotation
+ * TODO: add to jalviewXML and annotation display settings
+ */
+ boolean centreColumnLabels=false;
/**
- * DOCUMENT ME!
+ * trigger update of conservation annotation
*/
public void updateConservation(final AlignmentPanel ap)
{
}
/**
- * DOCUMENT ME!
+ * trigger update of consensus annotation
*/
public void updateConsensus(final AlignmentPanel ap)
{
}
return false;
}
+
+ public boolean getCentreColumnLabels()
+ {
+ return centreColumnLabels;
+ }
+ public void setCentreColumnLabels(boolean centrecolumnlabels)
+ {
+ centreColumnLabels = centrecolumnlabels;
+ }
}
final String COLOUR = "Colour";
final Color HELIX_COLOUR = Color.red.darker();
final Color SHEET_COLOUR = Color.green.darker().darker();
-
/** DOCUMENT ME!! */
AlignViewport av;
AlignmentPanel ap;
&& (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);
JMenu formatMenu = new JMenu();
JMenu selectMenu = new JMenu();
protected JCheckBoxMenuItem idRightAlign = new JCheckBoxMenuItem();
+ protected JCheckBoxMenuItem centreColumnLabelsMenuItem = new JCheckBoxMenuItem();
protected JMenuItem gatherViews = new JMenuItem();
protected JMenuItem expandViews = new JMenuItem();
JMenuItem pageSetup = new JMenuItem();
scaleRight_actionPerformed(e);
}
});
+ centreColumnLabelsMenuItem.setVisible(true);
+ centreColumnLabelsMenuItem.setState(false);
+ centreColumnLabelsMenuItem.setText("Centre Column Labels");
+ centreColumnLabelsMenuItem.addActionListener(new java.awt.event.ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ centreColumnLabels_actionPerformed(e);
+ }
+ });
+
modifyPID.setText("Modify Identity Threshold...");
modifyPID.addActionListener(new java.awt.event.ActionListener()
{
formatMenu.add(viewTextMenuItem);
formatMenu.add(colourTextMenuItem);
formatMenu.add(renderGapsMenuItem);
+ formatMenu.add(centreColumnLabelsMenuItem);
selectMenu.add(findMenuItem);
selectMenu.addSeparator();
selectMenu.add(selectAllSequenceMenuItem);
selectMenu.add(deleteGroups);
}
+ protected void centreColumnLabels_actionPerformed(ActionEvent e)
+ {
+ }
+
protected void showProducts_actionPerformed(ActionEvent e)
{
- // TODO Auto-generated method stub
-
}
protected void buildSortByAnnotationScoresMenu()