本文整理匯總了Java中org.piccolo2d.PRoot.getPaintInvalid方法的典型用法代碼示例。如果您正苦於以下問題:Java PRoot.getPaintInvalid方法的具體用法?Java PRoot.getPaintInvalid怎麽用?Java PRoot.getPaintInvalid使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.piccolo2d.PRoot
的用法示例。
在下文中一共展示了PRoot.getPaintInvalid方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initialize
import org.piccolo2d.PRoot; //導入方法依賴的package包/類
public void initialize() {
final PCanvas c = getCanvas();
final PActivity updateHandles = new PActivity(-1, 0) {
protected void activityStep(final long elapsedTime) {
super.activityStep(elapsedTime);
final PRoot root = getActivityScheduler().getRoot();
if (root.getPaintInvalid() || root.getChildPaintInvalid()) {
final Iterator i = getCanvas().getCamera().getChildrenIterator();
while (i.hasNext()) {
final PNode each = (PNode) i.next();
if (each instanceof PHandle) {
final PHandle handle = (PHandle) each;
handle.relocateHandle();
}
}
}
}
};
final PPath rect = PPath.createRectangle(0, 0, 100, 100);
rect.setPaint(Color.RED);
c.getLayer().addChild(rect);
c.getCamera().addChild(new PBoundsHandle(PBoundsLocator.createNorthEastLocator(rect)));
c.getCamera().addChild(new PBoundsHandle(PBoundsLocator.createNorthWestLocator(rect)));
c.getCamera().addChild(new PBoundsHandle(PBoundsLocator.createSouthEastLocator(rect)));
c.getCamera().addChild(new PBoundsHandle(PBoundsLocator.createSouthWestLocator(rect)));
c.getRoot().getActivityScheduler().addActivity(updateHandles, true);
}