import jalview.commands.RemoveGapsCommand;
import jalview.commands.SlideSequencesCommand;
import jalview.commands.TrimRegionCommand;
+import jalview.controller.AlignViewController;
import jalview.datamodel.AlignedCodonFrame;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentAnnotation;
import jalview.gui.ViewSelectionMenu.ViewSetProvider;
import jalview.io.AlignmentProperties;
import jalview.io.AnnotationFile;
+import jalview.io.AppletFormatAdapter;
import jalview.io.BioJsHTMLOutput;
import jalview.io.FileLoader;
import jalview.io.FormatAdapter;
import jalview.io.HtmlSvgOutput;
import jalview.io.IdentifyFile;
+import jalview.io.JPredFile;
import jalview.io.JalviewFileChooser;
import jalview.io.JalviewFileView;
import jalview.io.JnetAnnotationMaker;
import jalview.schemes.NucleotideColourScheme;
import jalview.schemes.PIDColourScheme;
import jalview.schemes.PurinePyrimidineColourScheme;
+import jalview.schemes.RNAHelicesColour;
import jalview.schemes.RNAHelicesColourChooser;
import jalview.schemes.ResidueProperties;
import jalview.schemes.StrandColourScheme;
import jalview.schemes.ZappoColourScheme;
import jalview.structure.StructureSelectionManager;
import jalview.util.MessageManager;
+import jalview.util.Platform;
import jalview.viewmodel.AlignmentViewport;
+import jalview.ws.DBRefFetcher;
+import jalview.ws.WSMenuEntryProviderI;
import jalview.ws.jws1.Discoverer;
import jalview.ws.jws2.Jws2Discoverer;
import jalview.ws.jws2.jabaws2.Jws2Instance;
+import jalview.ws.rest.RestClient;
import jalview.ws.seqfetcher.DbSourceProxy;
import java.awt.BorderLayout;
import javax.swing.JScrollPane;
import javax.swing.SwingUtilities;
+import ext.vamsas.ServiceHandle;
+
/**
* DOCUMENT ME!
*
progressBar = new ProgressBar(this.statusPanel, this.statusBar);
}
- avc = new jalview.controller.AlignViewController(this, viewport,
+ avc = new AlignViewController(this, viewport,
alignPanel);
if (viewport.getAlignmentConservationAnnotation() == null)
{
// modifyPID.setEnabled(false);
}
- String sortby = jalview.bin.Cache.getDefault("SORT_ALIGNMENT",
+ String sortby = Cache.getDefault("SORT_ALIGNMENT",
"No sort");
if (sortby.equals("Id"))
wrapMenuItem_actionPerformed(null);
}
- if (jalview.bin.Cache.getDefault("SHOW_OVERVIEW", false))
+ if (Cache.getDefault("SHOW_OVERVIEW", false))
{
this.overviewMenuItem_actionPerformed(null);
}
public void addAlignmentPanel(final AlignmentPanel ap, boolean newPanel)
{
ap.alignFrame = this;
- avc = new jalview.controller.AlignViewController(this, viewport,
- alignPanel);
+ avc = new AlignViewController(this, viewport, alignPanel);
alignPanels.add(ap);
purinePyrimidineColour.setEnabled(nucleotide);
showComplementMenuItem.setText(MessageManager
.getString(nucleotide ? "label.protein" : "label.nucleotide"));
- setColourSelected(jalview.bin.Cache.getDefault(
+ setColourSelected(Cache.getDefault(
nucleotide ? Preferences.DEFAULT_COLOUR_NUC
: Preferences.DEFAULT_COLOUR_PROT, "None"));
}
listenToViewSelections.setSelected(av.followSelection);
rnahelicesColour.setEnabled(av.getAlignment().hasRNAStructure());
rnahelicesColour
- .setSelected(av.getGlobalColourScheme() instanceof jalview.schemes.RNAHelicesColour);
+ .setSelected(av.getGlobalColourScheme() instanceof RNAHelicesColour);
setShowProductsEnabled();
updateEditMenuBar();
}
*/
public String getVersion()
{
- return jalview.bin.Cache.getProperty("VERSION");
+ return Cache.getProperty("VERSION");
}
public FeatureRenderer getFeatureRenderer()
public void save_actionPerformed(ActionEvent e)
{
if (fileName == null
- || (currentFileFormat == null || !jalview.io.FormatAdapter
+ || (currentFileFormat == null || !FormatAdapter
.isValidIOFormat(currentFileFormat, true))
|| fileName.startsWith("http"))
{
public void saveAs_actionPerformed(ActionEvent e)
{
JalviewFileChooser chooser = new JalviewFileChooser(
- jalview.bin.Cache.getProperty("LAST_DIRECTORY"),
- jalview.io.AppletFormatAdapter.WRITABLE_EXTENSIONS,
- jalview.io.AppletFormatAdapter.WRITABLE_FNAMES,
+ Cache.getProperty("LAST_DIRECTORY"),
+ AppletFormatAdapter.WRITABLE_EXTENSIONS,
+ AppletFormatAdapter.WRITABLE_FNAMES,
currentFileFormat, false);
chooser.setFileView(new JalviewFileView());
fileName = chooser.getSelectedFile().getPath();
- jalview.bin.Cache.setProperty("DEFAULT_FILE_FORMAT",
+ Cache.setProperty("DEFAULT_FILE_FORMAT",
currentFileFormat);
- jalview.bin.Cache.setProperty("LAST_DIRECTORY", fileName);
+ Cache.setProperty("LAST_DIRECTORY", fileName);
if (currentFileFormat.indexOf(" ") > -1)
{
currentFileFormat = currentFileFormat.substring(0,
}
else
{
- if (!jalview.io.AppletFormatAdapter.isValidFormat(format, true))
+ if (!AppletFormatAdapter.isValidFormat(format, true))
{
warningMessage("Cannot save file " + fileName + " using format "
+ format, "Alignment output format not supported");
private void warningMessage(String warning, String title)
{
- if (new jalview.util.Platform().isHeadless())
+ if (Platform.isHeadless())
{
System.err.println("Warning: " + title + "\nWarning: " + warning);
{
// Pick the tree file
JalviewFileChooser chooser = new JalviewFileChooser(
- jalview.bin.Cache.getProperty("LAST_DIRECTORY"));
+ Cache.getProperty("LAST_DIRECTORY"));
chooser.setFileView(new JalviewFileView());
chooser.setDialogTitle(MessageManager
.getString("label.load_jalview_annotations"));
if (value == JalviewFileChooser.APPROVE_OPTION)
{
String choice = chooser.getSelectedFile().getPath();
- jalview.bin.Cache.setProperty("LAST_DIRECTORY", choice);
+ Cache.setProperty("LAST_DIRECTORY", choice);
loadJalviewDataFile(choice, null, null, null);
}
try
{
- jalview.gui.Desktop.internalCopy = true;
+ Desktop.internalCopy = true;
// Its really worth setting the clipboard contents
// to empty before setting the large StringSelection!!
Toolkit.getDefaultToolkit().getSystemClipboard()
iSize--;
}
}
- if (jalview.gui.UserDefinedColours.getUserColourSchemes() != null)
+ if (UserDefinedColours.getUserColourSchemes() != null)
{
- java.util.Enumeration userColours = jalview.gui.UserDefinedColours
+ Enumeration userColours = UserDefinedColours
.getUserColourSchemes().keys();
while (userColours.hasMoreElements())
radioItem.removeActionListener(radioItem.getActionListeners()[0]);
int option = JOptionPane.showInternalConfirmDialog(
- jalview.gui.Desktop.desktop,
+ Desktop.desktop,
MessageManager
.getString("label.remove_from_default_list"),
MessageManager
JOptionPane.YES_NO_OPTION);
if (option == JOptionPane.YES_OPTION)
{
- jalview.gui.UserDefinedColours
- .removeColourFromDefaults(radioItem.getText());
+ UserDefinedColours.removeColourFromDefaults(radioItem
+ .getText());
colourMenu.remove(radioItem);
}
else
* be submitted for multiple alignment.
*
*/
- public jalview.datamodel.AlignmentView gatherSequencesForAlignment()
+ public AlignmentView gatherSequencesForAlignment()
{
// Now, check we have enough sequences
AlignmentView msa = null;
{
// Pick the tree file
JalviewFileChooser chooser = new JalviewFileChooser(
- jalview.bin.Cache.getProperty("LAST_DIRECTORY"));
+ Cache.getProperty("LAST_DIRECTORY"));
chooser.setFileView(new JalviewFileView());
chooser.setDialogTitle(MessageManager
.getString("label.select_newick_like_tree_file"));
if (value == JalviewFileChooser.APPROVE_OPTION)
{
String choice = chooser.getSelectedFile().getPath();
- jalview.bin.Cache.setProperty("LAST_DIRECTORY", choice);
- jalview.io.NewickFile fin = null;
+ Cache.setProperty("LAST_DIRECTORY", choice);
+ NewickFile fin = null;
try
{
- fin = new jalview.io.NewickFile(choice, "File");
+ fin = new NewickFile(choice, "File");
viewport.setCurrentTree(ShowNewickTree(fin, choice).getTree());
} catch (Exception ex)
{
// Add any secondary structure prediction services
for (int i = 0, j = secstrpr.size(); i < j; i++)
{
- final ext.vamsas.ServiceHandle sh = (ext.vamsas.ServiceHandle) secstrpr
- .get(i);
- jalview.ws.WSMenuEntryProviderI impl = jalview.ws.jws1.Discoverer
- .getServiceClient(sh);
+ final ServiceHandle sh = (ServiceHandle) secstrpr.get(i);
+ WSMenuEntryProviderI impl = Discoverer.getServiceClient(sh);
int p = secstrmenu.getItemCount();
impl.attachWSMenuEntry(secstrmenu, me);
int q = secstrmenu.getItemCount();
// SHmmr test client - still being implemented.
// DEBUG - alignmentView
- for (jalview.ws.rest.RestClient client : jalview.ws.rest.RestClient
- .getRestClients())
+ for (RestClient client : RestClient.getRestClients())
{
client.attachWSMenuEntry(
JvSwingUtils.findOrCreateMenu(webService, client.getAction()),
/*
* public void vamsasStore_actionPerformed(ActionEvent e) { JalviewFileChooser
- * chooser = new JalviewFileChooser(jalview.bin.Cache.
+ * chooser = new JalviewFileChooser(Cache.
* getProperty("LAST_DIRECTORY"));
*
* chooser.setFileView(new JalviewFileView()); chooser.setDialogTitle("Export
showProducts.setEnabled(showp);
} catch (Exception e)
{
- jalview.bin.Cache.log
+ Cache.log
.warn("canTranslate threw an exception - please report to help@jalview.org",
e);
return false;
}
} catch (Exception e)
{
- jalview.bin.Cache.log.error(
+ Cache.log.error(
"Exception when finding crossreferences", e);
} catch (OutOfMemoryError e)
{
new OOMWarning("whilst fetching crossreferences", e);
} catch (Error e)
{
- jalview.bin.Cache.log.error("Error when finding crossreferences",
+ Cache.log.error("Error when finding crossreferences",
e);
}
AlignFrame.this.setProgressBar(MessageManager.formatMessage(
// old way
try
{
- return (jalview.analysis.Dna.canTranslate(selection,
+ return (Dna.canTranslate(selection,
viewport.getViewAsVisibleContigs(true)));
} catch (Exception e)
{
- jalview.bin.Cache.log
+ Cache.log
.warn("canTranslate threw an exception - please report to help@jalview.org",
e);
return false;
al = dna.translateCdna();
} catch (Exception ex)
{
- jalview.bin.Cache.log.error(
+ Cache.log.error(
"Exception during translation. Please report this !", ex);
final String msg = MessageManager
.getString("label.error_when_translating_sequences_submit_bug_report");
public boolean parseFeaturesFile(String file, String type)
{
return avc.parseFeaturesFile(file, type,
- jalview.bin.Cache.getDefault("RELAXEDSEQIDMATCHING", false));
+ Cache.getDefault("RELAXEDSEQIDMATCHING", false));
}
String file = files.get(i).toString();
String pdbfn = "";
String protocol = FormatAdapter.checkProtocol(file);
- if (protocol == jalview.io.FormatAdapter.FILE)
+ if (protocol == FormatAdapter.FILE)
{
File fl = new File(file);
pdbfn = fl.getName();
}
- else if (protocol == jalview.io.FormatAdapter.URL)
+ else if (protocol == FormatAdapter.URL)
{
URL url = new URL(file);
pdbfn = url.getFile();
{
if (protocol == null)
{
- protocol = jalview.io.FormatAdapter.checkProtocol(file);
+ protocol = FormatAdapter.checkProtocol(file);
}
// if the file isn't identified, or not positively identified as some
// other filetype (PFAM is default unidentified alignment file type) then
}
if (format.equalsIgnoreCase("JnetFile"))
{
- jalview.io.JPredFile predictions = new jalview.io.JPredFile(
- file, protocol);
+ JPredFile predictions = new JPredFile(file, protocol);
new JnetAnnotationMaker();
JnetAnnotationMaker.add_annotation(predictions,
viewport.getAlignment(), 0, false);
* if (format.equalsIgnoreCase("PDB")) {
*
* String pdbfn = ""; // try to match up filename with sequence id
- * try { if (protocol == jalview.io.FormatAdapter.FILE) { File fl =
+ * try { if (protocol == FormatAdapter.FILE) { File fl =
* new File(file); pdbfn = fl.getName(); } else if (protocol ==
- * jalview.io.FormatAdapter.URL) { URL url = new URL(file); pdbfn =
+ * FormatAdapter.URL) { URL url = new URL(file); pdbfn =
* url.getFile(); } } catch (Exception e) { } ; if (assocSeq ==
* null) { SequenceIdMatcher idm = new SequenceIdMatcher(viewport
* .getAlignment().getSequencesArray()); if (pdbfn.length() > 0) {
@Override
protected void extractScores_actionPerformed(ActionEvent e)
{
- ParseProperties pp = new jalview.analysis.ParseProperties(
- viewport.getAlignment());
+ ParseProperties pp = new ParseProperties(viewport.getAlignment());
// TODO: verify regex and introduce GUI dialog for version 2.5
// if (pp.getScoresFromDescription("col", "score column ",
// "\\W*([-+]?\\d*\\.?\\d*e?-?\\d*)\\W+([-+]?\\d*\\.?\\d*e?-?\\d*)",
@Override
public void run()
{
- new jalview.ws.DBRefFetcher(alignPanel.av
+ new DBRefFetcher(alignPanel.av
.getSequenceSelection(), alignPanel.alignFrame)
.fetchDBRefs(false);
}
{
final jalview.ws.SequenceFetcher sf = SequenceFetcher
.getSequenceFetcherSingleton(me);
- javax.swing.SwingUtilities.invokeLater(new Runnable()
+ SwingUtilities.invokeLater(new Runnable()
{
@Override
public void run()
@Override
public void run()
{
- new jalview.ws.DBRefFetcher(alignPanel.av
+ new DBRefFetcher(alignPanel.av
.getSequenceSelection(),
alignPanel.alignFrame, dassource)
.fetchDBRefs(false);
@Override
public void run()
{
- new jalview.ws.DBRefFetcher(alignPanel.av
+ new DBRefFetcher(alignPanel.av
.getSequenceSelection(),
alignPanel.alignFrame, dassource)
.fetchDBRefs(false);
@Override
public void run()
{
- new jalview.ws.DBRefFetcher(alignPanel.av
+ new DBRefFetcher(alignPanel.av
.getSequenceSelection(),
alignPanel.alignFrame, dassrc)
.fetchDBRefs(false);
*/
public void sendSelection()
{
- jalview.structure.StructureSelectionManager
+ StructureSelectionManager
.getStructureSelectionManager(Desktop.instance).sendSelection(
new SequenceGroup(getSelectionGroup()),
new ColumnSelection(getColumnSelection()), this);
try
{
- newAlignFrame.setMaximum(jalview.bin.Cache.getDefault(
+ newAlignFrame.setMaximum(Cache.getDefault(
"SHOW_FULLSCREEN",
false));
} catch (java.beans.PropertyVetoException ex)
import jalview.datamodel.SequenceFeature;
import jalview.datamodel.SequenceGroup;
import jalview.datamodel.SequenceI;
+import jalview.io.HTMLOutput;
import jalview.jbgui.GAlignmentPanel;
import jalview.math.AlignmentDimension;
import jalview.schemes.ResidueProperties;
import jalview.structure.StructureSelectionManager;
+import jalview.util.ImageMaker;
import jalview.util.MessageManager;
import jalview.util.Platform;
return idwidth.intValue() + 4;
}
- void makeAlignmentImage(jalview.util.ImageMaker.TYPE type, File file)
+ void makeAlignmentImage(ImageMaker.TYPE type, File file)
{
long progress = System.currentTimeMillis();
headless = (System.getProperty("java.awt.headless") != null && System
AlignmentDimension aDimension = getAlignmentDimension();
try
{
- jalview.util.ImageMaker im;
+ ImageMaker im;
final String imageAction, imageTitle;
- if (type == jalview.util.ImageMaker.TYPE.PNG)
+ if (type == ImageMaker.TYPE.PNG)
{
imageAction = "Create PNG image from alignment";
imageTitle = null;
}
- else if (type == jalview.util.ImageMaker.TYPE.EPS)
+ else if (type == ImageMaker.TYPE.EPS)
{
imageAction = "Create EPS file from alignment";
imageTitle = alignFrame.getTitle();
imageTitle = alignFrame.getTitle();
}
- im = new jalview.util.ImageMaker(this, type, imageAction,
+ im = new ImageMaker(this, type, imageAction,
aDimension.getWidth(), aDimension.getHeight(), file,
imageTitle);
if (av.getWrapAlignment())
*/
public void makeEPS(File epsFile)
{
- makeAlignmentImage(jalview.util.ImageMaker.TYPE.EPS, epsFile);
+ makeAlignmentImage(ImageMaker.TYPE.EPS, epsFile);
}
/**
*/
public void makePNG(File pngFile)
{
- makeAlignmentImage(jalview.util.ImageMaker.TYPE.PNG, pngFile);
+ makeAlignmentImage(ImageMaker.TYPE.PNG, pngFile);
}
public void makeSVG(File svgFile)
{
- makeAlignmentImage(jalview.util.ImageMaker.TYPE.SVG, svgFile);
+ makeAlignmentImage(ImageMaker.TYPE.SVG, svgFile);
}
public void makePNGImageMap(File imgMapFile, String imageName)
{
.getAlignment().getWidth(), g, gSize, f, fSize, sy;
StringBuffer text = new StringBuffer();
PrintWriter out = new PrintWriter(new FileWriter(imgMapFile));
- out.println(jalview.io.HTMLOutput.getImageMapHTML());
+ out.println(HTMLOutput.getImageMapHTML());
out.println("<img src=\"" + imageName
+ "\" border=\"0\" usemap=\"#Map\" >"
+ "<map name=\"Map\">");
PaintRefresher.RemoveComponent(this);
if (av != null)
{
- jalview.structure.StructureSelectionManager ssm = av
+ StructureSelectionManager ssm = av
.getStructureSelectionManager();
ssm.removeStructureViewerListener(getSeqPanel(), null);
ssm.removeSelectionListener(getSeqPanel());
package jalview.gui;
import jalview.bin.Cache;
+import jalview.datamodel.GraphLine;
import jalview.datamodel.SequenceGroup;
import jalview.schemes.AnnotationColourGradient;
import jalview.schemes.ColourSchemeI;
&& getCurrentAnnotation().threshold == null)
{
getCurrentAnnotation()
- .setThreshold(new jalview.datamodel.GraphLine(
+ .setThreshold(
+ new GraphLine(
(getCurrentAnnotation().graphMax - getCurrentAnnotation().graphMin) / 2f,
"Threshold", Color.black));
}
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.ColumnSelection;
+import jalview.datamodel.GraphLine;
import jalview.schemes.AnnotationColourGradient;
import jalview.util.MessageManager;
import jalview.viewmodel.annotationfilter.AnnotationFilterParameter;
{
getCurrentAnnotation()
.setThreshold(
- new jalview.datamodel.GraphLine(
+ new GraphLine(
(getCurrentAnnotation().graphMax - getCurrentAnnotation().graphMin) / 2f,
"Threshold", Color.black));
}
*/
package jalview.gui;
+import jalview.bin.Cache;
import jalview.datamodel.AlignmentAnnotation;
import jalview.io.AnnotationFile;
import jalview.io.FeaturesFile;
public void toFile_actionPerformed(ActionEvent e)
{
JalviewFileChooser chooser = new JalviewFileChooser(
- jalview.bin.Cache.getProperty("LAST_DIRECTORY"));
+ Cache.getProperty("LAST_DIRECTORY"));
chooser.setFileView(new JalviewFileView());
chooser.setDialogTitle(features ? MessageManager.getString("label.save_features_to_file")
*/
package jalview.gui;
+import jalview.analysis.AlignSeq;
+import jalview.analysis.AlignmentUtils;
+import jalview.datamodel.Alignment;
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.Annotation;
+import jalview.datamodel.Sequence;
+import jalview.datamodel.SequenceGroup;
+import jalview.datamodel.SequenceI;
+import jalview.io.FormatAdapter;
+import jalview.util.Comparison;
+import jalview.util.MessageManager;
+
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import javax.swing.SwingUtilities;
import javax.swing.ToolTipManager;
-import jalview.analysis.AlignmentUtils;
-import jalview.datamodel.Alignment;
-import jalview.datamodel.AlignmentAnnotation;
-import jalview.datamodel.Annotation;
-import jalview.datamodel.Sequence;
-import jalview.datamodel.SequenceGroup;
-import jalview.datamodel.SequenceI;
-import jalview.io.FormatAdapter;
-import jalview.util.MessageManager;
-
/**
* DOCUMENT ME!
*
if (dseqs[0] == null)
{
dseqs[0] = new Sequence(sq);
- dseqs[0].setSequence(jalview.analysis.AlignSeq.extractGaps(
- jalview.util.Comparison.GapChars, sq.getSequenceAsString()));
+ dseqs[0].setSequence(AlignSeq.extractGaps(
+ Comparison.GapChars, sq.getSequenceAsString()));
sq.setDatasetSequence(dseqs[0]);
}
import jalview.renderer.AnnotationRenderer;
import jalview.renderer.AwtRenderPanelI;
import jalview.util.MessageManager;
+import jalview.util.Platform;
import java.awt.AlphaComposite;
import java.awt.Color;
public AnnotationPanel(AlignmentPanel ap)
{
- MAC = jalview.util.Platform.isAMac();
+ MAC = Platform.isAMac();
ToolTipManager.sharedInstance().registerComponent(this);
ToolTipManager.sharedInstance().setInitialDelay(0);
protected boolean enableSeqAss = false;
- private jalview.datamodel.AlignmentAnnotation currentAnnotation;
+ private AlignmentAnnotation currentAnnotation;
protected boolean adjusting = false;
}
- public jalview.datamodel.AlignmentAnnotation getCurrentAnnotation()
+ public AlignmentAnnotation getCurrentAnnotation()
{
return currentAnnotation;
}
public void setCurrentAnnotation(
- jalview.datamodel.AlignmentAnnotation currentAnnotation)
+ AlignmentAnnotation currentAnnotation)
{
this.currentAnnotation = currentAnnotation;
}
import jalview.schemes.TurnColourScheme;
import jalview.schemes.ZappoColourScheme;
import jalview.structures.models.AAStructureBindingModel;
+import jalview.util.BrowserLauncher;
+import jalview.util.ImageMaker;
import jalview.util.MessageManager;
import jalview.util.Platform;
+import jalview.ws.dbsources.Pdb;
import java.awt.BorderLayout;
import java.awt.Color;
this.setBounds(bounds);
initMenus();
setViewId(viewid);
- // jalview.gui.Desktop.addInternalFrame(this, "Loading File",
+ // Desktop.addInternalFrame(this, "Loading File",
// bounds.width,bounds.height);
this.addInternalFrameListener(new InternalFrameAdapter()
// TODO: consider waiting until the structure/view is fully loaded before
// displaying
this.getContentPane().add(renderPanel, java.awt.BorderLayout.CENTER);
- jalview.gui.Desktop.addInternalFrame(this, jmb.getViewerTitle(),
+ Desktop.addInternalFrame(this, jmb.getViewerTitle(),
getBounds().width, getBounds().height);
if (scriptWindow == null)
{
String[] curfiles = jmb.getPdbFile(); // files currently in viewer
// TODO: replace with reference fetching/transfer code (validate PDBentry
// as a DBRef?)
- jalview.ws.dbsources.Pdb pdbclient = new jalview.ws.dbsources.Pdb();
+ Pdb pdbclient = new Pdb();
for (int pi = 0; pi < jmb.getPdbCount(); pi++)
{
String file = jmb.getPdbEntry(pi).getFile();
public void pdbFile_actionPerformed(ActionEvent actionEvent)
{
JalviewFileChooser chooser = new JalviewFileChooser(
- jalview.bin.Cache.getProperty("LAST_DIRECTORY"));
+ Cache.getProperty("LAST_DIRECTORY"));
chooser.setFileView(new JalviewFileView());
chooser.setDialogTitle(MessageManager.getString("label.save_pdb_file"));
@Override
public void viewMapping_actionPerformed(ActionEvent actionEvent)
{
- jalview.gui.CutAndPasteTransfer cap = new jalview.gui.CutAndPasteTransfer();
+ CutAndPasteTransfer cap = new CutAndPasteTransfer();
try
{
cap.appendText(jmb.printMappings());
cap.dispose();
return;
}
- jalview.gui.Desktop.addInternalFrame(cap,
+ Desktop.addInternalFrame(cap,
MessageManager.getString("label.pdb_sequence_mapping"), 550,
600);
}
@Override
public void eps_actionPerformed(ActionEvent e)
{
- makePDBImage(jalview.util.ImageMaker.TYPE.EPS);
+ makePDBImage(ImageMaker.TYPE.EPS);
}
@Override
public void png_actionPerformed(ActionEvent e)
{
- makePDBImage(jalview.util.ImageMaker.TYPE.PNG);
+ makePDBImage(ImageMaker.TYPE.PNG);
}
- void makePDBImage(jalview.util.ImageMaker.TYPE type)
+ void makePDBImage(ImageMaker.TYPE type)
{
int width = getWidth();
int height = getHeight();
- jalview.util.ImageMaker im;
+ ImageMaker im;
- if (type == jalview.util.ImageMaker.TYPE.PNG)
+ if (type == ImageMaker.TYPE.PNG)
{
- im = new jalview.util.ImageMaker(this,
- jalview.util.ImageMaker.TYPE.PNG,
+ im = new ImageMaker(this, ImageMaker.TYPE.PNG,
"Make PNG image from view", width, height, null, null);
}
- else if (type == jalview.util.ImageMaker.TYPE.EPS)
+ else if (type == ImageMaker.TYPE.EPS)
{
- im = new jalview.util.ImageMaker(this,
- jalview.util.ImageMaker.TYPE.EPS,
+ im = new ImageMaker(this, ImageMaker.TYPE.EPS,
"Make EPS file from view", width, height, null,
this.getTitle());
}
else
{
- im = new jalview.util.ImageMaker(this,
- jalview.util.ImageMaker.TYPE.SVG, "Make SVG file from PCA",
+ im = new ImageMaker(this, ImageMaker.TYPE.SVG,
+ "Make SVG file from PCA",
width, height, null, this.getTitle());
}
{
try
{
- jalview.util.BrowserLauncher
+ BrowserLauncher
.openURL("http://jmol.sourceforge.net/docs/JmolUserGuide/");
} catch (Exception ex)
{
getContentPane().add(split, BorderLayout.CENTER);
varnaPanel.addSelectionListener(this);
- jalview.gui.Desktop.addInternalFrame(this, "", getBounds().width,
+ Desktop.addInternalFrame(this, "", getBounds().width,
getBounds().height);
this.pack();
showPanel(true);
_channelModel = new ChannelListModel();
// Construct our jalview news channel
Channel chan = new Channel();
- chan.setURL(jalview.bin.Cache.getDefault(
+ chan.setURL(Cache.getDefault(
"JALVIEW_NEWS_RSS",
- jalview.bin.Cache.getDefault("www.jalview.org",
+ Cache.getDefault("www.jalview.org",
"http://www.jalview.org") + "/feeds/desktop/rss"));
loadLastM();
_channelModel.addChannel(chan);
}
if (lastDate != null)
{
- jalview.bin.Cache.setDateProperty("JALVIEW_NEWS_RSS_LASTMODIFIED",
+ Cache.setDateProperty("JALVIEW_NEWS_RSS_LASTMODIFIED",
lastDate);
- jalview.bin.Cache.log.debug("Saved last read date as "
- + jalview.bin.Cache.date_format.format(lastDate));
+ Cache.log.debug("Saved last read date as "
+ + Cache.date_format.format(lastDate));
}
}
{
// this tests the detection of new news based on the last read date stored
// in jalview properties
- jalview.bin.Cache.loadProperties(null);
- jalview.bin.Cache.initLogger();
+ Cache.loadProperties(null);
+ Cache.initLogger();
// test will advance read date each time
Calendar today = Calendar.getInstance(), lastread = Calendar
.getInstance();
lastread.getTime());
BlogReader me = new BlogReader();
System.out.println("Set last date to "
- + jalview.bin.Cache.date_format.format(lastread.getTime()));
+ + Cache.date_format.format(lastread.getTime()));
if (me.isNewsNew())
{
Cache.log.debug("There is news to read.");
*/
package jalview.gui;
+import jalview.bin.Cache;
+import jalview.datamodel.Alignment;
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.ColumnSelection;
+import jalview.datamodel.PDBEntry;
+import jalview.datamodel.SequenceI;
+import jalview.ext.rbvi.chimera.JalviewChimeraBinding;
+import jalview.gui.StructureViewer.ViewerType;
+import jalview.io.AppletFormatAdapter;
+import jalview.io.JalviewFileChooser;
+import jalview.io.JalviewFileView;
+import jalview.schemes.BuriedColourScheme;
+import jalview.schemes.ColourSchemeI;
+import jalview.schemes.HelixColourScheme;
+import jalview.schemes.HydrophobicColourScheme;
+import jalview.schemes.PurinePyrimidineColourScheme;
+import jalview.schemes.StrandColourScheme;
+import jalview.schemes.TaylorColourScheme;
+import jalview.schemes.TurnColourScheme;
+import jalview.schemes.ZappoColourScheme;
+import jalview.structures.models.AAStructureBindingModel;
+import jalview.util.BrowserLauncher;
+import jalview.util.MessageManager;
+import jalview.util.Platform;
+import jalview.ws.dbsources.Pdb;
+
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import javax.swing.event.MenuEvent;
import javax.swing.event.MenuListener;
-import jalview.bin.Cache;
-import jalview.datamodel.Alignment;
-import jalview.datamodel.AlignmentI;
-import jalview.datamodel.ColumnSelection;
-import jalview.datamodel.PDBEntry;
-import jalview.datamodel.SequenceI;
-import jalview.ext.rbvi.chimera.JalviewChimeraBinding;
-import jalview.gui.StructureViewer.ViewerType;
-import jalview.io.AppletFormatAdapter;
-import jalview.io.JalviewFileChooser;
-import jalview.io.JalviewFileView;
-import jalview.schemes.BuriedColourScheme;
-import jalview.schemes.ColourSchemeI;
-import jalview.schemes.HelixColourScheme;
-import jalview.schemes.HydrophobicColourScheme;
-import jalview.schemes.PurinePyrimidineColourScheme;
-import jalview.schemes.StrandColourScheme;
-import jalview.schemes.TaylorColourScheme;
-import jalview.schemes.TurnColourScheme;
-import jalview.schemes.ZappoColourScheme;
-import jalview.structures.models.AAStructureBindingModel;
-import jalview.util.MessageManager;
-import jalview.util.Platform;
-import jalview.ws.dbsources.Pdb;
-
/**
* GUI elements for handling an external chimera display
*
void initChimera()
{
jmb.setFinishedInit(false);
- jalview.gui.Desktop.addInternalFrame(this, jmb.getViewerTitle("Chimera", true),
+ Desktop.addInternalFrame(this, jmb.getViewerTitle("Chimera", true),
getBounds().width, getBounds().height);
if (!jmb.launchChimera())
public void pdbFile_actionPerformed(ActionEvent actionEvent)
{
JalviewFileChooser chooser = new JalviewFileChooser(
- jalview.bin.Cache.getProperty("LAST_DIRECTORY"));
+ Cache.getProperty("LAST_DIRECTORY"));
chooser.setFileView(new JalviewFileView());
chooser.setDialogTitle(MessageManager.getString("label.save_pdb_file"));
@Override
public void viewMapping_actionPerformed(ActionEvent actionEvent)
{
- jalview.gui.CutAndPasteTransfer cap = new jalview.gui.CutAndPasteTransfer();
+ CutAndPasteTransfer cap = new CutAndPasteTransfer();
try
{
cap.appendText(jmb.printMappings());
cap.dispose();
return;
}
- jalview.gui.Desktop.addInternalFrame(cap,
+ Desktop.addInternalFrame(cap,
MessageManager.getString("label.pdb_sequence_mapping"), 550,
600);
}
{
try
{
- jalview.util.BrowserLauncher
+ BrowserLauncher
.openURL("https://www.cgl.ucsf.edu/chimera/docs/UsersGuide");
} catch (Exception ex)
{
*/
package jalview.gui;
-import java.awt.*;
-import java.awt.datatransfer.*;
-import java.awt.event.*;
+import jalview.bin.Cache;
+import jalview.io.JalviewFileChooser;
+import jalview.io.JalviewFileView;
+import jalview.jbgui.GCutAndPasteHtmlTransfer;
+import jalview.util.MessageManager;
+import jalview.viewmodel.AlignmentViewport;
+
+import java.awt.Toolkit;
+import java.awt.datatransfer.Clipboard;
+import java.awt.datatransfer.StringSelection;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
+import java.awt.event.MouseEvent;
import java.io.StringWriter;
-import javax.swing.*;
+import javax.swing.JMenuItem;
+import javax.swing.JPopupMenu;
+import javax.swing.SwingUtilities;
import javax.swing.event.HyperlinkEvent;
-import javax.swing.event.HyperlinkListener;
import javax.swing.event.HyperlinkEvent.EventType;
-
-import jalview.io.*;
-import jalview.jbgui.*;
-import jalview.util.MessageManager;
-import jalview.viewmodel.AlignmentViewport;
+import javax.swing.event.HyperlinkListener;
/**
* Cut'n'paste files into the desktop See JAL-1105
public void save_actionPerformed(ActionEvent e)
{
JalviewFileChooser chooser = new JalviewFileChooser(
- jalview.bin.Cache.getProperty("LAST_DIRECTORY"));
+ Cache.getProperty("LAST_DIRECTORY"));
chooser.setAcceptAllFileFilterUsed(false);
chooser.setFileView(new JalviewFileView());
import jalview.api.AlignmentViewPanel;
import jalview.api.ComplexAlignFile;
import jalview.api.FeaturesDisplayedI;
+import jalview.bin.Cache;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.ColumnSelection;
import jalview.datamodel.SequenceI;
public void save_actionPerformed(ActionEvent e)
{
JalviewFileChooser chooser = new JalviewFileChooser(
- jalview.bin.Cache.getProperty("LAST_DIRECTORY"));
+ Cache.getProperty("LAST_DIRECTORY"));
chooser.setAcceptAllFileFilterUsed(false);
chooser.setFileView(new JalviewFileView());
try
{
- af.setMaximum(jalview.bin.Cache.getDefault("SHOW_FULLSCREEN",
+ af.setMaximum(Cache.getDefault("SHOW_FULLSCREEN",
false));
} catch (Exception ex)
{
*/
package jalview.gui;
+import jalview.bin.Cache;
+import jalview.jbgui.GDasSourceBrowser;
+import jalview.util.MessageManager;
+import jalview.util.TableSorter;
+import jalview.ws.dbsources.das.api.DasSourceRegistryI;
+import jalview.ws.dbsources.das.api.jalviewSourceI;
+
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.MouseAdapter;
import org.biodas.jdas.schema.sources.PROP;
import org.biodas.jdas.schema.sources.VERSION;
-import jalview.jbgui.GDasSourceBrowser;
-import jalview.util.MessageManager;
-import jalview.util.TableSorter;
-import jalview.ws.dbsources.das.api.DasSourceRegistryI;
-import jalview.ws.dbsources.das.api.jalviewSourceI;
-
public class DasSourceBrowser extends GDasSourceBrowser implements
Runnable, ListSelectionListener
{
{
fs = featureSettings;
// TODO DasSourceRegistryProvider API
- sourceRegistry = jalview.bin.Cache.getDasSourceRegistry();
+ sourceRegistry = Cache.getDasSourceRegistry();
String registry = sourceRegistry.getDasRegistryURL();
registryURL.setText(registry);
public void refresh_actionPerformed(ActionEvent e)
{
- saveProperties(jalview.bin.Cache.applicationProperties);
+ saveProperties(Cache.applicationProperties);
Thread worker = new Thread(this);
worker.start();
void setSelectedFromProperties()
{
- String active = jalview.bin.Cache.getDefault("DAS_ACTIVE_SOURCE",
+ String active = Cache.getDefault("DAS_ACTIVE_SOURCE",
"uniprot");
StringTokenizer st = new StringTokenizer(active, "\t");
selectedSources = new Vector();
{
if (registryURL.getText() == null || registryURL.getText().length() < 1)
{
- properties.remove(jalview.bin.Cache.DAS_REGISTRY_URL);
+ properties.remove(Cache.DAS_REGISTRY_URL);
}
else
{
- properties.setProperty(jalview.bin.Cache.DAS_REGISTRY_URL,
+ properties.setProperty(Cache.DAS_REGISTRY_URL,
registryURL.getText());
}
}
}
- properties.setProperty(jalview.bin.Cache.DAS_ACTIVE_SOURCE,
+ properties.setProperty(Cache.DAS_ACTIVE_SOURCE,
sb.toString());
String sourceprop = sourceRegistry.getLocalSourceString();
- properties.setProperty(jalview.bin.Cache.DAS_LOCAL_SOURCE, sourceprop);
+ properties.setProperty(Cache.DAS_LOCAL_SOURCE, sourceprop);
}
class DASTableModel extends AbstractTableModel
import jalview.api.AlignViewportI;
import jalview.api.AlignmentViewPanel;
+import jalview.api.StructureSelectionManagerProvider;
import jalview.bin.Cache;
+import jalview.io.AppletFormatAdapter;
import jalview.io.FileLoader;
import jalview.io.FormatAdapter;
import jalview.io.IdentifyFile;
import jalview.io.JalviewFileChooser;
import jalview.io.JalviewFileView;
+import jalview.jbgui.GDesktop;
import jalview.jbgui.GSplitFrame;
import jalview.jbgui.GStructureViewer;
import jalview.structure.StructureSelectionManager;
+import jalview.util.BrowserLauncher;
import jalview.util.ImageMaker;
import jalview.util.MessageManager;
import jalview.viewmodel.AlignmentViewport;
* @author $author$
* @version $Revision: 1.155 $
*/
-public class Desktop extends jalview.jbgui.GDesktop implements
- DropTargetListener, ClipboardOwner, IProgressIndicator,
- jalview.api.StructureSelectionManagerProvider
+public class Desktop extends GDesktop implements
+ DropTargetListener,
+ ClipboardOwner, IProgressIndicator,
+ StructureSelectionManagerProvider
{
private JalviewChangeSupport changeSupport = new JalviewChangeSupport();
doVamsasClientCheck();
doGroovyCheck();
doConfigureStructurePrefs();
- setTitle("Jalview " + jalview.bin.Cache.getProperty("VERSION"));
+ setTitle("Jalview " + Cache.getProperty("VERSION"));
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- boolean selmemusage = jalview.bin.Cache.getDefault("SHOW_MEMUSAGE",
+ boolean selmemusage = Cache.getDefault("SHOW_MEMUSAGE",
false);
- boolean showjconsole = jalview.bin.Cache.getDefault(
+ boolean showjconsole = Cache.getDefault(
"SHOW_JAVA_CONSOLE", false);
desktop = new MyDesktopPane(selmemusage);
showMemusage.setSelected(selmemusage);
jconsole = new Console(this, showjconsole);
// add essential build information
jconsole.setHeader("Jalview Version: "
- + jalview.bin.Cache.getProperty("VERSION") + "\n"
+ + Cache.getProperty("VERSION") + "\n"
+ "Jalview Installation: "
- + jalview.bin.Cache.getDefault("INSTALLATION", "unknown")
+ + Cache.getDefault("INSTALLATION", "unknown")
+ "\n" + "Build Date: "
- + jalview.bin.Cache.getDefault("BUILD_DATE", "unknown") + "\n"
+ + Cache.getDefault("BUILD_DATE", "unknown") + "\n"
+ "Java version: " + System.getProperty("java.version") + "\n"
+ System.getProperty("os.arch") + " "
+ System.getProperty("os.name") + " "
{
Cache.log.debug("Filechooser init thread started.");
JalviewFileChooser chooser = new JalviewFileChooser(
- jalview.bin.Cache.getProperty("LAST_DIRECTORY"),
- jalview.io.AppletFormatAdapter.READABLE_EXTENSIONS,
- jalview.io.AppletFormatAdapter.READABLE_FNAMES,
- jalview.bin.Cache.getProperty("DEFAULT_FILE_FORMAT"));
+ Cache.getProperty("LAST_DIRECTORY"),
+ AppletFormatAdapter.READABLE_EXTENSIONS,
+ AppletFormatAdapter.READABLE_FNAMES,
+ Cache.getProperty("DEFAULT_FILE_FORMAT"));
Cache.log.debug("Filechooser init thread finished.");
}
}).start();
// configure services
StructureSelectionManager ssm = StructureSelectionManager
.getStructureSelectionManager(this);
- if (jalview.bin.Cache.getDefault(Preferences.ADD_SS_ANN, true))
+ if (Cache.getDefault(Preferences.ADD_SS_ANN, true))
{
- ssm.setAddTempFacAnnot(jalview.bin.Cache.getDefault(
+ ssm.setAddTempFacAnnot(Cache.getDefault(
Preferences.ADD_TEMPFACT_ANN, true));
- ssm.setProcessSecondaryStructure(jalview.bin.Cache.getDefault(
+ ssm.setProcessSecondaryStructure(Cache.getDefault(
Preferences.STRUCT_FROM_PDB, true));
- ssm.setSecStructServices(jalview.bin.Cache.getDefault(
+ ssm.setSecStructServices(Cache.getDefault(
Preferences.USE_RNAVIEW, true));
}
else
{
// TODO: lock aspect ratio for scaling desktop Bug #0058199
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
- String x = jalview.bin.Cache.getProperty(windowName + "SCREEN_X");
- String y = jalview.bin.Cache.getProperty(windowName + "SCREEN_Y");
- String width = jalview.bin.Cache.getProperty(windowName
+ String x = Cache.getProperty(windowName + "SCREEN_X");
+ String y = Cache.getProperty(windowName + "SCREEN_Y");
+ String width = Cache.getProperty(windowName
+ "SCREEN_WIDTH");
- String height = jalview.bin.Cache.getProperty(windowName
+ String height = Cache.getProperty(windowName
+ "SCREEN_HEIGHT");
if ((x != null) && (y != null) && (width != null) && (height != null))
{
int ix = Integer.parseInt(x), iy = Integer.parseInt(y), iw = Integer
.parseInt(width), ih = Integer.parseInt(height);
- if (jalview.bin.Cache.getProperty("SCREENGEOMETRY_WIDTH") != null)
+ if (Cache.getProperty("SCREENGEOMETRY_WIDTH") != null)
{
// attempt #1 - try to cope with change in screen geometry - this
// version doesn't preserve original jv aspect ratio.
// take ratio of current screen size vs original screen size.
double sw = ((1f * screenSize.width) / (1f * Integer
- .parseInt(jalview.bin.Cache
+ .parseInt(Cache
.getProperty("SCREENGEOMETRY_WIDTH"))));
double sh = ((1f * screenSize.height) / (1f * Integer
- .parseInt(jalview.bin.Cache
+ .parseInt(Cache
.getProperty("SCREENGEOMETRY_HEIGHT"))));
// rescale the bounds depending upon the current screen geometry.
ix = (int) (ix * sw);
ih = (int) (ih * sh);
while (ix >= screenSize.width)
{
- jalview.bin.Cache.log
+ Cache.log
.debug("Window geometry location recall error: shifting horizontal to within screenbounds.");
ix -= screenSize.width;
}
while (iy >= screenSize.height)
{
- jalview.bin.Cache.log
+ Cache.log
.debug("Window geometry location recall error: shifting vertical to within screenbounds.");
iy -= screenSize.height;
}
- jalview.bin.Cache.log.debug("Got last known dimensions for "
+ Cache.log.debug("Got last known dimensions for "
+ windowName + ": x:" + ix + " y:" + iy + " width:" + iw
+ " height:" + ih);
}
private void doVamsasClientCheck()
{
- if (jalview.bin.Cache.vamsasJarsPresent())
+ if (Cache.vamsasJarsPresent())
{
setupVamsasDisconnectedGui();
VamsasMenu.setVisible(true);
public void inputLocalFileMenuItem_actionPerformed(AlignViewport viewport)
{
JalviewFileChooser chooser = new JalviewFileChooser(
- jalview.bin.Cache.getProperty("LAST_DIRECTORY"),
- jalview.io.AppletFormatAdapter.READABLE_EXTENSIONS,
- jalview.io.AppletFormatAdapter.READABLE_FNAMES,
- jalview.bin.Cache.getProperty("DEFAULT_FILE_FORMAT"));
+ Cache.getProperty("LAST_DIRECTORY"),
+ AppletFormatAdapter.READABLE_EXTENSIONS,
+ AppletFormatAdapter.READABLE_FNAMES,
+ Cache.getProperty("DEFAULT_FILE_FORMAT"));
chooser.setFileView(new JalviewFileView());
chooser.setDialogTitle(MessageManager
if (value == JalviewFileChooser.APPROVE_OPTION)
{
String choice = chooser.getSelectedFile().getPath();
- jalview.bin.Cache.setProperty("LAST_DIRECTORY", chooser
+ Cache.setProperty("LAST_DIRECTORY", chooser
.getSelectedFile().getParent());
String format = null;
history.setEditable(true);
history.addItem("http://www.");
- String historyItems = jalview.bin.Cache.getProperty("RECENT_URL");
+ String historyItems = Cache.getProperty("RECENT_URL");
StringTokenizer st;
public void quit()
{
Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
- jalview.bin.Cache
+ Cache
.setProperty("SCREENGEOMETRY_WIDTH", screen.width + "");
- jalview.bin.Cache.setProperty("SCREENGEOMETRY_HEIGHT", screen.height
+ Cache.setProperty("SCREENGEOMETRY_HEIGHT", screen.height
+ "");
storeLastKnownDimensions("", new Rectangle(getBounds().x,
getBounds().y, getWidth(), getHeight()));
private void storeLastKnownDimensions(String string, Rectangle jc)
{
- jalview.bin.Cache.log.debug("Storing last known dimensions for "
+ Cache.log.debug("Storing last known dimensions for "
+ string + ": x:" + jc.x + " y:" + jc.y + " width:" + jc.width
+ " height:" + jc.height);
- jalview.bin.Cache.setProperty(string + "SCREEN_X", jc.x + "");
- jalview.bin.Cache.setProperty(string + "SCREEN_Y", jc.y + "");
- jalview.bin.Cache.setProperty(string + "SCREEN_WIDTH", jc.width + "");
- jalview.bin.Cache.setProperty(string + "SCREEN_HEIGHT", jc.height + "");
+ Cache.setProperty(string + "SCREEN_X", jc.x + "");
+ Cache.setProperty(string + "SCREEN_Y", jc.y + "");
+ Cache.setProperty(string + "SCREEN_WIDTH", jc.width + "");
+ Cache.setProperty(string + "SCREEN_HEIGHT", jc.height + "");
}
/**
if (shortv)
{
message.append("<h1><strong>Version: "
- + jalview.bin.Cache.getProperty("VERSION") + "</strong></h1>");
+ + Cache.getProperty("VERSION") + "</strong></h1>");
message.append("<strong>Last Updated: <em>"
- + jalview.bin.Cache.getDefault("BUILD_DATE", "unknown")
+ + Cache.getDefault("BUILD_DATE", "unknown")
+ "</em></strong>");
}
{
message.append("<strong>Version "
- + jalview.bin.Cache.getProperty("VERSION")
+ + Cache.getProperty("VERSION")
+ "; last updated: "
- + jalview.bin.Cache.getDefault("BUILD_DATE", "unknown"));
+ + Cache.getDefault("BUILD_DATE", "unknown"));
}
- if (jalview.bin.Cache.getDefault("LATEST_VERSION", "Checking").equals(
+ if (Cache.getDefault("LATEST_VERSION", "Checking").equals(
"Checking"))
{
message.append("<br>...Checking latest version...</br>");
}
- else if (!jalview.bin.Cache.getDefault("LATEST_VERSION", "Checking")
- .equals(jalview.bin.Cache.getProperty("VERSION")))
+ else if (!Cache.getDefault("LATEST_VERSION", "Checking")
+ .equals(Cache.getProperty("VERSION")))
{
boolean red = false;
- if (jalview.bin.Cache.getProperty("VERSION").toLowerCase()
+ if (Cache.getProperty("VERSION").toLowerCase()
.indexOf("automated build") == -1)
{
red = true;
}
message.append("<br>!! Version "
- + jalview.bin.Cache.getDefault("LATEST_VERSION",
+ + Cache.getDefault("LATEST_VERSION",
"..Checking..")
+ " is available for download from "
- + jalview.bin.Cache.getDefault("www.jalview.org",
+ + Cache.getDefault("www.jalview.org",
"http://www.jalview.org") + " !!");
if (red)
{
}
}
message.append("<br>Authors: "
- + jalview.bin.Cache
+ + Cache
.getDefault("AUTHORFNAMES",
"The Jalview Authors (See AUTHORS file for current list)")
+ "<br><br>Development managed by The Barton Group, University of Dundee, Scotland, UK.<br>"
protected void garbageCollect_actionPerformed(ActionEvent e)
{
// We simply collect the garbage
- jalview.bin.Cache.log.debug("Collecting garbage...");
+ Cache.log.debug("Collecting garbage...");
System.gc();
- jalview.bin.Cache.log.debug("Finished garbage collection.");
+ Cache.log.debug("Finished garbage collection.");
}
/*
public void saveState_actionPerformed(ActionEvent e)
{
JalviewFileChooser chooser = new JalviewFileChooser(
- jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[]
+ Cache.getProperty("LAST_DIRECTORY"), new String[]
{ "jvp" }, new String[]
{ "Jalview Project" }, "Jalview Project");
setProgressBar(MessageManager.formatMessage(
"label.saving_jalview_project", new Object[]
{ choice.getName() }), choice.hashCode());
- jalview.bin.Cache.setProperty("LAST_DIRECTORY",
+ Cache.setProperty("LAST_DIRECTORY",
choice.getParent());
// TODO catch and handle errors for savestate
// TODO prevent user from messing with the Desktop whilst we're saving
public void loadState_actionPerformed(ActionEvent e)
{
JalviewFileChooser chooser = new JalviewFileChooser(
- jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[]
+ Cache.getProperty("LAST_DIRECTORY"), new String[]
{ "jvp", "jar" }, new String[]
{ "Jalview Project", "Jalview Project (old)" },
"Jalview Project");
final File selectedFile = chooser.getSelectedFile();
setProjectFile(selectedFile);
final String choice = selectedFile.getAbsolutePath();
- jalview.bin.Cache.setProperty("LAST_DIRECTORY",
+ Cache.setProperty("LAST_DIRECTORY",
selectedFile.getParent());
new Thread(new Runnable()
{
}
- jalview.gui.VamsasApplication v_client = null;
+ VamsasApplication v_client = null;
public void vamsasImport_actionPerformed(ActionEvent e)
{
{
// Load and try to start a session.
JalviewFileChooser chooser = new JalviewFileChooser(
- jalview.bin.Cache.getProperty("LAST_DIRECTORY"));
+ Cache.getProperty("LAST_DIRECTORY"));
chooser.setFileView(new JalviewFileView());
chooser.setDialogTitle(MessageManager
}
else
{
- jalview.bin.Cache.log
+ Cache.log
.error("Implementation error - load session from a running session is not supported.");
}
}
/**
- * import file into a new vamsas session (uses jalview.gui.VamsasApplication)
+ * import file into a new vamsas session (uses VamsasApplication)
*
* @param file
* @return true if import was a success and a session was started.
if (v_client != null)
{
- jalview.bin.Cache.log
+ Cache.log
.error("Implementation error - load session from a running session is not supported.");
return false;
}
}
bis.close();
fos.close();
- v_client = new jalview.gui.VamsasApplication(this, file,
+ v_client = new VamsasApplication(this, file,
url.toExternalForm());
} catch (Exception ex)
{
- jalview.bin.Cache.log.error(
+ Cache.log.error(
"Failed to create new vamsas session from contents of URL "
+ url, ex);
return false;
}
/**
- * import file into a new vamsas session (uses jalview.gui.VamsasApplication)
+ * import file into a new vamsas session (uses VamsasApplication)
*
* @param file
* @return true if import was a success and a session was started.
if (v_client != null)
{
- jalview.bin.Cache.log
+ Cache.log
.error("Implementation error - load session from a running session is not supported.");
return false;
}
{ file.getName() }), file.hashCode());
try
{
- v_client = new jalview.gui.VamsasApplication(this, file, null);
+ v_client = new VamsasApplication(this, file, null);
} catch (Exception ex)
{
setProgressBar(MessageManager.formatMessage(
"status.importing_vamsas_session_from", new Object[]
{ file.getName() }), file.hashCode());
- jalview.bin.Cache.log.error(
+ Cache.log.error(
"New vamsas session from existing session file failed:", ex);
return false;
}
// Start a session.
// we just start a default session for moment.
/*
- * JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache.
+ * JalviewFileChooser chooser = new JalviewFileChooser(Cache.
* getProperty("LAST_DIRECTORY"));
*
* chooser.setFileView(new JalviewFileView());
* int value = chooser.showOpenDialog(this);
*
* if (value == JalviewFileChooser.APPROVE_OPTION) { v_client = new
- * jalview.gui.VamsasApplication(this, chooser.getSelectedFile());
+ * VamsasApplication(this, chooser.getSelectedFile());
*/
v_client = new VamsasApplication(this);
setupVamsasConnectedGui();
sess = VamsasApplication.getSessionList();
} catch (Exception e)
{
- jalview.bin.Cache.log.warn(
+ Cache.log.warn(
"Problem getting current sessions list.", e);
sess = null;
}
if (sess != null)
{
- jalview.bin.Cache.log.debug("Got current sessions list: "
+ Cache.log.debug("Got current sessions list: "
+ sess.length + " entries.");
VamsasStMenu.removeAll();
for (int i = 0; i < sess.length; i++)
}
else
{
- jalview.bin.Cache.log.debug("No current vamsas sessions.");
+ Cache.log.debug("No current vamsas sessions.");
VamsasStMenu.removeAll();
VamsasStMenu.setVisible(false);
}
if (v_client != null)
{
JalviewFileChooser chooser = new JalviewFileChooser(
- jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[]
+ Cache.getProperty("LAST_DIRECTORY"), new String[]
{ "vdj" }, // TODO: VAMSAS DOCUMENT EXTENSION is VDJ
new String[]
{ "Vamsas Document" }, "Vamsas Document");
JPanel progpanel = addProgressPanel(MessageManager.formatMessage(
"label.saving_vamsas_doc", new Object[]
{ choice.getName() }));
- jalview.bin.Cache.setProperty("LAST_DIRECTORY", choice.getParent());
+ Cache.setProperty("LAST_DIRECTORY", choice.getParent());
String warnmsg = null;
String warnttl = null;
try
{
warnttl = "Serious Problem saving Vamsas Document";
warnmsg = ex.toString();
- jalview.bin.Cache.log.error("Error Whilst saving document to "
+ Cache.log.error("Error Whilst saving document to "
+ choice, ex);
} catch (Exception ex)
{
warnttl = "Problem saving Vamsas Document.";
warnmsg = ex.toString();
- jalview.bin.Cache.log.warn("Exception Whilst saving document to "
+ Cache.log.warn("Exception Whilst saving document to "
+ choice, ex);
}
*/
public void setVamsasUpdate(boolean b)
{
- jalview.bin.Cache.log.debug("Setting gui for Vamsas update "
+ Cache.log.debug("Setting gui for Vamsas update "
+ (b ? "in progress" : "finished"));
if (vamUpdate != null)
public void doGroovyCheck()
{
- if (jalview.bin.Cache.groovyJarsPresent())
+ if (Cache.groovyJarsPresent())
{
groovyShell = new JMenuItem();
groovyShell.setText(MessageManager.getString("label.groovy_console"));
public void groovyShell_actionPerformed(ActionEvent e)
{
// use reflection to avoid creating compilation dependency.
- if (!jalview.bin.Cache.groovyJarsPresent())
+ if (!Cache.groovyJarsPresent())
{
throw new Error(
MessageManager
run.invoke(gc);
} catch (Exception ex)
{
- jalview.bin.Cache.log.error("Groovy Shell Creation failed.", ex);
+ Cache.log.error("Groovy Shell Creation failed.", ex);
JOptionPane.showInternalMessageDialog(Desktop.desktop,
MessageManager.getString("label.couldnt_create_groovy_shell"),
"status.opening_params", new Object[]
{ url }), this.hashCode());
}
- jalview.util.BrowserLauncher.openURL(url);
+ BrowserLauncher.openURL(url);
} catch (Exception ex)
{
JOptionPane.showInternalMessageDialog(Desktop.desktop,
{
invalidate();
File of;
- ImageMaker im = new jalview.util.ImageMaker(this, ImageMaker.TYPE.EPS,
+ ImageMaker im = new ImageMaker(this, ImageMaker.TYPE.EPS,
"View of Desktop", getWidth(), getHeight(), of = new File(
"Jalview_snapshot" + System.currentTimeMillis()
+ ".eps"), "View of desktop");
*/
package jalview.gui;
+import jalview.bin.Cache;
import jalview.util.MessageManager;
-import java.awt.*;
-import java.awt.event.*;
-import javax.swing.*;
+import java.awt.BorderLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.BorderFactory;
+import javax.swing.ButtonGroup;
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JDialog;
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
public class EPSOptions extends JPanel
{
if (!askAgain.isSelected())
{
- jalview.bin.Cache.applicationProperties.remove("EPS_RENDERING");
+ Cache.applicationProperties.remove("EPS_RENDERING");
}
else
{
- jalview.bin.Cache.setProperty("EPS_RENDERING", value);
+ Cache.setProperty("EPS_RENDERING", value);
}
dialog.setVisible(false);
*/
package jalview.gui;
-import java.util.*;
-
-import java.awt.*;
-import java.awt.event.*;
-import javax.swing.*;
-import javax.swing.border.LineBorder;
-import javax.swing.event.*;
-
-import jalview.datamodel.*;
-import jalview.schemes.*;
+import jalview.datamodel.GraphLine;
+import jalview.schemes.AnnotationColourGradient;
+import jalview.schemes.GraduatedColor;
import jalview.util.MessageManager;
+import java.awt.BorderLayout;
+import java.awt.Color;
import java.awt.Dimension;
+import java.awt.FlowLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.util.Hashtable;
+
+import javax.swing.BorderFactory;
+import javax.swing.JCheckBox;
+import javax.swing.JColorChooser;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JSlider;
+import javax.swing.JTextField;
+import javax.swing.border.LineBorder;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
public class FeatureColourChooser extends JalviewDialog
{
{
if (!adjusting)
{
- thresholdValue.setText(((float) slider.getValue() / 1000f) + "");
+ thresholdValue.setText((slider.getValue() / 1000f) + "");
valueChanged();
}
}
: 2);
slider.setEnabled(true);
thresholdValue.setEnabled(true);
- threshline = new jalview.datamodel.GraphLine((max - min) / 2f,
+ threshline = new GraphLine((max - min) / 2f,
"Threshold", Color.black);
}
&& threshline == null)
{
// todo visual indication of feature threshold
- threshline = new jalview.datamodel.GraphLine((max - min) / 2f,
+ threshline = new GraphLine((max - min) / 2f,
"Threshold", Color.black);
}
public void valueChanged()
{
- threshline.value = (float) slider.getValue() / 1000f;
+ threshline.value = slider.getValue() / 1000f;
cs.setThresh(threshline.value);
changeColour();
ap.paintAlignment(false);
import jalview.datamodel.SearchResults;
import jalview.datamodel.SequenceFeature;
import jalview.datamodel.SequenceI;
+import jalview.io.FeaturesFile;
import jalview.schemes.GraduatedColor;
+import jalview.schemes.UserColourScheme;
import jalview.util.MessageManager;
import java.awt.BorderLayout;
Object col = getFeatureStyle(name.getText());
if (col == null)
{
- col = new jalview.schemes.UserColourScheme()
+ col = new UserColourScheme()
.createColourFromName(name.getText());
}
oldcol = fcol = col;
bigPanel, title, JOptionPane.YES_NO_CANCEL_OPTION,
JOptionPane.QUESTION_MESSAGE, null, options, MessageManager.getString("action.ok"));
- jalview.io.FeaturesFile ffile = new jalview.io.FeaturesFile();
+ FeaturesFile ffile = new FeaturesFile();
if (reply == JOptionPane.OK_OPTION && name.getText().length() > 0)
{
import jalview.datamodel.SequenceI;
import jalview.gui.Help.HelpId;
import jalview.io.JalviewFileChooser;
+import jalview.io.JalviewFileView;
import jalview.schemes.AnnotationColourGradient;
import jalview.schemes.GraduatedColor;
+import jalview.util.Format;
import jalview.util.MessageManager;
+import jalview.util.Platform;
+import jalview.util.QuickSort;
import jalview.viewmodel.AlignmentViewport;
+import jalview.ws.DasSequenceFeatureFetcher;
import jalview.ws.dbsources.das.api.jalviewSourceI;
import java.awt.BorderLayout;
{
DasSourceBrowser dassourceBrowser;
- jalview.ws.DasSequenceFeatureFetcher dasFeatureFetcher;
+ DasSequenceFeatureFetcher dasFeatureFetcher;
JPanel settingsPane = new JPanel();
frame = new JInternalFrame();
frame.setContentPane(this);
- if (new jalview.util.Platform().isAMac())
+ if (Platform.isAMac())
{
Desktop.addInternalFrame(frame,
MessageManager.getString("label.sequence_feature_settings"),
}
if (sort)
{
- jalview.util.QuickSort.sortFloat(order, data);
+ QuickSort.sortFloat(order, data);
}
}
void load()
{
JalviewFileChooser chooser = new JalviewFileChooser(
- jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[]
+ Cache.getProperty("LAST_DIRECTORY"), new String[]
{ "fc" }, new String[]
{ "Sequence Feature Colours" }, "Sequence Feature Colours");
- chooser.setFileView(new jalview.io.JalviewFileView());
+ chooser.setFileView(new JalviewFileView());
chooser.setDialogTitle(MessageManager.getString("label.load_feature_colours"));
chooser.setToolTipText(MessageManager.getString("action.load"));
void save()
{
JalviewFileChooser chooser = new JalviewFileChooser(
- jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[]
+ Cache.getProperty("LAST_DIRECTORY"), new String[]
{ "fc" }, new String[]
{ "Sequence Feature Colours" }, "Sequence Feature Colours");
- chooser.setFileView(new jalview.io.JalviewFileView());
+ chooser.setFileView(new JalviewFileView());
chooser.setDialogTitle(MessageManager.getString("label.save_feature_colours"));
chooser.setToolTipText(MessageManager.getString("action.save"));
sortOrder[i] = fr.getOrder(sortTypes[i]);
i++;
}
- jalview.util.QuickSort.sortFloat(sortOrder, sortTypes);
+ QuickSort.sortFloat(sortOrder, sortTypes);
sortOrder = null;
Object fcol;
GraduatedColor gcol;
{
jalview.schemabinding.version2.Colour col = new jalview.schemabinding.version2.Colour();
col.setName(sortTypes[i]);
- col.setRGB(jalview.util.Format.getHexString(fr.getColour(col
+ col.setRGB(Format.getHexString(fr.getColour(col
.getName())));
fcol = fr.getFeatureStyle(sortTypes[i]);
if (fcol instanceof GraduatedColor)
gcol = (GraduatedColor) fcol;
col.setMin(gcol.getMin());
col.setMax(gcol.getMax());
- col.setMinRGB(jalview.util.Format.getHexString(gcol
+ col.setMinRGB(Format.getHexString(gcol
.getMinColor()));
col.setAutoScale(gcol.isAutoScale());
col.setThreshold(gcol.getThresh());
}
if (sort)
{
- jalview.util.QuickSort.sortFloat(width, data);
+ QuickSort.sortFloat(width, data);
// update global priority order
}
}
cancelDAS.setEnabled(true);
- dasFeatureFetcher = new jalview.ws.DasSequenceFeatureFetcher(dataset,
+ dasFeatureFetcher = new DasSequenceFeatureFetcher(dataset,
this, selectedSources, checkDbRefs, promptFetchDbRefs);
af.getViewport().setShowSequenceFeatures(true);
af.showSeqFeatures.setSelected(true);
public void saveDAS_actionPerformed(ActionEvent e)
{
dassourceBrowser
- .saveProperties(jalview.bin.Cache.applicationProperties);
+ .saveProperties(Cache.applicationProperties);
}
public void complete()
package jalview.gui;
+import jalview.bin.Cache;
import jalview.util.MessageManager;
import java.awt.BorderLayout;
if (!askAgain.isSelected())
{
- jalview.bin.Cache.applicationProperties.remove("HTML_RENDERING");
+ Cache.applicationProperties.remove("HTML_RENDERING");
}
else
{
- jalview.bin.Cache.setProperty("HTML_RENDERING", value);
+ Cache.setProperty("HTML_RENDERING", value);
}
dialog.setVisible(false);
*/
package jalview.gui;
+import jalview.bin.Cache;
import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceFeature;
import jalview.datamodel.SequenceGroup;
import jalview.datamodel.SequenceI;
import jalview.io.SequenceAnnotationReport;
+import jalview.util.BrowserLauncher;
import jalview.util.MessageManager;
import jalview.util.UrlLink;
import jalview.viewmodel.AlignmentViewport;
// DEFAULT LINK IS FIRST IN THE LINK LIST
// BUT IF ITS A REGEX AND DOES NOT MATCH THE NEXT ONE WILL BE TRIED
url = links.elementAt(i++).toString();
- jalview.util.UrlLink urlLink = null;
+ UrlLink urlLink = null;
try
{
urlLink = new UrlLink(url);
} catch (Exception foo)
{
- jalview.bin.Cache.log.error("Exception for URLLink '" + url + "'",
+ Cache.log.error("Exception for URLLink '" + url + "'",
foo);
url = null;
continue;
;
if (!urlLink.isValid())
{
- jalview.bin.Cache.log.error(urlLink.getInvalidMessage());
+ Cache.log.error(urlLink.getInvalidMessage());
url = null;
continue;
}
}
try
{
- jalview.util.BrowserLauncher.openURL(url);
+ BrowserLauncher.openURL(url);
} catch (Exception ex)
{
JOptionPane
}
}
- jalview.gui.PopupMenu pop = new jalview.gui.PopupMenu(alignPanel, sq,
+ PopupMenu pop = new PopupMenu(alignPanel, sq,
nlinks, new Vector(Preferences.getGroupURLLinks()));
pop.show(this, e.getX(), e.getY());
import jalview.bin.Cache;
import jalview.util.MessageManager;
+import jalview.util.QuickSort;
import jalview.ws.seqfetcher.DbSourceProxy;
import java.awt.BorderLayout;
throw new Error(MessageManager.getString("error.implementation_error_cant_reorder_tree"));
}
}
- jalview.util.QuickSort.sort(names, nodes);
+ QuickSort.sort(names, nodes);
root.removeAllChildren();
for (int i = count - 1; i >= 0; i--)
{
*/
package jalview.gui;
+import jalview.analysis.AlignSeq;
import jalview.api.structures.JalviewStructureDisplayI;
import jalview.bin.Cache;
import jalview.datamodel.AlignedCodonFrame;
import jalview.datamodel.StructureViewerModel.StructureData;
import jalview.ext.varna.RnaModel;
import jalview.gui.StructureViewer.ViewerType;
+import jalview.io.AppletFormatAdapter;
import jalview.schemabinding.version2.AlcodMap;
import jalview.schemabinding.version2.AlcodonFrame;
import jalview.schemabinding.version2.Annotation;
import jalview.schemes.UserColourScheme;
import jalview.structure.StructureSelectionManager;
import jalview.structures.models.AAStructureBindingModel;
+import jalview.util.Comparison;
+import jalview.util.MapList;
import jalview.util.MessageManager;
import jalview.util.Platform;
import jalview.util.jarInputStreamProvider;
object.setVamsasModel(new jalview.schemabinding.version2.VamsasModel());
object.setCreationDate(new java.util.Date(System.currentTimeMillis()));
- object.setVersion(jalview.bin.Cache.getDefault("VERSION",
+ object.setVersion(Cache.getDefault("VERSION",
"Development Build"));
- jalview.datamodel.AlignmentI jal = av.getAlignment();
+ AlignmentI jal = av.getAlignment();
if (av.hasHiddenRows())
{
{
mp = new Mapping();
- jalview.util.MapList mlst = jmp.getMap();
+ MapList mlst = jmp.getMap();
List<int[]> r = mlst.getFromRanges();
for (int[] range : r)
{
mpc.setDseqFor(jmpid);
if (!seqRefIds.containsKey(mpc.getDseqFor()))
{
- jalview.bin.Cache.log.debug("creatign new DseqFor ID");
+ Cache.log.debug("creatign new DseqFor ID");
seqRefIds.put(mpc.getDseqFor(), ps);
}
else
{
- jalview.bin.Cache.log.debug("reusing DseqFor ID");
+ Cache.log.debug("reusing DseqFor ID");
}
}
mp.setMappingChoice(mpc);
/**
* persisted version of annotation row from which to take vis properties
*/
- public jalview.datamodel.AlignmentAnnotation template;
+ public AlignmentAnnotation template;
/**
* original position of the annotation row in the alignment
}
}
}
- jalview.datamodel.AlignmentAnnotation jaa = null;
+ AlignmentAnnotation jaa = null;
if (annotation.getGraph())
{
// if (autoForView || an[i].isAutoCalculated()) {
// hlim=11f;
// }
- jaa = new jalview.datamodel.AlignmentAnnotation(
+ jaa = new AlignmentAnnotation(
annotation.getLabel(), annotation.getDescription(), anot,
llim, hlim, annotation.getGraphType());
}
else
{
- jaa = new jalview.datamodel.AlignmentAnnotation(an[i].getLabel(),
+ jaa = new AlignmentAnnotation(an[i].getLabel(),
an[i].getDescription(), anot);
jaa._linecolour = firstColour;
}
// and make a note of any group association
if (an[i].getGroupRef() != null && an[i].getGroupRef().length() > 0)
{
- List<jalview.datamodel.AlignmentAnnotation> aal = groupAnnotRefs
+ List<AlignmentAnnotation> aal = groupAnnotRefs
.get(an[i].getGroupRef());
if (aal == null)
{
- aal = new ArrayList<jalview.datamodel.AlignmentAnnotation>();
+ aal = new ArrayList<AlignmentAnnotation>();
groupAnnotRefs.put(an[i].getGroupRef(), aal);
}
aal.add(jaa);
String pdbFile = filedat.getFilePath();
SequenceI[] seq = filedat.getSeqList().toArray(new SequenceI[0]);
binding.getSsm().setMapping(seq, null, pdbFile,
- jalview.io.AppletFormatAdapter.FILE);
+ AppletFormatAdapter.FILE);
binding.addSequenceForStructFile(pdbFile, seq);
}
// and add the AlignmentPanel's reference to the view panel
List<String> remains = new ArrayList<String>(visan.keySet());
for (int h = 0; h < hSize; h++)
{
- jalview.datamodel.AlignmentAnnotation jalan = al
+ AlignmentAnnotation jalan = al
.getAlignmentAnnotation()[h];
if (jalan.autoCalculated)
{
if (sq != dsq)
{
// StringBuffer sb = new StringBuffer();
- String newres = jalview.analysis.AlignSeq.extractGaps(
- jalview.util.Comparison.GapChars, sq.getSequenceAsString());
+ String newres = AlignSeq.extractGaps(
+ Comparison.GapChars, sq.getSequenceAsString());
if (!newres.equalsIgnoreCase(dsq.getSequenceAsString())
&& newres.length() > dsq.getLength())
{
seqRefIds.put(sqid, djs);
}
- jalview.bin.Cache.log.debug("about to recurse on addDBRefs.");
+ Cache.log.debug("about to recurse on addDBRefs.");
addDBRefs(djs, ms);
}
seqRefIds.put(jv2vobj.get(jvobj).toString(), (SequenceI) jvobj);
seqsToIds.put((SequenceI) jvobj, id);
}
- else if (jvobj instanceof jalview.datamodel.AlignmentAnnotation)
+ else if (jvobj instanceof AlignmentAnnotation)
{
String anid;
AlignmentAnnotation jvann = (AlignmentAnnotation) jvobj;
*/
package jalview.gui;
+import jalview.analysis.Conservation;
import jalview.binding.Annotation;
import jalview.binding.AnnotationElement;
import jalview.binding.Features;
import jalview.binding.Tree;
import jalview.binding.UserColours;
import jalview.binding.Viewport;
+import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.PDBEntry;
import jalview.schemes.ColourSchemeI;
import jalview.schemes.ColourSchemeProperty;
import jalview.schemes.ResidueProperties;
+import jalview.schemes.UserColourScheme;
import jalview.structure.StructureSelectionManager;
import jalview.util.MessageManager;
import jalview.util.jarInputStreamProvider;
this.raiseGUI = raiseGUI;
};
- jalview.schemes.UserColourScheme GetUserColourScheme(
- JalviewModelSequence jms, String id)
+ UserColourScheme GetUserColourScheme(JalviewModelSequence jms, String id)
{
UserColours[] uc = jms.getUserColours();
UserColours colours = null;
.getUserColourScheme().getColour(i).getRGB(), 16));
}
- return new jalview.schemes.UserColourScheme(newColours);
+ return new UserColourScheme(newColours);
}
/**
public AlignFrame LoadJalviewAlign(final jarInputStreamProvider jprovider)
{
final String file = jprovider.getFilename();
- jalview.gui.AlignFrame af = null;
+ AlignFrame af = null;
try
{
ae[aa].getValue());
}
- jalview.datamodel.AlignmentAnnotation jaa = null;
+ AlignmentAnnotation jaa = null;
if (an[i].getGraph())
{
- jaa = new jalview.datamodel.AlignmentAnnotation(an[i].getLabel(),
+ jaa = new AlignmentAnnotation(an[i].getLabel(),
an[i].getDescription(), anot, 0, 0,
- jalview.datamodel.AlignmentAnnotation.BAR_GRAPH);
+ AlignmentAnnotation.BAR_GRAPH);
}
else
{
- jaa = new jalview.datamodel.AlignmentAnnotation(an[i].getLabel(),
+ jaa = new AlignmentAnnotation(an[i].getLabel(),
an[i].getDescription(), anot);
}
if (groups[i].getConsThreshold() != 0)
{
- jalview.analysis.Conservation c = new jalview.analysis.Conservation(
+ Conservation c = new Conservation(
"All", ResidueProperties.propHash, 3,
sg.getSequences(null), 0, sg.getWidth() - 1);
c.calculate();
*/
package jalview.gui;
+import jalview.bin.Cache;
import jalview.util.MessageManager;
import java.awt.Component;
desktop = instance;
if (oomex != null)
{
- if (jalview.bin.Cache.log != null)
+ if (Cache.log != null)
{
- jalview.bin.Cache.log
+ Cache.log
.error("Out of Memory when " + action, oomex);
}
else
*/
package jalview.gui;
+import jalview.datamodel.SequenceI;
import jalview.renderer.AnnotationRenderer;
import java.awt.Color;
int lastcol = -1, lastrow = -1;
int color = Color.white.getRGB();
int row, col;
- jalview.datamodel.SequenceI seq;
+ SequenceI seq;
final boolean hasHiddenRows = av.hasHiddenRows(), hasHiddenCols = av
.hasHiddenColumns();
boolean hiddenRow = false;
*/
package jalview.gui;
+import jalview.bin.Cache;
+import jalview.datamodel.Alignment;
+import jalview.datamodel.AlignmentView;
+import jalview.datamodel.ColumnSelection;
+import jalview.datamodel.SeqCigar;
+import jalview.datamodel.SequenceI;
+import jalview.jbgui.GPCAPanel;
+import jalview.schemes.ResidueProperties;
+import jalview.util.ImageMaker;
+import jalview.util.MessageManager;
+import jalview.viewmodel.AlignmentViewport;
+import jalview.viewmodel.PCAModel;
+
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JOptionPane;
import javax.swing.JRadioButtonMenuItem;
-import jalview.datamodel.Alignment;
-import jalview.datamodel.AlignmentView;
-import jalview.datamodel.ColumnSelection;
-import jalview.datamodel.SeqCigar;
-import jalview.datamodel.SequenceI;
-import jalview.jbgui.GPCAPanel;
-import jalview.schemes.ResidueProperties;
-import jalview.util.MessageManager;
-import jalview.viewmodel.AlignmentViewport;
-import jalview.viewmodel.PCAModel;
-
/**
* DOCUMENT ME!
*
// make this an abstract function of all jalview analysis windows
if (pcaModel.getSeqtrings() == null)
{
- jalview.bin.Cache.log
+ Cache.log
.info("Unexpected call to originalSeqData_actionPerformed - should have hidden this menu action.");
return;
}
*/
public void eps_actionPerformed(ActionEvent e)
{
- makePCAImage(jalview.util.ImageMaker.TYPE.EPS);
+ makePCAImage(ImageMaker.TYPE.EPS);
}
/**
*/
public void png_actionPerformed(ActionEvent e)
{
- makePCAImage(jalview.util.ImageMaker.TYPE.PNG);
+ makePCAImage(ImageMaker.TYPE.PNG);
}
- void makePCAImage(jalview.util.ImageMaker.TYPE type)
+ void makePCAImage(ImageMaker.TYPE type)
{
int width = rc.getWidth();
int height = rc.getHeight();
- jalview.util.ImageMaker im;
+ ImageMaker im;
- if (type == jalview.util.ImageMaker.TYPE.PNG)
+ if (type == ImageMaker.TYPE.PNG)
{
- im = new jalview.util.ImageMaker(this,
- jalview.util.ImageMaker.TYPE.PNG,
+ im = new ImageMaker(this, ImageMaker.TYPE.PNG,
"Make PNG image from PCA", width, height, null, null);
}
- else if (type == jalview.util.ImageMaker.TYPE.EPS)
+ else if (type == ImageMaker.TYPE.EPS)
{
- im = new jalview.util.ImageMaker(this,
- jalview.util.ImageMaker.TYPE.EPS,
+ im = new ImageMaker(this, ImageMaker.TYPE.EPS,
"Make EPS file from PCA", width, height, null,
this.getTitle());
}
else
{
- im = new jalview.util.ImageMaker(this,
- jalview.util.ImageMaker.TYPE.SVG, "Make SVG file from PCA",
+ im = new ImageMaker(this, ImageMaker.TYPE.SVG,
+ "Make SVG file from PCA",
width, height, null, this.getTitle());
}
import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceI;
import jalview.jbgui.GPairwiseAlignPanel;
+import jalview.util.Format;
import jalview.util.MessageManager;
import jalview.viewmodel.AlignmentViewport;
for (int i = 0; i < count; i++)
{
- jalview.util.Format.print(System.out, "%s \n", ("" + i) + " "
- + seqs[i].getName());
+ Format.print(System.out, "%s \n",
+ ("" + i) + " " + seqs[i].getName());
}
System.out.println("\n");
{
for (int j = 0; j < i; j++)
{
- jalview.util.Format.printDouble(System.out, "%7.3f", scores[i][j]
- / totscore);
+ Format.printDouble(System.out, "%7.3f", scores[i][j] / totscore);
}
}
*/
package jalview.gui;
-import java.awt.Color;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Hashtable;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.TreeMap;
-import java.util.Vector;
-
-import javax.swing.ButtonGroup;
-import javax.swing.JCheckBoxMenuItem;
-import javax.swing.JColorChooser;
-import javax.swing.JMenu;
-import javax.swing.JMenuItem;
-import javax.swing.JOptionPane;
-import javax.swing.JPopupMenu;
-import javax.swing.JRadioButtonMenuItem;
-
import jalview.analysis.AAFrequency;
import jalview.analysis.AlignmentAnnotationUtils;
import jalview.analysis.AlignmentUtils;
import jalview.analysis.Conservation;
+import jalview.bin.Cache;
import jalview.commands.ChangeCaseCommand;
import jalview.commands.EditCommand;
import jalview.commands.EditCommand.Action;
import jalview.datamodel.SequenceFeature;
import jalview.datamodel.SequenceGroup;
import jalview.datamodel.SequenceI;
+import jalview.io.AppletFormatAdapter;
import jalview.io.FormatAdapter;
+import jalview.io.JalviewFileChooser;
import jalview.io.SequenceAnnotationReport;
import jalview.schemes.AnnotationColourGradient;
import jalview.schemes.Blosum62ColourScheme;
import jalview.schemes.TurnColourScheme;
import jalview.schemes.UserColourScheme;
import jalview.schemes.ZappoColourScheme;
+import jalview.util.BrowserLauncher;
+import jalview.util.DBRefUtils;
import jalview.util.GroupUrlLink;
import jalview.util.GroupUrlLink.UrlStringTooLongException;
import jalview.util.MessageManager;
import jalview.util.UrlLink;
+import jalview.ws.DBRefFetcher;
+
+import java.awt.Color;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+import java.util.Vector;
+
+import javax.swing.ButtonGroup;
+import javax.swing.JCheckBoxMenuItem;
+import javax.swing.JColorChooser;
+import javax.swing.JMenu;
+import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
+import javax.swing.JPopupMenu;
+import javax.swing.JRadioButtonMenuItem;
/**
* DOCUMENT ME!
colours.add(purinePyrimidineColour);
colours.add(RNAInteractionColour);
- for (int i = 0; i < jalview.io.FormatAdapter.WRITEABLE_FORMATS.length; i++)
+ for (int i = 0; i < FormatAdapter.WRITEABLE_FORMATS.length; i++)
{
JMenuItem item = new JMenuItem(
- jalview.io.FormatAdapter.WRITEABLE_FORMATS[i]);
+ FormatAdapter.WRITEABLE_FORMATS[i]);
item.addActionListener(new java.awt.event.ActionListener()
{
urlLink = new UrlLink(link);
} catch (Exception foo)
{
- jalview.bin.Cache.log.error("Exception for URLLink '" + link
+ Cache.log.error("Exception for URLLink '" + link
+ "'", foo);
continue;
}
;
if (!urlLink.isValid())
{
- jalview.bin.Cache.log.error(urlLink.getInvalidMessage());
+ Cache.log.error(urlLink.getInvalidMessage());
continue;
}
final String label = urlLink.getLabel();
{
// collect matching db-refs
- DBRefEntry[] dbr = jalview.util.DBRefUtils.selectRefs(
+ DBRefEntry[] dbr = DBRefUtils.selectRefs(
seq.getDBRef(), new String[]
{ urlLink.getTarget() });
// collect id string too
{
for (int d = 0; d < dbr.length; d++)
{
- String src = dbr[d].getSource(); // jalview.util.DBRefUtils.getCanonicalName(dbr[d].getSource()).toUpperCase();
+ String src = dbr[d].getSource(); // DBRefUtils.getCanonicalName(dbr[d].getSource()).toUpperCase();
Object[] sarray = (Object[]) commonDbrefs.get(src);
if (sarray == null)
{
urlLink = new GroupUrlLink(link);
} catch (Exception foo)
{
- jalview.bin.Cache.log.error("Exception for GroupURLLink '" + link
+ Cache.log.error("Exception for GroupURLLink '" + link
+ "'", foo);
continue;
}
;
if (!urlLink.isValid())
{
- jalview.bin.Cache.log.error(urlLink.getInvalidMessage());
+ Cache.log.error(urlLink.getInvalidMessage());
continue;
}
final String label = urlLink.getLabel();
boolean usingNames = false;
// Now see which parts of the group apply for this URL
- String ltarget = urlLink.getTarget(); // jalview.util.DBRefUtils.getCanonicalName(urlLink.getTarget());
+ String ltarget = urlLink.getTarget(); // DBRefUtils.getCanonicalName(urlLink.getTarget());
Object[] idset = (Object[]) commonDbrefs.get(ltarget.toUpperCase());
String[] seqstr, ids; // input to makeUrl
if (idset != null)
}
colourMenu.add(userDefinedColour);
- if (jalview.gui.UserDefinedColours.getUserColourSchemes() != null)
+ if (UserDefinedColours.getUserColourSchemes() != null)
{
- java.util.Enumeration userColours = jalview.gui.UserDefinedColours
+ Enumeration userColours = UserDefinedColours
.getUserColourSchemes().keys();
while (userColours.hasMoreElements())
{
try
{
- jalview.util.BrowserLauncher.openURL(url);
+ BrowserLauncher.openURL(url);
} catch (Exception ex)
{
JOptionPane.showInternalMessageDialog(Desktop.desktop,
public void pdbFromFile_actionPerformed()
{
- jalview.io.JalviewFileChooser chooser = new jalview.io.JalviewFileChooser(
- jalview.bin.Cache.getProperty("LAST_DIRECTORY"));
+ JalviewFileChooser chooser = new JalviewFileChooser(
+ Cache.getProperty("LAST_DIRECTORY"));
chooser.setFileView(new jalview.io.JalviewFileView());
chooser.setDialogTitle(MessageManager.formatMessage(
"label.select_pdb_file_for", new Object[]
int value = chooser.showOpenDialog(null);
- if (value == jalview.io.JalviewFileChooser.APPROVE_OPTION)
+ if (value == JalviewFileChooser.APPROVE_OPTION)
{
String choice = chooser.getSelectedFile().getPath();
- jalview.bin.Cache.setProperty("LAST_DIRECTORY", choice);
+ Cache.setProperty("LAST_DIRECTORY", choice);
new AssociatePdbFileWithSeq().associatePdbWithSeq(choice,
- jalview.io.AppletFormatAdapter.FILE, sequence, true,
+ AppletFormatAdapter.FILE, sequence, true,
Desktop.instance);
}
public void run()
{
- new jalview.ws.DBRefFetcher(sequences, ap.alignFrame)
+ new DBRefFetcher(sequences, ap.alignFrame)
.fetchDBRefs(false);
}
*/
package jalview.gui;
+import jalview.analysis.AnnotationSorter.SequenceAnnotationOrder;
+import jalview.bin.Cache;
+import jalview.gui.Help.HelpId;
+import jalview.gui.StructureViewer.ViewerType;
+import jalview.io.JalviewFileChooser;
+import jalview.io.JalviewFileView;
+import jalview.io.PIRFile;
+import jalview.jbgui.GPreferences;
+import jalview.jbgui.GSequenceLink;
+import jalview.schemes.ColourSchemeProperty;
+import jalview.util.BrowserLauncher;
+import jalview.util.MessageManager;
+import jalview.util.Platform;
+
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import ext.edu.ucsf.rbvi.strucviz2.StructureManager;
-import jalview.analysis.AnnotationSorter.SequenceAnnotationOrder;
-import jalview.bin.Cache;
-import jalview.gui.Help.HelpId;
-import jalview.gui.StructureViewer.ViewerType;
-import jalview.io.JalviewFileChooser;
-import jalview.io.JalviewFileView;
-import jalview.jbgui.GPreferences;
-import jalview.jbgui.GSequenceLink;
-import jalview.schemes.ColourSchemeProperty;
-import jalview.util.MessageManager;
-
/**
* DOCUMENT ME!
*
wsPrefs = new WsPreferences();
wsTab.add(wsPrefs, BorderLayout.CENTER);
int width = 500, height = 450;
- if (new jalview.util.Platform().isAMac())
+ if (Platform.isAMac())
{
width = 570;
height = 480;
*/
Cache.setOrRemove("DEFAULT_BROWSER", defaultBrowser.getText());
- jalview.util.BrowserLauncher.resetBrowser();
+ BrowserLauncher.resetBrowser();
if (nameLinks.size() > 0)
{
Boolean.toString(pirjv.isSelected()));
Cache.applicationProperties.setProperty("PIR_MODELLER",
Boolean.toString(modellerOutput.isSelected()));
- jalview.io.PIRFile.useModellerOutput = modellerOutput.isSelected();
+ PIRFile.useModellerOutput = modellerOutput.isSelected();
Cache.applicationProperties.setProperty("FIGURE_AUTOIDWIDTH",
Boolean.toString(autoIdWidth.isSelected()));
public void startupFileTextfield_mouseClicked()
{
JalviewFileChooser chooser = new JalviewFileChooser(
- jalview.bin.Cache.getProperty("LAST_DIRECTORY"),
+ Cache.getProperty("LAST_DIRECTORY"),
new String[]
{ "fa, fasta, fastq", "aln", "pfam", "msf", "pir", "blc", "jar" },
new String[]
{ "Fasta", "Clustal", "PFAM", "MSF", "PIR", "BLC", "Jalview" },
- jalview.bin.Cache.getProperty("DEFAULT_FILE_FORMAT"));
+ Cache.getProperty("DEFAULT_FILE_FORMAT"));
chooser.setFileView(new JalviewFileView());
chooser.setDialogTitle(MessageManager.getString("label.select_startup_file"));
if (value == JalviewFileChooser.APPROVE_OPTION)
{
- jalview.bin.Cache.applicationProperties.setProperty(
+ Cache.applicationProperties.setProperty(
"DEFAULT_FILE_FORMAT", chooser.getSelectedFormat());
startupFileTextfield.setText(chooser.getSelectedFile()
.getAbsolutePath());
* @param desktop
* - where the dialog box will be shown
* @param property
- * - boolean property in jalview.bin.Cache
+ * - boolean property in Cache
* @param dialogTitle
* - title of prompt box
* @param dialogText
return;
}
// First - check to see if wee have an old questionnaire/response id pair.
- String lastq = jalview.bin.Cache.getProperty(property);
+ String lastq = Cache.getProperty(property);
if (lastq == null)
{
raiseDialog();
Cache.log.debug("Got user response.");
}
- lastq = jalview.bin.Cache.getProperty(property);
+ lastq = Cache.getProperty(property);
String extype = "";
Exception e = null;
if (lastq == null)
*/
private void raiseDialog()
{
- if (jalview.bin.Cache.log.isDebugEnabled())
+ if (Cache.log.isDebugEnabled())
{
- jalview.bin.Cache.log.debug("Prompting user for " + dialogTitle
+ Cache.log.debug("Prompting user for " + dialogTitle
+ " for Cache property " + property);
}
try
Desktop.instance.relayerWindows();
}
// and finish parsing the result
- jalview.bin.Cache.log.debug("Got response : " + reply);
+ Cache.log.debug("Got response : " + reply);
if (reply == JOptionPane.YES_OPTION)
{
- jalview.bin.Cache.setProperty(property, "true");
+ Cache.setProperty(property, "true");
}
else if (reply == JOptionPane.NO_OPTION)
{
if (removeifunset)
{
- jalview.bin.Cache.removeProperty(property);
+ Cache.removeProperty(property);
}
else
{
- jalview.bin.Cache.setProperty(property, "false");
+ Cache.setProperty(property, "false");
}
}
else
{
- jalview.bin.Cache.log.debug("User cancelled setting " + property);
+ Cache.log.debug("User cancelled setting " + property);
return;
}
// verify the property is set for debugging
- if (jalview.bin.Cache.log.isDebugEnabled())
+ if (Cache.log.isDebugEnabled())
{
- jalview.bin.Cache.log.debug("User set property to "
- + jalview.bin.Cache.getProperty(property));
+ Cache.log.debug("User set property to "
+ + Cache.getProperty(property));
}
} catch (Exception e)
{
- jalview.bin.Cache.log.warn(
+ Cache.log.warn(
"Unexpected exception when prompting user for yes/no setting for property "
+ property, e);
}
import jalview.jbgui.GRestServiceEditorPane;
import jalview.util.MessageManager;
import jalview.ws.rest.InputType;
+import jalview.ws.rest.RestClient;
import jalview.ws.rest.RestServiceDescription;
import java.awt.BorderLayout;
/**
* the latest version of the service definition.
*/
- jalview.ws.rest.RestServiceDescription currentservice = null;
+ RestServiceDescription currentservice = null;
/**
* original service passed to editor if we are modifying an existing service
* definition
*/
- jalview.ws.rest.RestServiceDescription oldservice = null;
+ RestServiceDescription oldservice = null;
public RestServiceEditorPane()
{
df.getContentPane().setLayout(new BorderLayout());
df.getContentPane().add(
(nulserv = !nulserv) ? new RestServiceEditorPane(
- jalview.ws.rest.RestClient
- .makeShmmrRestClient()
+ RestClient.makeShmmrRestClient()
.getRestDescription())
: new RestServiceEditorPane(),
BorderLayout.CENTER);
*/
package jalview.gui;
+import jalview.bin.Cache;
import jalview.util.MessageManager;
import java.awt.BorderLayout;
if (!askAgain.isSelected())
{
- jalview.bin.Cache.applicationProperties.remove("SVG_RENDERING");
+ Cache.applicationProperties.remove("SVG_RENDERING");
}
else
{
- jalview.bin.Cache.setProperty("SVG_RENDERING", value);
+ Cache.setProperty("SVG_RENDERING", value);
}
dialog.setVisible(false);
import jalview.datamodel.SearchResults;
import jalview.datamodel.SequenceGroup;
import jalview.datamodel.SequenceI;
+import jalview.util.Comparison;
import java.awt.BasicStroke;
import java.awt.BorderLayout;
while (index < endx)
{
- if (jalview.util.Comparison.isGap(seq.getCharAt(index)))
+ if (Comparison.isGap(seq.getCharAt(index)))
{
index++;
while (index > startx)
{
- if (jalview.util.Comparison.isGap(seq.getCharAt(index)))
+ if (Comparison.isGap(seq.getCharAt(index)))
{
index--;
*/
package jalview.gui;
-import java.awt.BorderLayout;
-import java.awt.Color;
-import java.awt.Font;
-import java.awt.FontMetrics;
-import java.awt.Point;
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
-import java.awt.event.MouseMotionListener;
-import java.awt.event.MouseWheelEvent;
-import java.awt.event.MouseWheelListener;
-import java.util.List;
-import java.util.Vector;
-
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.ToolTipManager;
-
import jalview.api.AlignViewportI;
+import jalview.bin.Cache;
import jalview.commands.EditCommand;
import jalview.commands.EditCommand.Action;
import jalview.commands.EditCommand.Edit;
import jalview.util.MessageManager;
import jalview.viewmodel.AlignmentViewport;
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.FontMetrics;
+import java.awt.Point;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.awt.event.MouseMotionListener;
+import java.awt.event.MouseWheelEvent;
+import java.awt.event.MouseWheelListener;
+import java.util.List;
+import java.util.Vector;
+
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.ToolTipManager;
+
/**
* DOCUMENT ME!
*
{
for (int j = 0; j < startres - lastres; j++)
{
- if (!jalview.util.Comparison.isGap(groupSeqs[g]
+ if (!Comparison.isGap(groupSeqs[g]
.getCharAt(fixedRight - j)))
{
blank = false;
continue;
}
- if (!jalview.util.Comparison.isGap(groupSeqs[g].getCharAt(j)))
+ if (!Comparison.isGap(groupSeqs[g].getCharAt(j)))
{
// Not a gap, block edit not valid
endEditing();
for (blankColumn = fixedColumn; blankColumn > j; blankColumn--)
{
- if (jalview.util.Comparison.isGap(seq[s].getCharAt(blankColumn)))
+ if (Comparison.isGap(seq[s].getCharAt(blankColumn)))
{
// Theres a space, so break and insert the gap
break;
}
}
- jalview.gui.PopupMenu pop = new jalview.gui.PopupMenu(ap, null, links);
+ PopupMenu pop = new PopupMenu(ap, null, links);
pop.show(this, evt.getX(), evt.getY());
return;
}
{
if (av.getAlignment() == null)
{
- jalview.bin.Cache.log.warn("alignviewport av SeqSetId="
+ Cache.log.warn("alignviewport av SeqSetId="
+ av.getSequenceSetId() + " ViewId=" + av.getViewId()
+ " 's alignment is NULL! returning immediately.");
return;
*/
package jalview.gui;
+import jalview.bin.Cache;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.DBRefEntry;
import jalview.datamodel.DBRefSource;
import jalview.io.IdentifyFile;
import jalview.util.DBRefUtils;
import jalview.util.MessageManager;
+import jalview.util.Platform;
import jalview.ws.dbsources.das.api.DasSourceRegistryI;
+import jalview.ws.dbsources.das.datamodel.DasSequenceSource;
import jalview.ws.seqfetcher.DbSourceProxy;
import java.awt.BorderLayout;
}
}
if (sfetch == null
- || dasRegistry != jalview.bin.Cache.getDasSourceRegistry()
- || lastDasSourceRegistry != (jalview.bin.Cache
- .getDasSourceRegistry().getDasRegistryURL() + jalview.bin.Cache
+ || dasRegistry != Cache.getDasSourceRegistry()
+ || lastDasSourceRegistry != (Cache
+ .getDasSourceRegistry().getDasRegistryURL() + Cache
.getDasSourceRegistry().getLocalSourceString())
.hashCode())
{
guiWindow.setProgressBar(MessageManager.getString("status.init_sequence_database_fetchers"),
Thread.currentThread().hashCode());
}
- dasRegistry = jalview.bin.Cache.getDasSourceRegistry();
+ dasRegistry = Cache.getDasSourceRegistry();
dasRegistry.refreshSources();
jalview.ws.SequenceFetcher sf = new jalview.ws.SequenceFetcher();
frame = new JInternalFrame();
frame.setContentPane(this);
- if (new jalview.util.Platform().isAMac())
+ if (Platform.isAMac())
{
Desktop.addInternalFrame(frame, getFrameTitle(), 400, 240);
}
boolean enablePunct = !(eq != null && eq.indexOf(",") > -1);
for (DbSourceProxy dbs : database.getSelectedSources())
{
- if (dbs instanceof jalview.ws.dbsources.das.datamodel.DasSequenceSource)
+ if (dbs instanceof DasSequenceSource)
{
enablePunct = false;
break;
error += "Please select the source database\n";
}
// TODO: make this transformation more configurable
- com.stevesoft.pat.Regex empty;
+ Regex empty;
if (replacePunctuation.isEnabled() && replacePunctuation.isSelected())
{
- empty = new com.stevesoft.pat.Regex(
+ empty = new Regex(
// replace commas and spaces with a semicolon
"(\\s|[,; ])+", ";");
}
else
{
// just turn spaces and semicolons into single semicolons
- empty = new com.stevesoft.pat.Regex("(\\s|[; ])+", ";");
+ empty = new Regex("(\\s|[; ])+", ";");
}
textArea.setText(empty.replaceAll(textArea.getText()));
// see if there's anthing to search with
- if (!new com.stevesoft.pat.Regex("[A-Za-z0-9_.]").search(textArea
+ if (!new Regex("[A-Za-z0-9_.]").search(textArea
.getText()))
{
error += "Please enter a (semi-colon separated list of) database id(s)";
}
} catch (Exception e)
{
- jalview.bin.Cache.log.info("Error retrieving " + item
+ Cache.log.info("Error retrieving " + item
+ " from " + proxy.getDbName(), e);
nextfetch.add(item);
}
try
{
- af.setMaximum(jalview.bin.Cache.getDefault("SHOW_FULLSCREEN",
+ af.setMaximum(Cache.getDefault("SHOW_FULLSCREEN",
false));
} catch (Exception ex)
{
import jalview.datamodel.SequenceGroup;
import jalview.datamodel.SequenceI;
import jalview.schemes.ColourSchemeI;
+import jalview.util.Comparison;
import java.awt.Color;
import java.awt.FontMetrics;
resBoxColour = cs.findColour(seq.getCharAt(i), i, seq);
}
else if (forOverview
- && !jalview.util.Comparison.isGap(seq.getCharAt(i)))
+ && !Comparison.isGap(seq.getCharAt(i)))
{
resBoxColour = Color.lightGray;
}
getboxColour = false;
s = seq.getCharAt(i);
- if (!renderGaps && jalview.util.Comparison.isGap(s))
+ if (!renderGaps && Comparison.isGap(s))
{
continue;
}
/*
* int y = yoffset;
*
- * g.drawString("Jalview " + jalview.bin.Cache.getProperty("VERSION"), 50,
+ * g.drawString("Jalview " + Cache.getProperty("VERSION"), 50,
* y);
*
* FontMetrics fm = g.getFontMetrics(); int vwidth =
- * fm.stringWidth("Jalview " + jalview.bin.Cache.getProperty("VERSION"));
+ * fm.stringWidth("Jalview " + Cache.getProperty("VERSION"));
* g.setFont(new Font("Verdana", Font.BOLD, fontSize + 2)); g.drawString(
- * "Last updated: " + jalview.bin.Cache.getDefault("BUILD_DATE", "unknown"),
- * 50 + vwidth + 5, y); if (jalview.bin.Cache.getDefault("LATEST_VERSION",
+ * "Last updated: " + Cache.getDefault("BUILD_DATE", "unknown"),
+ * 50 + vwidth + 5, y); if (Cache.getDefault("LATEST_VERSION",
* "Checking").equals( "Checking")) { // Displayed when code version and
* jnlp version do not match g.drawString("...Checking latest version...",
* 50, y += fontSize + 10); y += 5; g.setColor(Color.black); } else if
- * (!jalview.bin.Cache.getDefault("LATEST_VERSION", "Checking")
- * .equals(jalview.bin.Cache.getProperty("VERSION"))) { if
- * (jalview.bin.Cache.getProperty("VERSION").toLowerCase()
+ * (!Cache.getDefault("LATEST_VERSION", "Checking")
+ * .equals(Cache.getProperty("VERSION"))) { if
+ * (Cache.getProperty("VERSION").toLowerCase()
* .indexOf("automated build") == -1) { // Displayed when code version and
* jnlp version do not match and code // version is not a development build
* g.setColor(Color.red); } g.drawString( "!! Jalview version " +
- * jalview.bin.Cache.getDefault("LATEST_VERSION", "..Checking..") +
+ * Cache.getDefault("LATEST_VERSION", "..Checking..") +
* " is available for download from "
- * +jalview.bin.Cache.getDefault("www.jalview.org"
+ * +Cache.getDefault("www.jalview.org"
* ,"http://www.jalview.org")+" !!", 50, y += fontSize + 10); y += 5;
* g.setColor(Color.black); }
*
package jalview.gui;
+import jalview.bin.Cache;
+import jalview.datamodel.DBRefEntry;
+import jalview.datamodel.PDBEntry;
+import jalview.datamodel.SequenceI;
+import jalview.io.AppletFormatAdapter;
+import jalview.io.JalviewFileChooser;
+import jalview.io.JalviewFileView;
+import jalview.jbgui.GStructureChooser;
+import jalview.jbgui.PDBDocFieldPreferences;
+import jalview.structure.StructureSelectionManager;
+import jalview.util.MessageManager;
+import jalview.ws.dbsources.PDBRestClient;
+import jalview.ws.dbsources.PDBRestClient.PDBDocField;
+import jalview.ws.uimodel.PDBRestRequest;
+import jalview.ws.uimodel.PDBRestResponse;
+import jalview.ws.uimodel.PDBRestResponse.PDBResponseSummary;
+
import java.awt.event.ItemEvent;
import java.util.ArrayList;
import java.util.Collection;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
-import jalview.datamodel.DBRefEntry;
-import jalview.datamodel.PDBEntry;
-import jalview.datamodel.SequenceI;
-import jalview.jbgui.GStructureChooser;
-import jalview.jbgui.PDBDocFieldPreferences;
-import jalview.structure.StructureSelectionManager;
-import jalview.util.MessageManager;
-import jalview.ws.dbsources.PDBRestClient;
-import jalview.ws.dbsources.PDBRestClient.PDBDocField;
-import jalview.ws.uimodel.PDBRestRequest;
-import jalview.ws.uimodel.PDBRestResponse;
-import jalview.ws.uimodel.PDBRestResponse.PDBResponseSummary;
-
/**
* Provides the behaviors for the Structure chooser Panel
*/
public void pdbFromFile_actionPerformed()
{
- jalview.io.JalviewFileChooser chooser = new jalview.io.JalviewFileChooser(
- jalview.bin.Cache.getProperty("LAST_DIRECTORY"));
- chooser.setFileView(new jalview.io.JalviewFileView());
+ JalviewFileChooser chooser = new JalviewFileChooser(
+ Cache.getProperty("LAST_DIRECTORY"));
+ chooser.setFileView(new JalviewFileView());
chooser.setDialogTitle(MessageManager.formatMessage(
"label.select_pdb_file_for", new String[]
{ selectedSequence.getDisplayId(false) }));
{ selectedSequence.getDisplayId(false) }));
int value = chooser.showOpenDialog(null);
- if (value == jalview.io.JalviewFileChooser.APPROVE_OPTION)
+ if (value == JalviewFileChooser.APPROVE_OPTION)
{
selectedPdbFileName = chooser.getSelectedFile().getPath();
- jalview.bin.Cache.setProperty("LAST_DIRECTORY", selectedPdbFileName);
+ Cache.setProperty("LAST_DIRECTORY", selectedPdbFileName);
validateSelections();
}
}
}
PDBEntry fileEntry = new AssociatePdbFileWithSeq()
.associatePdbWithSeq(
- selectedPdbFileName, jalview.io.AppletFormatAdapter.FILE,
+ selectedPdbFileName, AppletFormatAdapter.FILE,
selectedSequence, true, Desktop.instance);
launchStructureViewer(ap.getStructureSelectionManager(),
import jalview.io.NewickFile;
import jalview.jbgui.GTreePanel;
import jalview.schemes.ResidueProperties;
+import jalview.util.DBRefUtils;
import jalview.util.MessageManager;
import jalview.viewmodel.AlignmentViewport;
{
NewickFile newtree;
- jalview.datamodel.AlignmentView odata = null;
+ AlignmentView odata = null;
public TreeLoader(NewickFile newtree)
{
buffer.append("PID");
}
- jalview.io.NewickFile fout = new jalview.io.NewickFile(
- tree.getTopNode());
+ NewickFile fout = new NewickFile(tree.getTopNode());
try
{
cap.setText(fout.print(tree.isHasBootstrap(), tree.isHasDistances(),
public void saveAsNewick_actionPerformed(ActionEvent e)
{
JalviewFileChooser chooser = new JalviewFileChooser(
- jalview.bin.Cache.getProperty("LAST_DIRECTORY"));
+ Cache.getProperty("LAST_DIRECTORY"));
chooser.setFileView(new JalviewFileView());
chooser.setDialogTitle(MessageManager.getString("label.save_tree_as_newick"));
chooser.setToolTipText(MessageManager.getString("action.save"));
if (value == JalviewFileChooser.APPROVE_OPTION)
{
String choice = chooser.getSelectedFile().getPath();
- jalview.bin.Cache.setProperty("LAST_DIRECTORY", chooser
+ Cache.setProperty("LAST_DIRECTORY", chooser
.getSelectedFile().getParent());
try
{
- jalview.io.NewickFile fout = new jalview.io.NewickFile(
- tree.getTopNode());
+ NewickFile fout = new NewickFile(tree.getTopNode());
String output = fout.print(tree.isHasBootstrap(),
tree.isHasDistances(), tree.isHasRootDistance());
java.io.PrintWriter out = new java.io.PrintWriter(
{
if (!tree.hasOriginalSequenceData())
{
- jalview.bin.Cache.log
+ Cache.log
.info("Unexpected call to originalSeqData_actionPerformed - should have hidden this menu action.");
return;
}
{
boolean accurateText = true;
- String renderStyle = jalview.bin.Cache.getDefault("EPS_RENDERING",
+ String renderStyle = Cache.getDefault("EPS_RENDERING",
"Prompt each time");
// If we need to prompt, and if the GUI is visible then
try
{
- jalview.io.JalviewFileChooser chooser = new jalview.io.JalviewFileChooser(
- jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[]
+ JalviewFileChooser chooser = new JalviewFileChooser(
+ Cache.getProperty("LAST_DIRECTORY"), new String[]
{ "eps" }, new String[]
{ "Encapsulated Postscript" }, "Encapsulated Postscript");
chooser.setFileView(new jalview.io.JalviewFileView());
int value = chooser.showSaveDialog(this);
- if (value != jalview.io.JalviewFileChooser.APPROVE_OPTION)
+ if (value != JalviewFileChooser.APPROVE_OPTION)
{
return;
}
- jalview.bin.Cache.setProperty("LAST_DIRECTORY", chooser
+ Cache.setProperty("LAST_DIRECTORY", chooser
.getSelectedFile().getParent());
FileOutputStream out = new FileOutputStream(chooser.getSelectedFile());
try
{
- jalview.io.JalviewFileChooser chooser = new jalview.io.JalviewFileChooser(
- jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[]
+ JalviewFileChooser chooser = new JalviewFileChooser(
+ Cache.getProperty("LAST_DIRECTORY"), new String[]
{ "png" }, new String[]
{ "Portable network graphics" }, "Portable network graphics");
- chooser.setFileView(new jalview.io.JalviewFileView());
+ chooser.setFileView(new JalviewFileView());
chooser.setDialogTitle(MessageManager.getString("label.create_png_from_tree"));
chooser.setToolTipText(MessageManager.getString("action.save"));
int value = chooser.showSaveDialog(this);
- if (value != jalview.io.JalviewFileChooser.APPROVE_OPTION)
+ if (value != JalviewFileChooser.APPROVE_OPTION)
{
return;
}
- jalview.bin.Cache.setProperty("LAST_DIRECTORY", chooser
+ Cache.setProperty("LAST_DIRECTORY", chooser
.getSelectedFile().getParent());
FileOutputStream out = new FileOutputStream(chooser.getSelectedFile());
if (sq != null)
{
// search dbrefs, features and annotation
- DBRefEntry[] refs = jalview.util.DBRefUtils.selectRefs(
+ DBRefEntry[] refs = DBRefUtils.selectRefs(
sq.getDBRef(), new String[]
{ labelClass.toUpperCase() });
if (refs != null)
*/
package jalview.gui;
+import jalview.api.structures.JalviewStructureDisplayI;
+import jalview.bin.Cache;
+import jalview.datamodel.SequenceGroup;
+import jalview.io.JalviewFileChooser;
+import jalview.io.JalviewFileView;
+import jalview.jbgui.GUserDefinedColours;
+import jalview.schemes.ColourSchemeI;
+import jalview.schemes.ResidueProperties;
+import jalview.schemes.UserColourScheme;
+import jalview.util.ColorUtils;
+import jalview.util.Format;
+import jalview.util.MessageManager;
+
import java.awt.Color;
import java.awt.Font;
import java.awt.event.ActionEvent;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
-import jalview.api.structures.JalviewStructureDisplayI;
-import jalview.datamodel.SequenceGroup;
-import jalview.io.JalviewFileChooser;
-import jalview.jbgui.GUserDefinedColours;
-import jalview.schemes.ColourSchemeI;
-import jalview.schemes.ResidueProperties;
-import jalview.schemes.UserColourScheme;
-import jalview.util.ColorUtils;
-import jalview.util.MessageManager;
-
/**
* This panel allows the user to assign colours to Amino Acid residue codes, and
* save the colour scheme.
lowerCaseButtons = new ArrayList<JButton>();
JalviewFileChooser chooser = new JalviewFileChooser(
- jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[]
+ Cache.getProperty("LAST_DIRECTORY"), new String[]
{ "jc" }, new String[]
{ "Jalview User Colours" }, "Jalview User Colours");
- chooser.setFileView(new jalview.io.JalviewFileView());
+ chooser.setFileView(new JalviewFileView());
chooser.setDialogTitle(MessageManager
.getString("label.load_colour_scheme"));
chooser.setToolTipText(MessageManager.getString("action.load"));
if (value == JalviewFileChooser.APPROVE_OPTION)
{
File choice = chooser.getSelectedFile();
- jalview.bin.Cache.setProperty("LAST_DIRECTORY", choice.getParent());
- String defaultColours = jalview.bin.Cache.getDefault(
+ Cache.setProperty("LAST_DIRECTORY", choice.getParent());
+ String defaultColours = Cache.getDefault(
"USER_DEFINED_COLOURS", choice.getPath());
if (defaultColours.indexOf(choice.getPath()) == -1)
{
.concat(choice.getPath());
}
- jalview.bin.Cache.setProperty("USER_DEFINED_COLOURS", defaultColours);
+ Cache.setProperty("USER_DEFINED_COLOURS", defaultColours);
UserColourScheme ucs = loadColours(choice.getAbsolutePath());
Color[] colors = ucs.getColours();
{
UserColourScheme ret = null;
- String colours = jalview.bin.Cache.getProperty("USER_DEFINED_COLOURS");
+ String colours = Cache.getProperty("USER_DEFINED_COLOURS");
if (colours != null)
{
if (colours.indexOf("|") > -1)
userColourSchemes.remove(schemeName.getText());
}
JalviewFileChooser chooser = new JalviewFileChooser(
- jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[]
+ Cache.getProperty("LAST_DIRECTORY"), new String[]
{ "jc" }, new String[]
{ "Jalview User Colours" }, "Jalview User Colours");
- chooser.setFileView(new jalview.io.JalviewFileView());
+ chooser.setFileView(new JalviewFileView());
chooser.setDialogTitle(MessageManager.getString("label.save_colour_scheme"));
chooser.setToolTipText(MessageManager.getString("action.save"));
if (value == JalviewFileChooser.APPROVE_OPTION)
{
String choice = chooser.getSelectedFile().getPath();
- String defaultColours = jalview.bin.Cache.getDefault(
+ String defaultColours = Cache.getDefault(
"USER_DEFINED_COLOURS", choice);
if (defaultColours.indexOf(choice) == -1)
{
ap.alignFrame.updateUserColourMenu();
- jalview.bin.Cache.setProperty("USER_DEFINED_COLOURS", defaultColours);
+ Cache.setProperty("USER_DEFINED_COLOURS", defaultColours);
jalview.schemabinding.version2.JalviewUserColours ucs = new jalview.schemabinding.version2.JalviewUserColours();
JButton button = (JButton) buttonPanel.getComponent(i);
jalview.schemabinding.version2.Colour col = new jalview.schemabinding.version2.Colour();
col.setName(button.getText());
- col.setRGB(jalview.util.Format.getHexString(button
- .getBackground()));
+ col.setRGB(Format.getHexString(button.getBackground()));
ucs.addColour(col);
}
{
if (coloursFound.toString().length() > 1)
{
- jalview.bin.Cache.setProperty("USER_DEFINED_COLOURS",
+ Cache.setProperty("USER_DEFINED_COLOURS",
coloursFound.toString());
}
else
{
- jalview.bin.Cache.applicationProperties
+ Cache.applicationProperties
.remove("USER_DEFINED_COLOURS");
}
}
StringBuffer coloursFound = new StringBuffer();
StringTokenizer st = new StringTokenizer(
- jalview.bin.Cache.getProperty("USER_DEFINED_COLOURS"), "|");
+ Cache.getProperty("USER_DEFINED_COLOURS"), "|");
while (st.hasMoreElements())
{
if (coloursFound.toString().length() > 1)
{
- jalview.bin.Cache.setProperty("USER_DEFINED_COLOURS",
+ Cache.setProperty("USER_DEFINED_COLOURS",
coloursFound.toString());
}
else
{
- jalview.bin.Cache.applicationProperties
+ Cache.applicationProperties
.remove("USER_DEFINED_COLOURS");
}
*/
package jalview.gui;
+import jalview.bin.Cache;
+import jalview.util.BrowserLauncher;
import jalview.util.MessageManager;
-import java.io.*;
-import java.net.*;
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.net.URL;
-import javax.swing.*;
+import javax.swing.JOptionPane;
public class UserQuestionnaireCheck implements Runnable
{
{
if (url.indexOf("questionnaire.pl") == -1)
{
- jalview.bin.Cache.log
+ Cache.log
.error("'"
+ url
+ "' is an Invalid URL for the checkForQuestionnaire() method.\n"
private boolean checkresponse(URL qurl) throws Exception
{
- jalview.bin.Cache.log.debug("Checking Response for : " + qurl);
+ Cache.log.debug("Checking Response for : " + qurl);
boolean prompt = false;
// see if we have already responsed to this questionnaire or get a new
// qid/rid pair
try
{
// First - check to see if wee have an old questionnaire/response id pair.
- String lastq = jalview.bin.Cache.getProperty("QUESTIONNAIRE");
+ String lastq = Cache.getProperty("QUESTIONNAIRE");
if (lastq == null)
{
prompt = checkresponse(new URL(url
if (qid != null && rid != null)
{
// Update our local property cache with latest qid and rid
- jalview.bin.Cache.setProperty("QUESTIONNAIRE", qid + ":" + rid);
+ Cache.setProperty("QUESTIONNAIRE", qid + ":" + rid);
}
if (prompt)
{
String qurl = url + (url.indexOf('?') > -1 ? "&" : "?") + "qid="
+ qid + "&rid=" + rid;
- jalview.bin.Cache.log.info("Prompting user for questionnaire at "
+ Cache.log.info("Prompting user for questionnaire at "
+ qurl);
int reply = JOptionPane
.showInternalConfirmDialog(Desktop.desktop, MessageManager
if (reply == JOptionPane.YES_OPTION)
{
- jalview.bin.Cache.log.debug("Opening " + qurl);
- jalview.util.BrowserLauncher.openURL(qurl);
+ Cache.log.debug("Opening " + qurl);
+ BrowserLauncher.openURL(qurl);
}
}
} catch (Exception e)
{
- jalview.bin.Cache.log.warn("When trying to access questionnaire URL "
+ Cache.log.warn("When trying to access questionnaire URL "
+ url, e);
}
}
} catch (Exception e)
{
- jalview.bin.Cache.log
+ Cache.log
.error("Couldn't instantiate vamsas client !", e);
return false;
}
private ClientHandle getJalviewHandle()
{
return new ClientHandle("jalview.bin.Jalview",
- jalview.bin.Cache.getProperty("VERSION"));
+ Cache.getProperty("VERSION"));
}
/**
*/
package jalview.gui;
+import jalview.jbgui.GWebserviceInfo;
+import jalview.util.MessageManager;
+import jalview.ws.WSClientI;
+
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Font;
import javax.swing.text.html.HTMLEditorKit;
import javax.swing.text.html.StyleSheet;
-import jalview.jbgui.GWebserviceInfo;
-import jalview.util.MessageManager;
-import jalview.ws.WSClientI;
-
/**
* Base class for web service client thread and gui TODO: create StAX parser to
* extract html body content reliably when preparing html formatted job statuses
String title = "";
- jalview.ws.WSClientI thisService;
+ WSClientI thisService;
boolean serviceIsCancellable;
*
* @return DOCUMENT ME!
*/
- public jalview.ws.WSClientI getthisService()
+ public WSClientI getthisService()
{
return thisService;
}
* @param newservice
* service client to query for capabilities
*/
- public void setthisService(jalview.ws.WSClientI newservice)
+ public void setthisService(WSClientI newservice)
{
thisService = newservice;
serviceIsCancellable = newservice.isCancellable();
*/
package jalview.gui;
+import jalview.gui.OptsAndParamsPage.OptionBox;
+import jalview.gui.OptsAndParamsPage.ParamBox;
+import jalview.util.MessageManager;
+import jalview.ws.jws2.JabaParamStore;
+import jalview.ws.jws2.JabaPreset;
+import jalview.ws.jws2.Jws2Discoverer;
+import jalview.ws.jws2.ParameterUtils;
+import jalview.ws.jws2.jabaws2.Jws2Instance;
+import jalview.ws.params.ArgumentI;
+import jalview.ws.params.OptionI;
+import jalview.ws.params.ParamDatastoreI;
+import jalview.ws.params.ParameterI;
+import jalview.ws.params.WsParamSetI;
+
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import compbio.metadata.PresetManager;
import compbio.metadata.RunnerConfig;
-import jalview.gui.OptsAndParamsPage.OptionBox;
-import jalview.gui.OptsAndParamsPage.ParamBox;
-import jalview.util.MessageManager;
-import jalview.ws.jws2.JabaParamStore;
-import jalview.ws.jws2.JabaPreset;
-import jalview.ws.jws2.Jws2Discoverer;
-import jalview.ws.jws2.jabaws2.Jws2Instance;
-import jalview.ws.params.ArgumentI;
-import jalview.ws.params.OptionI;
-import jalview.ws.params.ParamDatastoreI;
-import jalview.ws.params.ParameterI;
-import jalview.ws.params.WsParamSetI;
-
/**
* job parameter editing/browsing dialog box. User can browse existing settings
* (user + presets + Defaults), and any changes to parameters creates a modified
*/
public static void main(String[] args)
{
- jalview.ws.jws2.Jws2Discoverer disc = jalview.ws.jws2.Jws2Discoverer
- .getDiscoverer();
+ Jws2Discoverer disc = Jws2Discoverer.getDiscoverer();
int p = 0;
if (args.length > 0)
{
{
try
{
- Option cpy = jalview.ws.jws2.ParameterUtils.copyOption(o);
+ Option cpy = ParameterUtils.copyOption(o);
} catch (Exception e)
{
System.err.println("Failed to copy " + o.getName());
{
try
{
- Parameter cpy = jalview.ws.jws2.ParameterUtils
+ Parameter cpy = ParameterUtils
.copyParameter(o);
} catch (Exception e)
{
List<String> writeparam = null, readparam = null;
try
{
- writeparam = jalview.ws.jws2.ParameterUtils
+ writeparam = ParameterUtils
.writeParameterSet(
pr.getArguments(lastserv.getRunnerConfig()),
" ");
System.out.println("Testing param read :");
- List<Option> pset = jalview.ws.jws2.ParameterUtils
+ List<Option> pset = ParameterUtils
.processParameters(writeparam,
lastserv.getRunnerConfig(), " ");
- readparam = jalview.ws.jws2.ParameterUtils
+ readparam = ParameterUtils
.writeParameterSet(pset, " ");
Iterator<String> o = pr.getOptions().iterator(), s = writeparam
.iterator(), t = readparam.iterator();
import jalview.bin.Cache;
import jalview.io.JalviewFileChooser;
+import jalview.io.JalviewFileView;
+import jalview.schemabinding.version2.WebServiceParameterSet;
import jalview.util.MessageManager;
import jalview.ws.params.ParamDatastoreI;
import jalview.ws.params.ParamManager;
InputStreamReader is = new InputStreamReader(
new java.io.FileInputStream(new File(filename)), "UTF-8");
- jalview.schemabinding.version2.WebServiceParameterSet wspset = new jalview.schemabinding.version2.WebServiceParameterSet();
+ WebServiceParameterSet wspset = new WebServiceParameterSet();
org.exolab.castor.xml.Unmarshaller unmar = new org.exolab.castor.xml.Unmarshaller(
wspset);
unmar.setWhitespacePreserve(true);
try
{
- wspset = (jalview.schemabinding.version2.WebServiceParameterSet) unmar
- .unmarshal(is);
+ wspset = (WebServiceParameterSet) unmar.unmarshal(is);
} catch (Exception ex)
{
throw new IOException(ex);
if (filename == null)
{
JalviewFileChooser chooser = new JalviewFileChooser(
- jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[]
+ Cache.getProperty("LAST_DIRECTORY"), new String[]
{ "wsparams" }, new String[]
{ "Web Service Parameter File" },
"Web Service Parameter File");
- chooser.setFileView(new jalview.io.JalviewFileView());
+ chooser.setFileView(new JalviewFileView());
chooser.setDialogTitle(MessageManager.getString("label.choose_filename_for_param_file"));
chooser.setToolTipText(MessageManager.getString("action.save"));
int value = chooser.showSaveDialog(Desktop.instance);
if (value == JalviewFileChooser.APPROVE_OPTION)
{
outfile = chooser.getSelectedFile();
- jalview.bin.Cache
+ Cache
.setProperty("LAST_DIRECTORY", outfile.getParent());
filename = outfile.getAbsolutePath();
if (!filename.endsWith(".wsparams"))
}
if (outfile != null)
{
- String paramFiles = jalview.bin.Cache.getDefault("WS_PARAM_FILES",
+ String paramFiles = Cache.getDefault("WS_PARAM_FILES",
filename);
if (paramFiles.indexOf(filename) == -1)
{
}
paramFiles = paramFiles.concat(filename);
}
- jalview.bin.Cache.setProperty("WS_PARAM_FILES", paramFiles);
+ Cache.setProperty("WS_PARAM_FILES", paramFiles);
- jalview.schemabinding.version2.WebServiceParameterSet paramxml = new jalview.schemabinding.version2.WebServiceParameterSet();
+ WebServiceParameterSet paramxml = new WebServiceParameterSet();
paramxml.setName(parameterSet.getName());
paramxml.setDescription(parameterSet.getDescription());
/*
*
- * JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache
+ * JalviewFileChooser chooser = new JalviewFileChooser(Cache
* .getProperty("LAST_DIRECTORY"), new String[] { "jc" }, new String[] {
* "Jalview User Colours" }, "Jalview User Colours"); chooser.setFileView(new
* jalview.io.JalviewFileView());
* int value = chooser.showOpenDialog(this);
*
* if (value == JalviewFileChooser.APPROVE_OPTION) { File choice =
- * chooser.getSelectedFile(); jalview.bin.Cache.setProperty("LAST_DIRECTORY",
- * choice.getParent()); String defaultColours = jalview.bin.Cache.getDefault(
+ * chooser.getSelectedFile(); Cache.setProperty("LAST_DIRECTORY",
+ * choice.getParent()); String defaultColours = Cache.getDefault(
* "USER_DEFINED_COLOURS", choice.getPath()); if
* (defaultColours.indexOf(choice.getPath()) == -1) { defaultColours =
* defaultColours.concat("|") .concat(choice.getPath()); } (non-Javadoc)
{
return;
}
- String paramFiles = jalview.bin.Cache.getDefault("WS_PARAM_FILES", "");
+ String paramFiles = Cache.getDefault("WS_PARAM_FILES", "");
if (paramFiles.indexOf(filename) > -1)
{
String nparamFiles = new String();
nparamFiles = nparamFiles.concat("|").concat(fl);
}
}
- jalview.bin.Cache.setProperty("WS_PARAM_FILES", nparamFiles);
+ Cache.setProperty("WS_PARAM_FILES", nparamFiles);
}
try
import jalview.jbgui.GWsPreferences;
import jalview.util.MessageManager;
import jalview.ws.jws2.Jws2Discoverer;
+import jalview.ws.rest.RestClient;
import jalview.ws.rest.RestServiceDescription;
import java.awt.BorderLayout;
wsList.setDefaultRenderer(Integer.class, new JabaWSStatusRenderer());
wsList.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
updateList();
- rsbsUrls = jalview.ws.rest.RestClient.getRsbsDescriptions();
+ rsbsUrls = RestClient.getRsbsDescriptions();
if (rsbsUrls != null)
{
oldRsbsUrls = new Vector<String>(rsbsUrls);
private void updateRsbsServiceList()
{
- jalview.ws.rest.RestClient.setRsbsServices(rsbsUrls);
+ RestClient.setRsbsServices(rsbsUrls);
}
/*