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
JAL-3210 Barebones gradle/buildship/eclipse. See README
[jalview.git]
/
src
/
jalview
/
datamodel
/
Alignment.java
diff --git
a/src/jalview/datamodel/Alignment.java
b/src/jalview/datamodel/Alignment.java
index
98510e3
..
c4098e2
100755
(executable)
--- a/
src/jalview/datamodel/Alignment.java
+++ b/
src/jalview/datamodel/Alignment.java
@@
-47,7
+47,7
@@
import java.util.Vector;
* @author JimP
*
*/
* @author JimP
*
*/
-public class Alignment implements AlignmentI
+public class Alignment implements AlignmentI, AutoCloseable
{
private Alignment dataset;
{
private Alignment dataset;
@@
-125,7
+125,8
@@
public class Alignment implements AlignmentI
/**
* Make a new alignment from an array of SeqCigars
*
/**
* Make a new alignment from an array of SeqCigars
*
- * @param alseqs
+ * @param seqs
+ * SeqCigar[]
*/
public Alignment(SeqCigar[] alseqs)
{
*/
public Alignment(SeqCigar[] alseqs)
{
@@
-302,15
+303,20
@@
public class Alignment implements AlignmentI
}
@Override
}
@Override
- public void finalize() throws Throwable
+ public void close()
{
if (getDataset() != null)
{
{
if (getDataset() != null)
{
- getDataset().removeAlignmentRef();
+ try
+ {
+ getDataset().removeAlignmentRef();
+ } catch (Throwable e)
+ {
+ e.printStackTrace();
+ }
}
nullReferences();
}
nullReferences();
- super.finalize();
}
/**
}
/**
@@
-398,10
+404,6
@@
public class Alignment implements AlignmentI
return null;
}
return null;
}
- private static final SequenceGroup[] noGroups = new SequenceGroup[0];
-
- private ArrayList<SequenceGroup> temp = new ArrayList<>();
-
/*
* (non-Javadoc)
*
/*
* (non-Javadoc)
*
@@
-411,15
+413,11
@@
public class Alignment implements AlignmentI
@Override
public SequenceGroup[] findAllGroups(SequenceI s)
{
@Override
public SequenceGroup[] findAllGroups(SequenceI s)
{
+ ArrayList<SequenceGroup> temp = new ArrayList<>();
synchronized (groups)
{
int gSize = groups.size();
synchronized (groups)
{
int gSize = groups.size();
- if (gSize == 0)
- {
- return noGroups;
- }
- temp.clear();
for (int i = 0; i < gSize; i++)
{
SequenceGroup sg = groups.get(i);
for (int i = 0; i < gSize; i++)
{
SequenceGroup sg = groups.get(i);
@@
-2034,17
+2032,4
@@
public class Alignment implements AlignmentI
}
}
}
}
- @Override
- public void resetColors()
- {
- for (int i = getHeight(); --i >= 0;)
- {
- sequences.get(i).resetColors();
- }
- // if (dataset != null)
- // {
- // dataset.resetColors();
- // }
- }
-
}
}