/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8)
+ * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
* Jalview is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
- *
+ *
* Jalview is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR
AlignViewport viewport;
Vector alignPanels = new Vector();
-
+
/**
* Last format used to load or save alignments in this window
*/
{
addKeyListener(new KeyAdapter()
{
+ @Override
public void keyPressed(KeyEvent evt)
{
if (viewport.cursorMode
}
}
+ @Override
public void keyReleased(KeyEvent evt)
{
switch (evt.getKeyCode())
Desktop.instance.addJalviewPropertyChangeListener("services",
thisListener = new java.beans.PropertyChangeListener()
{
+ @Override
public void propertyChange(PropertyChangeEvent evt)
{
// // System.out.println("Discoverer property change.");
SwingUtilities.invokeLater(new Runnable()
{
+ @Override
public void run()
{
System.err
});
addInternalFrameListener(new javax.swing.event.InternalFrameAdapter()
{
+ @Override
public void internalFrameClosed(
javax.swing.event.InternalFrameEvent evt)
{
// Finally, build the menu once to get current service state
new Thread(new Runnable()
{
+ @Override
public void run()
{
BuildWebServiceMenu();
updateEditMenuBar();
}
+ // methods for implementing IProgressIndicator
+ // need to refactor to a reusable stub class
Hashtable progressBars, progressBarHandlers;
/*
*
* @see jalview.gui.IProgressIndicator#setProgressBar(java.lang.String, long)
*/
+ @Override
public void setProgressBar(String message, long id)
{
if (progressBars == null)
validate();
}
+ @Override
public void registerHandler(final long id,
final IProgressIndicatorHandler handler)
{
cancel.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
handler.cancelActivity(id);
*
* @return true if any progress bars are still active
*/
+ @Override
public boolean operationInProgress()
{
if (progressBars != null && progressBars.size() > 0)
return alignPanel.seqPanel.seqCanvas.getFeatureRenderer();
}
+ @Override
public void fetchSequence_actionPerformed(ActionEvent e)
{
new SequenceFetcher(this);
}
+ @Override
public void addFromFile_actionPerformed(ActionEvent e)
{
Desktop.instance.inputLocalFileMenuItem_actionPerformed(viewport);
}
+ @Override
public void reload_actionPerformed(ActionEvent e)
{
if (fileName != null)
for (int i = 0; i < frames.length; i++)
{
if (frames[i] instanceof AlignFrame && frames[i] != this
+ && ((AlignFrame) frames[i]).fileName != null
&& ((AlignFrame) frames[i]).fileName.equals(fileName))
{
try
final FeatureSettings nfs = newframe.featureSettings;
SwingUtilities.invokeLater(new Runnable()
{
+ @Override
public void run()
{
nfs.frame.setBounds(fspos);
}
}
+ @Override
public void addFromText_actionPerformed(ActionEvent e)
{
Desktop.instance.inputTextboxMenuItem_actionPerformed(viewport);
}
+ @Override
public void addFromURL_actionPerformed(ActionEvent e)
{
Desktop.instance.inputURLMenuItem_actionPerformed(viewport);
}
+ @Override
public void save_actionPerformed(ActionEvent e)
{
if (fileName == null
* @param e
* DOCUMENT ME!
*/
+ @Override
public void saveAs_actionPerformed(ActionEvent e)
{
JalviewFileChooser chooser = new JalviewFileChooser(
}
}
FormatAdapter f = new FormatAdapter();
- String output = f.formatSequences(
- format,
- (Alignment) viewport.getAlignment(), // class cast exceptions will
+ String output = f.formatSequences(format,
+ viewport.getAlignment(), // class cast exceptions will
// occur in the distant future
omitHidden, f.getCacheSuffixDefault(format),
viewport.getColumnSelection());
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void outputText_actionPerformed(ActionEvent e)
{
String[] omitHidden = null;
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void htmlMenuItem_actionPerformed(ActionEvent e)
{
new HTMLOutput(alignPanel,
* @param e
* DOCUMENT ME!
*/
+ @Override
public void createPNG(File f)
{
alignPanel.makePNG(f);
* @param e
* DOCUMENT ME!
*/
+ @Override
public void createEPS(File f)
{
alignPanel.makeEPS(f);
}
+ @Override
public void pageSetup_actionPerformed(ActionEvent e)
{
PrinterJob printJob = PrinterJob.getPrinterJob();
* @param e
* DOCUMENT ME!
*/
+ @Override
public void printMenuItem_actionPerformed(ActionEvent e)
{
// Putting in a thread avoids Swing painting problems
thread.start();
}
+ @Override
public void exportFeatures_actionPerformed(ActionEvent e)
{
new AnnotationExporter().exportFeatures(alignPanel);
}
+ @Override
public void exportAnnotations_actionPerformed(ActionEvent e)
{
new AnnotationExporter().exportAnnotations(alignPanel,
.getAlignment()).alignmentProperties);
}
+ @Override
public void associatedData_actionPerformed(ActionEvent e)
{
// Pick the tree file
*
* @param closeAllTabs
*/
+ @Override
public void closeMenuItem_actionPerformed(boolean closeAllTabs)
{
if (alignPanels != null && alignPanels.size() < 2)
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void undoMenuItem_actionPerformed(ActionEvent e)
{
if (viewport.historyList.empty())
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void redoMenuItem_actionPerformed(ActionEvent e)
{
if (viewport.redoList.size() < 1)
{
return;
}
-
- if (up)
- {
- for (int i = 1; i < viewport.getAlignment().getHeight(); i++)
- {
- SequenceI seq = viewport.getAlignment().getSequenceAt(i);
-
- if (!sg.getSequences(null).contains(seq))
- {
- continue;
- }
-
- SequenceI temp = viewport.getAlignment().getSequenceAt(i - 1);
-
- if (sg.getSequences(null).contains(temp))
- {
- continue;
- }
-
- viewport.getAlignment().getSequences().setElementAt(temp, i);
- viewport.getAlignment().getSequences().setElementAt(seq, i - 1);
- }
- }
- else
- {
- for (int i = viewport.getAlignment().getHeight() - 2; i > -1; i--)
- {
- SequenceI seq = viewport.getAlignment().getSequenceAt(i);
-
- if (!sg.getSequences(null).contains(seq))
- {
- continue;
- }
-
- SequenceI temp = viewport.getAlignment().getSequenceAt(i + 1);
-
- if (sg.getSequences(null).contains(temp))
- {
- continue;
- }
-
- viewport.getAlignment().getSequences().setElementAt(temp, i);
- viewport.getAlignment().getSequences().setElementAt(seq, i + 1);
- }
- }
-
+ viewport.getAlignment().moveSelectedSequencesByOne(sg,
+ viewport.getHiddenRepSequences(), up);
alignPanel.paintAlignment(true);
}
}
SequenceI[] seqs1 = sg.toArray(new SequenceI[0]);
-
+
SequenceI[] seqs2 = new SequenceI[invertGroup.size()];
for (int i = 0; i < invertGroup.size(); i++)
seqs2[i] = (SequenceI) invertGroup.elementAt(i);
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void copy_actionPerformed(ActionEvent e)
{
System.gc();
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void pasteNew_actionPerformed(ActionEvent e)
{
paste(true);
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void pasteThis_actionPerformed(ActionEvent e)
{
paste(false);
}
int alwidth = 0;
+ ArrayList<Integer> newGraphGroups = new ArrayList<Integer>();
+ int fgroup = -1;
if (newAlignment)
{
{
newDs.clear(); // tidy up
}
+ if (alignment.getAlignmentAnnotation() != null)
+ {
+ for (AlignmentAnnotation alan : alignment
+ .getAlignmentAnnotation())
+ {
+ if (alan.graphGroup > fgroup)
+ {
+ fgroup = alan.graphGroup;
+ }
+ }
+ }
if (pastedal.getAlignmentAnnotation() != null)
{
// Add any annotation attached to alignment.
if (alann[i].sequenceRef == null && !alann[i].autoCalculated)
{
AlignmentAnnotation newann = new AlignmentAnnotation(alann[i]);
+ if (newann.graphGroup > -1)
+ {
+ if (newGraphGroups.size() <= newann.graphGroup
+ || newGraphGroups.get(newann.graphGroup) == null)
+ {
+ for (int q = newGraphGroups.size(); q <= newann.graphGroup; q++)
+ {
+ newGraphGroups.add(q, null);
+ }
+ newGraphGroups.set(newann.graphGroup, new Integer(
+ ++fgroup));
+ }
+ newann.graphGroup = newGraphGroups.get(newann.graphGroup)
+ .intValue();
+ }
+
newann.padAnnotation(alwidth);
alignment.addAnnotation(newann);
}
{
if (sequences[i].getAnnotation() != null)
{
+ AlignmentAnnotation newann;
for (int a = 0; a < sequences[i].getAnnotation().length; a++)
{
annotationAdded = true;
- sequences[i].getAnnotation()[a].adjustForAlignment();
- sequences[i].getAnnotation()[a].padAnnotation(alwidth);
+ newann = sequences[i].getAnnotation()[a];
+ newann.adjustForAlignment();
+ newann.padAnnotation(alwidth);
+ if (newann.graphGroup > -1)
+ {
+ if (newann.graphGroup > -1)
+ {
+ if (newGraphGroups.size() <= newann.graphGroup
+ || newGraphGroups.get(newann.graphGroup) == null)
+ {
+ for (int q = newGraphGroups.size(); q <= newann.graphGroup; q++)
+ {
+ newGraphGroups.add(q, null);
+ }
+ newGraphGroups.set(newann.graphGroup, new Integer(
+ ++fgroup));
+ }
+ newann.graphGroup = newGraphGroups.get(newann.graphGroup)
+ .intValue();
+ }
+ }
alignment.addAnnotation(sequences[i].getAnnotation()[a]); // annotation
// was
// duplicated
newann.padAnnotation(avwidth);
alview[avnum].addAnnotation(newann); // annotation was
// duplicated earlier
+ // TODO JAL-1145 graphGroups are not updated for sequence
+ // annotation added to several views. This may cause
+ // strangeness
alview[avnum].setAnnotationIndex(newann, a);
}
}
}
viewport.firePropertyChange("alignment", null,
alignment.getSequences());
+ if (alignPanels != null)
+ {
+ for (AlignmentPanel ap : ((Vector<AlignmentPanel>) alignPanels))
+ {
+ ap.validateAnnotationDimensions(false);
+ }
+ }
+ else
+ {
+ alignPanel.validateAnnotationDimensions(false);
+ }
}
else
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void cut_actionPerformed(ActionEvent e)
{
copy_actionPerformed(null);
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void delete_actionPerformed(ActionEvent evt)
{
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void deleteGroups_actionPerformed(ActionEvent e)
{
viewport.getAlignment().deleteAllGroups();
* @param e
* DOCUMENT ME!
*/
+ @Override
public void selectAllSequenceMenuItem_actionPerformed(ActionEvent e)
{
SequenceGroup sg = new SequenceGroup();
* @param e
* DOCUMENT ME!
*/
+ @Override
public void deselectAllSequenceMenuItem_actionPerformed(ActionEvent e)
{
if (viewport.cursorMode)
* @param e
* DOCUMENT ME!
*/
+ @Override
public void invertSequenceMenuItem_actionPerformed(ActionEvent e)
{
SequenceGroup sg = viewport.getSelectionGroup();
viewport.sendSelection();
}
+ @Override
public void invertColSel_actionPerformed(ActionEvent e)
{
viewport.invertColumnSelection();
* @param e
* DOCUMENT ME!
*/
+ @Override
public void remove2LeftMenuItem_actionPerformed(ActionEvent e)
{
trimAlignment(true);
* @param e
* DOCUMENT ME!
*/
+ @Override
public void remove2RightMenuItem_actionPerformed(ActionEvent e)
{
trimAlignment(false);
addHistoryItem(trimRegion);
- for (SequenceGroup sg :viewport.getAlignment().getGroups())
+ for (SequenceGroup sg : viewport.getAlignment().getGroups())
{
if ((trimLeft && !sg.adjustForRemoveLeft(column))
|| (!trimLeft && !sg.adjustForRemoveRight(column)))
* @param e
* DOCUMENT ME!
*/
+ @Override
public void removeGappedColumnMenuItem_actionPerformed(ActionEvent e)
{
int start = 0, end = viewport.getAlignment().getWidth() - 1;
* @param e
* DOCUMENT ME!
*/
+ @Override
public void removeAllGapsMenuItem_actionPerformed(ActionEvent e)
{
int start = 0, end = viewport.getAlignment().getWidth() - 1;
* @param e
* DOCUMENT ME!
*/
+ @Override
public void padGapsMenuitem_actionPerformed(ActionEvent e)
{
viewport.setPadGaps(padGapsMenuitem.isSelected());
* @param e
* DOCUMENT ME!
*/
+ @Override
public void findMenuItem_actionPerformed(ActionEvent e)
{
new Finder();
}
+ @Override
public void newView_actionPerformed(ActionEvent e)
{
newView(true);
return newap;
}
+ @Override
public void expandViews_actionPerformed(ActionEvent e)
{
Desktop.instance.explodeViews(this);
}
+ @Override
public void gatherViews_actionPerformed(ActionEvent e)
{
Desktop.instance.gatherViews(this);
* @param e
* DOCUMENT ME!
*/
+ @Override
public void font_actionPerformed(ActionEvent e)
{
new FontChooser(alignPanel);
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void seqLimit_actionPerformed(ActionEvent e)
{
viewport.setShowJVSuffix(seqLimits.isSelected());
alignPanel.paintAlignment(true);
}
+ @Override
public void idRightAlign_actionPerformed(ActionEvent e)
{
viewport.rightAlignIds = idRightAlign.isSelected();
alignPanel.paintAlignment(true);
}
+ @Override
public void centreColumnLabels_actionPerformed(ActionEvent e)
{
viewport.centreColumnLabels = centreColumnLabelsMenuItem.getState();
*
* @see jalview.jbgui.GAlignFrame#followHighlight_actionPerformed()
*/
+ @Override
protected void followHighlight_actionPerformed()
{
if (viewport.followHighlight = this.followHighlightMenuItem.getState())
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void colourTextMenuItem_actionPerformed(ActionEvent e)
{
viewport.setColourText(colourTextMenuItem.isSelected());
* @param e
* DOCUMENT ME!
*/
+ @Override
public void wrapMenuItem_actionPerformed(ActionEvent e)
{
scaleAbove.setVisible(wrapMenuItem.isSelected());
alignPanel.setWrapAlignment(wrapMenuItem.isSelected());
}
+ @Override
public void showAllSeqs_actionPerformed(ActionEvent e)
{
viewport.showAllHiddenSeqs();
}
+ @Override
public void showAllColumns_actionPerformed(ActionEvent e)
{
viewport.showAllHiddenColumns();
repaint();
}
+ @Override
public void hideSelSequences_actionPerformed(ActionEvent e)
{
viewport.hideAllSelectedSeqs();
* jalview.jbgui.GAlignFrame#hideAllButSelection_actionPerformed(java.awt.
* event.ActionEvent)
*/
+ @Override
public void hideAllButSelection_actionPerformed(ActionEvent e)
{
toggleHiddenRegions(false, false);
* jalview.jbgui.GAlignFrame#hideAllSelection_actionPerformed(java.awt.event
* .ActionEvent)
*/
+ @Override
public void hideAllSelection_actionPerformed(ActionEvent e)
{
SequenceGroup sg = viewport.getSelectionGroup();
* jalview.jbgui.GAlignFrame#showAllhidden_actionPerformed(java.awt.event.
* ActionEvent)
*/
+ @Override
public void showAllhidden_actionPerformed(ActionEvent e)
{
viewport.showAllHiddenColumns();
alignPanel.paintAlignment(true);
}
+ @Override
public void hideSelColumns_actionPerformed(ActionEvent e)
{
viewport.hideSelectedColumns();
alignPanel.paintAlignment(true);
}
+ @Override
public void hiddenMarkers_actionPerformed(ActionEvent e)
{
viewport.setShowHiddenMarkers(hiddenMarkers.isSelected());
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void scaleAbove_actionPerformed(ActionEvent e)
{
viewport.setScaleAboveWrapped(scaleAbove.isSelected());
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void scaleLeft_actionPerformed(ActionEvent e)
{
viewport.setScaleLeftWrapped(scaleLeft.isSelected());
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void scaleRight_actionPerformed(ActionEvent e)
{
viewport.setScaleRightWrapped(scaleRight.isSelected());
* @param e
* DOCUMENT ME!
*/
+ @Override
public void viewBoxesMenuItem_actionPerformed(ActionEvent e)
{
viewport.setShowBoxes(viewBoxesMenuItem.isSelected());
* @param e
* DOCUMENT ME!
*/
+ @Override
public void viewTextMenuItem_actionPerformed(ActionEvent e)
{
viewport.setShowText(viewTextMenuItem.isSelected());
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void renderGapsMenuItem_actionPerformed(ActionEvent e)
{
viewport.setRenderGaps(renderGapsMenuItem.isSelected());
public FeatureSettings featureSettings;
+ @Override
public void featureSettings_actionPerformed(ActionEvent e)
{
if (featureSettings != null)
* @param evt
* DOCUMENT ME!
*/
+ @Override
public void showSeqFeatures_actionPerformed(ActionEvent evt)
{
viewport.setShowSequenceFeatures(showSeqFeatures.isSelected());
* @param evt
* DOCUMENT ME!
*/
+ @Override
public void showSeqFeaturesHeight_actionPerformed(ActionEvent evt)
{
viewport.setShowSequenceFeaturesHeight(showSeqFeaturesHeight
* @param e
* DOCUMENT ME!
*/
+ @Override
public void annotationPanelMenuItem_actionPerformed(ActionEvent e)
{
viewport.setShowAnnotation(annotationPanelMenuItem.isSelected());
alignPanel.setAnnotationVisible(annotationPanelMenuItem.isSelected());
}
+ @Override
public void alignmentProperties()
{
JEditorPane editPane = new JEditorPane("text/html", "");
* @param e
* DOCUMENT ME!
*/
+ @Override
public void overviewMenuItem_actionPerformed(ActionEvent e)
{
if (alignPanel.overviewPanel != null)
frame.setLayer(JLayeredPane.PALETTE_LAYER);
frame.addInternalFrameListener(new javax.swing.event.InternalFrameAdapter()
{
+ @Override
public void internalFrameClosed(
javax.swing.event.InternalFrameEvent evt)
{
alignPanel.setOverviewPanel(overview);
}
+ @Override
public void textColour_actionPerformed(ActionEvent e)
{
new TextColourChooser().chooseColour(alignPanel, null);
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void noColourmenuItem_actionPerformed(ActionEvent e)
{
changeColour(null);
* @param e
* DOCUMENT ME!
*/
+ @Override
public void clustalColour_actionPerformed(ActionEvent e)
{
- changeColour(new ClustalxColourScheme(viewport.getAlignment(), viewport.getHiddenRepSequences()));
+ changeColour(new ClustalxColourScheme(viewport.getAlignment(),
+ viewport.getHiddenRepSequences()));
}
/**
* @param e
* DOCUMENT ME!
*/
+ @Override
public void zappoColour_actionPerformed(ActionEvent e)
{
changeColour(new ZappoColourScheme());
* @param e
* DOCUMENT ME!
*/
+ @Override
public void taylorColour_actionPerformed(ActionEvent e)
{
changeColour(new TaylorColourScheme());
* @param e
* DOCUMENT ME!
*/
+ @Override
public void hydrophobicityColour_actionPerformed(ActionEvent e)
{
changeColour(new HydrophobicColourScheme());
* @param e
* DOCUMENT ME!
*/
+ @Override
public void helixColour_actionPerformed(ActionEvent e)
{
changeColour(new HelixColourScheme());
* @param e
* DOCUMENT ME!
*/
+ @Override
public void strandColour_actionPerformed(ActionEvent e)
{
changeColour(new StrandColourScheme());
* @param e
* DOCUMENT ME!
*/
+ @Override
public void turnColour_actionPerformed(ActionEvent e)
{
changeColour(new TurnColourScheme());
* @param e
* DOCUMENT ME!
*/
+ @Override
public void buriedColour_actionPerformed(ActionEvent e)
{
changeColour(new BuriedColourScheme());
* @param e
* DOCUMENT ME!
*/
+ @Override
public void nucleotideColour_actionPerformed(ActionEvent e)
{
changeColour(new NucleotideColourScheme());
}
+ @Override
public void purinePyrimidineColour_actionPerformed(ActionEvent e)
{
changeColour(new PurinePyrimidineColourScheme());
* CovariationColourScheme(viewport.getAlignment().getAlignmentAnnotation
* ()[0])); }
*/
+ @Override
public void annotationColour_actionPerformed(ActionEvent e)
{
new AnnotationColourChooser(viewport, alignPanel);
}
+ @Override
public void rnahelicesColour_actionPerformed(ActionEvent e)
{
new RNAHelicesColourChooser(viewport, alignPanel);
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void applyToAllGroups_actionPerformed(ActionEvent e)
{
viewport.setColourAppliesToAllGroups(applyToAllGroups.isSelected());
if (viewport.getColourAppliesToAllGroups())
{
-
- for (SequenceGroup sg:viewport.getAlignment().getGroups())
+ for (SequenceGroup sg : viewport.getAlignment().getGroups())
{
if (cs == null)
{
if (cs instanceof ClustalxColourScheme)
{
- sg.cs = new ClustalxColourScheme(sg, viewport
- .getHiddenRepSequences());
+ sg.cs = new ClustalxColourScheme(sg,
+ viewport.getHiddenRepSequences());
}
else if (cs instanceof UserColourScheme)
{
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void modifyPID_actionPerformed(ActionEvent e)
{
if (viewport.getAbovePIDThreshold()
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void modifyConservation_actionPerformed(ActionEvent e)
{
if (viewport.getConservationSelected()
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void conservationMenuItem_actionPerformed(ActionEvent e)
{
viewport.setConservationSelected(conservationMenuItem.isSelected());
* @param e
* DOCUMENT ME!
*/
+ @Override
public void abovePIDThreshold_actionPerformed(ActionEvent e)
{
viewport.setAbovePIDThreshold(abovePIDThreshold.isSelected());
* @param e
* DOCUMENT ME!
*/
+ @Override
public void userDefinedColour_actionPerformed(ActionEvent e)
{
if (e.getActionCommand().equals("User Defined..."))
radioItem.setName("USER_DEFINED");
radioItem.addMouseListener(new MouseAdapter()
{
+ @Override
public void mousePressed(MouseEvent evt)
{
if (evt.isControlDown()
{
radioItem.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent evt)
{
userDefinedColour_actionPerformed(evt);
});
radioItem.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent evt)
{
userDefinedColour_actionPerformed(evt);
* @param e
* DOCUMENT ME!
*/
+ @Override
public void PIDColour_actionPerformed(ActionEvent e)
{
changeColour(new PIDColourScheme());
* @param e
* DOCUMENT ME!
*/
+ @Override
public void BLOSUM62Colour_actionPerformed(ActionEvent e)
{
changeColour(new Blosum62ColourScheme());
* @param e
* DOCUMENT ME!
*/
+ @Override
public void sortPairwiseMenuItem_actionPerformed(ActionEvent e)
{
SequenceI[] oldOrder = viewport.getAlignment().getSequencesArray();
* @param e
* DOCUMENT ME!
*/
+ @Override
public void sortIDMenuItem_actionPerformed(ActionEvent e)
{
SequenceI[] oldOrder = viewport.getAlignment().getSequencesArray();
* @param e
* DOCUMENT ME!
*/
+ @Override
public void sortLengthMenuItem_actionPerformed(ActionEvent e)
{
SequenceI[] oldOrder = viewport.getAlignment().getSequencesArray();
* @param e
* DOCUMENT ME!
*/
+ @Override
public void sortGroupMenuItem_actionPerformed(ActionEvent e)
{
SequenceI[] oldOrder = viewport.getAlignment().getSequencesArray();
* @param e
* DOCUMENT ME!
*/
+ @Override
public void removeRedundancyMenuItem_actionPerformed(ActionEvent e)
{
new RedundancyPanel(alignPanel, this);
* @param e
* DOCUMENT ME!
*/
+ @Override
public void pairwiseAlignmentMenuItem_actionPerformed(ActionEvent e)
{
if ((viewport.getSelectionGroup() == null)
* @param e
* DOCUMENT ME!
*/
+ @Override
public void PCAMenuItem_actionPerformed(ActionEvent e)
{
if (((viewport.getSelectionGroup() != null)
new PCAPanel(alignPanel);
}
+ @Override
public void autoCalculate_actionPerformed(ActionEvent e)
{
viewport.autoCalculateConsensus = autoCalculate.isSelected();
}
}
+ @Override
public void sortByTreeOption_actionPerformed(ActionEvent e)
{
viewport.sortByTree = sortByTree.isSelected();
* @param e
* DOCUMENT ME!
*/
+ @Override
public void averageDistanceTreeMenuItem_actionPerformed(ActionEvent e)
{
NewTreePanel("AV", "PID", "Average distance tree using PID");
* @param e
* DOCUMENT ME!
*/
+ @Override
public void neighbourTreeMenuItem_actionPerformed(ActionEvent e)
{
NewTreePanel("NJ", "PID", "Neighbour joining tree using PID");
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void njTreeBlosumMenuItem_actionPerformed(ActionEvent e)
{
NewTreePanel("NJ", "BL", "Neighbour joining tree using BLOSUM62");
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void avTreeBlosumMenuItem_actionPerformed(ActionEvent e)
{
NewTreePanel("AV", "BL", "Average distance tree using BLOSUM62");
{
TreePanel tp;
- if (viewport.getSelectionGroup() != null)
+ if (viewport.getSelectionGroup() != null
+ && viewport.getSelectionGroup().getSize() > 0)
{
if (viewport.getSelectionGroup().getSize() < 3)
{
SequenceGroup sg = viewport.getSelectionGroup();
/* Decide if the selection is a column region */
- for (SequenceI _s:sg.getSequences())
+ for (SequenceI _s : sg.getSequences())
{
- if (_s.getLength() < sg
- .getEndRes())
+ if (_s.getLength() < sg.getEndRes())
{
JOptionPane
.showMessageDialog(
sort.add(item);
item.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
SequenceI[] oldOrder = viewport.getAlignment().getSequencesArray();
sort.add(item);
item.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
SequenceI[] oldOrder = viewport.getAlignment().getSequencesArray();
* rebuilding in subsequence calls.
*
*/
+ @Override
public void buildSortByAnnotationScoresMenu()
{
if (viewport.getAlignment().getAlignmentAnnotation() == null)
// almost certainly a quicker way to do this - but we keep it simple
Hashtable scoreSorts = new Hashtable();
AlignmentAnnotation aann[];
- Enumeration sq = viewport.getAlignment().getSequences().elements();
- while (sq.hasMoreElements())
+ for (SequenceI sqa : viewport.getAlignment().getSequences())
{
- aann = ((SequenceI) sq.nextElement()).getAnnotation();
+ aann = sqa.getAnnotation();
for (int i = 0; aann != null && i < aann.length; i++)
{
if (aann[i].hasScore() && aann[i].sequenceRef != null)
* @param title
* SortBy menu item title.
*/
+ @Override
public void buildTreeMenu()
{
sortByTreeMenu.removeAll();
final NJTree tree = ((TreePanel) treePanels.elementAt(i)).getTree();
item.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
tp.sortByTree_actionPerformed(null);
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void LoadtreeMenuItem_actionPerformed(ActionEvent e)
{
// Pick the tree file
buildingMenu = true;
new Thread(new Runnable()
{
+ @Override
public void run()
{
try
"Secondary Structure Prediction");
final JMenu seqsrchmenu = new JMenu("Sequence Database Search");
final JMenu analymenu = new JMenu("Analysis");
- final JMenu dismenu = new JMenu("Disorder");
+ final JMenu dismenu = new JMenu("Protein Disorder");
// JAL-940 - only show secondary structure prediction services from
// the legacy server
if (// Cache.getDefault("SHOW_JWS1_SERVICES", true)
javax.swing.SwingUtilities.invokeLater(new Runnable()
{
+ @Override
public void run()
{
try
{
for (int i = 0, j = wsmenu.size(); i < j; i++)
{
- webService.add((JMenu) wsmenu.get(i));
+ webService.add(wsmenu.get(i));
}
}
else
}
} catch (Exception e)
{
+ Cache.log
+ .debug("Exception during web service menu building process.",
+ e);
}
;
}
xtype.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
// TODO: new thread for this call with vis-delay
Runnable foo = new Runnable()
{
+ @Override
public void run()
{
final long sttime = System.currentTimeMillis();
}
}
+ @Override
public void showProducts_actionPerformed(ActionEvent e)
{
// /////////////////////////////
}
}
+ @Override
public void showTranslation_actionPerformed(ActionEvent e)
{
// /////////////////////////////
return featuresFile;
}
+ @Override
public void dragEnter(DropTargetDragEvent evt)
{
}
+ @Override
public void dragExit(DropTargetEvent evt)
{
}
+ @Override
public void dragOver(DropTargetDragEvent evt)
{
}
+ @Override
public void dropActionChanged(DropTargetDragEvent evt)
{
}
+ @Override
public void drop(DropTargetDropEvent evt)
{
Transferable t = evt.getTransferable();
}
else
{
- // some problem - if no warning its probable that the ID matching process didn't work
- JOptionPane.showMessageDialog(Desktop.desktop,
- tcf.getWarningMessage()==null ? "Check that the file matches sequence IDs in the alignment." : tcf.getWarningMessage(),
- "Problem reading T-COFFEE score file",
- JOptionPane.WARNING_MESSAGE);
+ // some problem - if no warning its probable that the ID matching
+ // process didn't work
+ JOptionPane
+ .showMessageDialog(
+ Desktop.desktop,
+ tcf.getWarningMessage() == null ? "Check that the file matches sequence IDs in the alignment."
+ : tcf.getWarningMessage(),
+ "Problem reading T-COFFEE score file",
+ JOptionPane.WARNING_MESSAGE);
}
}
else
}
} catch (Exception x)
{
- Cache.log.debug("Exception when processing data source as T-COFFEE score file",x);
+ Cache.log
+ .debug("Exception when processing data source as T-COFFEE score file",
+ x);
tcf = null;
}
if (tcf == null)
} catch (Exception ex)
{
ex.printStackTrace();
+ } catch (OutOfMemoryError oom)
+ {
+ try
+ {
+ System.gc();
+ } catch (Exception x)
+ {
+ }
+ ;
+ new OOMWarning(
+ "loading data "
+ + (protocol != null ? (protocol.equals(FormatAdapter.PASTE) ? "from clipboard."
+ : "using " + protocol + " from " + file)
+ : ".")
+ + (format != null ? "(parsing as '" + format
+ + "' file)" : ""), oom, Desktop.desktop);
}
}
+ @Override
public void tabSelectionChanged(int index)
{
if (index > -1)
}
}
+ @Override
public void tabbedPane_mousePressed(MouseEvent e)
{
if (SwingUtilities.isRightMouseButton(e))
/**
* Open the dialog for regex description parsing.
*/
+ @Override
protected void extractScores_actionPerformed(ActionEvent e)
{
ParseProperties pp = new jalview.analysis.ParseProperties(
* jalview.jbgui.GAlignFrame#showDbRefs_actionPerformed(java.awt.event.ActionEvent
* )
*/
+ @Override
protected void showDbRefs_actionPerformed(ActionEvent e)
{
viewport.setShowDbRefs(showDbRefsMenuitem.isSelected());
* @seejalview.jbgui.GAlignFrame#showNpFeats_actionPerformed(java.awt.event.
* ActionEvent)
*/
+ @Override
protected void showNpFeats_actionPerformed(ActionEvent e)
{
viewport.setShowNpFeats(showNpFeatsMenuitem.isSelected());
fetchr.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
new Thread(new Runnable()
{
+ @Override
public void run()
{
new jalview.ws.DBRefFetcher(alignPanel.av
final AlignFrame me = this;
new Thread(new Runnable()
{
+ @Override
public void run()
{
final jalview.ws.SequenceFetcher sf = SequenceFetcher
.getSequenceFetcherSingleton(me);
javax.swing.SwingUtilities.invokeLater(new Runnable()
{
+ @Override
public void run()
{
String[] dbclasses = sf.getOrderedSupportedSources();
fetchr.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
new Thread(new Runnable()
{
+ @Override
public void run()
{
new jalview.ws.DBRefFetcher(alignPanel.av
+ "'");
fetchr.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
new Thread(new Runnable()
{
+ @Override
public void run()
{
new jalview.ws.DBRefFetcher(alignPanel.av
fetchr.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
new Thread(new Runnable()
{
+ @Override
public void run()
{
new jalview.ws.DBRefFetcher(alignPanel.av
/**
* Left justify the whole alignment.
*/
+ @Override
protected void justifyLeftMenuItem_actionPerformed(ActionEvent e)
{
AlignmentI al = viewport.getAlignment();
/**
* Right justify the whole alignment.
*/
+ @Override
protected void justifyRightMenuItem_actionPerformed(ActionEvent e)
{
AlignmentI al = viewport.getAlignment();
* jalview.jbgui.GAlignFrame#showUnconservedMenuItem_actionPerformed(java.
* awt.event.ActionEvent)
*/
+ @Override
protected void showUnconservedMenuItem_actionPerformed(ActionEvent e)
{
viewport.setShowUnconserved(showNonconservedMenuItem.getState());
* jalview.jbgui.GAlignFrame#showGroupConsensus_actionPerformed(java.awt.event
* .ActionEvent)
*/
+ @Override
protected void showGroupConsensus_actionPerformed(ActionEvent e)
{
viewport.setShowGroupConsensus(showGroupConsensus.getState());
* jalview.jbgui.GAlignFrame#showGroupConservation_actionPerformed(java.awt
* .event.ActionEvent)
*/
+ @Override
protected void showGroupConservation_actionPerformed(ActionEvent e)
{
viewport.setShowGroupConservation(showGroupConservation.getState());
* jalview.jbgui.GAlignFrame#showConsensusHistogram_actionPerformed(java.awt
* .event.ActionEvent)
*/
+ @Override
protected void showConsensusHistogram_actionPerformed(ActionEvent e)
{
viewport.setShowConsensusHistogram(showConsensusHistogram.getState());
* jalview.jbgui.GAlignFrame#showConsensusProfile_actionPerformed(java.awt
* .event.ActionEvent)
*/
+ @Override
protected void showSequenceLogo_actionPerformed(ActionEvent e)
{
viewport.setShowSequenceLogo(showSequenceLogo.getState());
alignPanel.updateAnnotation(applyAutoAnnotationSettings.getState());
}
+ @Override
protected void normaliseSequenceLogo_actionPerformed(ActionEvent e)
{
+ showSequenceLogo.setState(true);
+ viewport.setShowSequenceLogo(true);
viewport.setNormaliseSequenceLogo(normaliseSequenceLogo.getState());
alignPanel.updateAnnotation(applyAutoAnnotationSettings.getState());
}
+ @Override
protected void applyAutoAnnotationSettings_actionPerformed(ActionEvent e)
{
alignPanel.updateAnnotation(applyAutoAnnotationSettings.getState());
* jalview.jbgui.GAlignFrame#makeGrpsFromSelection_actionPerformed(java.awt
* .event.ActionEvent)
*/
+ @Override
protected void makeGrpsFromSelection_actionPerformed(ActionEvent e)
{
if (viewport.getSelectionGroup() != null)
Color col = new Color((int) (Math.random() * 255),
(int) (Math.random() * 255), (int) (Math.random() * 255));
col = col.brighter();
- for (SequenceI s:gps[g].getSequences())
- viewport.setSequenceColour(
- s, col)
- ;
+ for (SequenceI s : gps[g].getSequences())
+ viewport.setSequenceColour(s, col);
}
PaintRefresher.Refresh(this, viewport.getSequenceSetId());
alignPanel.updateAnnotation();
static PageFormat pf;
+ @Override
public void run()
{
PrinterJob printJob = PrinterJob.getPrinterJob();