int res = x / av.getCharWidth() + av.getStartRes();\r
SequenceGroup sg = null;\r
\r
+\r
if (av.getColumnSelection().contains(res))\r
{\r
av.getColumnSelection().removeElement(res);\r
return hiddenSequences == null ? 0 : hiddenSequences.size();\r
}\r
\r
+ public int getWidth()\r
+ {\r
+ Enumeration en = hiddenSequences.elements();\r
+ int width = 0;\r
+ while(en.hasMoreElements())\r
+ {\r
+ SequenceI seq = (SequenceI)en.nextElement();\r
+ if(seq.getLength()>width)\r
+ width = seq.getLength();\r
+ }\r
+ return width;\r
+ }\r
+\r
public void hideSequence(SequenceI sequence)\r
{\r
if(hiddenSequences==null)\r
\r
public void showAllColumns_actionPerformed(ActionEvent e)\r
{\r
- viewport.getColumnSelection().revealAllHiddenColumns(viewport);\r
+ viewport.showAllHiddenColumns();\r
}\r
\r
public void hideSelSequences_actionPerformed(ActionEvent e)\r
\r
public void hideSelectedColumns()\r
{\r
- if (colSel.selected.size() < 1)\r
+ if (colSel.size() < 1)\r
return;\r
\r
- while (colSel.selected.size() > 0)\r
+ while (colSel.size() > 0)\r
{\r
- int column = ( (Integer) colSel.selected.firstElement()).intValue();\r
+ int column = ( (Integer) colSel.getSelected().firstElement()).intValue();\r
colSel.hideColumns(column);\r
}\r
setSelectionGroup(null);\r
hasHiddenRows = false;\r
}\r
\r
+ public void showColumn(int col)\r
+ {\r
+ colSel.revealHiddenColumns(col);\r
+ if(colSel.size()<1)\r
+ hasHiddenColumns = false;\r
+ }\r
+\r
+ public void showAllHiddenColumns()\r
+ {\r
+ colSel.revealAllHiddenColumns();\r
+ hasHiddenColumns = false;\r
+ }\r
+\r
public void showAllHiddenSeqs()\r
{\r
if(alignment.getHiddenSequences().getSize()>0)\r
{\r
image = new BufferedImage(getWidth(), imgHeight,\r
BufferedImage.TYPE_INT_RGB);\r
- gg = (Graphics2D) image.getGraphics();\r
}\r
\r
+ gg = (Graphics2D) image.getGraphics();\r
//Fill in the background\r
gg.setColor(Color.white);\r
gg.fillRect(0, 0, getWidth(), imgHeight);\r
{\r
public void actionPerformed(ActionEvent e)\r
{\r
- av.getColumnSelection().revealHiddenColumns(reveal[0], av);\r
+ av.showColumn(reveal[0]);\r
reveal = null;\r
ap.repaint();\r
if(ap.overviewPanel != null)\r
});\r
pop.add(item);\r
\r
- if(av.getColumnSelection().hiddenColumns.size()>1)\r
+ if(av.getColumnSelection().size()>1)\r
{\r
item = new JMenuItem("Reveal All");\r
item.addActionListener(new ActionListener()\r
{\r
public void actionPerformed(ActionEvent e)\r
{\r
- av.getColumnSelection().revealAllHiddenColumns(av);\r
+ av.showAllHiddenColumns();\r
reveal = null;\r
ap.repaint();\r
if(ap.overviewPanel != null)\r