Stack historyList = new Stack(); // simpler than synching with alignFrame.\r
float [] redundancy;\r
SequenceI [] originalSequences;\r
- Hashtable originalColours;\r
Frame frame;\r
+ Vector redundantSeqs;\r
\r
public RedundancyPanel(AlignmentPanel ap)\r
{\r
super(ap, 0, false, null);\r
\r
+ redundantSeqs = new Vector();\r
this.ap = ap;\r
undoButton.setVisible(true);\r
applyButton.setVisible(true);\r
SequenceGroup sg = ap.av.getSelectionGroup();\r
int height;\r
\r
- originalColours = new Hashtable();\r
int start, end;\r
\r
if ( (sg != null) && (sg.getSize(false) >= 1))\r
String seqi, seqj;\r
for (int i = 0; i < height; i++)\r
{\r
- originalColours.put(originalSequences[i],\r
- originalSequences[i].getColor());\r
-\r
for (int j = 0; j < i; j++)\r
{\r
if(i==j)\r
for(int i=0; i<redundancy.length; i++)\r
{\r
if (value > redundancy[i])\r
- originalSequences[i].setColor(java.awt.Color.white);\r
- else\r
- originalSequences[i].setColor(java.awt.Color.red);\r
+ redundantSeqs.removeElement(originalSequences[i]);\r
+ else if(!redundantSeqs.contains(originalSequences[i]))\r
+ redundantSeqs.addElement(originalSequences[i]);\r
}\r
\r
+ ap.idPanel.idCanvas.setHighlighted(redundantSeqs);\r
+\r
PaintRefresher.Refresh(null,ap.av.alignment);\r
\r
}\r
\r
public void windowClosing(WindowEvent evt)\r
{\r
- for(int i=0; i<originalSequences.length; i++)\r
- {\r
- SequenceI seq = originalSequences[i];\r
- seq.setColor( (java.awt.Color)originalColours.get(seq));\r
- }\r
\r
- PaintRefresher.Refresh(ap.av.alignment);\r
}\r
\r
public void windowClosed(WindowEvent evt)\r
Stack historyList = new Stack(); // simpler than synching with alignFrame.\r
float [] redundancy;\r
SequenceI [] originalSequences;\r
- Hashtable originalColours;\r
JInternalFrame frame;\r
+ Vector redundantSeqs;\r
\r
/**\r
* Creates a new RedundancyPanel object.\r
* @param ap DOCUMENT ME!\r
* @param af DOCUMENT ME!\r
*/\r
- public RedundancyPanel(AlignmentPanel ap, AlignFrame af)\r
+ public RedundancyPanel(final AlignmentPanel ap, AlignFrame af)\r
{\r
this.ap = ap;\r
this.af = af;\r
+ redundantSeqs = new Vector();\r
\r
slider.addChangeListener(new ChangeListener()\r
{\r
\r
applyButton.setText("Remove");\r
allGroupsCheck.setVisible(false);\r
- slider.setMinimum(60);\r
+ slider.setMinimum(0);\r
slider.setMaximum(100);\r
slider.setValue(100);\r
\r
{\r
public void internalFrameClosing(InternalFrameEvent evt)\r
{\r
- resetColours();\r
+ ap.idPanel.idCanvas.setHighlighted(null);\r
}\r
}\r
);\r
SequenceGroup sg = ap.av.getSelectionGroup();\r
int height;\r
\r
- originalColours = new Hashtable();\r
int start, end;\r
\r
if ( (sg != null) && (sg.getSize(false) >= 1))\r
String seqi, seqj;\r
for (int i = 0; i < height; i++)\r
{\r
- originalColours.put(originalSequences[i],\r
- originalSequences[i].getColor());\r
\r
for (int j = 0; j < i; j++)\r
{\r
for(int i=0; i<redundancy.length; i++)\r
{\r
if (value > redundancy[i])\r
- originalSequences[i].setColor(java.awt.Color.white);\r
- else\r
- originalSequences[i].setColor(java.awt.Color.red);\r
- }\r
+ redundantSeqs.remove(originalSequences[i]);\r
+ else if(!redundantSeqs.contains(originalSequences[i]))\r
+ redundantSeqs.add(originalSequences[i]);\r
\r
- PaintRefresher.Refresh(null,ap.av.alignment);\r
+ }\r
\r
+ ap.idPanel.idCanvas.setHighlighted(redundantSeqs);\r
}\r
\r
/**\r
af.updateEditMenuBar();\r
}\r
\r
- void resetColours()\r
- {\r
- for(int i=0; i<originalSequences.length; i++)\r
- {\r
- SequenceI seq = originalSequences[i];\r
- seq.setColor( (java.awt.Color)originalColours.get(seq));\r
- }\r
-\r
- PaintRefresher.Refresh(ap.av.alignment);\r
- }\r
\r
/**\r
* DOCUMENT ME!\r