本文整理匯總了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());
}