Package java.awt

Examples of java.awt.TexturePaint


        tileg2d.fillOval(2, 2, tile.getWidth() - 2, tile.getHeight() - 2);
        tileg2d.dispose();
        Rectangle2D rect = new Rectangle2D.Double(
                2, 2,
                tile.getWidth() / 2.0, tile.getHeight() / 2.0);
        this.paint = new TexturePaint(tile, rect);
    }
View Full Code Here


        PSTilingPattern patternObj = (PSTilingPattern) pattern;
        if (this.patternType != patternObj.patternType) {
            return false;
        }

        TexturePaint patternTexture = patternObj.getTexturePaint();

        if ( ((patternTexture == null) && (texture != null)) ||
             ((patternTexture != null) && (texture == null))) {
            return false;
        }

        if ((patternTexture != null) && (texture != null)) {
            // compare textures data
            int width = texture.getImage().getWidth();
            int height = texture.getImage().getHeight();

            int widthPattern = patternTexture.getImage().getWidth();
            int heightPattern = patternTexture.getImage().getHeight();

            if (width != widthPattern) {
                return false;
            }
            if (height != heightPattern) {
                return false;
            }
            int [] rgbData = new int[width * height];
            int [] rgbDataPattern = new int[widthPattern * heightPattern];

            texture.getImage().getRGB(0, 0, width, height, rgbData, 0, width);
            patternTexture.getImage().getRGB(0, 0, widthPattern, heightPattern,
                    rgbDataPattern, 0, widthPattern);

            for (int i = 0; i < rgbData.length; i++) {
                if (rgbData[i] != rgbDataPattern[i]) {
                    return false;
View Full Code Here

      g.setColor(Color.white);
      g.fillRect(0,0,2*t,2*t);
      g.setColor(Color.lightGray);
      g.fillRect(0,0,t,t);
      g.fillRect(t,t,t,t);
      checkerPaint = new TexturePaint(bi,new Rectangle(0,0,bi.getWidth(),bi.getHeight()));
    }
    return checkerPaint;
  }
View Full Code Here

    int w2 = Math.min(getWidth(), w);
    int h2 = Math.min(getHeight(), w);
    Rectangle r = new Rectangle(getWidth()/2-w2/2,getHeight()/2-h2/2, w2, h2);
   
    if(c.getAlpha()<255) {
      TexturePaint checkers = getCheckerPaint();
      g.setPaint(checkers);
      g.fillRect(r.x, r.y, r.width, r.height);
    }
    g.setColor(c);
    g.fillRect(r.x, r.y, r.width, r.height);
View Full Code Here

   
    setFlags( flags );
   
    img = new BufferedImage( imgWidth, imgHeight, BufferedImage.TYPE_INT_ARGB );
    img.setRGB( 0, 0, imgWidth, imgHeight, pntBarGradientPixels, 0, imgWidth );
    pntBackground = new TexturePaint( img, new Rectangle( 0, 0, imgWidth, imgHeight ));

    setOpaque( true );
    }
View Full Code Here

                g2d.drawLine(0, i*10, SIZE, i*10);
            }
            ok = true;
        }
        img.flush();
        if (ok) paint = new TexturePaint(img, rec);
        return paint;
    }
View Full Code Here

    private Paint getPaint(byte[] bit) {
        Dimension d = getImageDimension(bit);
        BufferedImage img = getImage(bit);
        Rectangle2D rec = new Rectangle2D.Float(0, 0, (float)d.width, (float)d.height);
        TexturePaint paint = new TexturePaint(img, rec);
        return paint;
    }
View Full Code Here

    }

    private void createPaint() {
        BufferedImage bim = ImageHelper.loadBufferedImage(image);
        Rectangle rect = new Rectangle(width, height);
        paint = new TexturePaint(bim, rect);
    }
View Full Code Here

    if ( textureNode.selectSingleNode( JFreeChartEngine.Y2_NODE_NAME ) != null ) {
      y2 = Double.parseDouble( textureNode.selectSingleNode( JFreeChartEngine.Y2_NODE_NAME ).getText() );
    }
    Rectangle2D anchor = new Rectangle2D.Double( x1, y1, x2, y2 );

    Paint paint = new TexturePaint( texture, anchor );
    return paint;
  }
View Full Code Here

    if(slider.hasFocus()) {
      PlafPaintUtils.paintFocus(g2,r,3);
    }
   
    bi.getRaster().setDataElements(0,0,1,trackRect.height,intArray);
    TexturePaint p = new TexturePaint(bi,new Rectangle(0,trackRect.y,1,bi.getHeight()));
    g2.setPaint(p);
    g2.fillRect(r.x,r.y,r.width,r.height);
   
    PlafPaintUtils.drawBevel(g2, r);
  }
View Full Code Here

TOP

Related Classes of java.awt.TexturePaint

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.