Package java.awt

Examples of java.awt.Graphics.dispose()


  private Texture getColoredImageTexture(Color color) {
    BufferedImage image = new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB);
    Graphics g = image.getGraphics();
    g.setColor(color);
    g.drawLine(0, 0, 0, 0);
    g.dispose();
    Texture texture = new TextureLoader(image).getTexture();
    texture.setCapability(Texture.ALLOW_IMAGE_READ);
    texture.setCapability(Texture.ALLOW_FORMAT_READ);
    texture.getImage(0).setCapability(ImageComponent2D.ALLOW_IMAGE_READ);
    texture.getImage(0).setCapability(ImageComponent2D.ALLOW_FORMAT_READ);
View Full Code Here


      mode = MODE_PERCENTAGE;
    }
    Graphics g = getGraphics();
    if(g != null) {
      paint(g);
      g.dispose();
    } else {
    }
  }
 
  public boolean isBroken() {
View Full Code Here

  public void showStatus(String msg) {
    this.msg = msg;
    Graphics g = getGraphics();
    if(g != null) {
      paint(g);
      g.dispose();
    } else {
      //      No graphics in showStatus
    }
  }
 
View Full Code Here

    synchronized(paintLock) {
      Graphics g = getGraphics();

      if(g != null) {
        paint(g);
        g.dispose();
      }
    }
  }

  String indent(int level) {
View Full Code Here

      Graphics ig = titleImage.getGraphics();
      ig.setColor(Color.BLACK);
      ig.fillRect(0, 0, w, TITLE_HEIGHT);
      ig.setColor(Color.WHITE);
      ig.drawString(title, 0, TITLE_HEIGHT - 3);
      ig.dispose();
    }
    int startX = Math.max(0, (width - titleImage.getWidth(null)) / 2);
    g.drawImage(titleImage, startX, height, null);
  }
 
View Full Code Here

          g.setColor(COLOR_PROTECTION);
          g.fillRect(x * scale, y * scale, scale, scale);
        }
      }
    }
    g.dispose();

    SwingUtilities.invokeLater(new Runnable() {
      public void run() {
        title = zone;
        titleImage = null;
View Full Code Here

       * Adjust the width, so that the drawn border does not get corners
       * that may look ugly
       */
      getBorder().paintBorder(this, graphics, -insets.left, 0,
          getWidth() + insets.left + insets.right, getHeight());
      graphics.dispose();
    }
   
    @Override
    public void paint(Graphics g) {
      cache.paintComponent(g);
View Full Code Here

      for (int i = y; i < y + height; i += imageHeight) {
        g.drawImage(bottomRightImage, borderX, i, null);
      }
    }
   
    g.dispose();
  }
 
  /**
   * Get the appropriate border draw width for a component.
   *
 
View Full Code Here

    /* /// */
    g.drawLine(TITLEBAR_HEIGHT - 3, 1, 1, TITLEBAR_HEIGHT - 3);
    g.drawLine(TITLEBAR_HEIGHT - 2, 1, 1, TITLEBAR_HEIGHT - 2);
    g.drawLine(TITLEBAR_HEIGHT - 2, 2, 2, TITLEBAR_HEIGHT - 2);

    g.dispose();
    return new ImageIcon(image);
  }
 
  /**
   * Draw the minimize button icon.
View Full Code Here

         * SwingUtilities.paintComponent and accept JComponent in the
         * constructor, but now we need the interface anyway.
         */
        component.paintChildren(imageGraphics);
      }
      imageGraphics.dispose();       
    }
    g.drawImage(cachedImage, 0, 0, null);
  }
 
  /**
 
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.