/** * Returns the localized label for the given key. */ private static JLabel getLabel(final int key, final Vocabulary resources) { return new JLabel(resources.getLabel(key)); }
/** * Construct an editor for value using the specified format. */ public Singleton(final Format format) { super(new GridBagLayout()); if (format != null) { field = new JFormattedTextField(format); } else { field = new JTextField(); } field.setEditable(editable); final Vocabulary resources = Vocabulary.getResources(getLocale()); final GridBagConstraints c = new GridBagConstraints(); c.gridx=0; c.gridwidth=1; c.insets.left=9; c.fill=c.HORIZONTAL; c.gridy=0; add(new JLabel(resources.getLabel(VocabularyKeys.TYPE )), c); c.gridy++; add(new JLabel(resources.getLabel(VocabularyKeys.MINIMUM)), c); c.gridy++; add(new JLabel(resources.getLabel(VocabularyKeys.MAXIMUM)), c); c.gridy++; add(new JLabel(resources.getLabel(VocabularyKeys.VALUE )), c); c.gridx=1; c.weightx=1; c.insets.right=9; c.gridy=0; add(type, c); c.gridy++; add(minimum, c); c.gridy++; add(maximum, c); c.gridy++; add(field, c); }
c.gridy=2; predefinedKernels.add(new JLabel(resources.getLabel(VocabularyKeys.CATEGORY), JLabel.RIGHT ), c); c.gridy=3; predefinedKernels.add(new JLabel(resources.getLabel(VocabularyKeys.KERNEL), JLabel.RIGHT ), c); c.gridy=0; add(new JLabel( resources.getLabel(VocabularyKeys.SIZE), JLabel.RIGHT), c); c.gridx=2; add(new JLabel(' '+resources.getString(VocabularyKeys.LINES).toLowerCase()+" \u00D7 ", JLabel.CENTER), c); c.gridx=4; add(new JLabel(' '+resources.getString(VocabularyKeys.COLUMNS).toLowerCase(), JLabel.LEFT), c);
final GridBagConstraints c = new GridBagConstraints(); c.gridx=0; c.insets.right=6; c.gridy=0; add(new JLabel(resources.getLabel(VocabularyKeys.FORMAT )), c); c.gridy++; c.insets.top=3; add(new JLabel(resources.getLabel(VocabularyKeys.PREVIEW)), c); c.insets.right=0; c.gridx++; c.weightx=1; c.fill=c.HORIZONTAL; c.gridy=0; c.insets.top=0; add(choices, c);
final GridBagConstraints c = new GridBagConstraints(); c.gridy=1; c.insets.bottom=6; c.gridx=0; c.insets.left =9; add(new JLabel(resources.getLabel(VocabularyKeys.BAND)), c); c.gridx=1; c.insets.left =0; add(spinner, c); c.fill=c.BOTH; c.gridx=3; c.insets.right=9; add(current, c);
timezone.setSelectedItem(dateFormat.getTimeZone().getID()); final JLabel labelSize1 = new JLabel(resources.getLabel(VocabularyKeys.SIZE_IN_MINUTES)); final JLabel labelSize2 = new JLabel("\u00D7" /* Multiplication symbol */); final ButtonGroup group = new ButtonGroup(); c.gridy=0; timePanel.add(label=new JLabel(resources.getLabel(VocabularyKeys.START_TIME)), c); label.setLabelFor(tmin); c.gridy=1; timePanel.add(label=new JLabel(resources.getLabel(VocabularyKeys.END_TIME )), c); label.setLabelFor(tmax); c.gridy=2; timePanel.add(label=new JLabel(resources.getLabel(VocabularyKeys.TIME_ZONE )), c); label.setLabelFor(timezone); c.gridwidth=4; c.gridy=0; resoPanel.add(radioBestRes, c); c.gridy=1; resoPanel.add(radioPrefRes, c);