From e44a7e37b6c7b5961adaffc62b9042b8d442938e Mon Sep 17 00:00:00 2001 From: mensonge Date: Thu, 13 Nov 2008 09:49:11 +0000 Subject: New feature: basic Ajax suggestion for tags and implementation of Dojo toolkit git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@151 b3834d28-1941-0410-a4f8-b48e95affb8f --- includes/js/dojox/sketch/PreexistingAnnotation.js | 121 ++++++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 includes/js/dojox/sketch/PreexistingAnnotation.js (limited to 'includes/js/dojox/sketch/PreexistingAnnotation.js') diff --git a/includes/js/dojox/sketch/PreexistingAnnotation.js b/includes/js/dojox/sketch/PreexistingAnnotation.js new file mode 100644 index 0000000..a8c123e --- /dev/null +++ b/includes/js/dojox/sketch/PreexistingAnnotation.js @@ -0,0 +1,121 @@ +if(!dojo._hasResource["dojox.sketch.PreexistingAnnotation"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. +dojo._hasResource["dojox.sketch.PreexistingAnnotation"] = true; +dojo.provide("dojox.sketch.PreexistingAnnotation"); + +dojo.require("dojox.sketch.Annotation"); +dojo.require("dojox.sketch.Anchor"); + +(function(){ + var ta=dojox.sketch; + ta.PreexistingAnnotation=function(figure, id){ + ta.Annotation.call(this, figure, id); + this.transform={dx:0, dy:0}; + this.start={ x:0, y:0 }; + this.end={ x:200, y:200 }; + this.radius=8; + this.textPosition={ x:196, y:196 }; + this.textOffset=4; + this.textAlign="end"; + + this.property('label',this.id); + this.rectShape=null; + this.labelShape=null; + + this.anchors.start=new ta.Anchor(this, "start"); + this.anchors.end=new ta.Anchor(this, "end"); + }; + ta.PreexistingAnnotation.prototype=new ta.Annotation; + var p=ta.PreexistingAnnotation.prototype; + p.constructor=ta.PreexistingAnnotation; + + p.type=function(){ return 'Preexisting' }; + p.getType=function(){ return ta.PreexistingAnnotation; }; + + p._pos=function(){ + var x=Math.min(this.start.x, this.end.x); + var y=Math.min(this.start.y, this.end.y); + var w=Math.max(this.start.x, this.end.x); + var h=Math.max(this.start.y, this.end.y); + this.start={ x:x, y:y }; + this.end={ x:w, y:h }; + this.textPosition={ x:this.end.x-this.textOffset, y:this.end.y-this.textOffset }; + }; + p.apply=function(obj){ + if(!obj) return; + if(obj.documentElement) obj=obj.documentElement; + this.readCommonAttrs(obj); + + for(var i=0; i' + + '' + + '' + + this.property('label') + + '' + + ''; + }; + + ta.Annotation.register("Preexisting"); +})(); + +} -- cgit v1.2.3