本文整理汇总了Java中org.piccolo2d.util.PAffineTransform.scale方法的典型用法代码示例。如果您正苦于以下问题:Java PAffineTransform.scale方法的具体用法?Java PAffineTransform.scale怎么用?Java PAffineTransform.scale使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.piccolo2d.util.PAffineTransform
的用法示例。
在下文中一共展示了PAffineTransform.scale方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: testScaleAboutPointWorksAsExpected
import org.piccolo2d.util.PAffineTransform; //导入方法依赖的package包/类
public void testScaleAboutPointWorksAsExpected() {
node.setBounds(0, 0, 100, 100);
node.scaleAboutPoint(2, new Point2D.Double(50, 50));
final PAffineTransform expectedTransform = new PAffineTransform();
expectedTransform.translate(-50, -50);
expectedTransform.scale(2, 2);
assertEquals(expectedTransform, node.getTransform());
}