MCPcopy Index your code
hub / github.com/processing/processing / addChild

Method addChild

core/src/processing/core/PShape.java:2038–2051  ·  view source on GitHub ↗

@webref pshape:method @brief Adds a new child @param who any variable of type PShape @see PShape#getChild(int)

(PShape who)

Source from the content-addressed store, hash-verified

2036 * @see PShape#getChild(int)
2037 */
2038 public void addChild(PShape who) {
2039 if (children == null) {
2040 children = new PShape[1];
2041 }
2042 if (childCount == children.length) {
2043 children = (PShape[]) PApplet.expand(children);
2044 }
2045 children[childCount++] = who;
2046 who.parent = this;
2047
2048 if (who.getName() != null) {
2049 addName(who.getName(), who);
2050 }
2051 }
2052
2053
2054 // adds child who exactly at position idx in the array of children.

Callers 3

parseChildrenMethod · 0.45
copyGroupMethod · 0.45
addChildrenMethod · 0.45

Calls 3

expandMethod · 0.95
addNameMethod · 0.95
getNameMethod · 0.45

Tested by

no test coverage detected