Package edu.umd.cs.piccolo

Examples of edu.umd.cs.piccolo.PCanvas


                                      1.0 * winSizeY / canvasSizeY);
    }

    // Setup the actual window (its size, camera, title, etc.)
    if (canvas == null) {
      canvas = new PCanvas();
      getContentPane().add(canvas, BorderLayout.CENTER);
    }

    layer = canvas.getLayer();
    canvas.setBackground(Color.BLACK);
View Full Code Here


      ScreenOverlayWindow w = (ScreenOverlayWindow) d;
      // do this to release all references to graphical objects, such as PShadow,
      // which holds references to BufferedImages
      // this deals with the memory leak problem related to the use
      // of ScreenRegionCanvas
      PCanvas canvas = w.getCanvas();
      canvas.removeAll();
    }
    displayableList.clear();
   
    // force garbage collection
    System.gc();
View Full Code Here

    return overlayWindow;

 

  public BufferedImage createImage(){
    final PCanvas canvas = new PCanvas();

    BufferedImage backgroundImage = getScreenRegion().capture();
    final PImage background = new PImage(backgroundImage);
    canvas.getLayer().addChild(background);
    canvas.setBounds(0,0,backgroundImage.getWidth(),backgroundImage.getHeight());

    PLayer layer = canvas.getLayer();
    Rectangle r = getScreenRegion().getBounds();
    PLayer foregroundLayer = new PLayer();   
    layer.addChild(foregroundLayer);   
    foregroundLayer.setGlobalTranslation(new Point(-r.x,-r.y));
View Full Code Here

  private static class DragDropFrame extends JFrame {

    private PImage image;

    DragDropFrame(URL background, URL dragTarget) throws IOException {
      final PCanvas canvas = new PCanvas();
      image = new PImage();

      BufferedImage backgroundImage = ImageIO.read(background);
      PImage backgroundNode = new PImage();
      backgroundNode.setImage(backgroundImage);
      //backgroundNode.setPickable(false);
      //canvas.get
     
      BufferedImage dragTargetImage = ImageIO.read(dragTarget);
      PImage dragTargetNode = new PImage();
      dragTargetNode.setPickable(true);     
      dragTargetNode.setOffset(10,10);
      dragTargetNode.setImage(dragTargetImage);
           
      canvas.getLayer().addChild(backgroundNode);
      canvas.getLayer().addChild(dragTargetNode);           
     
      add(canvas);
     
      dragTargetNode.addInputEventListener(new PDragEventHandler(){
View Full Code Here

public class ScreenOverlayWindow extends JWindow implements ScreenDisplayable {

  private final PCanvas canvas;
  public ScreenOverlayWindow() {
    canvas = new PCanvas();
    canvas.setBackground(null);
    canvas.setOpaque(false);
    add(canvas);
//    setBackground(null);
    getContentPane().setBackground(null); // this line is needed to make the window transparent on Windows
View Full Code Here

TOP

Related Classes of edu.umd.cs.piccolo.PCanvas

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.