@Test public void testFireTreeStructureChanged() { model.addTreeModelListener(tListener); model.fireTreeStructureChanged(source, pathList, childIndices, children); verify(tListener, times(1)).treeStructureChanged(any(TreeModelEvent.class)); }
protected void fireTreeStructureChanged(Object source, Object[] path, int[] childIndices, Object[] children) { Object[] listeners = listenerList.getListenerList(); TreeModelEvent e = null; for (int i = listeners.length - 2; i >= 0; i -= 2) { if (listeners[i] == TreeModelListener.class) { if (e == null) e = new TreeModelEvent(source, path, childIndices, children); ((TreeModelListener) listeners[i + 1]).treeStructureChanged(e); } } }
AbstractTreeTableModel implements TreeTableModel { protected void fireTreeStructureChanged(Object source, Object[] path, int[] childIndices, Object[] children) { Object[] listeners = listenerList.getListenerList(); TreeModelEvent e = null; for (int i = listeners.length - 2; i >= 0; i -= 2) { if (listeners[i] == TreeModelListener.class) { if (e == null) e = new TreeModelEvent(source, path, childIndices, children); ((TreeModelListener) listeners[i + 1]).treeStructureChanged(e); } } } }
AbstractTreeTableModel implements TreeTableModel { protected void fireTreeStructureChanged(Object source, Object[] path, int[] childIndices, Object[] children) { Object[] listeners = listenerList.getListenerList(); TreeModelEvent e = null; for (int i = listeners.length - 2; i >= 0; i -= 2) { if (listeners[i] == TreeModelListener.class) { if (e == null) e = new TreeModelEvent(source, path, childIndices, children); ((TreeModelListener) listeners[i + 1]).treeStructureChanged(e); } } } AbstractTreeTableModel(Object root); }
AbstractTreeTableModel implements TreeTableModel { protected void fireTreeStructureChanged(Object source, Object[] path, int[] childIndices, Object[] children) { Object[] listeners = listenerList.getListenerList(); TreeModelEvent e = null; for (int i = listeners.length - 2; i >= 0; i -= 2) { if (listeners[i] == TreeModelListener.class) { if (e == null) e = new TreeModelEvent(source, path, childIndices, children); ((TreeModelListener) listeners[i + 1]).treeStructureChanged(e); } } } AbstractTreeTableModel(Object root); Object getRoot(); boolean isLeaf(Object node); void valueForPathChanged(TreePath path, Object newValue); int getIndexOfChild(Object parent, Object child); void addTreeModelListener(TreeModelListener l); void removeTreeModelListener(TreeModelListener l); Class<?> getColumnClass(int column); boolean isCellEditable(Object node, int column); void setValueAt(Object aValue, Object node, int column); }
AbstractTreeTableModel implements TreeTableModel { protected void fireTreeStructureChanged(Object source, Object[] path, int[] childIndices, Object[] children) { Object[] listeners = listenerList.getListenerList(); TreeModelEvent e = null; for (int i = listeners.length - 2; i >= 0; i -= 2) { if (listeners[i] == TreeModelListener.class) { if (e == null) e = new TreeModelEvent(source, path, childIndices, children); ((TreeModelListener) listeners[i + 1]).treeStructureChanged(e); } } } AbstractTreeTableModel(Object root); Object getRoot(); boolean isLeaf(Object node); void valueForPathChanged(TreePath path, Object newValue); int getIndexOfChild(Object parent, Object child); void addTreeModelListener(TreeModelListener l); void removeTreeModelListener(TreeModelListener l); Class<?> getColumnClass(int column); boolean isCellEditable(Object node, int column); void setValueAt(Object aValue, Object node, int column);  }