git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0fc5ffb
)
JAL-2069 fix minor bugs in variable setting
author
gmungoc
<g.m.carstairs@dundee.ac.uk>
Thu, 16 Nov 2017 14:23:00 +0000
(14:23 +0000)
committer
gmungoc
<g.m.carstairs@dundee.ac.uk>
Thu, 16 Nov 2017 14:23:00 +0000
(14:23 +0000)
src/jalview/gui/FeatureColourChooser.java
patch
|
blob
|
history
diff --git
a/src/jalview/gui/FeatureColourChooser.java
b/src/jalview/gui/FeatureColourChooser.java
index
da3819c
..
d3d9e1a
100644
(file)
--- a/
src/jalview/gui/FeatureColourChooser.java
+++ b/
src/jalview/gui/FeatureColourChooser.java
@@
-263,7
+263,7
@@
public class FeatureColourChooser extends JalviewDialog
textAttributeCombo.setEnabled(true);
String[] attributeName = cs.getAttributeName();
textAttributeCombo
textAttributeCombo.setEnabled(true);
String[] attributeName = cs.getAttributeName();
textAttributeCombo
- .setSelectedItem(String.join(COLON, attributeName));
+ .setSelectedItem(toAttributeDisplayName(attributeName));
}
else
{
}
else
{
@@
-278,7
+278,7
@@
public class FeatureColourChooser extends JalviewDialog
byAttributeValue.setSelected(true);
String[] attributeName = cs.getAttributeName();
valueAttributeCombo
byAttributeValue.setSelected(true);
String[] attributeName = cs.getAttributeName();
valueAttributeCombo
- .setSelectedItem(String.join(COLON, attributeName));
+ .setSelectedItem(toAttributeDisplayName(attributeName));
valueAttributeCombo.setEnabled(true);
updateMinMax();
}
valueAttributeCombo.setEnabled(true);
updateMinMax();
}
@@
-393,7
+393,7
@@
public class FeatureColourChooser extends JalviewDialog
else if (byAttributeValue.isSelected())
{
String attName = (String) valueAttributeCombo.getSelectedItem();
else if (byAttributeValue.isSelected())
{
String attName = (String) valueAttributeCombo.getSelectedItem();
- String[] attNames = attName.split(COLON);
+ String[] attNames = fromAttributeDisplayName(attName);
minMax = FeatureAttributes.getInstance().getMinMax(type, attNames);
}
if (minMax != null)
minMax = FeatureAttributes.getInstance().getMinMax(type, attNames);
}
if (minMax != null)
@@
-740,17
+740,17
@@
public class FeatureColourChooser extends JalviewDialog
{
attribute = (String) textAttributeCombo.getSelectedItem();
textAttributeCombo.setEnabled(true);
{
attribute = (String) textAttributeCombo.getSelectedItem();
textAttributeCombo.setEnabled(true);
- acg.setAttributeName(attribute.split(COLON));
+ acg.setAttributeName(fromAttributeDisplayName(attribute));
}
else if (byAttributeValue.isSelected())
{
attribute = (String) valueAttributeCombo.getSelectedItem();
valueAttributeCombo.setEnabled(true);
}
else if (byAttributeValue.isSelected())
{
attribute = (String) valueAttributeCombo.getSelectedItem();
valueAttributeCombo.setEnabled(true);
- acg.setAttributeName(attribute.split(COLON));
+ acg.setAttributeName(fromAttributeDisplayName(attribute));
}
else
{
}
else
{
- acg.setAttributeName((String) null);
+ acg.setAttributeName((String[]) null);
}
if (!hasThreshold)
}
if (!hasThreshold)
@@
-839,6
+839,11
@@
public class FeatureColourChooser extends JalviewDialog
ap.paintAlignment(updateStructsAndOverview, updateStructsAndOverview);
}
ap.paintAlignment(updateStructsAndOverview, updateStructsAndOverview);
}
+ private String[] fromAttributeDisplayName(String attribute)
+ {
+ return attribute == null ? null : attribute.split(COLON);
+ }
+
@Override
protected void raiseClosed()
{
@Override
protected void raiseClosed()
{
@@
-972,7
+977,7
@@
public class FeatureColourChooser extends JalviewDialog
continue;
}
}
continue;
}
}
- validAtts.add(String.join(COLON, attName));
+ validAtts.add(toAttributeDisplayName(attName));
String desc = fa.getDescription(featureType, attName);
if (desc != null && desc.length() > MAX_TOOLTIP_LENGTH)
{
String desc = fa.getDescription(featureType, attName);
if (desc != null && desc.length() > MAX_TOOLTIP_LENGTH)
{
@@
-1003,4
+1008,9
@@
public class FeatureColourChooser extends JalviewDialog
return attCombo;
}
return attCombo;
}
+ private String toAttributeDisplayName(String[] attName)
+ {
+ return attName == null ? "" : String.join(COLON, attName);
+ }
+
}
}