Status: Accepted
Owner: allain.lalonde
Labels: Type-Defect Toolkit-Piccolo2D.Java Component-Extras OpSys-All  
Milestone-1.3 Priority-Medium Effort-Medium

New issue 148 by allain.lalonde: PSwing nodes doen't handle interactions  
when added to the camera
http://code.google.com/p/piccolo2d/issues/detail?id=148

What steps will reproduce the problem?
The following code demonstrates the problem:

import java.awt.Dimension;

import javax.swing.JFrame;
import javax.swing.JTextField;

import edu.umd.cs.piccolox.pswing.PSwing;
import edu.umd.cs.piccolox.pswing.PSwingCanvas;

public class PSwingCanvasTest {
     public static void main(String[] args) {
         JFrame frame = new JFrame();
         frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         frame.getContentPane().setPreferredSize(new Dimension(600, 600));

         frame.getContentPane().add(buildPSwingCanvas());
         frame.pack();
         frame.setVisible(true);
     }

     private static PSwingCanvas buildPSwingCanvas() {
         PSwingCanvas canvas = new PSwingCanvas();

         addCameraPSwing(canvas);
         addLayerPSwing(canvas);

         return canvas;
     }

     private static void addCameraPSwing(PSwingCanvas canvas) {
         PSwing swingNode = buildPSwingNode();
         canvas.getCamera().addChild(swingNode);
     }

     private static void addLayerPSwing(PSwingCanvas canvas) {
         PSwing swingNode = buildPSwingNode();
         swingNode.setOffset(200, 0);
         canvas.getLayer().addChild(swingNode);
     }

     private static PSwing buildPSwingNode() {
         JTextField textField = new JTextField();
         textField.setPreferredSize(new Dimension(100, 20));
         return new PSwing(textField);
     }
}

What is the expected output? What do you see instead?
   Both PSwing nodes should allow focus, but only the one on the right does.


--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to