public boolean isAncestor(Object parent, Object child) { while (child != null && child != parent) { child = getParent(child); } return child == parent; }
public boolean isAncestor(Object parent, Object child) { while (child != null && child != parent) { child = getParent(child); } return child == parent; }
public Object remove(Object cell) { if (cell == root) { setRoot(null); } else if (getParent(cell) != null) { execute(new mxChildChange(this, null, cell)); } return cell; }
public Object remove(Object cell) { if (cell == root) { setRoot(null); } else if (getParent(cell) != null) { execute(new mxChildChange(this, null, cell)); } return cell; }
public Object add(Object parent, Object child, int index) { if (child != parent && parent != null && child != null) { boolean parentChanged = parent != getParent(child); execute(new mxChildChange(this, parent, child, index)); // Maintains the edges parents by moving the edges // into the nearest common ancestor of its // terminals if (maintainEdgeParent && parentChanged) { updateEdgeParents(child); } } return child; }
public Object add(Object parent, Object child, int index) { if (child != parent && parent != null && child != null) { boolean parentChanged = parent != getParent(child); execute(new mxChildChange(this, parent, child, index)); // Maintains the edges parents by moving the edges // into the nearest common ancestor of its // terminals if (maintainEdgeParent && parentChanged) { updateEdgeParents(child); } } return child; }
Object parent = getParent(cell);
Object parent = getParent(cell);
getGeometry(source) != null && getGeometry(source).isRelative()) source = getParent(source); getGeometry(target) != null && getGeometry(target).isRelative()) target = getParent(target); cell = getParent(source); && (getParent(cell) != root || isAncestor(cell, edge)) && getParent(edge) != cell) mxPoint origin1 = getOrigin(getParent(edge)); mxPoint origin2 = getOrigin(cell);
getGeometry(source) != null && getGeometry(source).isRelative()) source = getParent(source); getGeometry(target) != null && getGeometry(target).isRelative()) target = getParent(target); cell = getParent(source); && (getParent(cell) != root || isAncestor(cell, edge)) && getParent(edge) != cell) mxPoint origin1 = getOrigin(getParent(edge)); mxPoint origin2 = getOrigin(cell);
mxICell previous = (mxICell) getParent(cell);
mxICell previous = (mxICell) getParent(cell);
/** * Returns the absolute, accumulated origin for the children inside the * given parent. */ public mxPoint getOrigin(Object cell) { mxPoint result = null; if (cell != null) { result = getOrigin(getParent(cell)); if (!isEdge(cell)) { mxGeometry geo = getGeometry(cell); if (geo != null) { result.setX(result.getX() + geo.getX()); result.setY(result.getY() + geo.getY()); } } } else { result = new mxPoint(); } return result; }
/** * Returns the absolute, accumulated origin for the children inside the * given parent. */ public mxPoint getOrigin(Object cell) { mxPoint result = null; if (cell != null) { result = getOrigin(getParent(cell)); if (!isEdge(cell)) { mxGeometry geo = getGeometry(cell); if (geo != null) { result.setX(result.getX() + geo.getX()); result.setY(result.getY() + geo.getY()); } } } else { result = new mxPoint(); } return result; }