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-3748 fix compilation error
[jalview.git]
/
src
/
jalview
/
datamodel
/
Alignment.java
diff --git
a/src/jalview/datamodel/Alignment.java
b/src/jalview/datamodel/Alignment.java
index
3e0856a
..
3b0ca46
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;
@@
-302,15
+302,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();
}
/**
}
/**
@@
-712,39
+717,21
@@
public class Alignment implements AlignmentI
for (int i = 0; i < sequences.size(); i++)
{
for (int i = 0; i < sequences.size(); i++)
{
- if (getSequenceAt(i).getLength() > maxLength)
- {
- maxLength = getSequenceAt(i).getLength();
- }
+ maxLength = Math.max(maxLength, getSequenceAt(i).getLength());
}
}
-
return maxLength;
}
return maxLength;
}
- /*
+
@Override
@Override
- public int getWidth()
+ public int getVisibleWidth()
{
{
- final Wrapper temp = new Wrapper();
-
- forEachSequence(new Consumer<SequenceI>()
+ int w = getWidth();
+ if (hiddenCols != null)
{
{
- @Override
- public void accept(SequenceI s)
- {
- if (s.getLength() > temp.inner)
- {
- temp.inner = s.getLength();
- }
- }
- }, 0, sequences.size() - 1);
-
- return temp.inner;
+ w -= hiddenCols.getSize();
+ }
+ return w;
}
}
-
- public static class Wrapper
- {
- public int inner;
- }*/
/**
* DOCUMENT ME!
/**
* DOCUMENT ME!