String type = null;
+ JPanel minColour = new JPanel();
+
+ JPanel maxColour = new JPanel();
+
+ JComboBox threshold = new JComboBox();
+
+ JSlider slider = new JSlider();
+
+ JTextField thresholdValue = new JTextField(20);
+
+ // TODO implement GUI for tolower flag
+ // JCheckBox toLower = new JCheckBox();
+
+ JCheckBox thresholdIsMin = new JCheckBox();
+
+ JCheckBox colourAlternately = new JCheckBox();
+
+ JCheckBox colourByLabel = new JCheckBox();
+
+ private GraphLine threshline;
+
+ private Color oldmaxColour;
+
+ private Color oldminColour;
+
public FeatureColourChooser(FeatureRenderer frender, String type)
{
this(frender, false, type);
}
});
- float mm[] = ((float[][]) fr.getMinMax().get(type))[0];
+ float mm[] = fr.getMinMax().get(type)[0];
min = mm[0];
max = mm[1];
// update the gui from threshold state
thresholdIsMin.setSelected(!cs.isAutoScale());
colourByLabel.setSelected(cs.isColourByLabel());
+ colourAlternately.setSelected(cs.isColourAlternately());
if (cs.getThreshType() != AnnotationColourGradient.NO_THRESHOLD)
{
// initialise threshold slider and selector
}
});
maxColour.setBorder(new LineBorder(Color.black));
+ JLabel minText = new JLabel();
minText.setText(MessageManager.getString("label.min"));
minText.setFont(JvSwingUtils.getLabelFont());
+ JLabel maxText = new JLabel();
maxText.setText(MessageManager.getString("label.max"));
maxText.setFont(JvSwingUtils.getLabelFont());
- this.setLayout(borderLayout1);
- jPanel2.setLayout(flowLayout1);
+ this.setLayout(new BorderLayout());
+ JPanel jPanel1 = new JPanel();
+ JPanel jPanel2 = new JPanel();
+ jPanel2.setLayout(new FlowLayout());
jPanel1.setBackground(Color.white);
jPanel2.setBackground(Color.white);
threshold.addActionListener(new ActionListener()
.getString("label.threshold_feature_above_thereshold")); // index 1
threshold.addItem(MessageManager
.getString("label.threshold_feature_below_thereshold")); // index 2
- jPanel3.setLayout(flowLayout2);
+ JPanel jPanel3 = new JPanel();
+ jPanel3.setLayout(new FlowLayout());
thresholdValue.addActionListener(new ActionListener()
{
@Override
thresholdIsMin_actionPerformed(actionEvent);
}
});
+ colourAlternately.setBackground(Color.white);
+ colourAlternately.setText(MessageManager
+ .getString("label.colour_alternately"));
+ colourAlternately.setToolTipText(MessageManager
+ .getString("label.colour_alternately_tip"));
+ colourAlternately.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent actionEvent)
+ {
+ colourAlternately_actionPerformed(actionEvent);
+ }
+ });
colourByLabel.setBackground(Color.white);
colourByLabel
.setText(MessageManager.getString("label.colour_by_label"));
colourByLabel_actionPerformed(actionEvent);
}
});
+
+ JPanel colourPanel = new JPanel();
colourPanel.setBackground(Color.white);
jPanel1.add(ok);
jPanel1.add(cancel);
- jPanel2.add(colourByLabel, java.awt.BorderLayout.WEST);
+ jPanel2.add(colourAlternately, java.awt.BorderLayout.WEST);
+ jPanel2.add(colourByLabel, java.awt.BorderLayout.CENTER);
jPanel2.add(colourPanel, java.awt.BorderLayout.EAST);
colourPanel.add(minText);
colourPanel.add(minColour);
this.add(jPanel2, java.awt.BorderLayout.NORTH);
}
- JLabel minText = new JLabel();
-
- JLabel maxText = new JLabel();
-
- JPanel minColour = new JPanel();
-
- JPanel maxColour = new JPanel();
-
- JPanel colourPanel = new JPanel();
-
- JPanel jPanel1 = new JPanel();
-
- JPanel jPanel2 = new JPanel();
-
- BorderLayout borderLayout1 = new BorderLayout();
-
- JComboBox threshold = new JComboBox();
-
- FlowLayout flowLayout1 = new FlowLayout();
-
- JPanel jPanel3 = new JPanel();
-
- FlowLayout flowLayout2 = new FlowLayout();
-
- JSlider slider = new JSlider();
-
- JTextField thresholdValue = new JTextField(20);
-
- // TODO implement GUI for tolower flag
- // JCheckBox toLower = new JCheckBox();
-
- JCheckBox thresholdIsMin = new JCheckBox();
-
- JCheckBox colourByLabel = new JCheckBox();
-
- private GraphLine threshline;
-
- private Color oldmaxColour;
-
- private Color oldminColour;
+ protected void colourAlternately_actionPerformed(ActionEvent actionEvent)
+ {
+ changeColour();
+ }
public void minColour_actionPerformed()
{
acg.setAutoScaled(true);
}
acg.setColourByLabel(colourByLabel.isSelected());
+ acg.setColourAlternately(colourAlternately.isSelected());
+ colourByLabel.setEnabled(!colourAlternately.isSelected());
+ colourAlternately.setEnabled(!colourByLabel.isSelected());
+ if (!fr.isOrdinal(type))
+ {
+ // don't allow colour alternately if no feature numbering on features
+ colourAlternately.setEnabled(false);
+ }
if (acg.isColourByLabel())
{
maxColour.setEnabled(false);