Examples of FontInfo


Examples of net.sourceforge.squirrel_sql.fw.gui.FontInfo

      _nbrRows.setInt(props.getSQLNbrRowsToShow());
    }

    if (propName == null || propName.equals(SessionProperties.IPropertyNames.FONT_INFO))
    {
      FontInfo fi = props.getFontInfo();
      if (fi != null)
      {
        _sqlEntry.setFont(fi.createFont());
      }
    }

    if (propName == null || propName.equals(SessionProperties.IPropertyNames.SQL_ENTRY_HISTORY_SIZE)
              || propName.equals(SessionProperties.IPropertyNames.LIMIT_SQL_ENTRY_HISTORY_SIZE))
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.gui.FontInfo

   * Update the applications fonts.
   */
  void updateApplicationFonts()
  {
    final LAFPreferences prefs = _plugin.getLAFPreferences();
    FontInfo fi = prefs.getMenuFontInfo();
    String[] keys = FONT_KEYS[FONT_KEYS_ARRAY_MENU];
    for (int i = 0; i < keys.length; ++i)
    {
      if (prefs.isMenuFontEnabled())
      {
        if (fi != null)
        {
          UIManager.put(keys[i], fi.createFont());
        }
      }
      else
      {
        UIManager.put(keys[i], _origUIDefaults.getFont(keys[i]));
      }
    }
    fi = prefs.getStaticFontInfo();
    keys = FONT_KEYS[FONT_KEYS_ARRAY_STATIC];
    for (int i = 0; i < keys.length; ++i)
    {
      if (prefs.isStaticFontEnabled())
      {
        if (fi != null)
        {
          UIManager.put(keys[i], fi.createFont());
        }
      }
      else
      {
        UIManager.put(keys[i], _origUIDefaults.getFont(keys[i]));
      }
    }
    fi = prefs.getOtherFontInfo();
    keys = FONT_KEYS[FONT_KEYS_ARRAY_OTHER];
    for (int i = 0; i < keys.length; ++i)
    {
      if (prefs.isOtherFontEnabled())
      {
        if (fi != null)
        {
          UIManager.put(keys[i], fi.createFont());
        }
      }
      else
      {
        UIManager.put(keys[i], _origUIDefaults.getFont(keys[i]));
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.gui.FontInfo

      _staticFontEnabledChk.setSelected(_prefs.isStaticFontEnabled());
      _statusBarFontEnabledChk.setSelected(
        _prefs.isStatusBarFontEnabled());
      _otherFontEnabledChk.setSelected(_prefs.isOtherFontEnabled());

      FontInfo fi = _prefs.getMenuFontInfo();
      _menuFontLbl.setText(fi != null ? fi.toString() : "");
      fi = _prefs.getStaticFontInfo();
      _staticFontLbl.setText(fi != null ? fi.toString() : "");
      fi = _prefs.getStatusBarFontInfo();
      _statusBarFontLbl.setText(fi != null ? fi.toString() : "");
      fi = _prefs.getOtherFontInfo();
      _otherFontLbl.setText(fi != null ? fi.toString() : "");

      _menuFontBtn.setEnabled(_prefs.isMenuFontEnabled());
      _staticFontBtn.setEnabled(_prefs.isStaticFontEnabled());
      _statusBarFontBtn.setEnabled(_prefs.isStatusBarFontEnabled());
      _otherFontBtn.setEnabled(_prefs.isOtherFontEnabled());
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.gui.FontInfo

      void setSelectedFont(Font font)
      {
        _font = font;
        if (_fi == null)
        {
          _fi = new FontInfo(font);
        }
        else
        {
          _fi.setFont(font);
        }
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.gui.FontInfo

      public void actionPerformed(ActionEvent evt)
      {
        if (evt.getSource() instanceof FontButton)
        {
          FontButton btn = (FontButton) evt.getSource();
          FontInfo fi = btn.getFontInfo();
          Font font = null;
          if (fi != null)
          {
            font = fi.createFont();
          }
          font = new FontChooser().showDialog(font);
          if (font != null)
          {
            btn.setSelectedFont(font);
            btn._lbl.setText(new FontInfo(font).toString());
          }
        }
      }
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.gui.FontInfo

  void updateFromPreferences()
  {
    synchronized (doclock)
    {
      final FontInfo fi = _session.getProperties().getFontInfo();
      SyntaxStyle style;
      SimpleAttributeSet attribs;

      style = _syntaxPrefs.getColumnStyle();
      attribs = getMyStyle(IConstants.IStyleNames.COLUMN);
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.gui.FontInfo

  /**
   * Create the styles and place them in the hash table.
   */
  private void initStyles()
  {
    final FontInfo fi = _session.getProperties().getFontInfo();

    SyntaxStyle style;
    SimpleAttributeSet attribs;

    // TODO: Do we need this one. */
    attribs = new SimpleAttributeSet();
    StyleConstants.setFontFamily(attribs, fi.getFamily());
    StyleConstants.setFontSize(attribs, fi.getSize());
    StyleConstants.setBackground(attribs, Color.white);
    StyleConstants.setForeground(attribs, Color.black);
    StyleConstants.setBold(attribs, false);
    StyleConstants.setItalic(attribs, false);
    styles.put("body", attribs);

    // TODO: Do we need this one. */
    attribs = new SimpleAttributeSet();
    StyleConstants.setFontFamily(attribs, fi.getFamily());
    StyleConstants.setFontSize(attribs, fi.getSize());
    StyleConstants.setBackground(attribs, Color.white);
    StyleConstants.setForeground(attribs, Color.blue);
    StyleConstants.setBold(attribs, true);
    StyleConstants.setItalic(attribs, false);
    styles.put("tag", attribs);

    // TODO: Do we need this one. */
    attribs = new SimpleAttributeSet();
    StyleConstants.setFontFamily(attribs, fi.getFamily());
    StyleConstants.setFontSize(attribs, fi.getSize());
    StyleConstants.setBackground(attribs, Color.white);
    StyleConstants.setForeground(attribs, Color.blue);
    StyleConstants.setBold(attribs, false);
    StyleConstants.setItalic(attribs, false);
    styles.put("endtag", attribs);

    // TODO: Do we need this one. */
    attribs = new SimpleAttributeSet();
    StyleConstants.setFontFamily(attribs, fi.getFamily());
    StyleConstants.setFontSize(attribs, fi.getSize());
    StyleConstants.setBackground(attribs, Color.white);
    StyleConstants.setForeground(attribs, Color.black);
    StyleConstants.setBold(attribs, false);
    StyleConstants.setItalic(attribs, false);
    styles.put("reference", attribs);

    // TODO: Do we need this one. */
    attribs = new SimpleAttributeSet();
    StyleConstants.setFontFamily(attribs, fi.getFamily());
    StyleConstants.setFontSize(attribs, fi.getSize());
    StyleConstants.setBackground(attribs, Color.white);
    StyleConstants.setForeground(attribs, new Color(0xB03060)/*Color.maroon*/);
    StyleConstants.setBold(attribs, true);
    StyleConstants.setItalic(attribs, false);
    styles.put("name", attribs);

    // TODO: Do we need this one. */
    attribs = new SimpleAttributeSet();
    StyleConstants.setFontFamily(attribs, fi.getFamily());
    StyleConstants.setFontSize(attribs, fi.getSize());
    StyleConstants.setBackground(attribs, Color.white);
    StyleConstants.setForeground(attribs, new Color(0xB03060)/*Color.maroon*/);
    StyleConstants.setBold(attribs, false);
    StyleConstants.setItalic(attribs, true);
    styles.put("value", attribs);

    // TODO: Do we need this one. */
    attribs = new SimpleAttributeSet();
    StyleConstants.setFontFamily(attribs, fi.getFamily());
    StyleConstants.setFontSize(attribs, fi.getSize());
    StyleConstants.setBackground(attribs, Color.white);
    StyleConstants.setForeground(attribs, Color.black);
    StyleConstants.setBold(attribs, true);
    StyleConstants.setItalic(attribs, false);
    styles.put("text", attribs);

    style = _syntaxPrefs.getColumnStyle();
    attribs = new SimpleAttributeSet();
    applyStyle(attribs, style, fi);
    styles.put(IConstants.IStyleNames.COLUMN, attribs);

    style = _syntaxPrefs.getCommentStyle();
    attribs = new SimpleAttributeSet();
    applyStyle(attribs, style, fi);
    styles.put(IConstants.IStyleNames.COMMENT, attribs);

    style = _syntaxPrefs.getDataTypeStyle();
    attribs = new SimpleAttributeSet();
    applyStyle(attribs, style, fi);
    styles.put(IConstants.IStyleNames.DATA_TYPE, attribs);

    style = _syntaxPrefs.getErrorStyle();
    attribs = new SimpleAttributeSet();
    applyStyle(attribs, style, fi);
    styles.put(IConstants.IStyleNames.ERROR, attribs);

    style = _syntaxPrefs.getFunctionStyle();
    attribs = new SimpleAttributeSet();
    applyStyle(attribs, style, fi);
    styles.put(IConstants.IStyleNames.FUNCTION, attribs);

    style = _syntaxPrefs.getIdentifierStyle();
    attribs = new SimpleAttributeSet();
    applyStyle(attribs, style, fi);
    styles.put(IConstants.IStyleNames.IDENTIFIER, attribs);

    style = _syntaxPrefs.getLiteralStyle();
    attribs = new SimpleAttributeSet();
    applyStyle(attribs, style, fi);
    styles.put(IConstants.IStyleNames.LITERAL, attribs);

    style = _syntaxPrefs.getOperatorStyle();
    attribs = new SimpleAttributeSet();
    applyStyle(attribs, style, fi);
    styles.put(IConstants.IStyleNames.OPERATOR, attribs);

    style = _syntaxPrefs.getReservedWordStyle();
    attribs = new SimpleAttributeSet();
    applyStyle(attribs, style, fi);
    styles.put(IConstants.IStyleNames.RESERVED_WORD, attribs);

    style = _syntaxPrefs.getSeparatorStyle();
    attribs = new SimpleAttributeSet();
    applyStyle(attribs, style, fi);
    styles.put(IConstants.IStyleNames.SEPARATOR, attribs);

    style = _syntaxPrefs.getTableStyle();
    attribs = new SimpleAttributeSet();
    applyStyle(attribs, style, fi);
    styles.put(IConstants.IStyleNames.TABLE, attribs);

    style = _syntaxPrefs.getWhiteSpaceStyle();
    attribs = new SimpleAttributeSet();
    applyStyle(attribs, style, fi);
    styles.put(IConstants.IStyleNames.WHITESPACE, attribs);

    // TODO: Do we need this one. */
    attribs = new SimpleAttributeSet();
    StyleConstants.setFontFamily(attribs, fi.getFamily());
    StyleConstants.setFontSize(attribs, fi.getSize());
    StyleConstants.setBackground(attribs, Color.white);
    StyleConstants.setForeground(attribs, new Color(0xA020F0).darker());
    StyleConstants.setBold(attribs, false);
    StyleConstants.setItalic(attribs, false);
    styles.put("preprocessor", attribs);

    // TODO: Do we need this one. */
    attribs = new SimpleAttributeSet();
    StyleConstants.setFontFamily(attribs, fi.getFamily());
    StyleConstants.setFontSize(attribs, fi.getSize());
    StyleConstants.setBackground(attribs, Color.white);
    StyleConstants.setForeground(attribs, Color.orange);
    StyleConstants.setBold(attribs, false);
    StyleConstants.setItalic(attribs, false);
    styles.put("unknown", attribs);
View Full Code Here

Examples of org.apache.fop.fonts.FontInfo

        //Fonts
        try {
            FontResolver fontResolver = FontSetup.createMinimalFontResolver();
            List fontList = PrintRendererConfigurator.buildFontListFromConfiguration(
                    cfg, null, fontResolver, false, null);
            FontInfo fontInfo = new FontInfo();
            FontSetup.setup(fontInfo, fontList, fontResolver);
            graphics.setFontInfo(fontInfo);
        } catch (FOPException e) {
            throw new ConfigurationException("Error while setting up fonts", e);
        }
View Full Code Here

Examples of org.apache.fop.fonts.FontInfo

     * Setup a default FontInfo instance if none has been setup before.
     */
    public void setupDefaultFontInfo() {
        if (fontInfo == null) {
            //Default minimal fonts
            FontInfo fontInfo = new FontInfo();
            FontSetup.setup(fontInfo, null, null);
            setFontInfo(fontInfo);
        }
    }
View Full Code Here

Examples of org.apache.fop.fonts.FontInfo

        int weight = ((taWeight != null)
                       &&  (taWeight.floatValue() > 1.0)) ? Font.WEIGHT_BOLD
                       : Font.WEIGHT_NORMAL;

        Font fontState = null;
        FontInfo fi = fontInfo;
        boolean found = false;
        String fontFamily = null;
        if (gvtFonts != null) {
            Iterator i = gvtFonts.iterator();
            while (i.hasNext()) {
                GVTFontFamily fam = (GVTFontFamily) i.next();
                if (fam instanceof SVGFontFamily) {
                    PROXY_PAINTER.paint(node, g2d);
                    return;
                }
                fontFamily = fam.getFamilyName();
                if (fi.hasFont(fontFamily, style, weight)) {
                    FontTriplet triplet = fontInfo.fontLookup(fontFamily, style,
                                                       weight);
                    int fsize = (int)(size.floatValue() * 1000);
                    fontState = fontInfo.getFontInstance(triplet, fsize);
                    found = true;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.