summaryrefslogtreecommitdiffstats
path: root/src/net/java/joglutils/msg/nodes/Group.java
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2007-04-01 23:43:43 +0000
committerKenneth Russel <[email protected]>2007-04-01 23:43:43 +0000
commit340ef879cdeaebdce644351cfddf90c032cf5d56 (patch)
treef40d01f0f01e998973dce10524553946770a6811 /src/net/java/joglutils/msg/nodes/Group.java
parent5b543c792f28e79e1b15da6747e68d9e0f5c8ce9 (diff)
Added PerspectiveCamera.getWidthAngle(). Removed commented-out code
from Camera. Added error checking code to Group. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/joglutils/trunk@54 83d24430-9974-4f80-8418-2cc3294053b9
Diffstat (limited to 'src/net/java/joglutils/msg/nodes/Group.java')
-rw-r--r--src/net/java/joglutils/msg/nodes/Group.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/net/java/joglutils/msg/nodes/Group.java b/src/net/java/joglutils/msg/nodes/Group.java
index df3232d..ccf06f0 100644
--- a/src/net/java/joglutils/msg/nodes/Group.java
+++ b/src/net/java/joglutils/msg/nodes/Group.java
@@ -48,11 +48,15 @@ public class Group extends Node {
/** Append a child node to the list of children nodes this group node is managing. */
public void addChild(Node child) {
+ if (child == null)
+ throw new IllegalArgumentException("child may not be null");
children.add(child);
}
/** Adds a child so that it becomes the one with the given index. */
public void insertChild(int index, Node child) {
+ if (child == null)
+ throw new IllegalArgumentException("child may not be null");
children.add(index, child);
}
@@ -102,6 +106,8 @@ public class Group extends Node {
greater than the number of children
*/
public void replaceChild(int index, Node newChild) throws IndexOutOfBoundsException {
+ if (newChild == null)
+ throw new IllegalArgumentException("child may not be null");
removeChild(index);
insertChild(index, newChild);
}
@@ -111,6 +117,8 @@ public class Group extends Node {
oldChild as argument, and call replaceChild(int, SoNode*) if the
child is found. */
public void replaceChild(Node oldChild, Node newChild) {
+ if (newChild == null)
+ throw new IllegalArgumentException("child may not be null");
int idx = findChild(oldChild);
if (idx >= 0)
replaceChild(idx, newChild);