};
});
// Finally, build the menu once to get current service state
- javax.swing.SwingUtilities.invokeLater(new Runnable() {
- public void run() { BuildWebServiceMenu();}
- });
+ new Thread(new Runnable()
+ {
+ public void run()
+ {
+ BuildWebServiceMenu();
+ }
+ }).start();
}
public void setGUINucleotide(boolean nucleotide)
public void actionPerformed(ActionEvent e)
{
handler.cancelActivity(id);
- us.setProgressBar("Cancelled "
- + ((JLabel) progressPanel.getComponent(0)).getText(), id);
+ us.setProgressBar(
+ "Cancelled "
+ + ((JLabel) progressPanel.getComponent(0))
+ .getText(), id);
}
});
progressPanel.add(cancel, BorderLayout.EAST);
*/
public void saveAs_actionPerformed(ActionEvent e)
{
- JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache
- .getProperty("LAST_DIRECTORY"),
+ JalviewFileChooser chooser = new JalviewFileChooser(
+ jalview.bin.Cache.getProperty("LAST_DIRECTORY"),
jalview.io.AppletFormatAdapter.WRITABLE_EXTENSIONS,
jalview.io.AppletFormatAdapter.WRITABLE_FNAMES,
currentFileFormat, false);
CutAndPasteTransfer cap = new CutAndPasteTransfer();
cap.setForInput(null);
- try {
+ try
+ {
cap.setText(new FormatAdapter().formatSequences(e.getActionCommand(),
- viewport.alignment, omitHidden, viewport.colSel));
- Desktop.addInternalFrame(cap, "Alignment output - "
- + e.getActionCommand(), 600, 500);
+ viewport.alignment, omitHidden, viewport.colSel));
+ Desktop.addInternalFrame(cap,
+ "Alignment output - " + e.getActionCommand(), 600, 500);
} catch (OutOfMemoryError oom)
{
- new OOMWarning("Outputting alignment as "+e.getActionCommand(),oom);
+ new OOMWarning("Outputting alignment as " + e.getActionCommand(), oom);
cap.dispose();
}
*/
protected void htmlMenuItem_actionPerformed(ActionEvent e)
{
- new HTMLOutput(alignPanel, alignPanel.seqPanel.seqCanvas
- .getSequenceRenderer(), alignPanel.seqPanel.seqCanvas
- .getFeatureRenderer());
+ new HTMLOutput(alignPanel,
+ alignPanel.seqPanel.seqCanvas.getSequenceRenderer(),
+ alignPanel.seqPanel.seqCanvas.getFeatureRenderer());
}
public void createImageMap(File file, String image)
public void exportAnnotations_actionPerformed(ActionEvent e)
{
- new AnnotationExporter().exportAnnotations(alignPanel,
+ new AnnotationExporter().exportAnnotations(
+ alignPanel,
viewport.showAnnotation ? viewport.alignment
.getAlignmentAnnotation() : null, viewport.alignment
.getGroups(),
public void associatedData_actionPerformed(ActionEvent e)
{
// Pick the tree file
- JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache
- .getProperty("LAST_DIRECTORY"));
+ JalviewFileChooser chooser = new JalviewFileChooser(
+ jalview.bin.Cache.getProperty("LAST_DIRECTORY"));
chooser.setFileView(new JalviewFileView());
chooser.setDialogTitle("Load Jalview Annotations or Features File");
chooser.setToolTipText("Load Jalview Annotations / Features file");
jalview.gui.Desktop.internalCopy = true;
// Its really worth setting the clipboard contents
// to empty before setting the large StringSelection!!
- Toolkit.getDefaultToolkit().getSystemClipboard().setContents(
- new StringSelection(""), null);
+ Toolkit.getDefaultToolkit().getSystemClipboard()
+ .setContents(new StringSelection(""), null);
- Toolkit.getDefaultToolkit().getSystemClipboard().setContents(ss,
- Desktop.instance);
+ Toolkit.getDefaultToolkit().getSystemClipboard()
+ .setContents(ss, Desktop.instance);
} catch (OutOfMemoryError er)
{
new OOMWarning("copying region", er);
}
buildSortByAnnotationScoresMenu();
}
- viewport.firePropertyChange("alignment", null, alignment
- .getSequences());
+ viewport.firePropertyChange("alignment", null,
+ alignment.getSequences());
}
else
}
pos = npos + 1;
} while (npos != -1);
- contents
- .append("<tr><td>" + key + "</td><td>" + val + "</td></tr>");
+ contents.append("<tr><td>" + key + "</td><td>" + val + "</td></tr>");
}
contents.append("</table>");
}
JInternalFrame frame = new JInternalFrame();
OverviewPanel overview = new OverviewPanel(alignPanel);
frame.setContentPane(overview);
- Desktop.addInternalFrame(frame, "Overview " + this.getTitle(), frame
- .getWidth(), frame.getHeight());
+ Desktop.addInternalFrame(frame, "Overview " + this.getTitle(),
+ frame.getWidth(), frame.getHeight());
frame.pack();
frame.setLayer(JLayeredPane.PALETTE_LAYER);
- frame
- .addInternalFrameListener(new javax.swing.event.InternalFrameAdapter()
- {
- public void internalFrameClosed(
- javax.swing.event.InternalFrameEvent evt)
- {
- alignPanel.setOverviewPanel(null);
- };
- });
+ frame.addInternalFrameListener(new javax.swing.event.InternalFrameAdapter()
+ {
+ public void internalFrameClosed(
+ javax.swing.event.InternalFrameEvent evt)
+ {
+ alignPanel.setOverviewPanel(null);
+ };
+ });
alignPanel.setOverviewPanel(overview);
}
public void clustalColour_actionPerformed(ActionEvent e)
{
changeColour(new ClustalxColourScheme(
- viewport.alignment.getSequences(), viewport.alignment
- .getWidth()));
+ viewport.alignment.getSequences(),
+ viewport.alignment.getWidth()));
}
/**
Alignment al = (Alignment) viewport.alignment;
Conservation c = new Conservation("All",
- ResidueProperties.propHash, 3, al.getSequences(), 0, al
- .getWidth() - 1);
+ ResidueProperties.propHash, 3, al.getSequences(), 0,
+ al.getWidth() - 1);
c.calculate();
c.verdict(false, viewport.ConsPercGaps);
if (cs instanceof ClustalxColourScheme)
{
- sg.cs = new ClustalxColourScheme(sg
- .getSequences(viewport.hiddenRepSequences), sg.getWidth());
+ sg.cs = new ClustalxColourScheme(
+ sg.getSequences(viewport.hiddenRepSequences),
+ sg.getWidth());
}
else if (cs instanceof UserColourScheme)
{
{
sg.cs.setThreshold(threshold, viewport.getIgnoreGapsConsensus());
- sg.cs.setConsensus(AAFrequency.calculate(sg
- .getSequences(viewport.hiddenRepSequences), sg
- .getStartRes(), sg.getEndRes() + 1));
+ sg.cs.setConsensus(AAFrequency.calculate(
+ sg.getSequences(viewport.hiddenRepSequences),
+ sg.getStartRes(), sg.getEndRes() + 1));
}
else
{
if (viewport.getConservationSelected())
{
Conservation c = new Conservation("Group",
- ResidueProperties.propHash, 3, sg
- .getSequences(viewport.hiddenRepSequences), sg
- .getStartRes(), sg.getEndRes() + 1);
+ ResidueProperties.propHash, 3,
+ sg.getSequences(viewport.hiddenRepSequences),
+ sg.getStartRes(), sg.getEndRes() + 1);
c.calculate();
c.verdict(false, viewport.ConsPercGaps);
sg.cs.setConservation(c);
if (viewport.getAbovePIDThreshold()
&& viewport.globalColourScheme != null)
{
- SliderPanel.setPIDSliderSource(alignPanel, viewport
- .getGlobalColourScheme(), "Background");
+ SliderPanel.setPIDSliderSource(alignPanel,
+ viewport.getGlobalColourScheme(), "Background");
SliderPanel.showPIDSlider();
}
}
if (evt.isControlDown()
|| SwingUtilities.isRightMouseButton(evt))
{
- radioItem
- .removeActionListener(radioItem.getActionListeners()[0]);
+ radioItem.removeActionListener(radioItem.getActionListeners()[0]);
int option = JOptionPane.showInternalConfirmDialog(
jalview.gui.Desktop.desktop,
public void actionPerformed(ActionEvent e)
{
SequenceI[] oldOrder = viewport.getAlignment().getSequencesArray();
- AlignmentSorter.sortByAnnotationScore(scoreLabel, viewport
- .getAlignment());// ,viewport.getSelectionGroup());
+ AlignmentSorter.sortByAnnotationScore(scoreLabel,
+ viewport.getAlignment());// ,viewport.getSelectionGroup());
addHistoryItem(new OrderCommand("Sort by " + scoreLabel, oldOrder,
viewport.alignment));
alignPanel.paintAlignment(true);
Enumeration labels = scoreSorts.keys();
while (labels.hasMoreElements())
{
- addSortByAnnotScoreMenuItem(sortByAnnotScore, (String) labels
- .nextElement());
+ addSortByAnnotScoreMenuItem(sortByAnnotScore,
+ (String) labels.nextElement());
}
sortByAnnotScore.setVisible(scoreSorts.size() > 0);
scoreSorts.clear();
protected void LoadtreeMenuItem_actionPerformed(ActionEvent e)
{
// Pick the tree file
- JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache
- .getProperty("LAST_DIRECTORY"));
+ JalviewFileChooser chooser = new JalviewFileChooser(
+ jalview.bin.Cache.getProperty("LAST_DIRECTORY"));
chooser.setFileView(new JalviewFileView());
chooser.setDialogTitle("Select a newick-like tree file");
chooser.setToolTipText("Load a tree file");
}
if (fin != null && fin.hasWarningMessage())
{
- JOptionPane.showMessageDialog(Desktop.desktop, fin
- .getWarningMessage(), "Possible problem with tree file",
+ JOptionPane.showMessageDialog(Desktop.desktop,
+ fin.getWarningMessage(), "Possible problem with tree file",
JOptionPane.WARNING_MESSAGE);
}
}
}
;
}
+ final AlignFrame me = this;
buildingMenu = true;
+ new Thread(new Runnable() {
+ public void run() {
try
{
System.err
// TODO: add in rediscovery GUI function to restart discoverer
// TODO: group services by location as well as function and/or introduce
// object broker mechanism.
- Vector wsmenu = new Vector();
- final IProgressIndicator af = this;
+ final Vector wsmenu = new Vector();
+ final IProgressIndicator af = me;
if (Cache.getDefault("SHOW_JWS1_SERVICES", true)
&& Discoverer.services != null
&& (Discoverer.services.size() > 0))
.get(i);
jalview.ws.WSMenuEntryProviderI impl = jalview.ws.jws1.Discoverer
.getServiceClient(sh);
- impl.attachWSMenuEntry(msawsmenu, this);
+ impl.attachWSMenuEntry(msawsmenu, me);
}
wsmenu.add(msawsmenu);
.get(i);
jalview.ws.WSMenuEntryProviderI impl = jalview.ws.jws1.Discoverer
.getServiceClient(sh);
- impl.attachWSMenuEntry(secstrmenu, this);
+ impl.attachWSMenuEntry(secstrmenu, me);
}
wsmenu.add(secstrmenu);
}
.elementAt(i);
jalview.ws.WSMenuEntryProviderI impl = jalview.ws.jws1.Discoverer
.getServiceClient(sh);
- impl.attachWSMenuEntry(seqsrchmenu, this);
+ impl.attachWSMenuEntry(seqsrchmenu, me);
}
wsmenu.add(seqsrchmenu);
}
if (jws2servs.hasServices())
{
JMenu jws2men = new JMenu("Jalview 2 Services");
- jws2servs.attachWSMenuEntry(jws2men, this);
+ jws2servs.attachWSMenuEntry(jws2men, me);
for (int i = 0, iSize = jws2men.getMenuComponentCount(); i < iSize; i++)
{
wsmenu.add(jws2men.getMenuComponent(i));
}
}
}
+
+ javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() {
+ try {
+
resetWebServiceMenu();
// finally, add the whole shebang onto the webservices menu
if (wsmenu.size() > 0)
}
else
{
- this.webService.add(this.webServiceNoServices);
+ me.webService.add(me.webServiceNoServices);
}
+ } catch (Exception e)
+ {
+ }
+ ;
+ }
+ });
} catch (Exception e)
{
}
;
+
buildingMenu = false;
+ }}).start();
+
}
/**
} catch (Exception e)
{
jalview.bin.Cache.log
- .warn(
- "canTranslate threw an exception - please report to help@jalview.org",
+ .warn("canTranslate threw an exception - please report to help@jalview.org",
e);
return false;
}
// old way
try
{
- return (jalview.analysis.Dna.canTranslate(selection, viewport
- .getViewAsVisibleContigs(true)));
+ return (jalview.analysis.Dna.canTranslate(selection,
+ viewport.getViewAsVisibleContigs(true)));
} catch (Exception e)
{
jalview.bin.Cache.log
- .warn(
- "canTranslate threw an exception - please report to help@jalview.org",
+ .warn("canTranslate threw an exception - please report to help@jalview.org",
e);
return false;
}
boolean featuresFile = false;
try
{
- featuresFile = new FeaturesFile(file, type).parse(viewport.alignment
- .getDataset(), alignPanel.seqPanel.seqCanvas
- .getFeatureRenderer().featureColours, false);
+ featuresFile = new FeaturesFile(file, type)
+ .parse(viewport.alignment.getDataset(),
+ alignPanel.seqPanel.seqCanvas.getFeatureRenderer().featureColours,
+ false);
} catch (Exception ex)
{
ex.printStackTrace();
{
jalview.io.JPredFile predictions = new jalview.io.JPredFile(file,
protocol);
- new JnetAnnotationMaker().add_annotation(predictions, viewport
- .getAlignment(), 0, false);
+ new JnetAnnotationMaker().add_annotation(predictions,
+ viewport.getAlignment(), 0, false);
isAnnotation = true;
}
else
// preferences and have checkboxes.. rather than individual sources selected
// here
JMenu rfetch = new JMenu("Fetch DB References");
- rfetch
- .setToolTipText("Retrieve and parse sequence database records for the alignment or the currently selected sequences");
+ rfetch.setToolTipText("Retrieve and parse sequence database records for the alignment or the currently selected sequences");
webService.add(rfetch);
JMenuItem fetchr = new JMenuItem("Standard Databases");
- fetchr
- .setToolTipText("Fetch from EMBL/EMBLCDS or Uniprot/PDB and any selected DAS sources");
+ fetchr.setToolTipText("Fetch from EMBL/EMBLCDS or Uniprot/PDB and any selected DAS sources");
fetchr.addActionListener(new ActionListener()
{
if (viewport.getSelectionGroup() != null)
{
SequenceGroup[] gps = jalview.analysis.Grouping.makeGroupsFrom(
- viewport.getSequenceSelection(), viewport.getAlignmentView(
- true).getSequenceStrings(viewport.getGapCharacter()),
+ viewport.getSequenceSelection(),
+ viewport.getAlignmentView(true).getSequenceStrings(
+ viewport.getGapCharacter()),
viewport.alignment.getGroups());
viewport.alignment.deleteAllGroups();
viewport.sequenceColours = null;
gps[g].setShowNonconserved(viewport.getShowUnconserved());
gps[g].setshowSequenceLogo(viewport.isShowSequenceLogo());
viewport.alignment.addGroup(gps[g]);
- Color col = new Color((int) (Math.random() * 255), (int) (Math
- .random() * 255), (int) (Math.random() * 255));
+ Color col = new Color((int) (Math.random() * 255),
+ (int) (Math.random() * 255), (int) (Math.random() * 255));
col = col.brighter();
for (Enumeration sq = gps[g].getSequences(null).elements(); sq
.hasMoreElements(); viewport.setSequenceColour(