aboutsummaryrefslogtreecommitdiffstats
path: root/src/graphui/classes/com/jogamp/graph
diff options
context:
space:
mode:
Diffstat (limited to 'src/graphui/classes/com/jogamp/graph')
-rw-r--r--src/graphui/classes/com/jogamp/graph/ui/Group.java27
-rw-r--r--src/graphui/classes/com/jogamp/graph/ui/Scene.java16
2 files changed, 6 insertions, 37 deletions
diff --git a/src/graphui/classes/com/jogamp/graph/ui/Group.java b/src/graphui/classes/com/jogamp/graph/ui/Group.java
index d1156120a..fc6f91980 100644
--- a/src/graphui/classes/com/jogamp/graph/ui/Group.java
+++ b/src/graphui/classes/com/jogamp/graph/ui/Group.java
@@ -564,19 +564,8 @@ public class Group extends Shape implements Container {
@Override
public boolean contains(final Shape s) {
- if( shapes.contains(s) ) {
- return true;
- }
- for(final Shape shape : shapes) {
- if( shape instanceof Container ) {
- if( ((Container)shape).contains(s) ) {
- return true;
- }
- }
- }
- return false;
+ return TreeTool.contains(shapes, s);
}
-
@Override
public Shape getShapeByIdx(final int id) {
if( 0 > id ) {
@@ -586,21 +575,11 @@ public class Group extends Shape implements Container {
}
@Override
public Shape getShapeByID(final int id) {
- for(final Shape b : shapes) {
- if(b.getID() == id ) {
- return b;
- }
- }
- return null;
+ return TreeTool.getShapeByID(shapes, id);
}
@Override
public Shape getShapeByName(final String name) {
- for(final Shape b : shapes) {
- if( b.getName().equals(name) ) {
- return b;
- }
- }
- return null;
+ return TreeTool.getShapeByName(shapes, name);
}
@Override
diff --git a/src/graphui/classes/com/jogamp/graph/ui/Scene.java b/src/graphui/classes/com/jogamp/graph/ui/Scene.java
index 03cc29097..fa11f2675 100644
--- a/src/graphui/classes/com/jogamp/graph/ui/Scene.java
+++ b/src/graphui/classes/com/jogamp/graph/ui/Scene.java
@@ -332,7 +332,7 @@ public final class Scene implements Container, GLEventListener {
@Override
public boolean contains(final Shape s) {
- return false;
+ return TreeTool.contains(shapes, s);
}
@Override
public Shape getShapeByIdx(final int id) {
@@ -343,21 +343,11 @@ public final class Scene implements Container, GLEventListener {
}
@Override
public Shape getShapeByID(final int id) {
- for(final Shape b : shapes) {
- if(b.getID() == id ) {
- return b;
- }
- }
- return null;
+ return TreeTool.getShapeByID(shapes, id);
}
@Override
public Shape getShapeByName(final String name) {
- for(final Shape b : shapes) {
- if( b.getName().equals(name) ) {
- return b;
- }
- }
- return null;
+ return TreeTool.getShapeByName(shapes, name);
}
/** Returns {@link RegionRenderer#getSampleCount()}. */