本文整理汇总了Java中org.piccolo2d.PCamera.setPaint方法的典型用法代码示例。如果您正苦于以下问题:Java PCamera.setPaint方法的具体用法?Java PCamera.setPaint怎么用?Java PCamera.setPaint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.piccolo2d.PCamera
的用法示例。
在下文中一共展示了PCamera.setPaint方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initialize
import org.piccolo2d.PCamera; //导入方法依赖的package包/类
public void initialize() {
final PLayer l = new PLayer();
final PPath n = PPath.createEllipse(0, 0, 100, 80);
n.setPaint(Color.red);
n.setStroke(null);
PBoundsHandle.addBoundsHandlesTo(n);
l.addChild(n);
n.translate(200, 200);
final PCamera c = new PCamera();
c.setBounds(0, 0, 100, 80);
c.scaleView(0.1);
c.addLayer(l);
PBoundsHandle.addBoundsHandlesTo(c);
c.setPaint(Color.yellow);
getCanvas().getLayer().addChild(l);
getCanvas().getLayer().addChild(c);
}
示例2: PLens
import org.piccolo2d.PCamera; //导入方法依赖的package包/类
/**
* Constructs the default PLens.
*/
public PLens() {
// Drag bar gets resized to fit the available space, so any rectangle
// will do here
dragBarRect = new Rectangle2D.Float(0.0f, 0.0f, 1.0f, 1.0f);
dragBar = new PPath.Float(dragBarRect);
dragBar.setPaint(DEFAULT_DRAGBAR_PAINT);
// This forces drag events to percolate up to PLens object
dragBar.setPickable(false);
addChild(dragBar);
camera = new PCamera();
camera.setPaint(DEFAULT_LENS_PAINT);
addChild(camera);
// create an event handler to drag the lens around. Note that this event
// handler consumes events in case another conflicting event handler has
// been installed higher up in the heirarchy.
lensDragger = new PDragEventHandler();
lensDragger.getEventFilter().setMarksAcceptedEventsAsHandled(true);
addInputEventListener(lensDragger);
// When this PLens is dragged around adjust the cameras view transform.
addPropertyChangeListener(PNode.PROPERTY_TRANSFORM, new PropertyChangeListener() {
public void propertyChange(final PropertyChangeEvent evt) {
camera.setViewTransform(getInverseTransform());
}
});
}