public void deleteRow(int rowIndex) {
// If the deleted row is the parent of any segment we must assign a new parent (the root segment)
String name = getSegment(rowIndex).getName();
super.deleteRow(rowIndex);
// Note that the loop starts at 1, since the first row is the root segment
Segment root = getSegment(0);
for (int row = 1; row < getRowCount(); ++row) {
Segment seg = getSegment(row);
if (seg.getParentName().equals(name)) {
setValueAt(root.getName(), row, PARENT);
}
}
}