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
JAL-2507 fix test: knockon from capitalisation on secondary structure from stockholm...
[jalview.git]
/
src
/
jalview
/
gui
/
AnnotationColourChooser.java
diff --git
a/src/jalview/gui/AnnotationColourChooser.java
b/src/jalview/gui/AnnotationColourChooser.java
index
d24409f
..
253a7ec
100644
(file)
--- a/
src/jalview/gui/AnnotationColourChooser.java
+++ b/
src/jalview/gui/AnnotationColourChooser.java
@@
-61,7
+61,7
@@
public class AnnotationColourChooser extends AnnotationRowFilter
private Hashtable<SequenceGroup, ColourSchemeI> oldgroupColours;
private Hashtable<SequenceGroup, ColourSchemeI> oldgroupColours;
- private JCheckBox currentColours = new JCheckBox();
+ private JCheckBox useOriginalColours = new JCheckBox();
private JPanel minColour = new JPanel();
private JPanel minColour = new JPanel();
@@
-69,6
+69,10
@@
public class AnnotationColourChooser extends AnnotationRowFilter
private JCheckBox thresholdIsMin = new JCheckBox();
private JCheckBox thresholdIsMin = new JCheckBox();
+ protected static final int MIN_WIDTH = 500;
+
+ protected static final int MIN_HEIGHT = 240;
+
public AnnotationColourChooser(AlignViewport av, final AlignmentPanel ap)
{
super(av, ap);
public AnnotationColourChooser(AlignViewport av, final AlignmentPanel ap)
{
super(av, ap);
@@
-78,9
+82,9
@@
public class AnnotationColourChooser extends AnnotationRowFilter
oldgroupColours = new Hashtable<SequenceGroup, ColourSchemeI>();
for (SequenceGroup sg : ap.av.getAlignment().getGroups())
{
oldgroupColours = new Hashtable<SequenceGroup, ColourSchemeI>();
for (SequenceGroup sg : ap.av.getAlignment().getGroups())
{
- if (sg.cs != null)
+ if (sg.getColourScheme() != null)
{
{
- oldgroupColours.put(sg, sg.cs);
+ oldgroupColours.put(sg, sg.getColourScheme());
}
}
}
}
}
}
@@
-90,7
+94,7
@@
public class AnnotationColourChooser extends AnnotationRowFilter
Desktop.addInternalFrame(frame,
MessageManager.getString("label.colour_by_annotation"), 520,
215);
Desktop.addInternalFrame(frame,
MessageManager.getString("label.colour_by_annotation"), 520,
215);
-
+ frame.setMinimumSize(new Dimension(MIN_WIDTH, MIN_HEIGHT));
addSliderChangeListener();
addSliderMouseListeners();
addSliderChangeListener();
addSliderMouseListeners();
@@
-106,7
+110,7
@@
public class AnnotationColourChooser extends AnnotationRowFilter
if (oldcs instanceof AnnotationColourGradient)
{
AnnotationColourGradient acg = (AnnotationColourGradient) oldcs;
if (oldcs instanceof AnnotationColourGradient)
{
AnnotationColourGradient acg = (AnnotationColourGradient) oldcs;
- currentColours.setSelected(acg.isPredefinedColours()
+ useOriginalColours.setSelected(acg.isPredefinedColours()
|| acg.getBaseColour() != null);
if (!acg.isPredefinedColours() && acg.getBaseColour() == null)
{
|| acg.getBaseColour() != null);
if (!acg.isPredefinedColours() && acg.getBaseColour() == null)
{
@@
-206,16
+210,16
@@
public class AnnotationColourChooser extends AnnotationRowFilter
}
});
}
});
- currentColours.setFont(JvSwingUtils.getLabelFont());
- currentColours.setOpaque(false);
- currentColours.setText(MessageManager
+ useOriginalColours.setFont(JvSwingUtils.getLabelFont());
+ useOriginalColours.setOpaque(false);
+ useOriginalColours.setText(MessageManager
.getString("label.use_original_colours"));
.getString("label.use_original_colours"));
- currentColours.addActionListener(new ActionListener()
+ useOriginalColours.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
{
{
@Override
public void actionPerformed(ActionEvent e)
{
- currentColours_actionPerformed();
+ originalColours_actionPerformed();
}
});
thresholdIsMin.setBackground(Color.white);
}
});
thresholdIsMin.setBackground(Color.white);
@@
-255,7
+259,7
@@
public class AnnotationColourChooser extends AnnotationRowFilter
jPanel1.add(cancel);
jPanel2.add(annotations, "grow, wrap");
jPanel2.add(seqAssociated);
jPanel1.add(cancel);
jPanel2.add(annotations, "grow, wrap");
jPanel2.add(seqAssociated);
- jPanel2.add(currentColours);
+ jPanel2.add(useOriginalColours);
JPanel colpanel = new JPanel(new FlowLayout());
colpanel.setBackground(Color.white);
colpanel.add(minColour);
JPanel colpanel = new JPanel(new FlowLayout());
colpanel.setBackground(Color.white);
colpanel.add(minColour);
@@
-320,7
+324,7
@@
public class AnnotationColourChooser extends AnnotationRowFilter
for (SequenceGroup sg : ap.av.getAlignment().getGroups())
{
for (SequenceGroup sg : ap.av.getAlignment().getGroups())
{
- sg.cs = oldgroupColours.get(sg);
+ sg.setColourScheme(oldgroupColours.get(sg));
}
}
}
}
}
}
@@
-330,7
+334,7
@@
public class AnnotationColourChooser extends AnnotationRowFilter
{
if (slider.isEnabled())
{
{
if (slider.isEnabled())
{
- if (currentColours.isSelected()
+ if (useOriginalColours.isSelected()
&& !(av.getGlobalColourScheme() instanceof AnnotationColourGradient))
{
updateView();
&& !(av.getGlobalColourScheme() instanceof AnnotationColourGradient))
{
updateView();
@@
-342,14
+346,16
@@
public class AnnotationColourChooser extends AnnotationRowFilter
}
}
}
}
- public void currentColours_actionPerformed()
+ public void originalColours_actionPerformed()
{
{
- if (currentColours.isSelected())
+ boolean selected = useOriginalColours.isSelected();
+ if (selected)
{
reset();
}
{
reset();
}
- maxColour.setEnabled(!currentColours.isSelected());
- minColour.setEnabled(!currentColours.isSelected());
+ maxColour.setEnabled(!selected);
+ minColour.setEnabled(!selected);
+ thresholdIsMin.setEnabled(!selected);
updateView();
}
updateView();
}
@@
-370,7
+376,7
@@
public class AnnotationColourChooser extends AnnotationRowFilter
slider.setEnabled(true);
thresholdValue.setEnabled(true);
slider.setEnabled(true);
thresholdValue.setEnabled(true);
- thresholdIsMin.setEnabled(true);
+ thresholdIsMin.setEnabled(!useOriginalColours.isSelected());
if (selectedThresholdItem == AnnotationColourGradient.NO_THRESHOLD)
{
if (selectedThresholdItem == AnnotationColourGradient.NO_THRESHOLD)
{
@@
-416,7
+422,7
@@
public class AnnotationColourChooser extends AnnotationRowFilter
{
AnnotationColourGradient acg = null;
{
AnnotationColourGradient acg = null;
- if (currentColours.isSelected())
+ if (useOriginalColours.isSelected())
{
acg = new AnnotationColourGradient(currentAnn,
av.getGlobalColourScheme(), selectedThresholdOption);
{
acg = new AnnotationColourGradient(currentAnn,
av.getGlobalColourScheme(), selectedThresholdOption);
@@
-448,18
+454,18
@@
public class AnnotationColourChooser extends AnnotationRowFilter
continue;
}
continue;
}
- if (currentColours.isSelected())
+ if (useOriginalColours.isSelected())
{
{
- sg.cs = new AnnotationColourGradient(currentAnn, sg.cs,
- selectedThresholdOption);
+ sg.setColourScheme(new AnnotationColourGradient(currentAnn, sg
+ .getColourScheme(), selectedThresholdOption));
((AnnotationColourGradient) sg.cs).setSeqAssociated(seqAssociated
.isSelected());
}
else
{
((AnnotationColourGradient) sg.cs).setSeqAssociated(seqAssociated
.isSelected());
}
else
{
- sg.cs = new AnnotationColourGradient(currentAnn,
+ sg.setColourScheme(new AnnotationColourGradient(currentAnn,
minColour.getBackground(), maxColour.getBackground(),
minColour.getBackground(), maxColour.getBackground(),
- selectedThresholdOption);
+ selectedThresholdOption));
((AnnotationColourGradient) sg.cs).setSeqAssociated(seqAssociated
.isSelected());
}
((AnnotationColourGradient) sg.cs).setSeqAssociated(seqAssociated
.isSelected());
}