1
/* This notice must be untouched at all times.
4
The latest version is available at
5
http://www.openjacob.org
7
Copyright (c) 2006 Andreas Herz. All rights reserved.
8
Created 5. 11. 2006 by Andreas Herz (Web: http://www.freegroup.de )
12
This library is free software; you can redistribute it and/or
13
modify it under the terms of the GNU Lesser General Public
14
License (LGPL) as published by the Free Software Foundation; either
15
version 2.1 of the License, or (at your option) any later version.
17
This library is distributed in the hope that it will be useful,
18
but WITHOUT ANY WARRANTY; without even the implied warranty of
19
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20
Lesser General Public License for more details.
22
You should have received a copy of the GNU Lesser General Public
23
License along with this library; if not, write to the Free Software
24
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA,
25
or see http://www.gnu.org/copyleft/lesser.html
31
* @author Andreas Herz
34
draw2d.ImageFigure=function(/*:String*/url)
38
draw2d.Node.call(this);
39
this.setDimension(40,40);
42
draw2d.ImageFigure.prototype = new draw2d.Node;
44
draw2d.ImageFigure.prototype.type="Image";
49
draw2d.ImageFigure.prototype.createHTMLElement=function()
51
var item = draw2d.Node.prototype.createHTMLElement.call(this);
52
item.style.width=this.width+"px";
53
item.style.height=this.height+"px";
54
item.style.margin="0px";
55
item.style.padding="0px";
56
item.style.border="0px";
58
item.style.backgroundImage="url("+this.url+")";
60
item.style.backgroundImage="";
65
* A image can't change the color. Do nothing
68
draw2d.ImageFigure.prototype.setColor= function(/*:draw2d.Color*/ color)
74
* An image can't be resized. So - this function returns always false,
76
* @return Returns always false.
79
draw2d.ImageFigure.prototype.isResizeable=function()
85
* Set URL of the image. This can be absolute like http://www.anydomain.de/myimage.gif or relative
86
* to the current server. directory
88
* @param {String} url The url of the image.
90
draw2d.ImageFigure.prototype.setImage=function(/*:String*/ url)
94
this.html.style.backgroundImage="url("+this.url+")";
96
this.html.style.backgroundImage="";
b'\\ No newline at end of file'