diff options
author | Kenneth Russel <[email protected]> | 2007-03-18 23:30:00 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2007-03-18 23:30:00 +0000 |
commit | 44ded763ea870d0daad90a0f7355a5792b16b774 (patch) | |
tree | 1d8ff1f40e46793f0e9856d10e7e2cfc3c366da2 /src/net/java/joglutils/msg/nodes/Coordinate3.java | |
parent | e1f4a731f55ab29e3f23f87102af1b11c67cb0da (diff) |
Added extensible action method mechanism via ActionTable, decoupling
Action implementations from the set of Nodes in the library.
Refactored OpenGL rendering into node instances to potentially share
more code among different Action subclasses.
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/joglutils/trunk@45 83d24430-9974-4f80-8418-2cc3294053b9
Diffstat (limited to 'src/net/java/joglutils/msg/nodes/Coordinate3.java')
-rw-r--r-- | src/net/java/joglutils/msg/nodes/Coordinate3.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/net/java/joglutils/msg/nodes/Coordinate3.java b/src/net/java/joglutils/msg/nodes/Coordinate3.java index 4e2b94b..e8e2631 100644 --- a/src/net/java/joglutils/msg/nodes/Coordinate3.java +++ b/src/net/java/joglutils/msg/nodes/Coordinate3.java @@ -38,6 +38,7 @@ package net.java.joglutils.msg.nodes; import net.java.joglutils.msg.actions.*; +import net.java.joglutils.msg.elements.*; import net.java.joglutils.msg.collections.*; /** Represents a set of 3-dimensional vertices which can be assembled @@ -46,6 +47,11 @@ import net.java.joglutils.msg.collections.*; public class Coordinate3 extends Node { private Vec3fCollection data; + static { + // Enable the elements this node affects for known actions + GLCoordinateElement.enable(GLRenderAction.getDefaultState()); + } + /** Sets the coordinate data in this node. */ public void setData(Vec3fCollection data) { this.data = data; @@ -57,6 +63,8 @@ public class Coordinate3 extends Node { } public void doAction(Action action) { - action.visit(this); + if (CoordinateElement.isEnabled(action.getState())) { + CoordinateElement.set(action.getState(), getData().getData()); + } } } |