Examples of GraphicsEnvironment


Examples of java.awt.GraphicsEnvironment

     * @see DeclutterMatrix
     */
    private static class ThreadGraphicsDispenser extends ThreadLocal {
        public Object initialValue() {
            BufferedImage bi = new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB);
            GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
            Graphics2D workingGraphics = ge.createGraphics(bi);
            return workingGraphics;
        }
View Full Code Here

Examples of java.awt.GraphicsEnvironment

     * this <code>BufferedImage</code>.
     * @return a <code>Graphics2D</code>, used for drawing into this
     *          image.
     */
    public Graphics2D createGraphics() {
  GraphicsEnvironment env =
      GraphicsEnvironment.getLocalGraphicsEnvironment();
  return env.createGraphics(this);
    }
View Full Code Here

Examples of java.awt.GraphicsEnvironment

     * @param font
     *            the initial font to display.
     */
    public FontChooserPanel(final Font font) {

        final GraphicsEnvironment g = GraphicsEnvironment
                .getLocalGraphicsEnvironment();
        final String[] fonts = g.getAvailableFontFamilyNames();

        setLayout(new BorderLayout());
        final JPanel right = new JPanel(new BorderLayout());

        final JPanel fontPanel = new JPanel(new BorderLayout());
View Full Code Here

Examples of java.awt.GraphicsEnvironment

    {

        public BufferedImage getColorBufferedImage(int width, int height,
                boolean hasAlpha)
        {
            GraphicsEnvironment ge = GraphicsEnvironment
                    .getLocalGraphicsEnvironment();
            GraphicsDevice gd = ge.getDefaultScreenDevice();
            GraphicsConfiguration gc = gd.getDefaultConfiguration();
            return gc.createCompatibleImage(width, height,
                    Transparency.TRANSLUCENT);
        }
View Full Code Here

Examples of java.awt.GraphicsEnvironment

                public void actionPerformed(ActionEvent e) {
                    frame.setVisible(false);
                }
            });

            GraphicsEnvironment ge =
                GraphicsEnvironment.getLocalGraphicsEnvironment();
            String[]  fontNames = ge.getAvailableFontFamilyNames();
            Dimension fontsComboBoxDimension = new Dimension(160, 25);

            fontsComboBox = new JComboBox(fontNames);

            fontsComboBox.putClientProperty("is3DEnabled", Boolean.TRUE);
View Full Code Here

Examples of java.awt.GraphicsEnvironment

    SBoxLayout.addSpring(fontRow);
    fontBox.add(fontRow, SBoxLayout.constraint(SLayout.EXPAND_X));
    final JLabel label = new JLabel("Font");
    fontRow.add(label);
    final JComboBox fontList = new JComboBox();
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    for (String font : ge.getAvailableFontFamilyNames()) {
      fontList.addItem(font);
    }
    // Show the user what's in use at the moment
    String font = WtWindowManager.getInstance().getProperty(FONT_PROPERTY, DEFAULT_FONT);
    fontList.setSelectedItem(font);
View Full Code Here

Examples of java.awt.GraphicsEnvironment

    }

    private void logScreenSize(Report report) {
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        report.setScreenSize(screenSize);
        GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
        report.setScreenDevices(ge.getScreenDevices().length);
    }
View Full Code Here

Examples of java.awt.GraphicsEnvironment

import javax.imageio.ImageIO;

public class Java2dHelper {

    public static BufferedImage createCompatibleImage(int width, int height) {
        GraphicsEnvironment environment = GraphicsEnvironment.getLocalGraphicsEnvironment();
        GraphicsDevice screenDevice = environment.getDefaultScreenDevice();
        GraphicsConfiguration configuration = screenDevice.getDefaultConfiguration();
        return configuration.createCompatibleImage(width, height);
    }
View Full Code Here

Examples of java.awt.GraphicsEnvironment

   *
   * @param frame
   *            The frame to center
   */
  public static void centerFrameOnMainDisplay(final JFrame frame) {
    final GraphicsEnvironment ge = GraphicsEnvironment
        .getLocalGraphicsEnvironment();
    final GraphicsDevice[] screens = ge.getScreenDevices();
    if (screens.length < 1) {
      return; // Silently fail.
    }
    final Rectangle screenBounds = screens[0].getDefaultConfiguration()
        .getBounds();
View Full Code Here

Examples of java.awt.GraphicsEnvironment

  private static String[] availableFontNames = null;

  private static String[] getAvailableFontNames() {
    if (availableFontNames == null) {
      GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
      availableFontNames = ge.getAvailableFontFamilyNames();
    }
    return availableFontNames;
  }
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.