本文整理了Java中java.awt.geom.AffineTransform.deltaTransform()
方法的一些代码示例,展示了AffineTransform.deltaTransform()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AffineTransform.deltaTransform()
方法的具体详情如下:
包路径:java.awt.geom.AffineTransform
类名称:AffineTransform
方法名:deltaTransform
暂无
代码示例来源:origin: nodebox/nodebox
public Rect map(Rect r) {
// TODO: The size conversion might be incorrect. (using deltaTransform) In that case, make topLeft and bottomRight points.
Point2D origin = new Point2D.Double(r.getX(), r.getY());
Point2D size = new Point2D.Double(r.getWidth(), r.getHeight());
Point2D transformedOrigin = new Point2D.Double();
Point2D transformedSize = new Point2D.Double();
affineTransform.transform(origin, transformedOrigin);
affineTransform.deltaTransform(size, transformedSize);
return new Rect(transformedOrigin.getX(), transformedOrigin.getY(), transformedSize.getX(), transformedSize.getY());
}
代码示例来源:origin: nodebox/nodebox
public Rect convertBoundsToFrame(Rect bounds) {
AffineTransform t = fullTransform(bounds);
Point2D transformedOrigin = new Point2D.Double();
Point2D transformedSize = new Point2D.Double();
t.transform(new Point2D.Double(bounds.getX(), bounds.getY()), transformedOrigin);
t.deltaTransform(new Point2D.Double(bounds.getWidth(), bounds.getHeight()), transformedSize);
return new Rect(transformedOrigin.getX(), transformedOrigin.getY(), transformedSize.getX(), transformedSize.getY());
}
代码示例来源:origin: geotools/geotools
throws TransformException {
if (transform instanceof AffineTransform) {
return ((AffineTransform) transform).deltaTransform(source, dest);
代码示例来源:origin: geotools/geotools
final double det = m00 * m11 - m01 * m10;
if (!(Math.abs(det) > Double.MIN_VALUE)) {
return transform.createInverse().deltaTransform(source, dest);
代码示例来源:origin: info.aduna.commons/aduna-commons-graphics
public PaintContext createContext(ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform xform,
RenderingHints hints) {
Point2D transformedPoint = xform.transform(point, null);
Point2D transformedRadius1 = xform.deltaTransform(radius1, null);
Point2D transformedRadius2 = xform.deltaTransform(radius2, null);
return new RadialPaintContext(transformedPoint, transformedRadius1, pointColor, transformedRadius2, backgroundColor);
}
代码示例来源:origin: openstreetmap/osmembrane
/**
* Translates object delta coordinates to window delta coordinates. Typical
* delta coordinates are object sizes.
*
* @param objectDelta
* object delta coordinates
* @return object in window delta coordinates
*/
protected Point objToWindowDelta(Point2D objectDelta) {
Point2D result = new Point2D.Double();
objectToWindow.deltaTransform(objectDelta, result);
currentDisplay.deltaTransform(result, result);
return new Point((int) result.getX(), (int) result.getY());
}
代码示例来源:origin: org.bidib.jbidib.eu.hansolo/SteelSeries
@Override
public java.awt.PaintContext createContext(final ColorModel COLOR_MODEL,
final Rectangle DEVICE_BOUNDS,
final Rectangle2D USER_BOUNDS,
final AffineTransform TRANSFORM,
final RenderingHints RENDERING_HINTS) {
final Point2D TRANSFORMED_CENTER = TRANSFORM.transform(CENTER, null);
final Point2D TRANSFORMED_RADIUS_XY = TRANSFORM.deltaTransform(RADIUS_X_Y, null);
return new OvalGradientContext(TRANSFORMED_CENTER, TRANSFORMED_RADIUS_XY, FRACTIONS, COLORS);
}
代码示例来源:origin: HanSolo/SteelSeries-Swing
@Override
public java.awt.PaintContext createContext(final ColorModel COLOR_MODEL,
final Rectangle DEVICE_BOUNDS,
final Rectangle2D USER_BOUNDS,
final AffineTransform TRANSFORM,
final RenderingHints RENDERING_HINTS) {
final Point2D TRANSFORMED_CENTER = TRANSFORM.transform(CENTER, null);
final Point2D TRANSFORMED_RADIUS_XY = TRANSFORM.deltaTransform(RADIUS_X_Y, null);
return new OvalGradientContext(TRANSFORMED_CENTER, TRANSFORMED_RADIUS_XY, FRACTIONS, COLORS);
}
代码示例来源:origin: openstreetmap/osmembrane
/**
* Translates window delta coordinates to object delta coordinates. Typical
* delta coordinates are object sizes.
*
* @param windowDelta
* window delta coordinates
* @return windowDelta in object delta coordinates
*/
private Point2D windowToObjDelta(Point windowDelta) {
Point2D result = new Point2D.Double();
try {
AffineTransform temp = new AffineTransform(objectToWindow);
temp.preConcatenate(currentDisplay);
temp.invert();
temp.deltaTransform(windowDelta, result);
} catch (NoninvertibleTransformException e) {
Application.handleException(e);
}
return result;
}
代码示例来源:origin: google/sagetv
public static void transformRectCoords(java.awt.geom.RectangularShape rect, java.awt.geom.AffineTransform xform,
float[] rv)
{
double[] coords = {rect.getX(), rect.getY()};
double[] size = {rect.getWidth(), rect.getHeight()};
xform.transform(coords, 0, coords, 0, 1);
xform.deltaTransform(size, 0, size, 0, 1);
rv[0] = (float)coords[0];
rv[1] = (float)coords[1];
rv[2] = (float)size[0];
rv[3] = (float)size[1];
}
/* public static java.awt.geom.Rectangle2D.Float transformRectCoords(java.awt.geom.RectangularShape rect, java.awt.geom.AffineTransform xform)
代码示例来源:origin: org.apache.xmlgraphics/batik-awt-util
channels[i] = i;
txf.deltaTransform(tx, 0, tx, 0, 1);
txf.deltaTransform(ty, 0, ty, 0, 1);
txf.deltaTransform(vecX, 0, vecX, 0, 1);
txf.deltaTransform(vecY, 0, vecY, 0, 1);
代码示例来源:origin: apache/batik
channels[i] = i;
txf.deltaTransform(tx, 0, tx, 0, 1);
txf.deltaTransform(ty, 0, ty, 0, 1);
txf.deltaTransform(vecX, 0, vecX, 0, 1);
txf.deltaTransform(vecY, 0, vecY, 0, 1);
代码示例来源:origin: fr.avianey.apache-xmlgraphics/batik
channels[i] = i;
txf.deltaTransform(tx, 0, tx, 0, 1);
txf.deltaTransform(ty, 0, ty, 0, 1);
txf.deltaTransform(vecX, 0, vecX, 0, 1);
txf.deltaTransform(vecY, 0, vecY, 0, 1);
代码示例来源:origin: stackoverflow.com
translation = fromAncestor.deltaTransform(translation, new Point());
代码示例来源:origin: Audiveris/audiveris
pageTransform.deltaTransform(newDims, newDims);
代码示例来源:origin: Geomatys/geotoolkit
((AffineTransform) transform).deltaTransform(vector, 0, result, 0, 1);
} else {
代码示例来源:origin: org.geotools/gt2-widgets-swing
transform.deltaTransform(tmp, tmp);
if (Math.abs(tmp.x) < MIN_WIDTH || Math.abs(tmp.y) < MIN_HEIGHT) {
if (Math.abs(tmp.x) < MIN_WIDTH ) tmp.x = (tmp.x < 0) ? -MIN_WIDTH : MIN_WIDTH;
代码示例来源:origin: org.apache.xmlgraphics/batik-awt-util
usr2dev.deltaTransform(redVec, redVec);
redVec.x = Math.floor(redVec.x) - (BRed.getMinX() - refRed.getMinX());
redVec.y = Math.floor(redVec.y) - (BRed.getMinY() - refRed.getMinY());
usr2dev.deltaTransform(redVec, redVec);
redVec.x = Math.floor(redVec.x) - (CRed.getMinX() - refRed.getMinX());
redVec.y = Math.floor(redVec.y) - (CRed.getMinY() - refRed.getMinY());
usr2dev.deltaTransform(redVec, redVec);
redVec.x = Math.floor(redVec.x) - (DRed.getMinX() - refRed.getMinX());
redVec.y = Math.floor(redVec.y) - (DRed.getMinY() - refRed.getMinY());
代码示例来源:origin: Geomatys/geotoolkit
final double[] vector = new double[] {4, 7};
final double[] expected = new double[2];
at.deltaTransform(vector, 0, expected, 0, 1);
代码示例来源:origin: apache/fop
getTransform().deltaTransform(ptLen, ptLen);
double transLen = UnitConv.pt2mm(ptLen.distance(0, 0));
gen.writeText("LT1," + gen.formatDouble4(transLen) + ",1;");
Point2D ptSrc = new Point2D.Double(lw, 0);
Point2D ptDest = getTransform().deltaTransform(ptSrc, null);
double transDist = UnitConv.pt2mm(ptDest.distance(0, 0));
内容来源于网络,如有侵权,请联系作者删除!