public synchronized boolean removeObject(PathObject pathObject, boolean keepChildren) { return removeObject(pathObject, keepChildren, true); }
public static void removeObject(PathObject pathObject, boolean keepChildren) { PathObjectHierarchy hierarchy = getCurrentHierarchy(); if (hierarchy == null) return; hierarchy.removeObject(pathObject, keepChildren); }
boolean checkAllTestsComplete() { if (map.isEmpty() && getParent() != null) { if (countdown == null) { hierarchy.removeObject(this, true); } else if (countdown.decrementAndGet() == 0) { PathObject parent = getParent(); List<PathObject> parallelObjects = new ArrayList<>(); for (PathObject temp : parent.getChildObjects()) { if (temp instanceof ParallelTileObject) { parallelObjects.add(temp); } } parent.removePathObjects(parallelObjects); for (PathObject temp : parallelObjects) parent.addPathObjects(temp.getChildObjects()); if (parent.hasChildren() && parent instanceof PathROIObject) ((PathROIObject)parent).setLocked(true); hierarchy.fireHierarchyChangedEvent(parent); } return true; // getParent().removePathObject(this); // getParent().addPathObjects(getPathObjectList()); } return false; }
@Override public void taskComplete() { parentObject.clearPathObjects(); parentObject.addPathObjects(tiles); imageData.getHierarchy().fireHierarchyChangedEvent(this, parentObject); if (params.getBooleanParameterValue("removeParentAnnotation") && params.getBooleanParameterValue("makeAnnotations") && parentObject.isAnnotation()) { imageData.getHierarchy().removeObject(parentObject, true); } }