+ /**
+ * Configures the initial layout
+ */
+ private void jbInit()
+ {
+ this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
+ this.setBackground(Color.white);
+
+ changeColourAction = new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ changeColour(true);
+ }
+ };
+
+ changeMinMaxAction = new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ updateMinMax();
+ changeColour(true);
+ }
+ };
+
+ /*
+ * this panel
+ * detailsPanel
+ * colourByTextPanel
+ * colourByScorePanel
+ * okCancelPanel
+ */
+ JPanel detailsPanel = new JPanel();
+ detailsPanel.setLayout(new BoxLayout(detailsPanel, BoxLayout.Y_AXIS));
+
+ JPanel colourByTextPanel = initColourByTextPanel();
+ detailsPanel.add(colourByTextPanel);
+
+ JPanel colourByValuePanel = initColourByValuePanel();
+ detailsPanel.add(colourByValuePanel);
+
+ /*
+ * 4 radio buttons select between colour by description, by
+ * attribute text, by score, or by attribute value
+ */
+ ButtonGroup bg = new ButtonGroup();
+ bg.add(byDescription);
+ bg.add(byAttributeText);
+ bg.add(byScore);
+ bg.add(byAttributeValue);
+
+ JPanel okCancelPanel = initOkCancelPanel();
+
+ this.add(detailsPanel);
+ this.add(okCancelPanel);
+ }
+
+ /**
+ * Updates the min-max range for a change in choice of Colour by Score, or
+ * Colour by Attribute (value)
+ */
+ protected void updateMinMax()
+ {
+ float[] minMax = null;
+ if (byScore.isSelected())
+ {
+ minMax = fr.getMinMax().get(type)[0];
+ }
+ else if (byAttributeValue.isSelected())
+ {
+ String attName = (String) valueAttributeCombo.getSelectedItem();
+ String[] attNames = attName.split(COLON);
+ minMax = FeatureAttributes.getInstance().getMinMax(type, attNames);
+ }
+ if (minMax != null)
+ {
+ min = minMax[0];
+ max = minMax[1];
+ scaleFactor = (max == min) ? 1f : 100f / (max - min);
+ slider.setValue((int) (min * scaleFactor));
+ }
+ }
+
+ /**
+ * Lay out fields for graduated colour by value
+ *
+ * @return
+ */
+ protected JPanel initColourByValuePanel()