import jalview.schemes.ColourSchemes;
import jalview.schemes.ResidueColourScheme;
import jalview.schemes.TCoffeeColourScheme;
+import jalview.util.HttpUtils;
import jalview.util.MessageManager;
import jalview.util.Platform;
import jalview.viewmodel.AlignmentViewport;
Desktop.instance.closeAssociatedWindows();
FileLoader loader = new FileLoader();
- DataSourceType protocol = fileName.startsWith("http:")
+ DataSourceType protocol = HttpUtils.startsWithHttpOrHttps(fileName)
? DataSourceType.URL
: DataSourceType.FILE;
loader.LoadFile(viewport, fileName, protocol, currentFileFormat);
Rectangle bounds = this.getBounds();
FileLoader loader = new FileLoader();
- DataSourceType protocol = fileName.startsWith("http:")
+ DataSourceType protocol = HttpUtils.startsWithHttpOrHttps(fileName)
? DataSourceType.URL
: DataSourceType.FILE;
AlignFrame newframe = loader.LoadFileWaitTillLoaded(fileName,
public void save_actionPerformed(ActionEvent e)
{
if (fileName == null || (currentFileFormat == null)
- || fileName.startsWith("http"))
+ || HttpUtils.startsWithHttpOrHttps(fileName))
{
saveAs_actionPerformed(null);
}
}
/**
- * Calls AlignmentI.moveSelectedSequencesByOne with current sequence selection or the sequence under cursor in keyboard mode
+ * Calls AlignmentI.moveSelectedSequencesByOne with current sequence selection
+ * or the sequence under cursor in keyboard mode
*
* @param up
* or down (if !up)
if (sg == null)
{
- if (viewport.cursorMode)
+ if (viewport.cursorMode)
{
sg = new SequenceGroup();
- sg.addSequence(viewport.getAlignment()
- .getSequenceAt(alignPanel.getSeqPanel().seqCanvas.cursorY),false);
- } else {
+ sg.addSequence(viewport.getAlignment().getSequenceAt(
+ alignPanel.getSeqPanel().seqCanvas.cursorY), false);
+ }
+ else
+ {
return;
}
}
-
+
if (sg.getSize() < 1)
{
- return;
+ return;
}
-
+
// TODO: JAL-3733 - add an event to the undo buffer for this !
-
+
viewport.getAlignment().moveSelectedSequencesByOne(sg,
viewport.getHiddenRepSequences(), up);
alignPanel.paintAlignment(true, false);
webService.add(me.webServiceNoServices);
}
// TODO: move into separate menu builder class.
- boolean new_sspred = false;
- if (Cache.getDefault("SHOW_JWS2_SERVICES", true))
{
+ // logic for 2.11.1.4 is
+ // always look to see if there is a discover. if there isn't
+ // we can't show any Jws2 services
+ // if there are services available, show them - regardless of
+ // the 'show JWS2 preference'
+ // if the discoverer is running then say so
+ // otherwise offer to trigger discovery if 'show JWS2' is not
+ // enabled
Jws2Discoverer jws2servs = Jws2Discoverer.getDiscoverer();
if (jws2servs != null)
{
}
}
}
-
}
+
if (jws2servs.isRunning())
{
JMenuItem tm = new JMenuItem(
tm.setEnabled(false);
webService.add(tm);
}
+ else if (!Cache.getDefault("SHOW_JWS2_SERVICES", true))
+ {
+ JMenuItem enableJws2 = new JMenuItem(
+ "Discover Web Services");
+ enableJws2.setToolTipText(
+ "Select to start JABA Web Service discovery (or enable option in Web Service preferences)");
+ enableJws2.setEnabled(true);
+ enableJws2.addActionListener(new ActionListener()
+ {
+
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ // start service discoverer, but ignore preference
+ Desktop.instance.startServiceDiscovery(false,
+ true);
+ }
+ });
+ webService.add(enableJws2);
+ }
}
}
build_urlServiceMenu(me.webService);