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
++ --
[jalview.git]
/
src
/
jalview
/
gui
/
FeatureSettings.java
diff --git
a/src/jalview/gui/FeatureSettings.java
b/src/jalview/gui/FeatureSettings.java
index
23f22a3
..
4139645
100755
(executable)
--- a/
src/jalview/gui/FeatureSettings.java
+++ b/
src/jalview/gui/FeatureSettings.java
@@
-48,7
+48,9
@@
public class FeatureSettings extends JPanel
this.ap = ap;
\r
this.av = av;
\r
fr = ap.seqPanel.seqCanvas.getFeatureRenderer();
\r
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
frame = new JInternalFrame();
\r
frame.setContentPane(this);
\r
Desktop.addInternalFrame(frame, "Sequence Feature Settings", 400, 300);
\r
@@
-69,11
+71,20
@@
public class FeatureSettings extends JPanel
JPanel transPanel = new JPanel(new FlowLayout());
\r
transPanel.add(new JLabel("Transparency"));
\r
transPanel.add(transparency);
\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
\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
button.addActionListener(new ActionListener()
\r
{
\r
public void actionPerformed(ActionEvent evt)
\r
@@
-160,9
+171,16
@@
public class FeatureSettings extends JPanel
alignmentHasFeatures = true;
\r
\r
tmpfeatures = av.alignment.getSequenceAt(i).getDatasetSequence().getSequenceFeatures();
\r
alignmentHasFeatures = true;
\r
\r
tmpfeatures = av.alignment.getSequenceAt(i).getDatasetSequence().getSequenceFeatures();
\r
+
\r
int index = 0;
\r
while (index < tmpfeatures.length)
\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
if(tmpfeatures[index].getFeatureGroup()!=null)
\r
{
\r
group = tmpfeatures[index].featureGroup;
\r
@@
-248,6
+266,12
@@
public class FeatureSettings extends JPanel
{
\r
group = tmpfeatures[index].featureGroup;
\r
\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
if (group==null || fr.featureGroups.get(group)==null ||
\r
((Boolean) fr.featureGroups.get(group)).booleanValue())
\r
{
\r
@@
-291,6
+315,7
@@
public class FeatureSettings extends JPanel
//which was just selected
\r
type = visibleChecks.elementAt(i).toString();
\r
data[dataIndex][0] = type;
\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
data[dataIndex][1] = fr.getColour(type);
\r
data[dataIndex][2] = new Boolean(true);
\r
dataIndex++;
\r
@@
-420,8
+445,6
@@
public class FeatureSettings extends JPanel
Enumeration e = fr.featureColours.keys();
\r
while(e.hasMoreElements())
\r
{
\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
jalview.binding.Colour col = new jalview.binding.Colour();
\r
col.setName(e.nextElement().toString());
\r
col.setRGB(jalview.util.Format.getHexString(
\r
@@
-437,6
+460,18
@@
public class FeatureSettings extends JPanel
ex.printStackTrace();
\r
}
\r
}
\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
\r
}
\r
\r