Package java.awt

Examples of java.awt.Toolkit$AWTTreeLock


            try {
                Map map = null;
                // we should be able to look up the "recommended" AA settings (that correspond to the user's
                // desktop preferences and machine capabilities
                // see: http://java.sun.com/javase/6/docs/api/java/awt/doc-files/DesktopProperties.html
                Toolkit tk = Toolkit.getDefaultToolkit();
                map = (Map)(tk.getDesktopProperty("awt.font.desktophints"));
                antiAliasRenderingHint = map.get(RenderingHints.KEY_TEXT_ANTIALIASING);
            } catch (Exception e) {
                // conceivably could get an exception in a webstart environment? not sure
            }
        }
View Full Code Here


        if (useCursor) {
            /*
             * For who like make his CustomCursor
             */
            try {
                Toolkit tk = Toolkit.getDefaultToolkit();
                ImageIcon pointer = new ImageIcon(getClass().getResource("pan.gif"));
                Dimension bestSize = tk.getBestCursorSize(pointer.getIconWidth(), pointer.getIconHeight());
                Image pointerImage = ImageScaler.getOptimalScalingImage(pointer.getImage(),(int) bestSize.getWidth(),
                                                                          (int) bestSize.getHeight());
                Cursor cursor = tk.createCustomCursor(pointerImage, new Point(0, 0), "PP");
                setModeCursor(cursor);
                return;
            } catch (Exception e) {
                // Problem finding image probably, just move on.
            }
View Full Code Here

        int width = 256;

        BufferedImage bigImage = new BufferedImage(width * 6, height * 6, BufferedImage.TYPE_INT_RGB);
        GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
        Graphics g = ge.createGraphics(bigImage);
        Toolkit tk = Toolkit.getDefaultToolkit();

        for (int x = 0; x < 6; x++) {
            for (int y = 0; y < 6; y++) {
                int[] pixels = decompressSubframe(x, y, colortable);

                java.awt.Image bitmap = tk.createImage(new MemoryImageSource(width, height, pixels, 0, width));

                g.drawImage(bitmap, x * 256, y * 256, null);
            }
        }

View Full Code Here

        if (getNeedToRegenerate() || bitmap == null) {

            computePixels();

            Toolkit tk = Toolkit.getDefaultToolkit();
            bitmap = tk.createImage(new MemoryImageSource(width, height, pixels, 0, width));
        }

        if (imageFilter != null) {
            bitmap = filterImage();
        }
View Full Code Here

    contentPane.add(pane);

    setTitle("PDF Test Application");

    // Set the location and size of the window and show it
    Toolkit toolkit = Toolkit.getDefaultToolkit();
    Dimension screenSize = toolkit.getScreenSize();
    setLocation(50, 50);
    setSize(w, h/2);
    setVisible(true);
    toFront();
   
View Full Code Here

  private void printPdf() {
    System.out.println("Printing..");
    JobAttributes jobAttributes = new JobAttributes();
    //jobAttributes.setDialog(JobAttributes.DialogType.NONE);
    // CRAP!! - This doesn't work with jdk1.2.2 - fix it
    Toolkit toolkit = Toolkit.getDefaultToolkit();
    PrintJob pjob = toolkit.getPrintJob(this,
                                        "PDF Test Print",
                                        jobAttributes, 
                                        null);
    if(pjob != null) { 
      Graphics printGraphics = pjob.getGraphics();
View Full Code Here

   * @param g a <code>Graphics</code> value
   * @param d a <code>Dimension</code> value
   */
  private void drawSampleImage(Graphics g, Dimension d) {
    try {
      Toolkit toolkit = Toolkit.getDefaultToolkit();
      Image img = toolkit.createImage(sampleImageFile);
      MediaTracker tracker = new MediaTracker(drawingArea);
      tracker.addImage(img, 0);
      try {
        tracker.waitForID(0);
      }
View Full Code Here

    getContentPane().add(pnlMain, java.awt.BorderLayout.CENTER);

    pack();

    Toolkit toolkit = java.awt.Toolkit.getDefaultToolkit();
    java.awt.Dimension screenSize = toolkit.getScreenSize();
    int screenResolution = toolkit.getScreenResolution();
    float zoom = ((float) screenResolution) / JRViewer.REPORT_RESOLUTION;

    int height = (int) (550 * zoom);
    if (height > screenSize.getHeight())
    {
View Full Code Here

    getContentPane().add(pnlMain, java.awt.BorderLayout.CENTER);

    pack();
   
    Toolkit toolkit = java.awt.Toolkit.getDefaultToolkit();
    java.awt.Dimension screenSize = toolkit.getScreenSize();
    int screenResolution = toolkit.getScreenResolution();
    float zoom = ((float) screenResolution) / JRViewer.REPORT_RESOLUTION;
   
    int height = (int) (550 * zoom);
    if (height > screenSize.getHeight())
    {
View Full Code Here

      URL url = loader.getResource(name);
      if (url == null) {
        url = loader.getResource("/" + name);
      }
      if (url != null) {
        Toolkit tk = Toolkit.getDefaultToolkit();
        Image img = tk.getImage(url);
        return img;
      }
    }

    return null;
View Full Code Here

TOP

Related Classes of java.awt.Toolkit$AWTTreeLock

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.