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
JFAL-1594 fix Undo bug; enum EditCommand.Action; basic JUnit
[jalview.git]
/
src
/
jalview
/
commands
/
TrimRegionCommand.java
diff --git
a/src/jalview/commands/TrimRegionCommand.java
b/src/jalview/commands/TrimRegionCommand.java
index
4925d82
..
ebbe827
100644
(file)
--- a/
src/jalview/commands/TrimRegionCommand.java
+++ b/
src/jalview/commands/TrimRegionCommand.java
@@
-1,26
+1,32
@@
/*
/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
+ * Copyright (C) 2014 The Jalview Authors
*
* This file is part of Jalview.
*
* Jalview is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License
*
* This file is part of Jalview.
*
* Jalview is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
- *
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *
* Jalview is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* Jalview is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
*/
package jalview.commands;
*/
package jalview.commands;
-import java.util.*;
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.ColumnSelection;
+import jalview.datamodel.SequenceGroup;
+import jalview.datamodel.SequenceI;
+import jalview.util.ShiftList;
-import jalview.datamodel.*;
-import jalview.util.*;
+import java.util.List;
public class TrimRegionCommand extends EditCommand
{
public class TrimRegionCommand extends EditCommand
{
@@
-36,7
+42,7
@@
public class TrimRegionCommand extends EditCommand
SequenceGroup selectionGroup;
SequenceGroup selectionGroup;
- Vector deletedHiddenColumns;
+ List<int[]> deletedHiddenColumns;
int columnsDeleted;
int columnsDeleted;
@@
-56,8
+62,7
@@
public class TrimRegionCommand extends EditCommand
columnsDeleted = column;
columnsDeleted = column;
- edits = new Edit[]
- { new Edit(CUT, seqs, 0, column, al) };
+ setEdit(new Edit(Action.CUT, seqs, 0, column, al));
}
else if (command.equalsIgnoreCase(TRIM_RIGHT))
{
}
else if (command.equalsIgnoreCase(TRIM_RIGHT))
{
@@
-69,17
+74,16
@@
public class TrimRegionCommand extends EditCommand
columnsDeleted = width - 1;
columnsDeleted = width - 1;
- edits = new Edit[]
- { new Edit(CUT, seqs, column + 1, width, al) };
+ setEdit(new Edit(Action.CUT, seqs, column + 1, width, al));
}
// We need to keep a record of the sequence start
// in order to restore the state after a redo
}
// We need to keep a record of the sequence start
// in order to restore the state after a redo
- int i, isize = edits[0].seqs.length;
+ int i, isize = getEdit(0).seqs.length;
start = new int[isize];
for (i = 0; i < isize; i++)
{
start = new int[isize];
for (i = 0; i < isize; i++)
{
- start[i] = edits[0].seqs[i].getStart();
+ start[i] = getEdit(0).seqs[i].getStart();
}
performEdit(0, null);
}
performEdit(0, null);
@@
-157,7
+161,7
@@
public class TrimRegionCommand extends EditCommand
int[] region;
for (int i = 0; i < deletedHiddenColumns.size(); i++)
{
int[] region;
for (int i = 0; i < deletedHiddenColumns.size(); i++)
{
- region = (int[]) deletedHiddenColumns.elementAt(i);
+ region = deletedHiddenColumns.get(i);
colSel.hideColumns(region[0], region[1]);
}
}
colSel.hideColumns(region[0], region[1]);
}
}