Desktop.getDesktop().propertyChange(evt);
}
-
/**
- * BH 2018
- *
+ * BH 2018
+ *
* @return true if we have any features
*/
@Override
- protected boolean haveAlignmentFeatures() {
+ protected boolean haveAlignmentFeatures()
+ {
AlignmentI alignment = getViewport().getAlignment();
for (int i = 0; i < alignment.getHeight(); i++)
SequenceI seq = alignment.getSequenceAt(i);
for (String group : seq.getFeatures().getFeatureGroups(true))
{
- if (group != null)return true;
+ if (group != null)
+ return true;
}
}
- return false;
+ return false;
}
-
+
/**
* initalise the alignframe from the underlying viewport data and the
* configurations
*
*/
{
- addServiceListeners();
+ addServiceListeners();
}
setGUINucleotide();
}
setFileFormat(format);
reload.setEnabled(true);
}
-
+
/**
* JavaScript will have this, maybe others. More dependable than a file name
* and maintains a reference to the actual bytes loaded.
*
* @param file
*/
- public void setFileObject(File file) {
+ public void setFileObject(File file)
+ {
this.fileObject = file;
}
FileLoader loader = new FileLoader();
DataSourceType protocol = fileName.startsWith("http:")
- ? DataSourceType.URL : DataSourceType.FILE;
+ ? DataSourceType.URL
+ : DataSourceType.FILE;
loader.LoadFile(viewport, fileName, protocol, currentFileFormat);
}
else
{
DataSourceType protocol = (fileName.startsWith("http:")
- ? DataSourceType.URL : DataSourceType.FILE);
+ ? DataSourceType.URL
+ : DataSourceType.FILE);
newframe = loader.LoadFileWaitTillLoaded(fileName, protocol,
currentFileFormat);
}
else
{
- newframe = loader.LoadFileWaitTillLoaded(fileObject, DataSourceType.FILE, currentFileFormat);
+ newframe = loader.LoadFileWaitTillLoaded(fileObject,
+ DataSourceType.FILE, currentFileFormat);
}
newframe.setBounds(bounds);
{
@Override
public void run()
- {
+ {
currentFileFormat = chooser.getSelectedFormat();
while (currentFileFormat == null)
{
chooser.setToolTipText(
MessageManager.getString("label.load_jalview_annotations"));
chooser.response(new RunResponse(JalviewFileChooser.APPROVE_OPTION)
- {
+ {
- @Override
- public void run()
- {
- String choice = chooser.getSelectedFile().getPath();
- jalview.bin.Cache.setProperty("LAST_DIRECTORY", choice);
- loadJalviewDataFile(chooser.getSelectedFile(), null, null, null);
- }
+ @Override
+ public void run()
+ {
+ String choice = chooser.getSelectedFile().getPath();
+ jalview.bin.Cache.setProperty("LAST_DIRECTORY", choice);
+ loadJalviewDataFile(chooser.getSelectedFile(), null, null, null);
+ }
- });
+ });
chooser.openDialog(this);
}
chooser.setToolTipText(
MessageManager.getString("label.load_tree_file"));
- chooser.response(
- new jalview.util.dialogrunner.RunResponse(JalviewFileChooser.APPROVE_OPTION)
- {
- @Override
- public void run()
- {
- String filePath = chooser.getSelectedFile().getPath();
- Cache.setProperty("LAST_DIRECTORY", filePath);
- NewickFile fin = null;
- try
- {
- fin = new NewickFile(new FileParse(
- chooser.getSelectedFile(), DataSourceType.FILE));
- viewport.setCurrentTree(
- showNewickTree(fin, filePath).getTree());
- } catch (Exception ex)
- {
- JvOptionPane.showMessageDialog(Desktop.desktop,
- ex.getMessage(),
- MessageManager.getString(
- "label.problem_reading_tree_file"),
- JvOptionPane.WARNING_MESSAGE);
- ex.printStackTrace();
- }
- if (fin != null && fin.hasWarningMessage())
- {
- JvOptionPane.showMessageDialog(Desktop.desktop,
- fin.getWarningMessage(),
- MessageManager.getString(
- "label.possible_problem_with_tree_file"),
- JvOptionPane.WARNING_MESSAGE);
- }
- }
- }).openDialog(this);
+ chooser.response(new jalview.util.dialogrunner.RunResponse(
+ JalviewFileChooser.APPROVE_OPTION)
+ {
+ @Override
+ public void run()
+ {
+ String filePath = chooser.getSelectedFile().getPath();
+ Cache.setProperty("LAST_DIRECTORY", filePath);
+ NewickFile fin = null;
+ try
+ {
+ fin = new NewickFile(new FileParse(chooser.getSelectedFile(),
+ DataSourceType.FILE));
+ viewport.setCurrentTree(showNewickTree(fin, filePath).getTree());
+ } catch (Exception ex)
+ {
+ JvOptionPane.showMessageDialog(Desktop.desktop, ex.getMessage(),
+ MessageManager
+ .getString("label.problem_reading_tree_file"),
+ JvOptionPane.WARNING_MESSAGE);
+ ex.printStackTrace();
+ }
+ if (fin != null && fin.hasWarningMessage())
+ {
+ JvOptionPane.showMessageDialog(Desktop.desktop,
+ fin.getWarningMessage(),
+ MessageManager.getString(
+ "label.possible_problem_with_tree_file"),
+ JvOptionPane.WARNING_MESSAGE);
+ }
+ }
+ }).openDialog(this);
}
public TreePanel showNewickTree(NewickFile nf, String treeTitle)
*/
public boolean parseFeaturesFile(Object file, DataSourceType sourceType)
{
- // BH 2018
+ // BH 2018
return avc.parseFeaturesFile(file, sourceType,
Cache.getDefault("RELAXEDSEQIDMATCHING", false));
// Java's Transferable for native dnd
evt.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE);
Transferable t = evt.getTransferable();
-
-
+
final AlignFrame thisaf = this;
final List<Object> files = new ArrayList<>();
List<DataSourceType> protocols = new ArrayList<>();
ArrayList<Object> filesnotmatched = new ArrayList<>();
for (int i = 0; i < files.size(); i++)
{
- // BH 2018
+ // BH 2018
Object file = files.get(i);
String fileName = file.toString();
String pdbfn = "";
- DataSourceType protocol = (file instanceof File ? DataSourceType.FILE : FormatAdapter.checkProtocol(fileName));
+ DataSourceType protocol = (file instanceof File
+ ? DataSourceType.FILE
+ : FormatAdapter.checkProtocol(fileName));
if (protocol == DataSourceType.FILE)
{
- File fl = (file instanceof File ? (File) file : new File(fileName));
+ File fl = (file instanceof File ? (File) file
+ : new File(fileName));
pdbfn = fl.getName();
}
else if (protocol == DataSourceType.URL)
int assocfiles = 0;
if (filesmatched.size() > 0)
{
- boolean autoAssociate = Cache.getDefault("AUTOASSOCIATE_PDBANDSEQS", false);
+ boolean autoAssociate = Cache
+ .getDefault("AUTOASSOCIATE_PDBANDSEQS", false);
if (!autoAssociate)
{
String msg = MessageManager.formatMessage(