this.ap = ap;\r
this.av = av;\r
fr = ap.seqPanel.seqCanvas.getFeatureRenderer();\r
- av.alignment.getSequences();\r
+ if (av.featuresDisplayed == null || fr.renderOrder==null)\r
+ fr.findAllFeatures();\r
+\r
frame = new JInternalFrame();\r
frame.setContentPane(this);\r
Desktop.addInternalFrame(frame, "Sequence Feature Settings", 400, 300);\r
JPanel transPanel = new JPanel(new FlowLayout());\r
transPanel.add(new JLabel("Transparency"));\r
transPanel.add(transparency);\r
+ JButton button = new JButton("Invert Selection");\r
+ transPanel.add(button);\r
+ button.addActionListener(new ActionListener()\r
+ {\r
+ public void actionPerformed(ActionEvent evt)\r
+ {\r
+ invertSelection();\r
+ }\r
+ });\r
\r
//////////////////////////////////////////////\r
//We're going to need those OK cancel buttons\r
JPanel buttonPanel = new JPanel(new FlowLayout());\r
- JButton button = new JButton("OK");\r
+ button = new JButton("OK");\r
button.addActionListener(new ActionListener()\r
{\r
public void actionPerformed(ActionEvent evt)\r
alignmentHasFeatures = true;\r
\r
tmpfeatures = av.alignment.getSequenceAt(i).getDatasetSequence().getSequenceFeatures();\r
+\r
int index = 0;\r
while (index < tmpfeatures.length)\r
{\r
+ if(tmpfeatures[index].begin == 0 && tmpfeatures[index].end ==0)\r
+ {\r
+ index++;\r
+ continue;\r
+ }\r
+\r
if(tmpfeatures[index].getFeatureGroup()!=null)\r
{\r
group = tmpfeatures[index].featureGroup;\r
{\r
group = tmpfeatures[index].featureGroup;\r
\r
+ if(tmpfeatures[index].begin==0 && tmpfeatures[index].end==0)\r
+ {\r
+ index ++;\r
+ continue;\r
+ }\r
+\r
if (group==null || fr.featureGroups.get(group)==null ||\r
((Boolean) fr.featureGroups.get(group)).booleanValue())\r
{\r
//which was just selected\r
type = visibleChecks.elementAt(i).toString();\r
data[dataIndex][0] = type;\r
+\r
data[dataIndex][1] = fr.getColour(type);\r
data[dataIndex][2] = new Boolean(true);\r
dataIndex++;\r
Enumeration e = fr.featureColours.keys();\r
while(e.hasMoreElements())\r
{\r
-\r
-\r
jalview.binding.Colour col = new jalview.binding.Colour();\r
col.setName(e.nextElement().toString());\r
col.setRGB(jalview.util.Format.getHexString(\r
ex.printStackTrace();\r
}\r
}\r
+ }\r
+\r
+ public void invertSelection()\r
+ {\r
+ for(int i=0; i<table.getRowCount(); i++)\r
+ {\r
+ Boolean value = (Boolean)table.getValueAt(i,2);\r
+\r
+ table.setValueAt(\r
+ new Boolean(!value.booleanValue()),\r
+ i,2);\r
+ }\r
\r
}\r
\r