com.l2fprod.common.swing.JFontChooser Java Examples

The following examples show how to use com.l2fprod.common.swing.JFontChooser. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: FrmLabelSymbolSet.java    From MeteoInfo with GNU Lesser General Public License v3.0 5 votes vote down vote up
private void jButton_FontActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_FontActionPerformed
    // TODO add your handling code here:
    //FontChooser fontChooser = new FontChooser(this, true, _labelBreak.getFont());
    //fontChooser.setVisible(true);
    Font aFont = JFontChooser.showDialog(this, null, _labelBreak.getFont());
    if (aFont != null) {
        this.jTextArea_Text.setFont(aFont);
        _labelBreak.setFont(aFont);
    }
}
 
Example #2
Source File: FrmLabelSet.java    From MeteoInfo with GNU Lesser General Public License v3.0 5 votes vote down vote up
private void jButton_FontActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_FontActionPerformed
    // TODO add your handling code here:
    Font font = JFontChooser.showDialog(this, null, _font);
    if (font != null) {
        _font = font;
        updateLabelSet();
        updateLabelsFontColor();
        _mapView.paintLayers();
    }
}
 
Example #3
Source File: FrmTextEditor.java    From MeteoInfo with GNU Lesser General Public License v3.0 5 votes vote down vote up
private void jMenuItem_SetFontActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem_SetFontActionPerformed
    // TODO add your handling code here:
    TextEditor textEditor = getActiveTextEditor();
    Font tFont = JFontChooser.showDialog(this, null, textEditor.getTextArea().getFont());
    if (tFont != null) {
        this.setTextFont(tFont);
        ((FrmMain) _parent).getOptions().setTextFont(tFont);
    }
}
 
Example #4
Source File: FrmSetting.java    From MeteoInfo with GNU Lesser General Public License v3.0 5 votes vote down vote up
private void jButton_FontActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_FontActionPerformed
    // TODO add your handling code here:
    TextEditor textEditor = this.parent.getEditorDock().getActiveTextEditor();
    Font tFont = JFontChooser.showDialog(this, null, textEditor.getTextArea().getFont());
    if (tFont != null) {
        this.parent.getEditorDock().setTextFont(tFont);
        this.parent.getConsoleDockable().getConsole().setFont(tFont);
        this.parent.getOptions().setTextFont(tFont);
        this.jTextField_Font.setText(tFont.getFontName() + "  " + String.valueOf(tFont.getSize()));
    }
}
 
Example #5
Source File: ChooseFont.java    From orbit-image-analysis with GNU General Public License v3.0 5 votes vote down vote up
public ChooseFont() {
  setLayout(new PercentLayout(PercentLayout.VERTICAL, 3));

  JFontChooser chooser = new JFontChooser();
  chooser.setSelectedFont(new Font("Dialog", Font.BOLD | Font.ITALIC, 56));
  add("*", chooser);

  JButton button = new JButton("Click here to show JFontChooser");
  button.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
      selectFont(ChooseFont.this);
    }
  });
  add(button);
}
 
Example #6
Source File: ChooseFont.java    From orbit-image-analysis with GNU General Public License v3.0 5 votes vote down vote up
private static void selectFont(Component parent) {
  Font selectedFont = JFontChooser.showDialog(parent, "Choose Font", null);
  if (selectedFont == null) {
    JOptionPane.showMessageDialog(parent, "You clicked 'Cancel'");
  } else {
    JOptionPane.showMessageDialog(parent, "You selected '"
      + selectedFont.getName() + "'");
  }
}
 
Example #7
Source File: FontPropertyEditor.java    From orbit-image-analysis with GNU General Public License v3.0 5 votes vote down vote up
protected void selectFont() {
  ResourceManager rm = ResourceManager.all(FontPropertyEditor.class);
  String title = rm.getString("FontPropertyEditor.title");
  
  Font selectedFont = JFontChooser.showDialog(editor, title, font);

  if (selectedFont != null) {
    Font oldFont = font;
    Font newFont = selectedFont;
    label.setValue(newFont);
    font = newFont;
    firePropertyChange(oldFont, newFont);
  }
}
 
Example #8
Source File: WindowsFontChooserUI.java    From orbit-image-analysis with GNU General Public License v3.0 5 votes vote down vote up
public void installUI(JComponent c) {
  super.installUI(c);

  chooser = (JFontChooser)c;

  installComponents();
  installListeners();
}
 
Example #9
Source File: WindowsFontChooserUI.java    From orbit-image-analysis with GNU General Public License v3.0 5 votes vote down vote up
protected void installListeners() {
  SelectedFontUpdater listener = new SelectedFontUpdater();
  fontList.addListSelectionListener(listener);
  fontEffectList.addListSelectionListener(listener);
  fontSizeList.addListSelectionListener(listener);
  fontSizeField.getDocument().addDocumentListener(listener);

  propertyListener = createPropertyChangeListener();
  chooser.addPropertyChangeListener(JFontChooser.SELECTED_FONT_CHANGED_KEY,
      propertyListener);
}
 
Example #10
Source File: BasicFontChooserUI.java    From orbit-image-analysis with GNU General Public License v3.0 5 votes vote down vote up
public void installUI(JComponent c) {
  super.installUI(c);

  chooser = (JFontChooser)c;

  installComponents();
  installListeners();
}
 
Example #11
Source File: BasicFontChooserUI.java    From orbit-image-analysis with GNU General Public License v3.0 5 votes vote down vote up
protected void installListeners() {
  SelectedFontUpdater listener = new SelectedFontUpdater();
  fontList.addListSelectionListener(listener);
  fontSizeList.addListSelectionListener(listener);
  fontSizeField.getDocument().addDocumentListener(listener);
  boldCheck.addActionListener(listener);
  italicCheck.addActionListener(listener);

  propertyListener = createPropertyChangeListener();
  chooser.addPropertyChangeListener(
    JFontChooser.SELECTED_FONT_CHANGED_KEY,
    propertyListener);
}
 
Example #12
Source File: FrmChartLabel.java    From MeteoInfo with GNU Lesser General Public License v3.0 4 votes vote down vote up
private void jButton_FontActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_FontActionPerformed
    // TODO add your handling code here:
    Font font = JFontChooser.showDialog(this, null, this.chartSet.getLabelFont());
    if (font != null)
        this.chartSet.setLabelFont(font);
}
 
Example #13
Source File: FrmOptions.java    From MeteoInfo with GNU Lesser General Public License v3.0 4 votes vote down vote up
private void jButton_LegendFontActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_LegendFontActionPerformed
    // TODO add your handling code here:
    Font lFont = JFontChooser.showDialog(this, null, _legendFont);
    _legendFont = lFont;
    this.jLabel_LegendFont.setText(_legendFont.getFontName() + " " + _legendFont.getSize());
}
 
Example #14
Source File: FrmOptions.java    From MeteoInfo with GNU Lesser General Public License v3.0 4 votes vote down vote up
private void jButton_TextFontActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_TextFontActionPerformed
    // TODO add your handling code here:
    Font tFont = JFontChooser.showDialog(this, null, _textFont);
    _textFont = tFont;
    this.jLabel_TextFont.setText(_textFont.getFontName() + " " + _textFont.getSize());
}