git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'develop' into features/JAL-2446NCList
[jalview.git]
/
src
/
jalview
/
appletgui
/
AlignFrame.java
diff --git
a/src/jalview/appletgui/AlignFrame.java
b/src/jalview/appletgui/AlignFrame.java
index
681c777
..
b30c5ae
100644
(file)
--- a/
src/jalview/appletgui/AlignFrame.java
+++ b/
src/jalview/appletgui/AlignFrame.java
@@
-22,6
+22,9
@@
package jalview.appletgui;
import jalview.analysis.AlignmentSorter;
import jalview.analysis.AnnotationSorter.SequenceAnnotationOrder;
import jalview.analysis.AlignmentSorter;
import jalview.analysis.AnnotationSorter.SequenceAnnotationOrder;
+import jalview.analysis.TreeBuilder;
+import jalview.analysis.scoremodels.PIDModel;
+import jalview.analysis.scoremodels.ScoreModels;
import jalview.api.AlignViewControllerGuiI;
import jalview.api.AlignViewControllerI;
import jalview.api.AlignViewportI;
import jalview.api.AlignViewControllerGuiI;
import jalview.api.AlignViewControllerI;
import jalview.api.AlignViewportI;
@@
-596,27
+599,11
@@
public class AlignFrame extends EmbmenuFrame implements ActionListener,
}
case KeyEvent.VK_PAGE_UP:
}
case KeyEvent.VK_PAGE_UP:
- if (viewport.getWrapAlignment())
- {
- alignPanel.scrollUp(true);
- }
- else
- {
- alignPanel.setScrollValues(ranges.getStartRes(),
- 2 * ranges.getStartSeq() - ranges.getEndSeq());
- }
+ ranges.pageUp();
break;
case KeyEvent.VK_PAGE_DOWN:
break;
case KeyEvent.VK_PAGE_DOWN:
- if (viewport.getWrapAlignment())
- {
- alignPanel.scrollUp(false);
- }
- else
- {
- alignPanel
- .setScrollValues(ranges.getStartRes(), ranges.getEndSeq());
- }
+ ranges.pageDown();
break;
case KeyEvent.VK_Z:
break;
case KeyEvent.VK_Z:
@@
-1437,6
+1424,17
@@
public class AlignFrame extends EmbmenuFrame implements ActionListener,
return null;
}
return null;
}
+ private List<String> getDisplayedFeatureGroups()
+ {
+ if (alignPanel.getFeatureRenderer() != null
+ && viewport.getFeaturesDisplayed() != null)
+ {
+ return alignPanel.getFeatureRenderer().getDisplayedFeatureGroups();
+
+ }
+ return null;
+ }
+
public String outputFeatures(boolean displayTextbox, String format)
{
String features;
public String outputFeatures(boolean displayTextbox, String format)
{
String features;
@@
-1444,12
+1442,14
@@
public class AlignFrame extends EmbmenuFrame implements ActionListener,
if (format.equalsIgnoreCase("Jalview"))
{
features = formatter.printJalviewFormat(viewport.getAlignment()
if (format.equalsIgnoreCase("Jalview"))
{
features = formatter.printJalviewFormat(viewport.getAlignment()
- .getSequencesArray(), getDisplayedFeatureCols());
+ .getSequencesArray(), getDisplayedFeatureCols(),
+ getDisplayedFeatureGroups(), true);
}
else
{
features = formatter.printGffFormat(viewport.getAlignment()
}
else
{
features = formatter.printGffFormat(viewport.getAlignment()
- .getSequencesArray(), getDisplayedFeatureCols());
+ .getSequencesArray(), getDisplayedFeatureCols(),
+ getDisplayedFeatureGroups(), true);
}
if (displayTextbox)
}
if (displayTextbox)
@@
-1797,7
+1797,7
@@
public class AlignFrame extends EmbmenuFrame implements ActionListener,
synchronized void slideSequences(boolean right, int size)
{
synchronized void slideSequences(boolean right, int size)
{
- List<SequenceI> sg = new Vector<SequenceI>();
+ List<SequenceI> sg = new Vector<>();
if (viewport.cursorMode)
{
sg.add(viewport.getAlignment().getSequenceAt(
if (viewport.cursorMode)
{
sg.add(viewport.getAlignment().getSequenceAt(
@@
-1899,7
+1899,7
@@
public class AlignFrame extends EmbmenuFrame implements ActionListener,
static StringBuffer copiedSequences;
static StringBuffer copiedSequences;
- static Vector copiedHiddenColumns;
+ static Vector<int[]> copiedHiddenColumns;
protected void copy_actionPerformed()
{
protected void copy_actionPerformed()
{
@@
-1910,7
+1910,7
@@
public class AlignFrame extends EmbmenuFrame implements ActionListener,
SequenceGroup sg = viewport.getSelectionGroup();
copiedSequences = new StringBuffer();
SequenceGroup sg = viewport.getSelectionGroup();
copiedSequences = new StringBuffer();
- Map<Integer, SequenceI> orderedSeqs = new HashMap<Integer, SequenceI>();
+ Map<Integer, SequenceI> orderedSeqs = new HashMap<>();
for (int i = 0; i < sg.getSize(); i++)
{
SequenceI seq = sg.getSequenceAt(i);
for (int i = 0; i < sg.getSize(); i++)
{
SequenceI seq = sg.getSequenceAt(i);
@@
-1923,13
+1923,13
@@
public class AlignFrame extends EmbmenuFrame implements ActionListener,
if (viewport.hasHiddenColumns() && viewport.getSelectionGroup() != null)
{
if (viewport.hasHiddenColumns() && viewport.getSelectionGroup() != null)
{
- copiedHiddenColumns = new Vector();
+ copiedHiddenColumns = new Vector<>(viewport.getAlignment()
+ .getHiddenColumns().getHiddenColumnsCopy());
int hiddenOffset = viewport.getSelectionGroup().getStartRes();
int hiddenOffset = viewport.getSelectionGroup().getStartRes();
- for (int[] region : viewport.getAlignment().getHiddenColumns()
- .getListOfCols())
+ for (int[] region : copiedHiddenColumns)
{
{
- copiedHiddenColumns.addElement(new int[] {
- region[0] - hiddenOffset, region[1] - hiddenOffset });
+ region[0] = region[0] - hiddenOffset;
+ region[1] = region[1] - hiddenOffset;
}
}
else
}
}
else
@@
-2044,7
+2044,7
@@
public class AlignFrame extends EmbmenuFrame implements ActionListener,
{
for (int i = 0; i < copiedHiddenColumns.size(); i++)
{
{
for (int i = 0; i < copiedHiddenColumns.size(); i++)
{
- int[] region = (int[]) copiedHiddenColumns.elementAt(i);
+ int[] region = copiedHiddenColumns.elementAt(i);
af.viewport.hideColumns(region[0], region[1]);
}
}
af.viewport.hideColumns(region[0], region[1]);
}
}
@@
-2630,7
+2630,7
@@
public class AlignFrame extends EmbmenuFrame implements ActionListener,
}
Frame frame = new Frame();
}
Frame frame = new Frame();
- OverviewPanel overview = new OverviewPanel(alignPanel);
+ final OverviewPanel overview = new OverviewPanel(alignPanel);
frame.add(overview);
// +50 must allow for applet frame window
jalview.bin.JalviewLite.addFrame(frame, MessageManager.formatMessage(
frame.add(overview);
// +50 must allow for applet frame window
jalview.bin.JalviewLite.addFrame(frame, MessageManager.formatMessage(
@@
-2645,6
+2645,7
@@
public class AlignFrame extends EmbmenuFrame implements ActionListener,
@Override
public void windowClosing(WindowEvent e)
{
@Override
public void windowClosing(WindowEvent e)
{
+ overview.dispose();
if (ap != null)
{
ap.setOverviewPanel(null);
if (ap != null)
{
ap.setOverviewPanel(null);
@@
-2732,7
+2733,7
@@
public class AlignFrame extends EmbmenuFrame implements ActionListener,
{
SequenceI[] oldOrder = viewport.getAlignment().getSequencesArray();
AlignmentSorter.sortByPID(viewport.getAlignment(), viewport
{
SequenceI[] oldOrder = viewport.getAlignment().getSequencesArray();
AlignmentSorter.sortByPID(viewport.getAlignment(), viewport
- .getAlignment().getSequenceAt(0), null);
+ .getAlignment().getSequenceAt(0));
addHistoryItem(new OrderCommand("Pairwise Sort", oldOrder,
viewport.getAlignment()));
addHistoryItem(new OrderCommand("Pairwise Sort", oldOrder,
viewport.getAlignment()));
@@
-2824,25
+2825,31
@@
public class AlignFrame extends EmbmenuFrame implements ActionListener,
public void averageDistanceTreeMenuItem_actionPerformed()
{
public void averageDistanceTreeMenuItem_actionPerformed()
{
- NewTreePanel("AV", "PID", "Average distance tree using PID");
+ newTreePanel(TreeBuilder.AVERAGE_DISTANCE, new PIDModel().getName(),
+ "Average distance tree using PID");
}
public void neighbourTreeMenuItem_actionPerformed()
{
}
public void neighbourTreeMenuItem_actionPerformed()
{
- NewTreePanel("NJ", "PID", "Neighbour joining tree using PID");
+ newTreePanel(TreeBuilder.NEIGHBOUR_JOINING, new PIDModel().getName(),
+ "Neighbour joining tree using PID");
}
protected void njTreeBlosumMenuItem_actionPerformed()
{
}
protected void njTreeBlosumMenuItem_actionPerformed()
{
- NewTreePanel("NJ", "BL", "Neighbour joining tree using BLOSUM62");
+ newTreePanel(TreeBuilder.NEIGHBOUR_JOINING, ScoreModels.getInstance()
+ .getBlosum62().getName(),
+ "Neighbour joining tree using BLOSUM62");
}
protected void avTreeBlosumMenuItem_actionPerformed()
{
}
protected void avTreeBlosumMenuItem_actionPerformed()
{
- NewTreePanel("AV", "BL", "Average distance tree using BLOSUM62");
+ newTreePanel(TreeBuilder.AVERAGE_DISTANCE, ScoreModels.getInstance()
+ .getBlosum62().getName(),
+ "Average distance tree using BLOSUM62");
}
}
- void NewTreePanel(String type, String pwType, String title)
+ void newTreePanel(String type, String pwType, String title)
{
// are the sequences aligned?
if (!viewport.getAlignment().isAligned(false))
{
// are the sequences aligned?
if (!viewport.getAlignment().isAligned(false))