Examples of TexturePaint


Examples of ae.java.awt.TexturePaint

         *   - the texture image can be (or is already) cached in an OpenGL
         *     texture object
         */
        @Override
        boolean isPaintValid(SunGraphics2D sg2d) {
            TexturePaint paint = (TexturePaint)sg2d.paint;
            OGLSurfaceData dstData = (OGLSurfaceData)sg2d.surfaceData;
            BufferedImage bi = paint.getImage();

            // see if texture-non-pow2 extension is available
            if (!dstData.isTexNonPow2Available()) {
                int imgw = bi.getWidth();
                int imgh = bi.getHeight();
View Full Code Here

Examples of com.google.code.appengine.awt.TexturePaint

        // than the source rectangle, this function compresses the rows and columns by using
        // the specified raster operation.
        renderer.storeGDIObject(index, new GDIObject() {
            public void render(EMFRenderer renderer) {
                if (image != null) {
                    renderer.setBrushPaint(new TexturePaint(image, new Rectangle(0, 0, 16, 16)));
                }
            }
        });
    }
View Full Code Here

Examples of java.awt.TexturePaint

    }
    else if (paint instanceof TexturePaint)
    {
      try
      {
        final TexturePaint tp = (TexturePaint)paint;
        final BufferedImage img = tp.getImage();
        final Rectangle2D rect = tp.getAnchorRect();
        final com.lowagie.text.Image image = com.lowagie.text.Image.getInstance(img, null);
        final PdfPatternPainter pattern = cb.createPattern(image.getWidth(), image.getHeight());
        final AffineTransform inverse = this.normalizeMatrix();
        inverse.translate(rect.getX(), rect.getY());
        inverse.scale(rect.getWidth() / image.getWidth(), -rect.getHeight() / image.getHeight());
View Full Code Here

Examples of java.awt.TexturePaint

    public void setFillPattern(URL fillPatternURL) {
        // This is kind of tricky. Look at the list, find out which
        // members are OMGraphic2D objects, and set the Paint for
        // those graphics.

        TexturePaint texture = null;
        try {

            if (fillPatternURL != null) {
                BufferedImage bi = BufferedImageHelper.getBufferedImage(fillPatternURL,
                        0,
                        0,
                        -1,
                        -1);
                texture = new TexturePaint(bi, new Rectangle(0, 0, bi.getWidth(), bi.getHeight()));
            }
        } catch (InterruptedException ie) {
            Debug.error("PoliticalArea.setFillPattern(): error getting texture image - \n"
                    + ie);
        }
View Full Code Here

Examples of java.awt.TexturePaint

            String texturePaintKey = "fill" + fillPaintString + fillPatternString;

            if (fillPaintString == null) {
                fillPaint = Color.black;

                TexturePaint ret = (TexturePaint) renderAttributesCache.get("fill" + fillPaint + fillPatternString);

                if (ret != null) {
                    return ret;
                } else {
                    ret = (TexturePaint) renderAttributesCache.get(texturePaintKey);

                    if (ret != null) {
                        return ret;
                    }
                }
            }

            BufferedImage bi = new BufferedImage(8, 8, BufferedImage.TYPE_INT_ARGB);
            Graphics2D big = bi.createGraphics();
            big.setColor(new Color(0, true)); // clear
            big.fillRect(0, 0, 8, 8);
            big.setPaint(fillPaint);

            if (fillPatternString.equalsIgnoreCase(LPC_HORIZONTAL_PATTERN)) {
                big.draw(new Line2D.Double(0, 0, 7, 0));
                big.draw(new Line2D.Double(0, 4, 7, 4));
            } else if (fillPatternString.equalsIgnoreCase(LPC_VERTICAL_PATTERN)) {
                big.draw(new Line2D.Double(0, 0, 0, 7));
                big.draw(new Line2D.Double(4, 0, 4, 7));
            } else if (fillPatternString.equalsIgnoreCase(LPC_CROSS_PATTERN)) {
                big.draw(new Line2D.Double(0, 0, 7, 0));
                big.draw(new Line2D.Double(0, 4, 7, 4));
                big.draw(new Line2D.Double(0, 0, 0, 7));
                big.draw(new Line2D.Double(4, 0, 4, 7));
            } else if (fillPatternString.equalsIgnoreCase(LPC_DIAG_CROSS_PATTERN)) {
                big.draw(new Line2D.Double(0, 0, 7, 7));
                big.draw(new Line2D.Double(0, 4, 3, 7));
                big.draw(new Line2D.Double(4, 0, 7, 3));
                big.draw(new Line2D.Double(0, 7, 7, 0));
                big.draw(new Line2D.Double(0, 3, 3, 0));
                big.draw(new Line2D.Double(4, 7, 7, 4));
            } else if (fillPatternString.equalsIgnoreCase(LPC_BACKWARD_DIAG_PATTERN)) {
                big.draw(new Line2D.Double(0, 0, 7, 7));
                big.draw(new Line2D.Double(0, 4, 3, 7));
                big.draw(new Line2D.Double(4, 0, 7, 3));
            } else if (fillPatternString.equalsIgnoreCase(LPC_FORWARD_DIAG_PATTERN)) {
                big.draw(new Line2D.Double(0, 7, 7, 0));
                big.draw(new Line2D.Double(0, 3, 3, 0));
                big.draw(new Line2D.Double(4, 7, 7, 4));
            } else {
                // default to solid
                big.fillRect(0, 0, 8, 8);
            }

            Rectangle r = new Rectangle(0, 0, 8, 8);
            TexturePaint texturePaint = new TexturePaint(bi, r);

            renderAttributesCache.put(texturePaintKey, texturePaint);
            return texturePaint;
        }
    }
View Full Code Here

Examples of java.awt.TexturePaint

                            0,
                            0,
                            -1,
                            -1);

                    return new TexturePaint(bi, new Rectangle(0, 0, bi.getWidth(), bi.getHeight()));
                } catch (InterruptedException ie) {
                    Debug.error("DrawingAttributes: Interrupted Exception scaling texture paint");
                }
            }
            return fillPattern;
View Full Code Here

Examples of java.awt.TexturePaint

                            0,
                            0,
                            -1,
                            -1);

                    fillPattern = new TexturePaint(bi, new Rectangle(0, 0, bi.getWidth(), bi.getHeight()));
                }
            } catch (MalformedURLException murle) {
                Debug.error("DrawingAttributes.init: bad texture URL - \n     "
                        + realPrefix + fillPatternProperty);
                fillPattern = null;
View Full Code Here

Examples of java.awt.TexturePaint

    g2D.setPaint(Color.WHITE);
    g2D.fillRect(0, 0, imageSize, imageSize);   
    BufferedImage textureImage = this.imageChoicePreviewComponent.getImage();
    if (textureImage != null) {
      // Draw the texture image as if it will be shown on a 250 x 250 cm wall
      g2D.setPaint(new TexturePaint(textureImage,
          new Rectangle2D.Float(0, 0,
              this.controller.getWidth() / 250 * imageSize,
              this.controller.getHeight() / 250 * imageSize)));
      g2D.fillRect(0, 0, imageSize, imageSize);
    }
View Full Code Here

Examples of java.awt.TexturePaint

      imageGraphics.scale(gridScale, gridScale);
     
      paintGridLines(imageGraphics, gridScale, 0, mainGridSize, 0, mainGridSize, gridSize, mainGridSize);   
      imageGraphics.dispose();
     
      g2D.setPaint(new TexturePaint(gridImage, new Rectangle2D.Float(0, 0, mainGridSize, mainGridSize)));
     
      g2D.fill(new Rectangle2D.Float(xMin, yMin, xMax - xMin, yMax - yMin));
    } else {
      paintGridLines(g2D, gridScale, xMin, xMax, yMin, yMax, gridSize, mainGridSize);         
    }
View Full Code Here

Examples of java.awt.TexturePaint

                        }
                      });
                }
                textureImage = this.floorTextureImagesCache.get(floorTexture.getImage());
              }
              g2D.setPaint(new TexturePaint(textureImage,
                  new Rectangle2D.Float(0, 0, floorTexture.getWidth(), floorTexture.getHeight())));
            }
          }         
        }
       
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.