This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Finishing current JsUnit testcase as passed. | |
*/ | |
private static void pass() { | |
if (currentTest != null) { | |
runNotifier.fireTestFinished(currentTest); | |
currentTest = null; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void runJsUnitInRhino(String entryPoint) { | |
//... | |
int result = proc.waitFor(); | |
if (result != 0) { | |
throw new JSExecutionException(getStdError(proc)); | |
} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** 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. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var graph = SceneJs.graph( | |
SceneJs.node({ | |
preVisit: function(nodeContext) { | |
// Your pre-visit functionality | |
}, | |
postVisit: function(nodeContext) { | |
// Your post-visit functionality |
OlderNewer