+ this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
+ this.setBackground(Color.white);
+
+ changeColourAction = new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ 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);
+ }
+
+ /**
+ * Lay out fields for graduated colour by value
+ *
+ * @return
+ */
+ protected JPanel initColourByValuePanel()
+ {
+ JPanel byValuePanel = new JPanel();
+ byValuePanel.setLayout(new BoxLayout(byValuePanel, BoxLayout.Y_AXIS));
+ byValuePanel.setBorder(BorderFactory.createTitledBorder(MessageManager
+ .getString("label.colour_by_value")));
+ byValuePanel.setBackground(Color.white);
+
+ /*
+ * first row - choose colour by score or by attribute, choose attribute
+ */
+ JPanel byWhatPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
+ byWhatPanel.setBackground(Color.white);
+ byValuePanel.add(byWhatPanel);
+
+ byScore.setText(MessageManager.getString("label.score"));
+ byWhatPanel.add(byScore);
+ byScore.addActionListener(changeColourAction);
+
+ byAttributeValue.setText(MessageManager
+.getString("label.attribute"));
+ byAttributeValue.addActionListener(changeColourAction);
+ byWhatPanel.add(byAttributeValue);
+
+ List<String> attNames = FeatureAttributes.getInstance().getAttributes(
+ type);
+ valueAttributeCombo = populateAttributesDropdown(type, attNames,
+ true);
+
+ /*
+ * if no numeric atttibutes found, disable colour by attribute value
+ */
+ if (valueAttributeCombo.getItemCount() == 0)
+ {
+ byAttributeValue.setEnabled(false);
+ }
+
+ byWhatPanel.add(valueAttributeCombo);
+
+ /*
+ * second row - min/max/no colours
+ */
+ JPanel colourRangePanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
+ colourRangePanel.setBackground(Color.white);
+ byValuePanel.add(colourRangePanel);