Package java.awt

Examples of java.awt.Font.deriveFont()


    for (Channel channel : channelArr) {
      String msg = channel.getCopyrightNotice();
      // repeatedly reduce the font size while the copyright notice is wider than the column
      while (metric.stringWidth(msg) > mColumnWidth) {
        Font font = grp.getFont();
        grp.setFont(font.deriveFont((float)(font.getSize()-1)));
        metric = grp.getFontMetrics();
      }
    }
    for (int i = 0; i < channelArr.length; i++) {
      String msg = channelArr[i].getCopyrightNotice();
View Full Code Here


      mLog.info("platform independent mode is OFF");

      mOpenCloseMenuItem = new JMenuItem(mLocalizer.msg("menu.open", "Open"));
      Font f = mOpenCloseMenuItem.getFont();

      mOpenCloseMenuItem.setFont(f.deriveFont(Font.BOLD));
      mQuitMenuItem = new JMenuItem(mLocalizer.msg("menu.quit", "Quit"), TVBrowserIcons.quit(TVBrowserIcons.SIZE_SMALL));
      mConfigure = new JMenuItem(mLocalizer.msg("menu.configure", "Configure"), TVBrowserIcons
          .preferences(TVBrowserIcons.SIZE_SMALL));

      mConfigure.addActionListener(new ActionListener() {
View Full Code Here

     
    }
   
    private void paintString(Graphics g, String msg) {
      Font old = g.getFont();
      g.setFont(old.deriveFont(Font.BOLD).deriveFont(18.0f));
      FontMetrics fm = g.getFontMetrics();
      int x = (getWidth() - fm.stringWidth(msg)) / 2;
      if (x < 0) x = 0;
      g.drawString(msg, x, getHeight() - 23);
      g.setFont(old);
View Full Code Here

      if(fontFace != null)
        currentFont = new Font(fontFace, currentFontStyle, currentFontSize);
      if(fontSize != null)
      {
        currentFontSize = Integer.parseInt(fontSize);
        currentFont = currentFont.deriveFont((float)currentFontSize);
      }
      if(colorCodeStr != null)
      {
        switch(Integer.parseInt(colorCodeStr))
        {
View Full Code Here

  }
 
  public void configureTextField(EditableLabelField field, double zoom) {
    Font f = font;
    if (zoom != 1.0) {
      f = f.deriveFont(AffineTransform.getScaleInstance(zoom, zoom));
    }
    field.setFont(f);
   
    Dimension dim = field.getPreferredSize();
    int w;
View Full Code Here

  public void paintIconRectangular(InstancePainter painter) {
    Graphics g = painter.getGraphics();
    g.setColor(Color.black);
    g.drawRect(1, 2, 16, 16);
    Font old = g.getFont();
    g.setFont(old.deriveFont(9.0f));
    GraphicsUtil.drawCenteredText(g, "2k", 96);
    GraphicsUtil.drawCenteredText(g, "+1", 9, 13);
    g.setFont(old);
  }
View Full Code Here

      else if (textattribute.equals(TextAttribute.FAMILY))
      {
        final Font font = getFont();
        final Map fontAttributes = font.getAttributes();
        fontAttributes.put(TextAttribute.FAMILY, iter.getAttributes().get(textattribute));
        setFont(font.deriveFont(fontAttributes));
      }
      else if (textattribute.equals(TextAttribute.POSTURE))
      {
        final Font font = getFont();
        final Map fontAttributes = font.getAttributes();
View Full Code Here

      else if (textattribute.equals(TextAttribute.POSTURE))
      {
        final Font font = getFont();
        final Map fontAttributes = font.getAttributes();
        fontAttributes.put(TextAttribute.POSTURE, iter.getAttributes().get(textattribute));
        setFont(font.deriveFont(fontAttributes));
      }
      else if (textattribute.equals(TextAttribute.WEIGHT))
      {
        final Font font = getFont();
        final Map fontAttributes = font.getAttributes();
View Full Code Here

      else if (textattribute.equals(TextAttribute.WEIGHT))
      {
        final Font font = getFont();
        final Map fontAttributes = font.getAttributes();
        fontAttributes.put(TextAttribute.WEIGHT, iter.getAttributes().get(textattribute));
        setFont(font.deriveFont(fontAttributes));
      }
    }
  }

  /**
 
View Full Code Here

        if (awtFont == null)
        {
          throw new JRRuntimeException("The '" + face.getName() + "' font face in family '" + family.getName() + "' returns a null font.");
        }

        awtFont = awtFont.deriveFont((float)size);
       
        awtFont = awtFont.deriveFont(style & ~faceStyle);
      }
    }
   
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.