Package com.jgraph.gaeawt.java.awt

Examples of com.jgraph.gaeawt.java.awt.Rectangle


    super(sampleModel, dataBuffer, aRegion, parent);
  }

  protected WritableRaster(SampleModel sampleModel, int[] dataBuffer)
  {
    this(sampleModel, dataBuffer, new Rectangle(0, 0,
        sampleModel.width, sampleModel.height), null);
  }
View Full Code Here


        sampleModel.width, sampleModel.height), null);
  }

  protected WritableRaster(SampleModel sampleModel)
  {
    this(sampleModel, sampleModel.createDataBuffer(), new Rectangle(
        0, 0, sampleModel.width, sampleModel.height), null);
  }
View Full Code Here

  }

  public void setData(Raster r)
  {

    Rectangle from = r.getBounds();
    Rectangle to = raster.getBounds();
    Rectangle intersection = to.intersection(from);

    int minX = intersection.x;
    int minY = intersection.y;
    int w = intersection.width;
    int h = intersection.height;
View Full Code Here

    else
    {
      childModel = sampleModel.createSubsetSampleModel(bandList);
    }

    return new Raster(childModel, dataBuffer, new Rectangle(0, 0, width,
        height), this);
  }
View Full Code Here

  }

  protected Raster(SampleModel sampleModel, int[] dataBuffer)
  {

    this(sampleModel, dataBuffer, new Rectangle(0, 0,
        sampleModel.getWidth(), sampleModel.getHeight()), null);
  }
View Full Code Here

    this.numBands = sampleModel.getNumBands();
  }

  protected Raster(SampleModel sampleModel)
  {
    this(sampleModel, sampleModel.createDataBuffer(), new Rectangle(0, 0,
        sampleModel.getWidth(), sampleModel.getHeight()), null);
  }
View Full Code Here

    return new OrdinaryWritableRaster(sm);
  }

  public Rectangle getBounds()
  {
    return new Rectangle(minX, minY, width, height);
  }
View Full Code Here

    @Override
    public void drawGlyphVector(Graphics2D g, GlyphVector glyphVector,
            float x, float y) {

        AffineTransform at = g.getTransform();
        Rectangle c = g.getClipBounds();
        if (at != null){
            int atType = at.getType();
            if (atType == AffineTransform.TYPE_TRANSLATION) {
                c.translate((int)Math.round(at.getTranslateX()), (int)Math.round(at.getTranslateY()));
            }
        }

        WritableRaster wr = ((BufferedImageGraphics2D)g).getWritableRaster();

        Rectangle rBounds = wr.getBounds();

        int color = g.getColor().getRGB();

        drawClipGlyphVector(wr, color, glyphVector, (int)Math.round(x + at.getTranslateX()), (int)Math.round(y + at.getTranslateY()),
        Math.max(c.x,rBounds.x),
        Math.max(c.y,rBounds.y),
        Math.min((int)Math.round(c.getMaxX()), (int)Math.round(rBounds.getMaxX())),
        Math.min((int)Math.round(c.getMaxY()), (int)Math.round(rBounds.getMaxY())));

    }
View Full Code Here

    @SuppressWarnings("deprecation")
    @Override
    public void drawString(Graphics2D g, String str, float x, float y) {
        AffineTransform at = g.getTransform();
        Rectangle c = g.getClipBounds();
        if (at != null){
            int atType = at.getType();
            if (atType == AffineTransform.TYPE_TRANSLATION) {
                c.translate((int)Math.round(at.getTranslateX()), (int)Math.round(at.getTranslateY()));
            }
        }
        WritableRaster wr = ((BufferedImageGraphics2D)g).getWritableRaster();
        Rectangle rBounds = wr.getBounds();

        int color = g.getColor().getRGB();

        drawClipString(wr, color, str, (FontPeerImpl) (g.getFont().getPeer()),
                (int)Math.round(x + at.getTranslateX()), (int)Math.round(y + at.getTranslateY()),
                Math.max(c.x,rBounds.x),
                Math.max(c.y,rBounds.y),
                Math.min((int)Math.round(c.getMaxX()), (int)Math.round(rBounds.getMaxX())),
                Math.min((int)Math.round(c.getMaxY()), (int)Math.round(rBounds.getMaxY())));

    }
View Full Code Here

      int srcY, ColorModel dstCM, WritableRaster dstR, int dstX,
      int dstY, int width, int height, AffineTransform at,
      Composite comp, Color bgcolor, MultiRectArea clip)
  {

    Rectangle srcBounds = new Rectangle(srcX, srcY, width, height);
    Rectangle dstBlitBounds = new Rectangle(dstX, dstY, width, height);

    Rectangle transSrcBounds = getBounds2D(at, srcBounds).getBounds();
    Rectangle transDstBlitBounds = getBounds2D(at, dstBlitBounds)
        .getBounds();

    int translateX = transDstBlitBounds.x - transSrcBounds.x;
    int translateY = transDstBlitBounds.y - transSrcBounds.y;

    AffineTransform inv = null;
    try
    {
      inv = at.createInverse();
    }
    catch (NoninvertibleTransformException e)
    {
      return;
    }

    double[] m = new double[6];
    inv.getMatrix(m);

    int clipRects[];
    if (clip != null)
    {
      clipRects = clip.rect;
    }
    else
    {
      clipRects = new int[] { 5, 0, 0, dstR.getWidth(), dstR.getHeight() };
    }

    int compType = 0;
    int srcConstAlpha = 0;
    int rule = 0;
    int bgRGB = bgcolor == null ? 0 : bgcolor.getRGB();
    int srcRGB = 0, dstRGB = 0;
    int srcVal = 0;
    int dstVal = 0;
    if (comp instanceof AlphaComposite)
    {
      compType = AlphaCompositeMode;
      AlphaComposite ac = (AlphaComposite) comp;
      rule = ac.getRule();
      srcConstAlpha = (int) (ac.getAlpha() * 255 + 0.5f);
    }
    else if (comp instanceof XORComposite)
    {
      compType = XORMode;
      XORComposite xor = (XORComposite) comp;
      bgRGB = xor.getXORColor().getRGB();
    }

    for (int i = 1; i < clipRects[0]; i += 4)
    {
      Rectangle dstBounds = new Rectangle(clipRects[i], clipRects[i + 1],
          0, 0);
      dstBounds.add(clipRects[i + 2] + 1, clipRects[i + 1]);
      dstBounds.add(clipRects[i + 2] + 1, clipRects[i + 3] + 1);
      dstBounds.add(clipRects[i], clipRects[i + 3] + 1);

      Rectangle bounds = dstBounds.intersection(transDstBlitBounds);

      int minSrcX = srcBounds.x;
      int minSrcY = srcBounds.y;
      int maxSrcX = minSrcX + srcBounds.width;
      int maxSrcY = minSrcY + srcBounds.height;
View Full Code Here

TOP

Related Classes of com.jgraph.gaeawt.java.awt.Rectangle

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.