*/
package jalview.gui;
+import java.util.Locale;
+
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.swing.JFileChooser;
+import javax.swing.JOptionPane;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.Rectangle;
+import java.awt.Toolkit;
+import java.awt.datatransfer.Clipboard;
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.StringSelection;
+import java.awt.datatransfer.Transferable;
+import java.awt.dnd.DnDConstants;
+import java.awt.dnd.DropTargetDragEvent;
+import java.awt.dnd.DropTargetDropEvent;
+import java.awt.dnd.DropTargetEvent;
+import java.awt.dnd.DropTargetListener;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.FocusAdapter;
+import java.awt.event.FocusEvent;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+import java.awt.event.KeyAdapter;
+import java.awt.event.KeyEvent;
+import java.awt.event.MouseEvent;
+import java.awt.print.PageFormat;
+import java.awt.print.PrinterJob;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.PrintWriter;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Deque;
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Vector;
+
+import javax.swing.ButtonGroup;
+import javax.swing.JCheckBoxMenuItem;
+import javax.swing.JComponent;
+import javax.swing.JEditorPane;
+import javax.swing.JInternalFrame;
+import javax.swing.JLabel;
+import javax.swing.JLayeredPane;
+import javax.swing.JMenu;
+import javax.swing.JMenuItem;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.SwingUtilities;
+import javax.swing.event.InternalFrameAdapter;
+import javax.swing.event.InternalFrameEvent;
+
+import ext.vamsas.ServiceHandle;
import jalview.analysis.AlignmentSorter;
import jalview.analysis.AlignmentUtils;
import jalview.analysis.CrossRef;
import jalview.schemes.ColourSchemes;
import jalview.schemes.ResidueColourScheme;
import jalview.schemes.TCoffeeColourScheme;
+import jalview.util.HttpUtils;
import jalview.util.ImageMaker.TYPE;
import jalview.util.MessageManager;
import jalview.util.Platform;
{
public static int frameCount;
-
public static final int DEFAULT_WIDTH = 700;
public static final int DEFAULT_HEIGHT = 500;
private int id;
private DataSourceType protocol ;
-
/**
* Creates a new AlignFrame object with specific width and height.
*
public AlignFrame(AlignmentI al, HiddenColumns hiddenColumns, int width,
int height, String sequenceSetId, String viewId)
{
-
id = (++frameCount);
-
setSize(width, height);
if (al.getDataset() == null)
* initalise the alignframe from the underlying viewport data and the
* configurations
*/
-
void init()
{
boolean newPanel = (alignPanel == null);
addAlignmentPanel(alignPanel, newPanel);
// setBackground(Color.white); // BH 2019
-
if (!Jalview.isHeadlessMode())
{
progressBar = new ProgressBar(this.statusPanel, this.statusBar);
addKeyListener();
- final List<AlignmentPanel> selviews = new ArrayList<>();
+ final List<AlignmentViewPanel> selviews = new ArrayList<>();
final List<AlignmentPanel> origview = new ArrayList<>();
final String menuLabel = MessageManager
.getString("label.copy_format_from");
}
}
});
- if (Cache.getDefault("VERSION", "DEVELOPMENT").toLowerCase()
+ if (Cache.getDefault("VERSION", "DEVELOPMENT").toLowerCase(Locale.ROOT)
.indexOf("devel") > -1
- || Cache.getDefault("VERSION", "DEVELOPMENT").toLowerCase()
+ || Cache.getDefault("VERSION", "DEVELOPMENT").toLowerCase(Locale.ROOT)
.indexOf("test") > -1)
{
formatMenu.add(vsel);
}
addFocusListener(new FocusAdapter()
{
-
@Override
public void focusGained(FocusEvent e)
{
* @param format
* format of file
*/
-
@Deprecated
public void setFileName(String file, FileFormatI format)
{
*
* @param file
*/
-
public void setFileObject(File file)
{
this.fileObject = file;
* Add a KeyListener with handlers for various KeyPressed and KeyReleased
* events
*/
-
void addKeyListener()
{
addKeyListener(new KeyAdapter()
{
-
@Override
public void keyPressed(KeyEvent evt)
{
}
if (viewport.cursorMode)
{
- alignPanel.getSeqPanel().moveCursor(0, 1);
+ alignPanel.getSeqPanel().moveCursor(0, 1, evt.isShiftDown());
}
break;
}
if (viewport.cursorMode)
{
- alignPanel.getSeqPanel().moveCursor(0, -1);
+ alignPanel.getSeqPanel().moveCursor(0, -1,evt.isShiftDown());
}
break;
}
else
{
- alignPanel.getSeqPanel().moveCursor(-1, 0);
+ alignPanel.getSeqPanel().moveCursor(-1, 0, evt.isShiftDown());
}
break;
}
else
{
- alignPanel.getSeqPanel().moveCursor(1, 0);
+ alignPanel.getSeqPanel().moveCursor(1, 0, evt.isShiftDown());
}
break;
{
buildWebServicesMenu();
}
-
/* Set up intrinsic listeners for dynamically generated GUI bits. */
private void addServiceListeners()
{
* Configure menu items that vary according to whether the alignment is
* nucleotide or protein
*/
-
public void setGUINucleotide()
{
AlignmentI al = getViewport().getAlignment();
* operation that affects the data in the current view (selection changed,
* etc) to update the menus to reflect the new state.
*/
-
@Override
public void setMenusForViewport()
{
* @param av
* AlignViewport
*/
-
public void setMenusFromViewport(AlignViewport av)
{
padGapsMenuitem.setSelected(av.isPadGaps());
*
* @param b
*/
-
public void setGroovyEnabled(boolean b)
{
runGroovy.setEnabled(b);
*
* @see jalview.gui.IProgressIndicator#setProgressBar(java.lang.String, long)
*/
-
@Override
public void setProgressBar(String message, long id)
{
*
* @return true if any progress bars are still active
*/
-
@Override
public boolean operationInProgress()
{
* will cause the status bar to be hidden, with possibly undesirable flicker
* of the screen layout.
*/
-
@Override
public void setStatus(String text)
{
/*
* Added so Castor Mapping file can obtain Jalview Version
*/
-
public String getVersion()
{
return jalview.bin.Cache.getProperty("VERSION");
Desktop.getInstance().closeAssociatedWindows();
FileLoader loader = new FileLoader();
-// DataSourceType protocol = fileName.startsWith("http:")
-// ? DataSourceType.URL
-// : DataSourceType.FILE;
- loader.LoadFile(viewport, (fileObject == null ? fileName : fileObject), protocol, currentFileFormat);
+ loader.LoadFile(viewport, (fileObject == null ? fileName : fileObject), protocol, currentFileFormat);
}
else
{
final FeatureSettings nfs = newframe.featureSettings;
SwingUtilities.invokeLater(new Runnable()
{
-
@Override
public void run()
{
}
this.closeMenuItem_actionPerformed(true);
}
-
}
@Override
public void save_actionPerformed(ActionEvent e)
{
if (fileName == null || (currentFileFormat == null)
- || fileName.startsWith("http"))
+ || HttpUtils.startsWithHttpOrHttps(fileName))
{
saveAs_actionPerformed();
}
* Saves the alignment to a file with a name chosen by the user, if necessary
* warning if a file would be overwritten
*/
-
@Override
public void saveAs_actionPerformed()
{
*
* @return true if last call to saveAlignment(file, format) was successful.
*/
-
public boolean isSaveAlignmentSuccessful()
{
if (!lastSaveSuccessful)
{
- JvOptionPane.showInternalMessageDialog(this, MessageManager
- .formatMessage("label.couldnt_save_file", new Object[]
- { lastFilenameSaved }),
- MessageManager.getString("label.error_saving_file"),
- JvOptionPane.WARNING_MESSAGE);
+ if (!Platform.isHeadless())
+ {
+ JvOptionPane.showInternalMessageDialog(this, MessageManager
+ .formatMessage("label.couldnt_save_file", new Object[]
+ { lastFilenameSaved }),
+ MessageManager.getString("label.error_saving_file"),
+ JvOptionPane.WARNING_MESSAGE);
+ }
+ else
+ {
+ Cache.log.error(MessageManager
+ .formatMessage("label.couldnt_save_file", new Object[]
+ { lastFilenameSaved }));
+ }
}
else
{
* @param file
* @param format
*/
-
public void saveAlignment(String file, FileFormatI format)
{
lastSaveSuccessful = true;
}
lastSaveSuccessful = new Jalview2XML().saveAlignment(this, file,
shortName);
-
statusBar.setText(MessageManager.formatMessage(
"label.successfully_saved_to_file_in_format", new Object[]
{ fileName, format }));
-
return;
}
AlignExportSettingsI options = new AlignExportSettingsAdapter(false);
Runnable cancelAction = new Runnable()
{
-
@Override
public void run()
{
};
Runnable outputAction = new Runnable()
{
-
@Override
public void run()
{
{
// create backupfiles object and get new temp filename destination
boolean doBackup = BackupFiles.getEnabled();
- BackupFiles backupfiles = doBackup ? new BackupFiles(file) : null;
+ BackupFiles backupfiles = null;
+ if (doBackup)
+ {
+ Cache.log.trace(
+ "ALIGNFRAME making backupfiles object for " + file);
+ backupfiles = new BackupFiles(file);
+ }
try
{
String tempFilePath = doBackup ? backupfiles.getTempFilePath()
: file;
+ Cache.log.trace("ALIGNFRAME setting PrintWriter");
PrintWriter out = new PrintWriter(new FileWriter(tempFilePath));
+ if (backupfiles != null)
+ {
+ Cache.log.trace("ALIGNFRAME about to write to temp file "
+ + backupfiles.getTempFilePath());
+ }
+
out.print(output);
+ Cache.log.trace("ALIGNFRAME about to close file");
out.close();
+ Cache.log.trace("ALIGNFRAME closed file");
AlignFrame.this.setTitle(file);
statusBar.setText(MessageManager.formatMessage(
"label.successfully_saved_to_file_in_format",
new Object[]
{ fileName, format.getName() }));
lastSaveSuccessful = true;
+ } catch (IOException e)
+ {
+ lastSaveSuccessful = false;
+ Cache.log.error(
+ "ALIGNFRAME Something happened writing the temp file");
+ Cache.log.error(e.getMessage());
+ Cache.log.debug(Cache.getStackTraceString(e));
} catch (Exception ex)
{
lastSaveSuccessful = false;
- ex.printStackTrace();
+ Cache.log.error(
+ "ALIGNFRAME Something unexpected happened writing the temp file");
+ Cache.log.error(ex.getMessage());
+ Cache.log.debug(Cache.getStackTraceString(ex));
}
if (doBackup)
{
backupfiles.setWriteSuccess(lastSaveSuccessful);
+ Cache.log.debug("ALIGNFRAME writing temp file was "
+ + (lastSaveSuccessful ? "" : "NOT ") + "successful");
// do the backup file roll and rename the temp file to actual file
+ Cache.log.trace(
+ "ALIGNFRAME about to rollBackupsAndRenameTempFile");
lastSaveSuccessful = backupfiles.rollBackupsAndRenameTempFile();
+ Cache.log.debug(
+ "ALIGNFRAME performed rollBackupsAndRenameTempFile "
+ + (lastSaveSuccessful ? "" : "un")
+ + "successfully");
}
}
}
*
* @param fileFormatName
*/
-
@Override
protected void outputText_actionPerformed(String fileFormatName)
{
AlignExportSettingsI options = new AlignExportSettingsAdapter(false);
Runnable outputAction = new Runnable()
{
-
@Override
public void run()
{
* @param e
* DOCUMENT ME!
*/
-
@Override
protected void htmlMenuItem_actionPerformed(ActionEvent e)
{
}
// ??
-
public void createImageMap(File file, String image)
{
alignPanel.makePNGImageMap(file, image);
*
* @param f
*/
-
@Override
public void createPNG(File f)
{
*
* @param f
*/
-
@Override
public void createEPS(File f)
{
*
* @param f
*/
-
@Override
public void createSVG(File f)
{
* @param e
* DOCUMENT ME!
*/
-
@Override
public void printMenuItem_actionPerformed(ActionEvent e)
{
chooser.setToolTipText(tooltip);
chooser.setResponseHandler(0, new Runnable()
{
-
@Override
public void run()
{
*
* @param closeAllTabs
*/
-
@Override
public void closeMenuItem_actionPerformed(boolean closeAllTabs)
{
*
* @param panelToClose
*/
-
public void closeView(AlignmentPanel panelToClose)
{
int index = tabbedPane.getSelectedIndex();
/**
* DOCUMENT ME!
*/
-
void updateEditMenuBar()
{
*
* @return alignment objects for all views
*/
-
AlignmentI[] getViewAlignments()
{
if (alignPanels != null)
* @param e
* DOCUMENT ME!
*/
-
@Override
protected void undoMenuItem_actionPerformed(ActionEvent e)
{
// viewport.getColumnSelection()
// .getHiddenColumns().size() > 0);
originalSource.notifyAlignment();
-
}
}
* @param e
* DOCUMENT ME!
*/
-
@Override
protected void redoMenuItem_actionPerformed(ActionEvent e)
{
// viewport.getColumnSelection()
// .getHiddenColumns().size() > 0);
originalSource.notifyAlignment();
-
}
}
}
/**
- * DOCUMENT ME!
+ * Calls AlignmentI.moveSelectedSequencesByOne with current sequence selection
+ * or the sequence under cursor in keyboard mode
*
* @param up
- * DOCUMENT ME!
+ * or down (if !up)
*/
-
public void moveSelectedSequences(boolean up)
{
SequenceGroup sg = viewport.getSelectionGroup();
if (sg == null)
{
+ if (viewport.cursorMode)
+ {
+ sg = new SequenceGroup();
+ sg.addSequence(viewport.getAlignment().getSequenceAt(
+ alignPanel.getSeqPanel().seqCanvas.cursorY), false);
+ }
+ else
+ {
+ return;
+ }
+ }
+
+ if (sg.getSize() < 1)
+ {
return;
}
+ // TODO: JAL-3733 - add an event to the undo buffer for this !
viewport.getAlignment().moveSelectedSequencesByOne(sg,
viewport.getHiddenRepSequences(), up);
alignPanel.paintAlignment(true, false);
* @param e
* DOCUMENT ME!
*/
-
@Override
protected void copy_actionPerformed()
{
.setContents(new StringSelection(""), null);
Toolkit.getDefaultToolkit().getSystemClipboard().setContents(ss,
- Desktop.getInstance());
+ d);
} catch (OutOfMemoryError er)
{
new OOMWarning("copying region", er);
* @throws InterruptedException
* @throws IOException
*/
-
@Override
protected void pasteNew_actionPerformed(ActionEvent e)
throws IOException, InterruptedException
* @throws InterruptedException
* @throws IOException
*/
-
@Override
protected void pasteThis_actionPerformed(ActionEvent e)
throws IOException, InterruptedException
System.out.println("Exception whilst pasting: " + ex);
// could be anything being pasted in here
}
+
}
@Override
AlignFrame af = new AlignFrame(alignment, DEFAULT_WIDTH,
DEFAULT_HEIGHT);
String newtitle = new String("Flanking alignment");
+
Desktop d = Desktop.getInstance();
if (d.jalviewClipboard != null && d.jalviewClipboard[2] != null)
{
/**
* Action Cut (delete and copy) the selected region
*/
-
@Override
protected void cut_actionPerformed()
{
/**
* Performs menu option to Delete the currently selected region
*/
-
@Override
protected void delete_actionPerformed()
{
* @param e
* DOCUMENT ME!
*/
-
@Override
protected void deleteGroups_actionPerformed(ActionEvent e)
{
* @param e
* DOCUMENT ME!
*/
-
@Override
public void selectAllSequenceMenuItem_actionPerformed(ActionEvent e)
{
* @param e
* DOCUMENT ME!
*/
-
@Override
public void deselectAllSequenceMenuItem_actionPerformed(ActionEvent e)
{
* @param e
* DOCUMENT ME!
*/
-
@Override
public void invertSequenceMenuItem_actionPerformed(ActionEvent e)
{
* @param e
* DOCUMENT ME!
*/
-
@Override
public void remove2LeftMenuItem_actionPerformed(ActionEvent e)
{
* @param e
* DOCUMENT ME!
*/
-
@Override
public void remove2RightMenuItem_actionPerformed(ActionEvent e)
{
}
viewport.notifyAlignment();
-
}
}
* @param e
* DOCUMENT ME!
*/
-
@Override
public void removeGappedColumnMenuItem_actionPerformed(ActionEvent e)
{
ranges.setStartRes(seq.findIndex(startRes) - 1);
viewport.notifyAlignment();
-
}
/**
* @param e
* DOCUMENT ME!
*/
-
@Override
public void removeAllGapsMenuItem_actionPerformed(ActionEvent e)
{
viewport.getAlignment()));
viewport.getRanges().setStartRes(seq.findIndex(startRes) - 1);
+
viewport.notifyAlignment();
}
* @param e
* DOCUMENT ME!
*/
-
@Override
public void padGapsMenuitem_actionPerformed(ActionEvent e)
{
viewport.setPadGaps(padGapsMenuitem.isSelected());
viewport.notifyAlignment();
-
}
/**
- * DOCUMENT ME!
+ * Opens a Finder dialog
*
* @param e
- * DOCUMENT ME!
*/
-
@Override
public void findMenuItem_actionPerformed(ActionEvent e)
{
- new Finder();
+ new Finder(alignPanel, false, null);
}
/**
* Create a new view of the current alignment.
*/
-
@Override
public void newView_actionPerformed(ActionEvent e)
{
* if true then duplicate all annnotation, groups and settings
* @return new alignment panel, already displayed.
*/
-
public AlignmentPanel newView(String viewTitle, boolean copyAnnotation)
{
/*
* @param viewTitle
* @return
*/
-
protected String getNewViewName(String viewTitle)
{
int index = Desktop.getViewCount(viewport.getSequenceSetId());
* @param comps
* @return
*/
-
protected List<String> getExistingViewNames(List<Component> comps)
{
List<String> existingNames = new ArrayList<>();
/**
* Explode tabbed views into separate windows.
*/
-
@Override
public void expandViews_actionPerformed(ActionEvent e)
{
/**
* Gather views in separate windows back into a tabbed presentation.
*/
-
@Override
public void gatherViews_actionPerformed(ActionEvent e)
{
* @param e
* DOCUMENT ME!
*/
-
@Override
public void font_actionPerformed(ActionEvent e)
{
* @param e
* DOCUMENT ME!
*/
-
@Override
protected void seqLimit_actionPerformed(ActionEvent e)
{
*
* @see jalview.jbgui.GAlignFrame#followHighlight_actionPerformed()
*/
-
@Override
protected void followHighlight_actionPerformed()
{
* @param e
* DOCUMENT ME!
*/
-
@Override
protected void colourTextMenuItem_actionPerformed(ActionEvent e)
{
* @param e
* DOCUMENT ME!
*/
-
@Override
public void wrapMenuItem_actionPerformed(ActionEvent e)
{
* @param toggleSeqs
* @param toggleCols
*/
-
protected void toggleHiddenRegions(boolean toggleSeqs, boolean toggleCols)
{
* jalview.jbgui.GAlignFrame#hideAllButSelection_actionPerformed(java.awt.
* event.ActionEvent)
*/
-
@Override
public void hideAllButSelection_actionPerformed(ActionEvent e)
{
* jalview.jbgui.GAlignFrame#hideAllSelection_actionPerformed(java.awt.event
* .ActionEvent)
*/
-
@Override
public void hideAllSelection_actionPerformed(ActionEvent e)
{
* jalview.jbgui.GAlignFrame#showAllhidden_actionPerformed(java.awt.event.
* ActionEvent)
*/
-
@Override
public void showAllhidden_actionPerformed(ActionEvent e)
{
* @param e
* DOCUMENT ME!
*/
-
@Override
protected void scaleAbove_actionPerformed(ActionEvent e)
{
* @param e
* DOCUMENT ME!
*/
-
@Override
protected void scaleLeft_actionPerformed(ActionEvent e)
{
* @param e
* DOCUMENT ME!
*/
-
@Override
protected void scaleRight_actionPerformed(ActionEvent e)
{
* @param e
* DOCUMENT ME!
*/
-
@Override
public void viewBoxesMenuItem_actionPerformed(ActionEvent e)
{
* @param e
* DOCUMENT ME!
*/
-
@Override
public void viewTextMenuItem_actionPerformed(ActionEvent e)
{
* @param e
* DOCUMENT ME!
*/
-
@Override
protected void renderGapsMenuItem_actionPerformed(ActionEvent e)
{
* @param evt
* DOCUMENT ME!
*/
-
@Override
public void showSeqFeatures_actionPerformed(ActionEvent evt)
{
*
* @param e
*/
-
@Override
public void annotationPanelMenuItem_actionPerformed(ActionEvent e)
{
JLabel textLabel = new JLabel();
textLabel.setText(content);
textLabel.setBackground(Color.WHITE);
-
pane = new JPanel(new BorderLayout());
((JPanel) pane).setOpaque(true);
pane.setBackground(Color.WHITE);
* @param e
* DOCUMENT ME!
*/
-
@Override
public void overviewMenuItem_actionPerformed(ActionEvent e)
{
}
JInternalFrame frame = new JInternalFrame();
-
// BH 2019.07.26 we allow for an embedded
// undecorated overview with defined size
frame.setName(Platform.getAppID("overview"));
dim = null; // hidden, not embedded
}
OverviewPanel overview = new OverviewPanel(alignPanel, dim);
-
frame.setContentPane(overview);
if (dim == null)
{
frame.addInternalFrameListener(
new javax.swing.event.InternalFrameAdapter()
{
-
@Override
public void internalFrameClosed(
javax.swing.event.InternalFrameEvent evt)
* CovariationColourScheme(viewport.getAlignment().getAlignmentAnnotation
* ()[0])); }
*/
-
@Override
public void annotationColour_actionPerformed()
{
*
* @param selected
*/
-
@Override
public void applyToAllGroups_actionPerformed(boolean selected)
{
* @param name
* the name (not the menu item label!) of the colour scheme
*/
-
@Override
public void changeColour_actionPerformed(String name)
{
*
* @param cs
*/
-
@Override
public void changeColour(ColourSchemeI cs)
{
/**
* Show the PID threshold slider panel
*/
-
@Override
protected void modifyPID_actionPerformed()
{
/**
* Show the Conservation slider panel
*/
-
@Override
protected void modifyConservation_actionPerformed()
{
/**
* Action on selecting or deselecting (Colour) By Conservation
*/
-
@Override
public void conservationMenuItem_actionPerformed(boolean selected)
{
/**
* Action on selecting or deselecting (Colour) Above PID Threshold
*/
-
@Override
public void abovePIDThreshold_actionPerformed(boolean selected)
{
* @param e
* DOCUMENT ME!
*/
-
@Override
public void sortPairwiseMenuItem_actionPerformed(ActionEvent e)
{
* @param e
* DOCUMENT ME!
*/
-
@Override
public void sortIDMenuItem_actionPerformed(ActionEvent e)
{
* @param e
* DOCUMENT ME!
*/
-
@Override
public void sortLengthMenuItem_actionPerformed(ActionEvent e)
{
* @param e
* DOCUMENT ME!
*/
-
@Override
public void sortGroupMenuItem_actionPerformed(ActionEvent e)
{
alignPanel.paintAlignment(true, false);
}
-
/**
* DOCUMENT ME!
*
* @param e
* DOCUMENT ME!
*/
-
@Override
public void removeRedundancyMenuItem_actionPerformed(ActionEvent e)
{
* @param e
* DOCUMENT ME!
*/
-
@Override
public void pairwiseAlignmentMenuItem_actionPerformed(ActionEvent e)
{
viewport.setAutoCalculateConsensusAndConservation(
autoCalculate.isSelected());
if (viewport.getAutoCalculateConsensusAndConservation())
- // ??
- // viewport.autoCalculateConsensus = autoCalculate.isSelected();
- // if (viewport.autoCalculateConsensus)
{
viewport.notifyAlignment();
}
* @param options
* parameters for the distance or similarity calculation
*/
-
void newTreePanel(String type, String modelName,
SimilarityParamsI options)
{
* @param order
* DOCUMENT ME!
*/
-
public void addSortByOrderMenuItem(String title,
final AlignmentOrder order)
{
sort.add(item);
item.addActionListener(new java.awt.event.ActionListener()
{
-
@Override
public void actionPerformed(ActionEvent e)
{
* the label used to retrieve scores for each sequence on the
* alignment
*/
-
public void addSortByAnnotScoreMenuItem(JMenu sort,
final String scoreLabel)
{
sort.add(item);
item.addActionListener(new java.awt.event.ActionListener()
{
-
@Override
public void actionPerformed(ActionEvent e)
{
* rebuilding in subsequence calls.
*
*/
-
@Override
public void buildSortByAnnotationScoresMenu()
{
* closed, and adjust the tree leaf to sequence mapping when the alignment is
* modified.
*/
-
@Override
public void buildTreeSortMenu()
{
final JMenuItem item = new JMenuItem(tp.getTitle());
item.addActionListener(new java.awt.event.ActionListener()
{
-
@Override
public void actionPerformed(ActionEvent e)
{
}
return treePanels;
}
-
public boolean sortBy(AlignmentOrder alorder, String undoname)
{
SequenceI[] oldOrder = viewport.getAlignment().getSequencesArray();
* be submitted for multiple alignment.
*
*/
-
public jalview.datamodel.AlignmentView gatherSequencesForAlignment()
{
// Now, check we have enough sequences
* region or the whole alignment. (where the first sequence in the set is the
* one that the prediction will be for).
*/
-
public AlignmentView gatherSeqOrMsaForSecStrPrediction()
{
AlignmentView seqs = null;
* @param e
* DOCUMENT ME!
*/
-
@Override
protected void loadTreeMenuItem_actionPerformed(ActionEvent e)
{
chooser.setResponseHandler(0, new Runnable()
{
-
@Override
public void run()
{
* position
* @return TreePanel handle
*/
-
public TreePanel showNewickTree(NewickFile nf, String treeTitle,
AlignmentView input, int w, int h, int x, int y)
{
if (nf.getTree() != null)
{
tp = new TreePanel(alignPanel, nf, treeTitle, input);
+
Dimension dim = Platform.getDimIfEmbedded(tp, -1, -1);
if (dim == null)
{
return tp;
}
+
/**
* Schedule the web services menu rebuild to the event dispatch thread.
*/
*
* @param webService
*/
-
protected void build_urlServiceMenu(JMenu webService)
{
// TODO: remove this code when 2.7 is released
*
* @return true if Show Cross-references menu should be enabled
*/
-
public boolean canShowProducts()
{
SequenceI[] seqs = viewport.getAlignment().getSequencesArray();
JMenuItem xtype = new JMenuItem(source);
xtype.addActionListener(new ActionListener()
{
-
@Override
public void actionPerformed(ActionEvent e)
{
* @param source
* the database to show cross-references for
*/
-
protected void showProductsFor(final SequenceI[] sel, final boolean _odna,
final String source)
{
* Construct and display a new frame containing the translation of this
* frame's DNA sequences to their aligned protein (amino acid) equivalents.
*/
-
@Override
public void showTranslation_actionPerformed(GeneticCodeI codeTable)
{
*
* @param format
*/
-
public void setFileFormat(FileFormatI format)
{
this.currentFileFormat = format;
* access mode of file (see jalview.io.AlignFile)
* @return true if features file was parsed correctly.
*/
-
public boolean parseFeaturesFile(Object file, DataSourceType sourceType)
{
// BH 2018
+ " with " + toassoc.getDisplayId(true));
assocfiles++;
}
+
}
// TODO: do we need to update overview ? only if features are
// shown I guess
* @throws InterruptedException
* @throws IOException
*/
-
public void loadJalviewDataFile(Object file, DataSourceType sourceType,
FileFormatI format, SequenceI assocSeq)
{
}
if (isAnnotation)
{
+
updateForAnnotations();
}
} catch (Exception ex)
* Method invoked by the ChangeListener on the tabbed pane, in other words
* when a different tabbed pane is selected by the user or programmatically.
*/
-
@Override
public void tabSelectionChanged(int index)
{
/**
* On right mouse click on view tab, prompt for and set new view name.
*/
-
@Override
public void tabbedPane_mousePressed(MouseEvent e)
{
/**
* Open the dialog for regex description parsing.
*/
-
@Override
protected void extractScores_actionPerformed(ActionEvent e)
{
* jalview.jbgui.GAlignFrame#showDbRefs_actionPerformed(java.awt.event.ActionEvent
* )
*/
-
@Override
protected void showDbRefs_actionPerformed(ActionEvent e)
{
* @seejalview.jbgui.GAlignFrame#showNpFeats_actionPerformed(java.awt.event.
* ActionEvent)
*/
-
@Override
protected void showNpFeats_actionPerformed(ActionEvent e)
{
*
* @param av
*/
-
public boolean closeView(AlignViewportI av)
{
if (viewport == av)
Cache.getDefault(DBRefFetcher.TRIM_RETRIEVED_SEQUENCES, true));
trimrs.addActionListener(new ActionListener()
{
-
@Override
public void actionPerformed(ActionEvent e)
{
{
new Thread(new Runnable()
{
-
@Override
public void run()
{
alignPanel.alignFrame.featureSettings, isNucleotide);
dbRefFetcher.addListener(new FetchFinishedListenerI()
{
-
@Override
public void finished()
{
rfetch.add(fetchr);
new Thread(new Runnable()
{
-
@Override
public void run()
{
// .getSequenceFetcherSingleton();
javax.swing.SwingUtilities.invokeLater(new Runnable()
{
-
@Override
public void run()
{
dbRefFetcher
.addListener(new FetchFinishedListenerI()
{
-
@Override
public void finished()
{
{ src.getDbSource() }));
fetchr.addActionListener(new ActionListener()
{
-
@Override
public void actionPerformed(ActionEvent e)
{
dbRefFetcher
.addListener(new FetchFinishedListenerI()
{
-
@Override
public void finished()
{
dbRefFetcher
.addListener(new FetchFinishedListenerI()
{
-
@Override
public void finished()
{
/**
* Left justify the whole alignment.
*/
-
@Override
protected void justifyLeftMenuItem_actionPerformed(ActionEvent e)
{
/**
* Right justify the whole alignment.
*/
-
@Override
protected void justifyRightMenuItem_actionPerformed(ActionEvent e)
{
* jalview.jbgui.GAlignFrame#showUnconservedMenuItem_actionPerformed(java.
* awt.event.ActionEvent)
*/
-
@Override
protected void showUnconservedMenuItem_actionPerformed(ActionEvent e)
{
* jalview.jbgui.GAlignFrame#showGroupConsensus_actionPerformed(java.awt.event
* .ActionEvent)
*/
-
@Override
protected void showGroupConsensus_actionPerformed(ActionEvent e)
{
* jalview.jbgui.GAlignFrame#showGroupConservation_actionPerformed(java.awt
* .event.ActionEvent)
*/
-
@Override
protected void showGroupConservation_actionPerformed(ActionEvent e)
{
* jalview.jbgui.GAlignFrame#showConsensusHistogram_actionPerformed(java.awt
* .event.ActionEvent)
*/
-
@Override
protected void showConsensusHistogram_actionPerformed(ActionEvent e)
{
* jalview.jbgui.GAlignFrame#showConsensusProfile_actionPerformed(java.awt
* .event.ActionEvent)
*/
-
@Override
protected void showSequenceLogo_actionPerformed(ActionEvent e)
{
* jalview.jbgui.GAlignFrame#makeGrpsFromSelection_actionPerformed(java.awt
* .event.ActionEvent)
*/
-
@Override
protected void makeGrpsFromSelection_actionPerformed(ActionEvent e)
{
*
* @param alignmentPanel
*/
-
public void setDisplayedView(AlignmentPanel alignmentPanel)
{
if (!viewport.getSequenceSetId()
* @param forAlignment
* update non-sequence-related annotations
*/
-
@Override
protected void setAnnotationsVisibility(boolean visible,
boolean forSequences, boolean forAlignment)
/**
* Store selected annotation sort order for the view and repaint.
*/
-
@Override
protected void sortAnnotations_actionPerformed()
{
*
* @return alignment panels in this alignment frame
*/
-
public List<? extends AlignmentViewPanel> getAlignPanels()
{
// alignPanels is never null
* Open a new alignment window, with the cDNA associated with this (protein)
* alignment, aligned as is the protein.
*/
-
protected void viewAsCdna_actionPerformed()
{
// TODO no longer a menu action - refactor as required
*
* @param show
*/
-
@Override
protected void showComplement_actionPerformed(boolean show)
{
* Generate the reverse (optionally complemented) of the selected sequences,
* and add them to the alignment
*/
-
@Override
protected void showReverse_actionPerformed(boolean complement)
{
* AlignFrame is set as currentAlignFrame in Desktop, to allow the script to
* be targeted at this alignment.
*/
-
@Override
protected void runGroovy_actionPerformed()
{
* @param columnsContaining
* @return
*/
-
public boolean hideFeatureColumns(String featureType,
boolean columnsContaining)
{
* Rebuilds the Colour menu, including any user-defined colours which have
* been loaded either on startup or during the session
*/
-
public void buildColourMenu()
{
colourMenu.removeAll();
* Open a dialog (if not already open) that allows the user to select and
* calculate PCA or Tree analysis
*/
-
protected void openTreePcaDialog()
{
if (alignPanel.getCalculationDialog() == null)
{
hmmerMenu.setEnabled(HmmerCommand.isHmmerAvailable());
}
-
@Override
protected void loadVcf_actionPerformed()
{
final AlignFrame us = this;
chooser.setResponseHandler(0, new Runnable()
{
-
@Override
public void run()
{
}
private Rectangle lastFeatureSettingsBounds = null;
-
@Override
public void setFeatureSettingsGeometry(Rectangle bounds)
{
}
}
}
-