Examples of drawString()


Examples of java.awt.Graphics2D.drawString()

                ? RenderingHints.VALUE_TEXT_ANTIALIAS_ON : RenderingHints.VALUE_TEXT_ANTIALIAS_OFF;
        g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, antiAliased);
        Object fractionalMetrics = usesFractionalMetrics
                ? RenderingHints.VALUE_FRACTIONALMETRICS_ON : RenderingHints.VALUE_FRACTIONALMETRICS_OFF;
        g.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, fractionalMetrics);
        g.drawString(text, (float) -bounds.getX(), (float) -bounds.getY());
        g.dispose();

        return image;
    }
View Full Code Here

Examples of java.awt.Graphics2D.drawString()

    bp.paint(g2d, width, height);
   
    // Draw the texts
    g2d.setColor(Color.BLACK);
    g2d.setFont(largeFont);
    g2d.drawString(title, SIDE_MARGIN + IMAGE_PAD + categoryImage.getWidth(), TOP_MARGIN + (int) titleRect.getHeight());
   
    g2d.setFont(font);
    g2d.drawString(description, SIDE_MARGIN + IMAGE_PAD + categoryImage.getWidth(), height - BOTTOM_MARGIN);
   
    // Draw the image (the usable height starts right from the top)
View Full Code Here

Examples of java.awt.Graphics2D.drawString()

    g2d.setColor(Color.BLACK);
    g2d.setFont(largeFont);
    g2d.drawString(title, SIDE_MARGIN + IMAGE_PAD + categoryImage.getWidth(), TOP_MARGIN + (int) titleRect.getHeight());
   
    g2d.setFont(font);
    g2d.drawString(description, SIDE_MARGIN + IMAGE_PAD + categoryImage.getWidth(), height - BOTTOM_MARGIN);
   
    // Draw the image (the usable height starts right from the top)
    int y = (height - BOTTOM_MARGIN - categoryImage.getHeight()) / 2 + TOP_MARGIN;
    g2d.setComposite(AlphaComposite.SrcOver);
    g2d.drawImage(categoryImage, SIDE_MARGIN, y, null);
View Full Code Here

Examples of java.awt.Graphics2D.drawString()

      g2d.setFont(font);
      final FontMetrics metrics = g2d.getFontMetrics();
      int i = 0;
      for (String s : text) {
        width = metrics.stringWidth(s);
        g2d.drawString(s, this.getWidth() / 2 - width / 2,
            textPos + ((metrics.getHeight() + lineSpacing) * i));
        ++i;
      }
    }
  }
 
View Full Code Here

Examples of java.awt.Graphics2D.drawString()

                Point pt = viewPort.getViewPosition();
                dim = viewPort.getExtentSize();
                String str = Main.getString("img_wait");
                Rectangle2D rect = g2d.getFontMetrics().getStringBounds(str, g2d);
                g2d.drawString(str, (int)pt.getX() + (int)((dim.getWidth() - rect.getWidth())/2), (int)pt.getY() + (int)((dim.getHeight() + rect.getHeight())/2));
                if (Main.m_settings.isDebug())
                    System.err.println("no image !");
                repaint(250);
            }
        }
View Full Code Here

Examples of java.awt.Graphics2D.drawString()

        Graphics2D g2d = (Graphics2D)g;
        g2d.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON );
        g2d.setFont( awtFont.deriveFont( at ).deriveFont( fontSize ) );
        //g2d.getFontRenderContext().getTransform().scale( xScale, yScale );
       
        g2d.drawString( string, (int)x, (int)y );
    }
}
View Full Code Here

Examples of java.awt.Graphics2D.drawString()

        AffineTransform at = new AffineTransform();
        at.scale( xScale, yScale );
        Graphics2D g2d = (Graphics2D)g;
        g2d.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON );
        g2d.setFont( awtFont.deriveFont( at ).deriveFont( fontSize ) );
        g2d.drawString( string, (int)x, (int)y );
    }
   
    /**
     * Permit to load an external TTF Font program file
     *
 
View Full Code Here

Examples of java.awt.Graphics2D.drawString()

                g2d.setPaint(settings.tip.backgroundColor);
                g2d.fillRect(px, 1, strw, 18);
                g2d.setPaint(settings.tip.fontColor);
                g2d.drawRect(px, 1, strw, 18);
                g2d.setColor(settings.tip.fontColor);
                g2d.drawString(str, px + 4, 16);
            }

        }
    }
View Full Code Here

Examples of java.awt.Graphics2D.drawString()

      int[] xs = {0, titleW, titleW + titleHeight, 0};
      int[] ys = {0, 0, titleHeight, titleHeight};
      gg.fillPolygon(xs, ys, 4);
      gg.fillRect(0, titleHeight, width, height);
      gg.setColor(c.getForeground());
      gg.drawString(title, 10, titleHeight - titleDescent);
    } else {
      gg.fillRect(0, 0, width, height);
    }
   
    gg.dispose();
View Full Code Here

Examples of javax.microedition.lcdui.Graphics.drawString()

                    status = ResourceManager.getResource( "rowSetListView.noData" );
                }
                y = height - fontHeight - 2;
                g.setColor( color );
                g.drawLine( 1, y, getWidth() - 2, y );
                g.drawString(
                        status != null ? status : "",
                        1,
                        height - fontHeight + font.getBaselinePosition(),
                        Graphics.LEFT | Graphics.BASELINE
                );
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.