本文整理汇总了Java中org.piccolo2d.PCamera.paintDebugInfo方法的典型用法代码示例。如果您正苦于以下问题:Java PCamera.paintDebugInfo方法的具体用法?Java PCamera.paintDebugInfo怎么用?Java PCamera.paintDebugInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.piccolo2d.PCamera
的用法示例。
在下文中一共展示了PCamera.paintDebugInfo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testTooFewLayersCamera
import org.piccolo2d.PCamera; //导入方法依赖的package包/类
public void testTooFewLayersCamera() {
PCamera tooFew = new TooFewLayersCamera();
MockPLayer layer0 = new MockPLayer();
MockPLayer layer1 = new MockPLayer();
tooFew.addLayer(layer0);
tooFew.addLayer(layer1);
assertEquals(layer0, tooFew.getLayer(0));
assertEquals(layer1, tooFew.getLayer(1));
assertEquals(layer0, tooFew.getLayersReference().get(0));
assertEquals(layer1, tooFew.getLayersReference().get(1));
assertEquals(0, tooFew.indexOfLayer(layer0));
assertEquals(0, tooFew.indexOfLayer(layer0));
// pickCameraView
PPickPath pickPath = new PPickPath(tooFew, new PBounds(0, 0, 400, 400));
tooFew.pickCameraView(pickPath);
assertTrue(layer0.fullPickCalled());
assertTrue(layer1.fullPickCalled());
// paintCameraView
BufferedImage image = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB);
Graphics2D graphics = image.createGraphics();
PPaintContext paintContext = new PPaintContext(graphics);
tooFew.paintCameraView(paintContext);
assertTrue(layer0.fullPaintCalled());
assertTrue(layer1.fullPaintCalled());
// getUnionOfLayerFullBounds
tooFew.getUnionOfLayerFullBounds();
assertTrue(layer0.fullBoundsReferenceCalled());
assertTrue(layer1.fullBoundsReferenceCalled());
// paintDebugInfo
PDebug.debugBounds = true;
tooFew.paintDebugInfo(paintContext);
assertTrue(layer0.getAllNodesCalled());
assertTrue(layer1.getAllNodesCalled());
PDebug.debugBounds = false;
graphics.dispose();
}
示例2: testTooManyLayersCamera
import org.piccolo2d.PCamera; //导入方法依赖的package包/类
public void testTooManyLayersCamera() {
PCamera tooMany = new TooManyLayersCamera();
MockPLayer layer0 = new MockPLayer();
MockPLayer layer1 = new MockPLayer();
tooMany.addLayer(layer0);
tooMany.addLayer(layer1);
assertEquals(layer0, tooMany.getLayer(0));
assertEquals(layer1, tooMany.getLayer(1));
assertEquals(layer0, tooMany.getLayersReference().get(0));
assertEquals(layer1, tooMany.getLayersReference().get(1));
assertEquals(0, tooMany.indexOfLayer(layer0));
assertEquals(0, tooMany.indexOfLayer(layer0));
// pickCameraView
PPickPath pickPath = new PPickPath(tooMany, new PBounds(0, 0, 400, 400));
tooMany.pickCameraView(pickPath);
assertTrue(layer0.fullPickCalled());
assertTrue(layer1.fullPickCalled());
// paintCameraView
BufferedImage image = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB);
Graphics2D graphics = image.createGraphics();
PPaintContext paintContext = new PPaintContext(graphics);
tooMany.paintCameraView(paintContext);
assertTrue(layer0.fullPaintCalled());
assertTrue(layer1.fullPaintCalled());
// getUnionOfLayerFullBounds
tooMany.getUnionOfLayerFullBounds();
assertTrue(layer0.fullBoundsReferenceCalled());
assertTrue(layer1.fullBoundsReferenceCalled());
// paintDebugInfo
PDebug.debugBounds = true;
tooMany.paintDebugInfo(paintContext);
assertTrue(layer0.getAllNodesCalled());
assertTrue(layer1.getAllNodesCalled());
PDebug.debugBounds = false;
graphics.dispose();
}