Node API提供了一個(gè)方法在Node屬性集變化時(shí)通知注冊(cè)在其上的監(jiān)聽器更新。
protected final void firePropertySetsChange(Node.PropertySet[] o, Node.PropertySet[] n)
如圖,精靈動(dòng)畫就是一個(gè)自定義的Node,當(dāng)使用鼠標(biāo)將Node從A點(diǎn)拖拽到B點(diǎn)時(shí),Node坐標(biāo)已經(jīng)改變,可以調(diào)用Node的
firePropertySetsChange()方法通知屬性表單(Propertites Sheet)更新顯示。
因?yàn)?span style="color: #000000;">firePropertySetsChange()是個(gè)受保護(hù)(protected)的方法,如果需要在Node的外部調(diào)用,還可以包裝在自定義的公共(public)方法里。
public void notifySheetChange(){
firePropertySetsChange(null, Sheet.createDefault().toArray());
}