Package java.awt

Examples of java.awt.GraphicsEnvironment


    private void initializeFrame() {
        frame = new Frame(Messages.getString("ClientGUI.title")); //$NON-NLS-1$
        menuBar.setGame(client.game);
        frame.setMenuBar(menuBar);
        Rectangle virtualBounds = new Rectangle();
        GraphicsEnvironment ge = GraphicsEnvironment
                .getLocalGraphicsEnvironment();
        GraphicsDevice[] gs = ge.getScreenDevices();
        for (int j = 0; j < gs.length; j++) {
            GraphicsDevice gd = gs[j];
            GraphicsConfiguration[] gc = gd.getConfigurations();
            for (int i = 0; i < gc.length; i++) {
                virtualBounds = virtualBounds.union(gc[i].getBounds());
View Full Code Here


        frame = new JFrame(Messages.getString("ClientGUI.title")); //$NON-NLS-1$
        frame.getRootPane().setDoubleBuffered(false);
        menuBar.setGame(client.game);
        frame.setJMenuBar(menuBar);
        Rectangle virtualBounds = new Rectangle();
        GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
        GraphicsDevice[] gs = ge.getScreenDevices();
        for (GraphicsDevice gd : gs) {
            GraphicsConfiguration[] gc = gd.getConfigurations();
            for (GraphicsConfiguration element : gc) {
                virtualBounds = virtualBounds.union(element.getBounds());
            }
View Full Code Here

        points[0] = new Point(0, 0);
        return points;
    }

    public Graphics2D createGraphics() {
        GraphicsEnvironment ge =
            GraphicsEnvironment.getLocalGraphicsEnvironment();
        return ge.createGraphics(this);
    }
View Full Code Here

  /**
   * NOT YET IMPLEMENTED. Turn fullscreen mode on or off.
   */
  public void setFullscreen(boolean fullscreen) {
    GraphicsEnvironment ge=null;
    GraphicsDevice gd=null;
    ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    gd = ge.getDefaultScreenDevice();
   
    if (fullscreen) {
      if (gd.isFullScreenSupported()) {
//        gd.setFullScreenWindow(this);
      }
View Full Code Here

        }
    }

    private void loadStandardFonts()
    {
        GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
        Font[] fonts = ge.getAllFonts();

        for (int i = 0; i < fonts.length; i++)
        {
            fonts_.put(fonts[i].getFontName(), fonts[i]);
        }
View Full Code Here

  // TODO: TEST
  //private Polygon poly = new Polygon();
 
  public Renderer() {
      GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
      GraphicsDevice device = env.getDefaultScreenDevice();
        GraphicsConfiguration gc = device.getDefaultConfiguration();
    frame = new Frame("Fysix", gc);
    frame.addWindowListener(new WindowAdapter() {
      @Override
      public void windowClosing(WindowEvent e) {
View Full Code Here

    @Override
    public Image getImage()
    {
        if (image == null)
        {
            GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
            GraphicsDevice gd = ge.getDefaultScreenDevice();
            GraphicsConfiguration gc = gd.getDefaultConfiguration();
            BufferedImage bi = gc.createCompatibleImage(getIconWidth(), getIconHeight(),
                    Transparency.TRANSLUCENT);
            paintIcon(null, bi.getGraphics(), 0, 0);
        }
View Full Code Here

            // for the junit test not all chars are rendered
            { "build/scratchpad-test-resources/mona.ttf", "fallback", "Cabin" }
        };
       
        // setup fonts (especially needed, when run under *nix systems)
        GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
        Map<String,String> fontMap = new HashMap<String,String>();
        Map<String,String> fallbackMap = new HashMap<String,String>();
       
        for (String fontFile[] : fontFiles) {
            File f = new File(fontFile[0]);
            assumeTrue("necessary font file "+f.getName()+" not downloaded.", f.exists());
           
            Font font = Font.createFont(Font.TRUETYPE_FONT, f);
            ge.registerFont(font);
           
            Map<String,String> map = ("mapped".equals(fontFile[1]) ? fontMap : fallbackMap);
            map.put(fontFile[2], font.getFamily());
        }
       
View Full Code Here

     * Write to console the list of Font families found in the System.
     */
    private void showFontFamilies() {
        System.out.println("Show Font Families:");

        GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
        String []fontFamilies = ge.getAvailableFontFamilyNames();
        int fontFamiliesNumber = fontFamilies.length;
        StringBuffer fontFamilyNames = new StringBuffer(1024);
        for (int i=0; i < fontFamiliesNumber; i++) {
            if (i > 0) {
                fontFamilyNames.append(", ");
View Full Code Here

   */
  private String getMonospacedFontName() {

    if (monospacedFontName==null) {

      GraphicsEnvironment ge = GraphicsEnvironment.
                  getLocalGraphicsEnvironment();
      String[] familyNames = ge.getAvailableFontFamilyNames();
      Arrays.sort(familyNames);
      boolean windows = System.getProperty("os.name").toLowerCase().
                indexOf("windows")>=0;

      // "Monaco" is the "standard" monospaced font on OS X.  We'll
View Full Code Here

TOP

Related Classes of java.awt.GraphicsEnvironment

Copyright © 2018 www.massapicom. 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.