/** * Should perform the equivilent action as * createRendering followed by drawing the RenderedImage. * * @param g2d The Graphics2D to draw to. * @return true if the paint call succeeded, false if * for some reason the paint failed (in which * case a createRendering should be used). */ public boolean paintRable(Graphics2D g2d) { AffineTransform at = g2d.getTransform(); g2d.transform(getAffine()); GraphicsUtil.drawImage(g2d, getSource()); g2d.setTransform(at); return true; }
/** * Set the affine transform. * @param affine the new Affine transform to apply. */ public void setAffine(AffineTransform affine) { touch(); this.affine = affine; try { invAffine = affine.createInverse(); } catch (NoninvertibleTransformException e) { invAffine = null; } }
/** * Returns a Filter that represents an raster image (JPG or PNG). * * @param ctx the bridge context * @param primitiveRegion the primitive region * @param purl the url of the image */ protected static Filter createRasterFeImage(BridgeContext ctx, Rectangle2D primitiveRegion, ParsedURL purl) { // Need to fit the raster image to the filter region so that // we have the same behavior as raster images in the <image> element. Filter filter = ImageTagRegistry.getRegistry().readURL(purl); Rectangle2D bounds = filter.getBounds2D(); AffineTransform scale = new AffineTransform(); scale.translate(primitiveRegion.getX(), primitiveRegion.getY()); scale.scale(primitiveRegion.getWidth()/(bounds.getWidth()-1), primitiveRegion.getHeight()/(bounds.getHeight()-1)); scale.translate(-bounds.getX(), -bounds.getY()); return new AffineRable8Bit(filter, scale); } }
(rootElement, cursorSize.width, cursorSize.height, ctx); Filter filter = node.getGraphicsNodeRable(true); f = new AffineRable8Bit(filter, at); } catch (BridgeException ex) { throw ex; cursorSize.height); f = new AffineRable8Bit(filter, at); } else { AffineTransform at = f.getAffine(); at.transform(hotSpot, hotSpot);
public Rectangle2D getBounds2D() { Filter src = getSource(); Rectangle2D r = src.getBounds2D(); return affine.createTransformedShape(r).getBounds2D(); } /**
/** * Sets the source to be affine. * @param src image to affine. */ public void setSource(Filter src) { init(src); }
/** * Returns a Filter that represents an raster image (JPG or PNG). * * @param ctx the bridge context * @param primitiveRegion the primitive region * @param purl the url of the image */ protected static Filter createRasterFeImage(BridgeContext ctx, Rectangle2D primitiveRegion, ParsedURL purl) { // Need to fit the raster image to the filter region so that // we have the same behavior as raster images in the <image> element. Filter filter = ImageTagRegistry.getRegistry().readURL(purl); Rectangle2D bounds = filter.getBounds2D(); AffineTransform scale = new AffineTransform(); scale.translate(primitiveRegion.getX(), primitiveRegion.getY()); scale.scale(primitiveRegion.getWidth()/(bounds.getWidth()-1), primitiveRegion.getHeight()/(bounds.getHeight()-1)); scale.translate(-bounds.getX(), -bounds.getY()); return new AffineRable8Bit(filter, scale); } }
(rootElement, cursorSize.width, cursorSize.height, ctx); Filter filter = node.getGraphicsNodeRable(true); f = new AffineRable8Bit(filter, at); } catch (BridgeException ex) { throw ex; cursorSize.height); f = new AffineRable8Bit(filter, at); } else { AffineTransform at = f.getAffine(); at.transform(hotSpot, hotSpot);
public Rectangle2D getBounds2D() { Filter src = getSource(); Rectangle2D r = src.getBounds2D(); return affine.createTransformedShape(r).getBounds2D(); } /**
/** * Sets the source to be affine. * @param src image to affine. */ public void setSource(Filter src) { init(src); }
/** * Returns a Filter that represents an raster image (JPG or PNG). * * @param ctx the bridge context * @param primitiveRegion the primitive region * @param purl the url of the image */ protected static Filter createRasterFeImage(BridgeContext ctx, Rectangle2D primitiveRegion, ParsedURL purl) { // Need to fit the raster image to the filter region so that // we have the same behavior as raster images in the <image> element. Filter filter = ImageTagRegistry.getRegistry().readURL(purl); Rectangle2D bounds = filter.getBounds2D(); AffineTransform scale = new AffineTransform(); scale.translate(primitiveRegion.getX(), primitiveRegion.getY()); scale.scale(primitiveRegion.getWidth()/(bounds.getWidth()-1), primitiveRegion.getHeight()/(bounds.getHeight()-1)); scale.translate(-bounds.getX(), -bounds.getY()); return new AffineRable8Bit(filter, scale); } }
(rootElement, cursorSize.width, cursorSize.height, ctx); Filter filter = node.getGraphicsNodeRable(true); f = new AffineRable8Bit(filter, at); } catch (BridgeException ex) { throw ex; cursorSize.height); f = new AffineRable8Bit(filter, at); } else { AffineTransform at = f.getAffine(); at.transform(hotSpot, hotSpot);
/** * Should perform the equivilent action as * createRendering followed by drawing the RenderedImage. * * @param g2d The Graphics2D to draw to. * @return true if the paint call succeeded, false if * for some reason the paint failed (in which * case a createRendering should be used). */ public boolean paintRable(Graphics2D g2d) { AffineTransform at = g2d.getTransform(); g2d.transform(getAffine()); GraphicsUtil.drawImage(g2d, getSource()); g2d.setTransform(at); return true; }
public Rectangle2D getBounds2D() { Filter src = getSource(); Rectangle2D r = src.getBounds2D(); return affine.createTransformedShape(r).getBounds2D(); } /**
/** * Sets the source to be affine. * @param src image to affine. */ public void setSource(Filter src) { init(src); }
/** * Set the affine transform. * @param affine the new Affine transform to apply. */ public void setAffine(AffineTransform affine) { touch(); this.affine = affine; try { invAffine = affine.createInverse(); } catch (NoninvertibleTransformException e) { invAffine = null; } }
return new AffineRable8Bit(filter, at);
/** * Should perform the equivilent action as * createRendering followed by drawing the RenderedImage. * * @param g2d The Graphics2D to draw to. * @return true if the paint call succeeded, false if * for some reason the paint failed (in which * case a createRendering should be used). */ public boolean paintRable(Graphics2D g2d) { AffineTransform at = g2d.getTransform(); g2d.transform(getAffine()); GraphicsUtil.drawImage(g2d, getSource()); g2d.setTransform(at); return true; }