public class SequenceOrder extends java.lang.Object
AlignmentArea
.Constructor and Description |
---|
SequenceOrder(AlignmentArea owner)
Crates a new instance of this class and loads the names from the underlying data source of
the specified owner, if it has a data source.
|
Modifier and Type | Method and Description |
---|---|
SequenceOrderType |
getOrderType() |
AlignmentArea |
getOwner() |
java.lang.String |
idByIndex(int index)
Returns the unique identifier of the sequence displayed at the specified index
|
java.util.Iterator<java.lang.String> |
idIterator()
Returns an iterator over all IDs contained in this order.
|
int |
indexByID(java.lang.String id)
Returns the display index of the sequence with the specified ID.
|
int |
moveSequence(int index,
int offset)
Moves a sequence to a new position.
|
void |
refreshFromSource() |
void |
setAlphabeticalSequenceOrder(boolean ascending)
Sorts the sequences by their name.
|
void |
setSourceSequenceOrder()
Sorts the sequences by their occurrence in the source data.
|
public SequenceOrder(AlignmentArea owner)
The initial order the determined by the oder in the data source.
owner
- the alignment view objects the returned instance should be used forpublic AlignmentArea getOwner()
public SequenceOrderType getOrderType()
public int indexByID(java.lang.String id)
id
- the unique identifier of the sequencepublic java.lang.String idByIndex(int index)
index
- the index of the sequence (The first sequence has the index 0.)java.lang.IndexOutOfBoundsException
- if the specified index is below 0 or greater or equal to number of sequences.public void refreshFromSource()
public void setSourceSequenceOrder()
This method can also be used to refresh the sequence names if the data source changed.
public void setAlphabeticalSequenceOrder(boolean ascending)
ascending
- Specify true
here, if you want the sequences to have an ascending
alphabetical order and false
for a descending order.public int moveSequence(int index, int offset)
If the index + offset
is lower than 0 the sequence if moved to the beginning, if the
result greater than the index of the last element in the list, the sequence is moved to the
end.
index
- the index of the sequence to be moved (The first sequence has the index 0.)offset
- the number of positions to move the sequence (Can be positive or negative.)public java.util.Iterator<java.lang.String> idIterator()