public void propertyChanged(edu.cmu.cs.stage3.alice.core.event.PropertyEvent propertyEvent) { if (propertyEvent.getProperty() == m_each) { if (m_each.get() != null) { edu.cmu.cs.stage3.alice.core.Element l = (edu.cmu.cs.stage3.alice.core.Element) m_list.get(); Class valueClass = null; if (l instanceof edu.cmu.cs.stage3.alice.core.List) { valueClass = (Class) ((edu.cmu.cs.stage3.alice.core.List) l).valueClass.get(); } else if (l instanceof edu.cmu.cs.stage3.alice.core.Variable) { valueClass = (Class) ((edu.cmu.cs.stage3.alice.core.List) ((edu.cmu.cs.stage3.alice.core.Variable) l).value.get()) .valueClass.get(); } ((edu.cmu.cs.stage3.alice.core.Variable) m_each.get()).valueClass.set(valueClass); setVariableName(); } } if (propertyEvent.getProperty() == m_list) { if (m_list.get() != null && !nameListening) { ((edu.cmu.cs.stage3.alice.core.Element) m_list.get()).name.addPropertyListener(this); nameListening = true; } setVariable(); } else if (m_list.get() != null && propertyEvent.getProperty() == ((edu.cmu.cs.stage3.alice.core.Element) m_list.get()).name) { setVariableName(); } else { super.propertyChanged(propertyEvent); } }
@Override public void propertyChanged(edu.cmu.cs.stage3.alice.core.event.PropertyEvent propertyEvent) { if (propertyEvent.getProperty() == m_isCommentedOut) { revalidate(); repaint(); } else { updateGUI(); } }