Ldc
2024-04-07 0652600959e5e3b5796fb6e8da129704ca95347a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
draw2d.BaseTask=function(_url){
draw2d.ResizeImage.call(this,_url);
    this.outputPort = null;
    this.inputPort = null;
    this.setDimension(120,60);
};
draw2d.BaseTask.prototype=new draw2d.ResizeImage();
draw2d.BaseTask.prototype.type="BaseTask";
draw2d.BaseTask.prototype.createHTMLElement=function(){
    var item = draw2d.ResizeImage.prototype.createHTMLElement.call(this);
    this.textarea = document.createElement("div");
    this.textarea.className="task-textarea";
    this.textarea.style.position = "absolute";
    //this.textarea.style.zIndex = "" + draw2d.Figure.ZOrderBaseIndex;
    this.textarea.style.left = "0px";
    this.textarea.style.top = "0px";
    item.appendChild(this.textarea);
    return item;
};
draw2d.BaseTask.prototype.setDimension=function(w, h){
    try{
        draw2d.ResizeImage.prototype.setDimension.call(this, w, h);
        this.textarea.style.left = (this.width/10)+"px";
        this.textarea.style.top = (this.height/3)+"px";
        this.textarea.style.width = (this.width - 20) + "px";
        this.textarea.style.height = (this.height - 40)+ "px";
        if (this.outputPort !== null) {
            this.outputPort.setPosition(this.width + 5, this.height / 2);
        }
        if (this.inputPort !== null) {
            this.inputPort.setPosition(-5, this.height / 2);
        }
    }catch(e){
    }
};
draw2d.BaseTask.prototype.setWorkflow=function(_5019){
    draw2d.ResizeImage.prototype.setWorkflow.call(this,_5019);
    if (_5019 !== null && this.inputPort === null) {
        this.inputPort = new draw2d.MyInputPort();
        this.inputPort.setWorkflow(_5019);
        this.inputPort.setName("input");
        this.addPort(this.inputPort, -5, this.height / 2);
        this.outputPort = new draw2d.MyOutputPort();
        this.outputPort.setMaxFanOut(5);
        this.outputPort.setWorkflow(_5019);
        this.outputPort.setName("output");
        this.addPort(this.outputPort, this.width + 5, this.height / 2);
    }
};
draw2d.BaseTask.prototype.setContent = function(_5014) {
    this.textarea.innerHTML=_5014;
};