import jalview.bin.Cache;
import jalview.bin.Console;
import jalview.bin.Jalview;
+import jalview.bin.groovy.JalviewObjectI;
import jalview.commands.CommandI;
import jalview.commands.EditCommand;
import jalview.commands.EditCommand.Action;
@Override
public void focusGained(FocusEvent e)
{
- Jalview.setCurrentAlignFrame(AlignFrame.this);
+ Jalview.getInstance().setCurrentAlignFrame(AlignFrame.this);
}
});
*/
public void saveAlignment(String file, FileFormatI format)
{
- saveAlignment(file, format, false);
+ saveAlignment(file, format, false, false);
}
- public void saveAlignment(String file, FileFormatI format, boolean stdout)
+ public void saveAlignment(String file, FileFormatI format, boolean stdout,
+ boolean forceBackup)
{
lastSaveSuccessful = true;
if (!stdout)
else
{
// create backupfiles object and get new temp filename destination
- boolean doBackup = BackupFiles.getEnabled() && !stdout;
+ boolean doBackup = forceBackup
+ || (BackupFiles.getEnabled() && !stdout);
BackupFiles backupfiles = null;
if (doBackup)
{
*/
public void createPNG(File f) throws ImageOutputException
{
- createPNG(f, null, BitmapImageSizing.nullBitmapImageSizing());
+ createPNG(f, null, BitmapImageSizing.defaultBitmapImageSizing());
}
public void createPNG(File f, String renderer, BitmapImageSizing userBis)
closeAllTabs = true;
}
+ Desktop.closeModal(this);
+
try
{
if (alignPanels != null)
featureSettings.close();
featureSettings = null;
}
+
/*
* this will raise an INTERNAL_FRAME_CLOSED event and this method will
* be called recursively, with the frame now in 'closed' state
*
* @return alignment objects for all views
*/
- AlignmentI[] getViewAlignments()
+ public AlignmentI[] getViewAlignments()
{
if (alignPanels != null)
{
@Override
public void wrapMenuItem_actionPerformed(ActionEvent e)
{
- scaleAbove.setVisible(wrapMenuItem.isSelected());
- scaleLeft.setVisible(wrapMenuItem.isSelected());
- scaleRight.setVisible(wrapMenuItem.isSelected());
- viewport.setWrapAlignment(wrapMenuItem.isSelected());
+ setWrapFormat(wrapMenuItem.isSelected(), false);
+ }
+
+ public void setWrapFormat(boolean b, boolean setMenuItem)
+ {
+ scaleAbove.setVisible(b);
+ scaleLeft.setVisible(b);
+ scaleRight.setVisible(b);
+ viewport.setWrapAlignment(b);
alignPanel.updateLayout();
+ if (setMenuItem)
+ {
+ wrapMenuItem.setSelected(b);
+ }
}
@Override
}
JInternalFrame frame = new JInternalFrame();
-
+ frame.setFrameIcon(null);
frame.getContentPane().add(new JScrollPane(pane));
Desktop.addInternalFrame(frame, MessageManager
return alignPanel.overviewPanel;
}
JInternalFrame frame = new JInternalFrame();
+ frame.setFrameIcon(null);
final OverviewPanel overview = new OverviewPanel(alignPanel, frame,
showHidden);
frame.setContentPane(overview);
Desktop.addInternalFrame(frame, "", true, frame.getWidth(),
frame.getHeight(), true, true);
- frame.setFrameIcon(null);
frame.pack();
frame.setLayer(JLayeredPane.PALETTE_LAYER);
final AlignmentPanel thePanel = this.alignPanel;
else
{
JInternalFrame frame = new JInternalFrame();
+ frame.setFrameIcon(null);
frame.setContentPane(new PairwiseAlignPanel(viewport));
Desktop.addInternalFrame(frame,
MessageManager.getString("action.pairwise_alignment"), 600,
* Object[] { String,SequenceI}
*/
ArrayList<Object[]> filesmatched = new ArrayList<>();
- ArrayList<Object> filesnotmatched = new ArrayList<>();
+ ArrayList<Object[]> filesnotmatched = new ArrayList<>();
for (int i = 0; i < files.size(); i++)
{
// BH 2018
}
mtch = idm.findAllIdMatches(pdbfn);
}
+ FileFormatI type = null;
if (mtch != null)
{
- FileFormatI type;
try
{
type = new IdentifyFile().identify(file, protocol);
}
// File wasn't named like one of the sequences or wasn't a PDB
// file.
- filesnotmatched.add(file);
+ filesnotmatched.add(new Object[] { file, protocol, type });
}
}
int assocfiles = 0;
*/
for (Object[] o : filesmatched)
{
- filesnotmatched.add(o[0]);
+ filesnotmatched.add(new Object[] { o[0], o[1] });
}
}
}
{
return;
}
- for (Object fn : filesnotmatched)
+ for (Object[] fn : filesnotmatched)
{
- loadJalviewDataFile(fn, null, null, null);
+ loadJalviewDataFile(fn[0], (DataSourceType) fn[1],
+ (FileFormatI) fn[2], null);
}
}
{
format = new IdentifyFile().identify(file, sourceType);
}
- if (FileFormat.ScoreMatrix == format)
+ if (FileFormat.FeatureSettings == format)
+ {
+ if (featureSettings != null)
+ {
+ featureSettings.load(file, sourceType);
+ }
+ else
+ {
+ FeatureSettings.loadFeatureSettingsFile(getFeatureRenderer(),
+ fileObject, sourceType);
+ }
+ }
+ else if (FileFormat.ScoreMatrix == format)
{
ScoreMatrixFile sm = new ScoreMatrixFile(
new FileParse(file, sourceType));
}
}
alignPanel.validateAnnotationDimensions(true);
+ // TODO this triggers relayout of annotation panel - otherwise annotation
+ // label height is different to panel height
+ alignPanel.fontChanged();
alignPanel.alignmentChanged();
}
@Override
protected void runGroovy_actionPerformed()
{
- Jalview.setCurrentAlignFrame(this);
- groovy.ui.Console console = Desktop.getGroovyConsole();
+ Jalview.getInstance().setCurrentAlignFrame(this);
+ groovy.console.ui.Console console = Desktop.getGroovyConsole();
if (console != null)
{
try
{
+ console.setVariable(JalviewObjectI.currentAlFrameName, this);
console.runScript();
} catch (Exception ex)
{