本文整理了Java中org.eclipse.swt.graphics.Transform.multiply()
方法的一些代码示例,展示了Transform.multiply()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Transform.multiply()
方法的具体详情如下:
包路径:org.eclipse.swt.graphics.Transform
类名称:Transform
方法名:multiply
[英]Modifies the receiver such that the matrix it represents becomes the the result of multiplying the matrix it previously represented by the argument.
[中]修改接收器,使其表示的矩阵成为其先前由参数表示的矩阵的乘积。
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
/**
* Modifies the receiver so that it represents a transformation that is equivalent to its previous
* transformation rotated by the specified angle. The angle is specified in degrees and for the
* identity transform 0 degrees is at the 3 o'clock position. A positive value indicates a
* clockwise rotation while a negative value indicates a counter-clockwise rotation.
*
* @param angle the angle to rotate the transformation by
* @exception SWTException
* <ul>
* <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
* </ul>
*/
public void rotate( float angle ) {
if( isDisposed() ) {
SWT.error( SWT.ERROR_GRAPHIC_DISPOSED );
}
double radians = Math.toRadians( angle );
float m11 = ( float )Math.cos( radians );
float m12 = ( float )Math.sin( radians );
float m21 = -( float )Math.sin( radians );
float m22 = ( float )Math.cos( radians );
multiply( m11, m12, m21, m22, 0, 0 );
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
/**
* Modifies the receiver so that it represents a transformation that is equivalent to its previous
* transformation translated by (offsetX, offsetY).
*
* @param offsetX the distance to translate in the X direction
* @param offsetY the distance to translate in the Y direction
* @exception SWTException
* <ul>
* <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
* </ul>
*/
public void translate( float offsetX, float offsetY ) {
if( isDisposed() ) {
SWT.error( SWT.ERROR_GRAPHIC_DISPOSED );
}
multiply( 1, 0, 0, 1, offsetX, offsetY );
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
/**
* Modifies the receiver so that it represents a transformation that is equivalent to its previous
* transformation scaled by (scaleX, scaleY).
*
* @param scaleX the amount to scale in the X direction
* @param scaleY the amount to scale in the Y direction
* @exception SWTException
* <ul>
* <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
* </ul>
*/
public void scale( float scaleX, float scaleY ) {
if( isDisposed() ) {
SWT.error( SWT.ERROR_GRAPHIC_DISPOSED );
}
multiply( scaleX, 0, 0, scaleY, 0, 0 );
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
/**
* Modifies the receiver so that it represents a transformation that is equivalent to its previous
* transformation sheared by (shearX, shearY).
*
* @param shearX the shear factor in the X direction
* @param shearY the shear factor in the Y direction
* @exception SWTException
* <ul>
* <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
* </ul>
*/
public void shear( float shearX, float shearY ) {
if( isDisposed() ) {
SWT.error( SWT.ERROR_GRAPHIC_DISPOSED );
}
multiply( 1, shearY, shearX, 1, 0, 0 );
}
代码示例来源:origin: org.jfree/swtgraphics2d
/**
* Concatenates the specified transform to the existing transform.
*
* @param t the transform.
*/
@Override
public void transform(AffineTransform t) {
Transform swtTransform = new Transform(this.gc.getDevice());
this.gc.getTransform(swtTransform);
swtTransform.multiply(getSwtTransformFromPool(t));
this.gc.setTransform(swtTransform);
swtTransform.dispose();
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
multiply( elements[ 0 ],
elements[ 1 ],
elements[ 2 ],
代码示例来源:origin: org.xworker/xworker_swt
transform.translate(-hw, -hh);
transform.multiply(oldTransform);
gc.setTransform(transform);
内容来源于网络,如有侵权,请联系作者删除!