Package java.awt

Examples of java.awt.GraphicsEnvironment


    WindowPosition result = windowCoords.get(name.name());
   
    if (result == null)
    {// invent default coordinates, using http://java.sun.com/j2se/1.5.0/docs/api/java/awt/GraphicsDevice.html#getDefaultConfiguration()

      GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
      GraphicsDevice[] gs = ge.getScreenDevices();
      int deviceToUse = Integer.valueOf(getProperty(G_PROPERTIES.GRAPHICS_MONITOR));
      if (deviceToUse >= gs.length) deviceToUse =statechum.GlobalConfiguration.DEFAULT_SCREEN;// use the first one if cannot use the requested one.
      GraphicsConfiguration gc = gs[deviceToUse].getDefaultConfiguration();
     
      // from http://java.sun.com/j2se/1.4.2/docs/api/index.html
View Full Code Here


  public SplashScreen() {
    this.setUndecorated(true);
    this.setSize(WIDTH, HEIGHT);
   
    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

    log.debug("WaitDialog constrcutor");
    this.setSize(200,80);
    this.setResizable(false);
    this.setUndecorated(true);
    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

    g2d.dispose();
   
    }

  private BufferedImage loadMapImage() {
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    GraphicsConfiguration gc = ge.getDefaultScreenDevice().getDefaultConfiguration();
    File file = new File("bin/map.jpg");
    // String l_filename = IMAGE_DIR + File.separator + filename;
    log.debug("Loading image <"+file.getAbsolutePath()+">");
    try {
      BufferedImage bi = ImageIO.read(file);
View Full Code Here

            public void windowDeiconified(WindowEvent e) {
                _deiconify();
            }
        });

        GraphicsEnvironment ge = GraphicsEnvironment
                .getLocalGraphicsEnvironment();
        GraphicsDevice[] SCREENS = ge.getScreenDevices();
        Point ownerLoc = owner.getLocation();
        Rectangle screenBounds = null;

        for (int screen = 0; screen < SCREENS.length; screen++) {
            GraphicsConfiguration gc = SCREENS[screen]
View Full Code Here

    size.setBounds(121, 62, 41, 20);
    cPanelLabelDuzenle.add(size);

    yazitipi = new JComboBox<String>();
    yazitipi.setBounds(9, 62, 102, 20);
    GraphicsEnvironment ge = GraphicsEnvironment
        .getLocalGraphicsEnvironment();
    String[] fonts = ge.getAvailableFontFamilyNames();
    for (int i = 0; i < fonts.length; i++) {
      if (fonts[i].equals("Arial")) {
        fonts[i] = "Arial Black";
      }
    }
View Full Code Here

   * um dieses zu zentrieren.
   * Abhängig von der Größe und der Bildschirmauflösung
   * @return x-Koordinate in Pixeln
   */
  private int calculateXPosition() {
    GraphicsEnvironment environment = GraphicsEnvironment.getLocalGraphicsEnvironment();
    GraphicsDevice device = environment.getDefaultScreenDevice();
    DisplayMode display = device.getDisplayMode();
    int x = display.getWidth();
    return (x - xSize)/2;
  }
View Full Code Here

   * Überprüft, ob die Bildschirmaufösung den Minimalanforderungen genügt.
   * Wenn nicht wird eine Warnung angezeigt und gefragt, ob das Spiel trotzdem
   * gestartet werden soll.
   */
  private static void checkDisplayResolution() {
    GraphicsEnvironment environment = GraphicsEnvironment.getLocalGraphicsEnvironment();
    GraphicsDevice device = environment.getDefaultScreenDevice();
    DisplayMode display = device.getDisplayMode();
    int x = display.getWidth();
    int y = display.getHeight();
    if(x < minXResolution || y < minYResolution) {
      QuestionDialog resolutionWarning = new QuestionDialog(gui, Dictionary.RelosutionDialogWarning) {
View Full Code Here

     * Multiple fonts are listed.
     * The name of the first font found on the system is returned as result
     * of the convertion.
     */
    public void testFontFamilyMultiple() {
        GraphicsEnvironment ge =
            GraphicsEnvironment.getLocalGraphicsEnvironment();
        List fontList = Arrays.asList(ge.getAvailableFontFamilyNames());
        boolean hasGaramond = fontList.contains("Garamond");
        boolean hasTimes = fontList.contains("Times New Roman");

        attr = ss.addAttribute(empty, StyleConstants.FontFamily,
                               "Garamond, Times New Roman, serif");
View Full Code Here

    /**
     * Multiple fonts are listed. The first item refers to non-existent font,
     * the second to the known font on Windows systems.
     */
    public void testFontFamilyMultipleNonExistentW() {
        GraphicsEnvironment ge =
            GraphicsEnvironment.getLocalGraphicsEnvironment();
        List fontList = Arrays.asList(ge.getAvailableFontFamilyNames());
        boolean hasTimes = fontList.contains("Times New Roman");

        attr = ss.addAttribute(empty, StyleConstants.FontFamily,
                               "NonExistentFont, Times New Roman, serif");

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.