本文整理汇总了Java中org.piccolo2d.util.PAffineTransform.rotate方法的典型用法代码示例。如果您正苦于以下问题:Java PAffineTransform.rotate方法的具体用法?Java PAffineTransform.rotate怎么用?Java PAffineTransform.rotate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.piccolo2d.util.PAffineTransform
的用法示例。
在下文中一共展示了PAffineTransform.rotate方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testAnimateToPositionScaleRotationHasProperSetup
import org.piccolo2d.util.PAffineTransform; //导入方法依赖的package包/类
public void testAnimateToPositionScaleRotationHasProperSetup() {
node.setBounds(0, 0, 100, 100);
final PTransformActivity activity = node.animateToPositionScaleRotation(50, 50, 0.5, Math.PI, 50);
assertEquals(50, activity.getDuration());
assertEquals(PUtil.DEFAULT_ACTIVITY_STEP_RATE, activity.getStepRate());
assertTrue(activity.getFirstLoop());
assertFalse(activity.isStepping());
final double[] resultTransform = activity.getDestinationTransform();
final PAffineTransform expected = new PAffineTransform();
expected.translate(50, 50);
expected.scale(0.5, 0.5);
expected.rotate(Math.PI);
assertEquals(-0.5, resultTransform[0], 0.001);
assertEquals(0, resultTransform[1], 0.001);
assertEquals(0, resultTransform[2], 0.001);
assertEquals(-0.5, resultTransform[3], 0.001);
assertEquals(50.0, resultTransform[4], 0.001);
assertEquals(50.0, resultTransform[5], 0.001);
}
示例2: testAnimateToPositionScaleRotationWithDuration0IsImmediate
import org.piccolo2d.util.PAffineTransform; //导入方法依赖的package包/类
public void testAnimateToPositionScaleRotationWithDuration0IsImmediate() {
node.setBounds(0, 0, 100, 100);
final PActivity activity = node.animateToPositionScaleRotation(50, 50, 0.5, Math.PI, 0);
assertNull(activity);
final PAffineTransform resultTransform = node.getTransform();
final PAffineTransform expected = new PAffineTransform();
expected.translate(50, 50);
expected.scale(0.5, 0.5);
expected.rotate(Math.PI);
assertEquals(expected, resultTransform);
}
示例3: testRotateAboutPointVersion1AffectsTransformAsItShould
import org.piccolo2d.util.PAffineTransform; //导入方法依赖的package包/类
public void testRotateAboutPointVersion1AffectsTransformAsItShould() {
node.setBounds(25, 25, 50, 50);
node.rotateAboutPoint(Math.PI, 50, 0); // It's top center point
final PAffineTransform expectedTransform = new PAffineTransform();
expectedTransform.translate(100, 0);
expectedTransform.rotate(Math.PI);
assertEquals(expectedTransform, node.getTransform());
}
示例4: testRotateAboutPointVersion2AffectsTransformAsItShould
import org.piccolo2d.util.PAffineTransform; //导入方法依赖的package包/类
public void testRotateAboutPointVersion2AffectsTransformAsItShould() {
node.setBounds(25, 25, 50, 50);
node.rotateAboutPoint(Math.PI, new Point2D.Double(50, 0)); // It's top
// center
// point
final PAffineTransform expectedTransform = new PAffineTransform();
expectedTransform.translate(100, 0);
expectedTransform.rotate(Math.PI);
assertEquals(expectedTransform, node.getTransform());
}
示例5: testGetInverseTransformWorks
import org.piccolo2d.util.PAffineTransform; //导入方法依赖的package包/类
public void testGetInverseTransformWorks() {
node.translate(50, 50);
node.rotate(Math.PI);
final PAffineTransform expectedTransform = new PAffineTransform();
expectedTransform.rotate(-Math.PI);
expectedTransform.translate(-50, -50);
assertEquals(expectedTransform, node.getInverseTransform());
}