Skip to content

Instantly share code, notes, and snippets.

View xeolabs's full-sized avatar
🏋️‍♂️
Developing http://xeokit.io

Lindsay Kay xeolabs

🏋️‍♂️
Developing http://xeokit.io
View GitHub Profile
/**
* Finishing current JsUnit testcase as passed.
*/
private static void pass() {
if (currentTest != null) {
runNotifier.fireTestFinished(currentTest);
currentTest = null;
}
}
private static void runJsUnitInRhino(String entryPoint) {
//...
int result = proc.waitFor();
if (result != 0) {
throw new JSExecutionException(getStdError(proc));
}
}
var NumberGuess = function(cfg) {
cfg = cfg ? cfg : {};
return new Subo.Application({
name: cfg.name || 'numberguess', // Default name
onStart: function(args) {
args = args || {};
// Add a service to provide the number to guess. A service can be any kind of object; we call it a
// service because its intended to provide the service layer to the application.
<div id="numberguess"></div>
<script type="text/javascript" src="http://www.xeolabs.com/deploy/subo/src/core/subo.js"></script>
<script type="text/javascript" src="http://www.xeolabs.com/deploy/subo/src/examples/numberguess/numberguess.js"></script>
<script type="text/javascript">
var numberGuess = new NumberGuess({ name: 'numberguess'} );
numberGuess.start({homeUrl:'http://www.xeolabs.com/deploy/subo/src/examples/numberguess'});
</script>
var scene = new Guava.Graph({
children: [
/* A Canvas node activates a DOM canvas element for its subtree. You can have more
* than one Canvas node in your scene if you want multiple views of the scene on multiple
* canvas tags throughout your page (alternatively, you could have multiple ViewPorts on the
* same Canvas).
*/
new Guava.Canvas({
var scene = new SceneJs.Graph({
children: [
/* A Canvas node activates a DOM canvas element for its subtree. You can have more
* than one Canvas node in your scene if you want multiple views of the scene on multiple
* canvas tags throughout your page (alternatively, you could have multiple ViewPorts on the
* same Canvas).
*/
new SceneJs.Canvas({
/** An example of a installation of a backend for a canvas.
*/
SceneJs.Backend.installCanvasBackend(new (function() {
this.canvasType = 'awesome-new-canvas-0.1';
/** SceneJs.Backend's acquireCanvas method calls this method on each installed
* canvas backend to poll them for a context on the given canvas. As soon as one
* is able to provide a context, the canvas and the successful backend become active.
*
/**
* An example of installation of a backend through which nodes of a given type
* can drive a canvas of a particular type.
*/
SceneJs.Backend.installNodeBackend(
new (function() {
this.canvasType = 'awesome-new-canvas0.1';
this.nodeType = 'my-node-type';
SceneJs.MyNewNode = function(cfg) {
cfg = cfg || {};
/** Called when pre-visited during scene traversal
*/
this.preVisit = function() {
var backend = SceneJs.Backend.getNodeBackend(this.getType());
if (backend) {
var someData = {};
var graph = SceneJs.graph(
SceneJs.node({
preVisit: function(nodeContext) {
// Your pre-visit functionality
},
postVisit: function(nodeContext) {
// Your post-visit functionality