/** * Returns the selected font. * * @return the font. */ public Font getSelectedFont() { return this.fontChooserPanel.getSelectedFont(); }
/** * Returns a Font object representing the selection in the panel. * * @return the font. */ public Font getSelectedFont() { return new Font(getSelectedName(), getSelectedStyle(), getSelectedSize()); }
/** * Presents a font selection dialog to the user. */ private void attemptLabelFontSelection() { FontChooserPanel panel = new FontChooserPanel(this.labelFont); int result = JOptionPane.showConfirmDialog(this, panel, localizationResources.getString("Font_Selection"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE); if (result == JOptionPane.OK_OPTION) { this.labelFont = panel.getSelectedFont(); this.labelFontField.setText( this.labelFont.getFontName() + " " + this.labelFont.getSize() ); } }
final String[] fonts = g.getAvailableFontFamilyNames(); setLayout(new BorderLayout()); final JPanel right = new JPanel(new BorderLayout()); fontpane.setBorder(BorderFactory.createEtchedBorder()); fontPanel.add(fontpane); add(fontPanel); right.add(attributes, BorderLayout.SOUTH); add(right, BorderLayout.EAST); setSelectedFont(font);
/** * Returns the panel that is the user interface. * * @param font the font. * * @return the panel. */ private JPanel createContent(Font font) { final JPanel content = new JPanel(new BorderLayout()); content.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4)); if (font == null) { font = new Font("Dialog", 10, Font.PLAIN); } this.fontChooserPanel = new FontChooserPanel(font); content.add(this.fontChooserPanel); final JPanel buttons = createButtonPanel(); buttons.setBorder(BorderFactory.createEmptyBorder(4, 0, 0, 0)); content.add(buttons, BorderLayout.SOUTH); return content; }
/** * Presents a tick label font selection dialog to the user. */ public void attemptTickLabelFontSelection() { FontChooserPanel panel = new FontChooserPanel(this.tickLabelFont); int result = JOptionPane.showConfirmDialog(this, panel, localizationResources.getString("Font_Selection"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE); if (result == JOptionPane.OK_OPTION) { this.tickLabelFont = panel.getSelectedFont(); this.tickLabelFontField.setText( this.tickLabelFont.getFontName() + " " + this.tickLabelFont.getSize() ); } }
final String[] fonts = g.getAvailableFontFamilyNames(); setLayout(new BorderLayout()); final JPanel right = new JPanel(new BorderLayout()); fontpane.setBorder(BorderFactory.createEtchedBorder()); fontPanel.add(fontpane); add(fontPanel); right.add(attributes, BorderLayout.SOUTH); add(right, BorderLayout.EAST); setSelectedFont(font);
/** * Returns the panel that is the user interface. * * @param font the font. * * @return the panel. */ private JPanel createContent(Font font) { final JPanel content = new JPanel(new BorderLayout()); content.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4)); if (font == null) { font = new Font("Dialog", 10, Font.PLAIN); } this.fontChooserPanel = new FontChooserPanel(font); content.add(this.fontChooserPanel); final JPanel buttons = createButtonPanel(); buttons.setBorder(BorderFactory.createEmptyBorder(4, 0, 0, 0)); content.add(buttons, BorderLayout.SOUTH); return content; }
/** * Displays a primitive font chooser dialog to allow the user to change the font. */ private void displayFontDialog() { final FontChooserPanel panel = new FontChooserPanel(this.drawStringPanel1.getFont()); final int result = JOptionPane.showConfirmDialog(this, panel, "Font Selection", JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE); if (result == JOptionPane.OK_OPTION) { this.drawStringPanel1.setFont(panel.getSelectedFont()); this.drawStringPanel2.setFont(panel.getSelectedFont()); } }
/** * Returns a Font object representing the selection in the panel. * * @return the font. */ public Font getSelectedFont() { return new Font(getSelectedName(), getSelectedStyle(), getSelectedSize()); }
final String[] fonts = g.getAvailableFontFamilyNames(); setLayout(new BorderLayout()); final JPanel right = new JPanel(new BorderLayout()); fontpane.setBorder(BorderFactory.createEtchedBorder()); fontPanel.add(fontpane); add(fontPanel); right.add(attributes, BorderLayout.SOUTH); add(right, BorderLayout.EAST); setSelectedFont(font);
/** * Returns the selected font. * * @return the font. */ public Font getSelectedFont() { return this.fontChooserPanel.getSelectedFont(); }
/** * Returns the panel that is the user interface. * * @param font the font. * * @return the panel. */ private JPanel createContent(Font font) { final JPanel content = new JPanel(new BorderLayout()); content.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4)); if (font == null) { font = new Font("Dialog", 10, Font.PLAIN); } this.fontChooserPanel = new FontChooserPanel(font); content.add(this.fontChooserPanel); final JPanel buttons = createButtonPanel(); buttons.setBorder(BorderFactory.createEmptyBorder(4, 0, 0, 0)); content.add(buttons, BorderLayout.SOUTH); return content; }
/** * Presents a font selection dialog to the user. */ public void attemptFontSelection() { FontChooserPanel panel = new FontChooserPanel(this.titleFont); int result = JOptionPane.showConfirmDialog( this, panel, localizationResources.getString("Font_Selection"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE ); if (result == JOptionPane.OK_OPTION) { this.titleFont = panel.getSelectedFont(); this.fontfield.setText( this.titleFont.getFontName() + " " + this.titleFont.getSize() ); } }
/** * Returns a Font object representing the selection in the panel. * * @return the font. */ public Font getSelectedFont() { return new Font(getSelectedName(), getSelectedStyle(), getSelectedSize()); }
/** * Returns the selected font. * * @return the font. */ public Font getSelectedFont() { return this.fontChooserPanel.getSelectedFont(); }