god damn took so long but now rebase is almost done

This commit is contained in:
Peter Cottle 2012-10-13 01:12:52 -07:00
parent 359878037a
commit 6e30bedd37
3 changed files with 101 additions and 9 deletions

View file

@ -504,6 +504,14 @@ var VisNode = Backbone.Model.extend({
this.animateToAttr(toAttr, speed, easing);
},
animateToSnapshot: function(snapShot, speed, easing) {
console.log('animating to snapshot', snapShot, this.getID());
if (!snapShot[this.getID()]) {
return;
}
this.animateToAttr(snapShot[this.getID()], speed, easing);
},
animateToAttr: function(attr, speed, easing) {
var func = 'animate';
if (speed == 0) {
@ -579,6 +587,12 @@ var VisNode = Backbone.Model.extend({
this.setOutgoingEdgesBirthPosition(this.getParentScreenCoords());
},
setOutgoingEdgesOpacity: function(opacity) {
_.each(this.get('outgoingEdges'), function(edge) {
edge.setOpacity(opacity);
});
},
animateOutgoingEdgesToAttr: function(snapShot, speed, easing) {
_.each(this.get('outgoingEdges'), function(edge) {
var attr = snapShot[edge.getID()];
@ -650,6 +664,18 @@ var VisNode = Backbone.Model.extend({
});
},
setOpacity: function(opacity) {
opacity = (opacity === undefined) ? 1 : opacity;
// set the opacity on my stuff
var keys = ['circle', 'text'];
_.each(keys, function(key) {
this.get(key).attr({
opacity: opacity
});
}, this);
},
genGraphics: function(paper) {
var pos = this.getScreenCoords();
var textPos = this.getTextScreenCoords();
@ -768,6 +794,12 @@ var VisEdge = Backbone.Model.extend({
return GRAPHICS.visBranchStrokeColorNone;
},
setOpacity: function(opacity) {
opacity = (opacity === undefined) ? 1 : opacity;
this.get('path').attr({opacity: opacity});
},
genGraphics: function(paper) {
var pathString = this.getBezierCurve();