+ JPanel namePanel = new JPanel();
+ gridPanel.add(namePanel);
+ namePanel.add(new JLabel(MessageManager.getString("label.name:"),
+ JLabel.RIGHT));
+ namePanel.add(name);
+
+ JPanel groupPanel = new JPanel();
+ gridPanel.add(groupPanel);
+ groupPanel.add(new JLabel(MessageManager.getString("label.group:"),
+ JLabel.RIGHT));
+ groupPanel.add(group);
+
+ JPanel colourPanel = new JPanel();
+ gridPanel.add(colourPanel);
+ colourPanel.add(new JLabel(MessageManager.getString("label.colour"),
+ JLabel.RIGHT));
+ colourPanel.add(colour);
+ colour.setPreferredSize(new Dimension(150, 15));
+ colour.setFont(new java.awt.Font("Verdana", Font.PLAIN, 9));
+ colour.setForeground(Color.black);
+ colour.setHorizontalAlignment(SwingConstants.CENTER);
+ colour.setVerticalAlignment(SwingConstants.CENTER);
+ colour.setHorizontalTextPosition(SwingConstants.CENTER);
+ colour.setVerticalTextPosition(SwingConstants.CENTER);
+ mainPanel.add(gridPanel, BorderLayout.NORTH);
+
+ JPanel descriptionPanel = new JPanel();
+ descriptionPanel.add(new JLabel(MessageManager
+ .getString("label.description:"),
+ JLabel.RIGHT));
+ description.setFont(JvSwingUtils.getTextAreaFont());
+ description.setLineWrap(true);
+ descriptionPanel.add(new JScrollPane(description));
+
+ if (!create)
+ {
+ mainPanel.add(descriptionPanel, BorderLayout.SOUTH);
+
+ JPanel startEndPanel = new JPanel();
+ startEndPanel.add(new JLabel(MessageManager.getString("label.start"),
+ JLabel.RIGHT));
+ startEndPanel.add(start);
+ startEndPanel.add(new JLabel(MessageManager.getString("label.end"),
+ JLabel.RIGHT));
+ startEndPanel.add(end);
+ mainPanel.add(startEndPanel, BorderLayout.CENTER);
+ }
+ else
+ {
+ mainPanel.add(descriptionPanel, BorderLayout.CENTER);
+ }
+
+ /*
+ * default feature type and group to that of the first feature supplied,
+ * or to the last feature created if not supplied (null value)
+ */
+ SequenceFeature firstFeature = features.get(0);
+ boolean useLastDefaults = firstFeature.getType() == null;
+ final String featureType = useLastDefaults ? lastFeatureAdded
+ : firstFeature.getType();
+ final String featureGroup = useLastDefaults ? lastFeatureGroupAdded
+ : firstFeature.getFeatureGroup();
+ name.setText(featureType);
+ group.setText(featureGroup);
+
+ start.setValue(new Integer(firstFeature.getBegin()));
+ end.setValue(new Integer(firstFeature.getEnd()));
+ description.setText(firstFeature.getDescription());
+ updateColourButton(mainPanel, colour,
+ (oldcol = fcol = getFeatureStyle(featureType)));