+
+ /**
+ * This is called when adjacent control point is removed.
+ *
+ * This call should remove the give point, if the point cannot exist alone.
+ * At the moment there is one such case: branch.
+ *
+ * @return
+ */
+ protected boolean checkRemove() {
+ if (getParentPoint() != null) {
+ return getParentPoint().checkRemove();
+ } else {
+ if (getPipelineComponent() == null)
+ return true; // already removed
+ if (getPipelineComponent().getType().equals("Plant3D.URIs.Builtin_BranchSplitComponent")) {
+ if (getSubPoint().get(0).getNext() == null && getSubPoint().get(0).getPrevious() == null) {
+ remove();
+ return true;
+ }
+ }
+ return false;
+ }
+ }