Package java.awt

Examples of java.awt.Rectangle


            } 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


                            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

                            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

     * @return GradientPaint for shape.
     */
    public static Paint getGradientPaintForShape(Shape shape, Paint paint) {
        if (paint instanceof Color) {
            Color color = (Color) paint;
            Rectangle rect = shape.getBounds();
            paint = new GradientPaint((float) rect.getWidth() * .3f, (float) rect.getHeight() * .3f, color.brighter()
                    .brighter(), (float) rect.getWidth() * .7f, (float) rect.getHeight() * .7f, color.darker()
                    .darker());
        }
        return paint;
    }
View Full Code Here

    /**
     * Gets the imageable area of the page.
     * @return a Rectangle containing the bounds of the imageable area.
     */
  public Rectangle getImageableArea() {
    return new Rectangle((int) pageFormat.getImageableX(), (int) pageFormat
        .getImageableY(),
        (int) (pageFormat.getImageableX() + pageFormat
            .getImageableWidth()), (int) (pageFormat
            .getImageableY() + pageFormat.getImageableHeight()));
  }
View Full Code Here

    // The new instance inherits a few items
//    g.media = new Rectangle(media);
    g.trax = trax;
    g.tray = tray;
    g.clipRectangle = new Rectangle(clipRectangle);

    return (Graphics) g;
  } // end create()
View Full Code Here

   * @param y coordinate
   * @param w width
   * @param h height
   */
  public void setClip(int x,int y,int w,int h) {
    clipRectangle = new Rectangle(x,y,w,h);
    closeBlock();            // finish off any existing paths
    drawRect(x,y,w,h);
    closeBlock("W n");               // clip to current path
  }
View Full Code Here

   * As my JDK docs say, this may break with Java 2D.
   * <p>Sets the clipping region to that of a Shape.
   * @param s Shape to clip to.
   */
  public void setClip(Shape s) {
    Rectangle r = s.getBounds();
    setClip(r.x,r.y,r.width,r.height);
  }
View Full Code Here

    public Graphics create() {
      closeBlock();
      graphic g = new graphic(getPage(),job,getWriter());
     
      // The new instance inherits a few items
      g.clipRectangle = new Rectangle(clipRectangle);
     
      return (Graphics) g;
    }
View Full Code Here

    return preserveAspectRatio;
  }

  public Dimension getPreferredSize()
  {
    final Rectangle bounds = shape.getBounds();
    return new Dimension((int) bounds.getMaxX(), (int) bounds.getMaxY());
  }
View Full Code Here

TOP

Related Classes of java.awt.Rectangle

Copyright © 2015 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.