Package java.awt

Examples of java.awt.Font.deriveFont()


            } else {
                style &= ~Font.ITALIC;
            }
        }

        return font.deriveFont(style, size);
    }
}
View Full Code Here


        boxPane.getStyles().put("verticalAlignment", VerticalAlignment.CENTER);
        imageView.getStyles().put("opacity", opacity);

        Font font = (Font)label.getStyles().get("font");
        label.getStyles().put("font", font.deriveFont(Font.BOLD, 60));

        label.setText(text);
        imageView.setImage(image);

        validate();
View Full Code Here

//    final int x = 20+rect.x;
//    final int y = rect.y+rect.height/2;
//    gScr.drawString("ViewStatus", x, y);
    try {
      Font font = fontLoader.createDefaultDecorativeFont();
      font = font.deriveFont(18f);
      GlyphVector gv =opPainter.createGlyphVector((Graphics2D) gScr, cityName, font);
      Rectangle2D gvBounds = gv.getVisualBounds();
      int xPadding = (int) ((rect.width-gvBounds.getWidth())/2);
      ((Graphics2D)gScr).drawGlyphVector(gv, rect.x+xPadding, (rect.y+rect.height)*3/4);
    } catch (FontFormatException e) {
View Full Code Here

    offsetPolys = new ClickableOffsetPolygons();
    fullNotice = new BufferedImage(width, height, BufferedImage.TYPE_4BYTE_ABGR);
    Graphics2D g2d = (Graphics2D) fullNotice.getGraphics();
    g2d.setColor(ColorProvider.getStringColor(((TradingOfficeDialogMataData)metaData).balance));
    Font font =fontLoader.createDefaultFont(18);
    font = font.deriveFont(Font.BOLD);
    String s = "Balance sheet"; // TODO externalize
    GlyphVector gv = opPainter.createGlyphVector(g2d, s, font);
    int x = insets.left+(int)Math.ceil((width-gv.getVisualBounds().getWidth())/2);
    int y = insets.top+topOffset+2/3*font18Height;
    g2d.drawGlyphVector(gv, x, y);
View Full Code Here

    offsetPolys = new ClickableOffsetPolygons();
    fullNotice = new BufferedImage(width, height, BufferedImage.TYPE_4BYTE_ABGR);
    Graphics2D g2d = (Graphics2D) fullNotice.getGraphics();
    g2d.setColor(ColorProvider.getStringColor(((MarketBoothDialogMetaData)metaData).stockPrices));
    Font font =fontLoader.createDefaultFont(18);
    font = font.deriveFont(Font.BOLD);
    String s = "Stock and Prices"; // TODO externalize
    GlyphVector gv = opPainter.createGlyphVector(g2d, s, font);
    int x = insets.left+(int)Math.ceil((width-gv.getVisualBounds().getWidth())/2);
    int y = insets.top+topOffset+2/3*font18Height;
    g2d.drawGlyphVector(gv, x, y);
View Full Code Here

    // Draw inactive dark gray
    // Draw selected black
    // Draw disabled grey
    g2d.setColor(ColorProvider.getStringColor(((TradeDialogMetaData)metaData).city2ship));
    Font font =fontLoader.createDefaultFont(18);
    font = font.deriveFont(Font.BOLD);
    String s = "City <- -> Ship";// TODO externalize
    if (((TradeDialogMetaData)metaData).getCityProxy().getActiveShip() instanceof IConvoy){
      s = "City <- -> Convoy";// TODO externalize
    }
    GlyphVector gv = opPainter.createGlyphVector(g2d, s, font);
View Full Code Here

      Stroke oldStroke = g2d.getStroke();
      Font oldFont = g2d.getFont();
      Object oldAntialias = g2d.getRenderingHint(RenderingHints.KEY_ANTIALIASING);
     
      // Set the font size.
      g2d.setFont(oldFont.deriveFont(this.fontSize));
     
      double scaleDenominator = RendererUtilities.calculateOGCScale(
            mapContext.getAreaOfInterest(),
            mapContext.getRequest().getWidth(),
            new HashMap()
View Full Code Here

            }

            switch (index) {
            case CSS.ListStyleType.LIST_STYLE_DISC:
                decorator = DISC;
                font = font.deriveFont(font.getSize2D() * 0.7f);
                break;

            case CSS.ListStyleType.LIST_STYLE_CIRCLE:
                decorator = CIRCLE;
                font = font.deriveFont(font.getSize2D() * 0.7f);
 
View Full Code Here

                font = font.deriveFont(font.getSize2D() * 0.7f);
                break;

            case CSS.ListStyleType.LIST_STYLE_CIRCLE:
                decorator = CIRCLE;
                font = font.deriveFont(font.getSize2D() * 0.7f);
                break;

            case CSS.ListStyleType.LIST_STYLE_SQUARE:
                decorator = SQUARE;
                font = font.deriveFont(font.getSize2D() * 0.7f);
 
View Full Code Here

                font = font.deriveFont(font.getSize2D() * 0.7f);
                break;

            case CSS.ListStyleType.LIST_STYLE_SQUARE:
                decorator = SQUARE;
                font = font.deriveFont(font.getSize2D() * 0.7f);
                break;


            case CSS.ListStyleType.LIST_STYLE_DECIMAL:
                decorator = Integer.toString(item + 1) + ".";
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.