AlignViewport av;\r
AlignmentPanel ap;\r
int activeRow = -1;\r
- ArrayList activeRes;\r
+ Vector activeRes;\r
BufferedImage image;\r
Graphics2D gg;\r
FontMetrics fm;\r
this.setPreferredSize(new Dimension(1, height));\r
}\r
\r
- public void addEditableColumn(int i)\r
+\r
+ public void removeEditableColumn(int col)\r
{\r
if (activeRow == -1)\r
{\r
if (aa[j].editable)\r
{\r
activeRow = j;\r
-\r
break;\r
}\r
}\r
}\r
\r
- if (activeRes == null)\r
+ if (activeRes != null && activeRes.contains(String.valueOf(col)))\r
{\r
- activeRes = new ArrayList();\r
- activeRes.add(String.valueOf(i));\r
+ activeRes.removeElement(String.valueOf(col));\r
+ }\r
+ repaint();\r
+ }\r
\r
- return;\r
+\r
+ public void addEditableColumn(int col)\r
+ {\r
+ if (activeRow == -1)\r
+ {\r
+ AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();\r
+\r
+ for (int j = 0; j < aa.length; j++)\r
+ {\r
+ if (aa[j].editable)\r
+ {\r
+ activeRow = j;\r
+ break;\r
+ }\r
+ }\r
}\r
\r
- activeRes.add(String.valueOf(i));\r
+ if (activeRes == null)\r
+ activeRes = new Vector();\r
+\r
+ if (!activeRes.contains(String.valueOf(col)))\r
+ activeRes.addElement(String.valueOf(col));\r
+\r
+ repaint();\r
}\r
\r
public void actionPerformed(ActionEvent evt)\r
JOptionPane.QUESTION_MESSAGE);\r
\r
if (label == null)\r
- {\r
- label = "";\r
- }\r
+ return;\r
\r
if ( (label.length() > 0) && !aa[activeRow].hasText)\r
{\r
{\r
anot[index] = new Annotation(label, "", ' ', 0);\r
}\r
-\r
anot[index].displayCharacter = label;\r
}\r
}\r
symbol);\r
\r
if (label == null)\r
- {\r
- label = "";\r
- }\r
+ return;\r
\r
if ( (label.length() > 0) && !aa[activeRow].hasText)\r
{\r
{\r
if (activeRes == null)\r
{\r
- activeRes = new ArrayList();\r
+ activeRes = new Vector();\r
}\r
else\r
{\r
}\r
else\r
{\r
- activeRes = new ArrayList();\r
- activeRes.add(String.valueOf(res));\r
+ activeRes = new Vector();\r
+ activeRes.addElement(String.valueOf(res));\r
}\r
\r
repaint();\r
\r
if (j == 0)\r
{\r
- if ( (row.annotations[0].secondaryStructure == 'H') ||\r
- (row.annotations[0].secondaryStructure == 'E'))\r
- {\r
g.drawString(row.annotations[j].displayCharacter,\r
x, y + iconOffset + 2);\r
- }\r
}\r
- else if ( ( (row.annotations[j].secondaryStructure == 'H') ||\r
- (row.annotations[j].secondaryStructure == 'E')) &&\r
+ else if (\r
( (row.annotations[j - 1] == null) ||\r
- (row.annotations[j].secondaryStructure != row.annotations[j -\r
- 1].secondaryStructure)))\r
+ (row.annotations[j].displayCharacter != row.annotations[j -\r
+ 1].displayCharacter)))\r
{\r
g.drawString(row.annotations[j].displayCharacter, x,\r
y + iconOffset + 2);\r
}\r
\r
- if (!row.hasIcons)\r
- {\r
- g.drawString(row.annotations[j].displayCharacter,\r
- x + charOffset, y + iconOffset + 2);\r
- }\r
}\r
\r
if (row.hasIcons)\r