java.awt.geom.AffineTransform.getTranslateX()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(7.1k)|赞(0)|评价(0)|浏览(134)

本文整理了Java中java.awt.geom.AffineTransform.getTranslateX()方法的一些代码示例,展示了AffineTransform.getTranslateX()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AffineTransform.getTranslateX()方法的具体详情如下:
包路径:java.awt.geom.AffineTransform
类名称:AffineTransform
方法名:getTranslateX

AffineTransform.getTranslateX介绍

暂无

代码示例

代码示例来源:origin: geoserver/geoserver

writer.setValue(Double.toString(atx.getScaleX()));
writer.endNode();
writer.startNode("scaleY");
writer.setValue(Double.toString(atx.getScaleY()));
writer.endNode();
writer.startNode("shearX");
writer.endNode();
writer.startNode("translateX");
writer.setValue(Double.toString(atx.getTranslateX()));
writer.endNode();
writer.startNode("translateY");
writer.setValue(Double.toString(atx.getTranslateY()));
writer.endNode();
writer.endNode();

代码示例来源:origin: Syncleus/aparapi

public double screenx() {
  return ((offGraphicsTransform.getScaleX() * x) + offGraphicsTransform.getTranslateX());
}

代码示例来源:origin: it.geosolutions.jaiext.bandmerge/jt-bandmerge

@Override
  public void transform(AffineTransform tr, Point2D src, Point2D dst) {
    dst.setLocation(src.getX() + tr.getTranslateX(), src.getY() + tr.getTranslateY());
  }
};

代码示例来源:origin: fr.avianey.apache-xmlgraphics/batik

/**
 * Implements {@link SVGMatrix#setF(float)}.
 */
public void setF(float f) throws DOMException {
  AffineTransform at = getAffineTransform();
  at.setTransform(at.getScaleX(),
          at.getShearY(),
          at.getShearX(),
          at.getScaleY(),
          at.getTranslateX(),
          f);
}

代码示例来源:origin: sc.fiji/TrakEM2_

@SuppressWarnings( "rawtypes" )
@Override
protected void initModel()
{
  final AffineTransform a = patch.getAffineTransform();
  if ( AffineModel2D.class.isInstance( model ) )
    ( ( AffineModel2D )( Object )model ).set( a );
  else if ( SimilarityModel2D.class.isInstance( model ) )
    ( ( SimilarityModel2D )( Object )model ).set( a.getScaleX(), a.getShearY(), a.getTranslateX(), a.getTranslateY() );
  else if ( RigidModel2D.class.isInstance( model ) )
    ( ( RigidModel2D )( Object )model ).set( a.getScaleX(), a.getShearY(), a.getTranslateX(), a.getTranslateY() );
  else if ( TranslationModel2D.class.isInstance( model ) )
    ( ( TranslationModel2D )( Object )model ).set( a.getTranslateX(), a.getTranslateY() );
  else if ( InterpolatedAffineModel2D.class.isInstance( model ) )
    ( ( InterpolatedAffineModel2D )( Object )model ).set( a );
}

代码示例来源:origin: fr.avianey.apache-xmlgraphics/batik

/**
 * Implements {@link SVGMatrix#setA(float)}.
 */
public void setA(float a) throws DOMException {
  AffineTransform at = getAffineTransform();
  at.setTransform(a,
          at.getShearY(),
          at.getShearX(),
          at.getScaleY(),
          at.getTranslateX(),
          at.getTranslateY());
}

代码示例来源:origin: geoserver/geoserver

AffineTransform aTX = (AffineTransform) geometry.getGridToCRS();
writer.write("<geoTransform>");
writer.write("<scaleX>" + aTX.getScaleX() + "</scaleX>\n");
writer.write("<scaleY>" + aTX.getScaleY() + "</scaleY>\n");
writer.write("<shearX>" + aTX.getShearX() + "</shearX>\n");
writer.write("<shearY>" + aTX.getShearY() + "</shearY>\n");
writer.write("<translateX>" + aTX.getTranslateX() + "</translateX>\n");
writer.write("<translateY>" + aTX.getTranslateY() + "</translateY>\n");
writer.write("</geoTransform>\n");

代码示例来源:origin: apache/batik

/**
 * Implements {@link SVGMatrix#setF(float)}.
 */
public void setF(float f) throws DOMException {
  AffineTransform at = getAffineTransform();
  at.setTransform(at.getScaleX(),
          at.getShearY(),
          at.getShearX(),
          at.getScaleY(),
          at.getTranslateX(),
          f);
}

代码示例来源:origin: org.apache.xmlgraphics/batik-swing

public void updateMatrix(AffineTransform at) {
    prevScale  = (float)Math.sqrt(at.getDeterminant());
    prevTransX = (float)at.getTranslateX();
    prevTransY = (float)at.getTranslateY();
  }
}

代码示例来源:origin: fr.avianey.apache-xmlgraphics/batik

/**
 * Implements {@link SVGMatrix#setD(float)}.
 */
public void setD(float d) throws DOMException {
  AffineTransform at = getAffineTransform();
  at.setTransform(at.getScaleX(),
          at.getShearY(),
          at.getShearX(),
          d,
          at.getTranslateX(),
          at.getTranslateY());
}

代码示例来源:origin: apache/batik

/**
 * Implements {@link SVGMatrix#setA(float)}.
 */
public void setA(float a) throws DOMException {
  AffineTransform at = getAffineTransform();
  at.setTransform(a,
          at.getShearY(),
          at.getShearX(),
          at.getScaleY(),
          at.getTranslateX(),
          at.getTranslateY());
}

代码示例来源:origin: Syncleus/aparapi

public double translatex(int _screenx) {
  return ((_screenx - offGraphicsTransform.getTranslateX()) / offGraphicsTransform.getScaleX());
}

代码示例来源:origin: apache/pdfbox

/**
 * Creates a matrix with the same elements as the given AffineTransform.
 * @param at
 */
public Matrix(AffineTransform at)
{
  single = new float[DEFAULT_SINGLE.length];
  System.arraycopy(DEFAULT_SINGLE, 0, single, 0, DEFAULT_SINGLE.length);
  single[0] = (float)at.getScaleX();
  single[1] = (float)at.getShearY();
  single[3] = (float)at.getShearX();
  single[4] = (float)at.getScaleY();
  single[6] = (float)at.getTranslateX();
  single[7] = (float)at.getTranslateY();
}

代码示例来源:origin: org.apache.xmlgraphics/batik-anim

public void setY(float newY) {
  SVGContext context = getSVGContext();
  AffineTransform scrnTrans = context.getScreenTransform();
  scrnTrans = new AffineTransform
    (scrnTrans.getScaleX(), scrnTrans.getShearY(),
     scrnTrans.getShearX(), scrnTrans.getScaleY(),
     scrnTrans.getTranslateX(), newY);
  context.setScreenTransform(scrnTrans);
}
public SVGPoint matrixTransform(SVGMatrix mat) {

代码示例来源:origin: fr.avianey.apache-xmlgraphics/batik

public void updateMatrix(AffineTransform at) {
    prevScale  = (float)Math.sqrt(at.getDeterminant());
    prevTransX = (float)at.getTranslateX();
    prevTransY = (float)at.getTranslateY();
  }
}

代码示例来源:origin: apache/batik

/**
 * Implements {@link SVGMatrix#setD(float)}.
 */
public void setD(float d) throws DOMException {
  AffineTransform at = getAffineTransform();
  at.setTransform(at.getScaleX(),
          at.getShearY(),
          at.getShearX(),
          d,
          at.getTranslateX(),
          at.getTranslateY());
}

代码示例来源:origin: apache/pdfbox

/**
 * Set the values of the matrix from the AffineTransform.
 *
 * @param af The transform to get the values from.
 * @deprecated Use the {@link #Matrix(AffineTransform)} constructor instead.
 */
@Deprecated
public void setFromAffineTransform( AffineTransform af )
{
  single[0] = (float)af.getScaleX();
  single[1] = (float)af.getShearY();
  single[3] = (float)af.getShearX();
  single[4] = (float)af.getScaleY();
  single[6] = (float)af.getTranslateX();
  single[7] = (float)af.getTranslateY();
}

代码示例来源:origin: apache/batik

public void setY(float newY) {
  SVGContext context = getSVGContext();
  AffineTransform scrnTrans = context.getScreenTransform();
  scrnTrans = new AffineTransform
    (scrnTrans.getScaleX(), scrnTrans.getShearY(),
     scrnTrans.getShearX(), scrnTrans.getScaleY(),
     scrnTrans.getTranslateX(), newY);
  context.setScreenTransform(scrnTrans);
}
public SVGPoint matrixTransform(SVGMatrix mat) {

代码示例来源:origin: apache/batik

public void updateMatrix(AffineTransform at) {
    prevScale  = (float)Math.sqrt(at.getDeterminant());
    prevTransX = (float)at.getTranslateX();
    prevTransY = (float)at.getTranslateY();
  }
}

代码示例来源:origin: geotools/geotools

/**
 * Sets this matrix to the specified affine transform.
 *
 * @since 2.3
 */
public void setMatrix(final AffineTransform transform) {
  mat.a11 = transform.getScaleX();
  mat.a12 = transform.getShearX();
  mat.a13 = transform.getTranslateX();
  mat.a21 = transform.getShearY();
  mat.a22 = transform.getScaleY();
  mat.a23 = transform.getTranslateY();
  mat.a31 = 0;
  mat.a32 = 0;
  mat.a33 = 1;
}

相关文章