GoogleCodeArchive / piccolo2d

Automatically exported from code.google.com/p/piccolo2d
0 stars 0 forks source link

property changes are not cascading to parent nodes #87

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem: The following code does:
public void testPropertyChangesCascadeToParent() {
  PNode aParent = new PNode();              
  final List changes = new ArrayList();     
  PropertyChangeListener listener = new PropertyChangeListener(){           
    public void propertyChange(PropertyChangeEvent evt) {
      changes.add(evt);
    }
  };
  aParent.addPropertyChangeListener(PNode.PROPERTY_BOUNDS, listener);

  PNode aChild = new PNode();
  aChild.setPropertyChangeParentMask(PNode.PROPERTY_CODE_BOUNDS);
  aParent.addChild(aChild);

  aChild.setBounds(0, 0, 100, 100);
  assertFalse(changes.isEmpty());
}

What is the expected output? What do you see instead?
Expected output is that the test should pass, but it fails on the last
line. If the event were cascaded to its parent then I'd think that handler
would have fired.

What version of the product are you using? On what operating system?
1.2.1

Please provide any additional information below.
  I like Turtles.

Original issue reported on code.google.com by allain.lalonde on 11 Jul 2009 at 7:16

GoogleCodeExporter commented 9 years ago
I've committed changes that confirm that the system is working as expected. 
Turns out 
the default behaviour for cascading is to block everything unless explicitly 
allowed by 
a call to setPropertyChangeParentMask. I'll write a test documenting that it 
works that 
way.  It was an error in my understanding.

Original comment by allain.lalonde on 13 Jul 2009 at 8:00

GoogleCodeExporter commented 9 years ago

Original comment by allain.lalonde on 30 Oct 2009 at 3:54