git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
bdb9169
)
distinct methods for getting references to selected sequences or getting new seuqence...
author
jprocter
<Jim Procter>
Mon, 23 Apr 2007 15:11:55 +0000
(15:11 +0000)
committer
jprocter
<Jim Procter>
Mon, 23 Apr 2007 15:11:55 +0000
(15:11 +0000)
src/jalview/gui/AlignViewport.java
patch
|
blob
|
history
diff --git
a/src/jalview/gui/AlignViewport.java
b/src/jalview/gui/AlignViewport.java
index
f1b7be3
..
88a6e37
100755
(executable)
--- a/
src/jalview/gui/AlignViewport.java
+++ b/
src/jalview/gui/AlignViewport.java
@@
-1466,8
+1466,10
@@
public class AlignViewport
}
/**
}
/**
- * This method returns the a new SequenceI [] with
- * the selection sequence and start and end points adjusted
+ * This method returns an array of new SequenceI objects
+ * derived from the whole alignment or just the current
+ * selection with start and end points adjusted
+ * @note if you need references to the actual SequenceI objects in the alignment or currently selected then use getSequenceSelection()
* @return String[]
*/
public SequenceI[] getSelectionAsNewSequence()
* @return String[]
*/
public SequenceI[] getSelectionAsNewSequence()
@@
-1477,6
+1479,10
@@
public class AlignViewport
if (selectionGroup == null)
{
sequences = alignment.getSequencesArray();
if (selectionGroup == null)
{
sequences = alignment.getSequencesArray();
+ for (int i=0; i<sequences.length; i++)
+ {
+ sequences[i] = new Sequence(sequences[i]); // construct new sequence
+ }
}
else
{
}
else
{
@@
-1485,7
+1491,23
@@
public class AlignViewport
return sequences;
}
return sequences;
}
-
+ /**
+ * get the currently selected sequence objects or all the sequences in the alignment.
+ * @return array of references to sequence objects
+ */
+ public SequenceI[] getSequenceSelection()
+ {
+ SequenceI[] sequences;
+ if (selectionGroup==null)
+ {
+ sequences = alignment.getSequencesArray();
+ }
+ else
+ {
+ sequences = selectionGroup.getSequencesInOrder(alignment);
+ }
+ return sequences;
+ }
/**
* This method returns the visible alignment as text, as
* seen on the GUI, ie if columns are hidden they will not
/**
* This method returns the visible alignment as text, as
* seen on the GUI, ie if columns are hidden they will not