Fixed formating. Removed hundred of emtpy lines :(

This commit is contained in:
trifonnt 2009-09-24 18:23:23 +00:00
parent 1dcac13a6a
commit 8d82c29b87
1 changed files with 6 additions and 401 deletions

View File

@ -16,812 +16,417 @@
*****************************************************************************/ *****************************************************************************/
package org.apache.ecs.xhtml; package org.apache.ecs.xhtml;
import org.apache.ecs.Element; import org.apache.ecs.Element;
import org.apache.ecs.KeyEvents; import org.apache.ecs.KeyEvents;
import org.apache.ecs.MouseEvents; import org.apache.ecs.MouseEvents;
import org.apache.ecs.Printable; import org.apache.ecs.Printable;
import org.apache.ecs.SinglePartElement; import org.apache.ecs.SinglePartElement;
/** /**
This class creates an <img> tag. This class creates an <img> tag.
@version $Id: img.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $ @version $Id: img.java,v 1.2 2006/07/30 00:54:02 jjanke Exp $
@author <a href="mailto:snagy@servletapi.com">Stephan Nagy</a> @author <a href="mailto:snagy@servletapi.com">Stephan Nagy</a>
@author <a href="mailto:jon@clearink.com">Jon S. Stevens</a> @author <a href="mailto:jon@clearink.com">Jon S. Stevens</a>
@author <a href="mailto:bojan@binarix.com">Bojan Smojver</a> @author <a href="mailto:bojan@binarix.com">Bojan Smojver</a>
*/ */
public class img extends SinglePartElement implements Printable, MouseEvents, KeyEvents public class img extends SinglePartElement implements Printable, MouseEvents, KeyEvents
{ {
/** /**
* *
*/ */
private static final long serialVersionUID = -8168015457971219546L; private static final long serialVersionUID = -8168015457971219546L;
/** /**
Private initialization routine.
Private initialization routine.
*/ */
{ {
setElementType("img"); setElementType("img");
setCase(LOWERCASE); setCase(LOWERCASE);
setAttributeQuote(true); setAttributeQuote(true);
setBeginEndModifier('/'); setBeginEndModifier('/');
} }
/** /**
Basic constructor. Use the set* methods to set the attibutes. Basic constructor. Use the set* methods to set the attibutes.
*/ */
public img() public img()
{ {
} }
/** /**
Creates an img tag Creates an img tag
@param src the src="" attribute @param src the src="" attribute
*/ */
public img(String src)
public img(String src)
{ {
setSrc(src); setSrc(src);
} }
/** /**
Creates an img tag Creates an img tag
@param src the src="" attribute @param src the src="" attribute
@param border the border="" attribute @param border the border="" attribute
*/ */
public img(String src, int border) public img(String src, int border)
{ {
setSrc(src); setSrc(src);
setBorder(border); setBorder(border);
} }
/** /**
Creates an img tag Creates an img tag
@param src the src="" attribute @param src the src="" attribute
@param name the name="" attribute @param name the name="" attribute
*/ */
public img(String src, String name) public img(String src, String name)
{ {
setSrc(src); setSrc(src);
setName(name); setName(name);
} }
/** /**
Creates an img tag Creates an img tag
@param src the src="" attribute @param src the src="" attribute
@param name the name="" attribute @param name the name="" attribute
@param border the border="" attribute @param border the border="" attribute
*/ */
public img(String src, String name, int border) public img(String src, String name, int border)
{ {
setSrc(src); setSrc(src);
setName(name); setName(name);
setBorder(border); setBorder(border);
} }
/** /**
Sets the src="" attribute Sets the src="" attribute
@param src the src="" attribute @param src the src="" attribute
*/ */
public img setSrc(String src) public img setSrc(String src)
{ {
addAttribute("src",src); addAttribute("src",src);
return this; return this;
} }
/** /**
Sets the border="" attribute Sets the border="" attribute
@param border the border="" attribute @param border the border="" attribute
*/ */
public img setBorder(int border) public img setBorder(int border)
{ {
addAttribute("border",Integer.toString(border)); addAttribute("border",Integer.toString(border));
return this; return this;
} }
/** /**
Sets the name="" attribute Sets the name="" attribute
@param name the name="" attribute @param name the name="" attribute
*/ */
public img setName(String name) public img setName(String name)
{ {
addAttribute("name",name); addAttribute("name",name);
return this; return this;
} }
/** /**
Sets the height="" attribute Sets the height="" attribute
@param height the height="" attribute @param height the height="" attribute
*/ */
public img setHeight(String height) public img setHeight(String height)
{ {
addAttribute("height",height); addAttribute("height",height);
return this; return this;
} }
/** /**
Sets the height="" attribute Sets the height="" attribute
@param height the height="" attribute @param height the height="" attribute
*/ */
public img setHeight(int height) public img setHeight(int height)
{ {
addAttribute("height",Integer.toString(height)); addAttribute("height",Integer.toString(height));
return this; return this;
} }
/** /**
Sets the width="" attribute Sets the width="" attribute
@param width the width="" attribute @param width the width="" attribute
*/ */
public img setWidth(String width) public img setWidth(String width)
{ {
addAttribute("width",width); addAttribute("width",width);
return this; return this;
} }
/** /**
Sets the width="" attribute Sets the width="" attribute
@param width the width="" attribute @param width the width="" attribute
*/ */
public img setWidth(int width) public img setWidth(int width)
{ {
addAttribute("width",Integer.toString(width)); addAttribute("width",Integer.toString(width));
return this; return this;
} }
/** /**
Sets the alt="" attribute Sets the alt="" attribute
@param alt the alt="" attribute @param alt the alt="" attribute
*/ */
public img setAlt(String alt) public img setAlt(String alt)
{ {
addAttribute("alt",alt); addAttribute("alt",alt);
return this; return this;
} }
/** /**
Sets the ismap attribute Sets the ismap attribute
@param ismap the ismap attribute @param ismap the ismap attribute
*/ */
public img setIsMap(boolean ismap) public img setIsMap(boolean ismap)
{ {
if (ismap == true)
if(ismap == true) addAttribute("ismap", "ismap");
addAttribute("ismap","ismap");
else else
removeAttribute("ismap"); removeAttribute("ismap");
return this; return this;
} }
/** /**
Sets the usmap="" attribute Sets the usmap="" attribute
@param usemap the usmap="" attribute @param usemap the usmap="" attribute
*/ */
public img setUseMap(String usemap) public img setUseMap(String usemap)
{ {
addAttribute("usemap",usemap); addAttribute("usemap",usemap);
return this; return this;
} }
/** /**
Sets the align="" attribute Sets the align="" attribute
@param align the align="" attribute @param align the align="" attribute
*/ */
public img setAlign(String align) public img setAlign(String align)
{ {
addAttribute("align",align); addAttribute("align",align);
return this; return this;
} }
/** /**
Sets the hspace="" attribute Sets the hspace="" attribute
@param hspace the hspace="" attribute @param hspace the hspace="" attribute
*/ */
public img setHspace(String hspace) public img setHspace(String hspace)
{ {
addAttribute("hspace",hspace); addAttribute("hspace",hspace);
return this; return this;
} }
/** /**
Sets the hspace="" attribute Sets the hspace="" attribute
@param hspace the hspace="" attribute @param hspace the hspace="" attribute
*/ */
public img setHspace(int hspace) public img setHspace(int hspace)
{ {
addAttribute("hspace",Integer.toString(hspace)); addAttribute("hspace",Integer.toString(hspace));
return this; return this;
} }
/** /**
Sets the vspace="" attribute Sets the vspace="" attribute
@param vspace the vspace="" attribute @param vspace the vspace="" attribute
*/ */
public img setVspace(String vspace) public img setVspace(String vspace)
{ {
addAttribute("vspace",vspace); addAttribute("vspace",vspace);
return this; return this;
} }
/** /**
Sets the vspace="" attribute Sets the vspace="" attribute
@param vspace the vspace="" attribute @param vspace the vspace="" attribute
*/ */
public img setVspace(int vspace) public img setVspace(int vspace)
{ {
addAttribute("vspace",Integer.toString(vspace)); addAttribute("vspace",Integer.toString(vspace));
return this; return this;
} }
/** /**
Sets the lang="" and xml:lang="" attributes Sets the lang="" and xml:lang="" attributes
@param lang the lang="" and xml:lang="" attributes @param lang the lang="" and xml:lang="" attributes
*/ */
public Element setLang(String lang) public Element setLang(String lang)
{ {
addAttribute("lang",lang); addAttribute("lang",lang);
addAttribute("xml:lang",lang); addAttribute("xml:lang",lang);
return this; return this;
} }
/** /**
Adds an Element to the element. Adds an Element to the element.
@param hashcode name of element for hash table @param hashcode name of element for hash table
@param element Adds an Element to the element. @param element Adds an Element to the element.
*/ */
public img addElement(String hashcode,Element element) public img addElement(String hashcode,Element element)
{ {
addElementToRegistry(hashcode,element); addElementToRegistry(hashcode,element);
return(this); return(this);
} }
/** /**
Adds an Element to the element. Adds an Element to the element.
@param hashcode name of element for hash table @param hashcode name of element for hash table
@param element Adds an Element to the element. @param element Adds an Element to the element.
*/ */
public img addElement(String hashcode,String element) public img addElement(String hashcode,String element)
{ {
addElementToRegistry(hashcode,element); addElementToRegistry(hashcode,element);
return(this); return(this);
} }
/** /**
Adds an Element to the element. Adds an Element to the element.
@param element Adds an Element to the element. @param element Adds an Element to the element.
*/ */
public img addElement(Element element) public img addElement(Element element)
{ {
addElementToRegistry(element); addElementToRegistry(element);
return(this); return(this);
} }
/** /**
Adds an Element to the element. Adds an Element to the element.
@param element Adds an Element to the element. @param element Adds an Element to the element.
*/ */
public img addElement(String element) public img addElement(String element)
{ {
addElementToRegistry(element); addElementToRegistry(element);
return(this); return(this);
} }
/** /**
Removes an Element from the element. Removes an Element from the element.
@param hashcode the name of the element to be removed. @param hashcode the name of the element to be removed.
*/ */
public img removeElement(String hashcode) public img removeElement(String hashcode)
{ {
removeElementFromRegistry(hashcode); removeElementFromRegistry(hashcode);
return(this); return(this);
} }
/** /**
The onclick event occurs when the pointing device button is clicked The onclick event occurs when the pointing device button is clicked
over an element. This attribute may be used with most elements. over an element. This attribute may be used with most elements.
@param The script @param The script
*/ */
public void setOnClick(String script) public void setOnClick(String script)
{ {
addAttribute ( "onclick", script ); addAttribute ( "onclick", script );
} }
/** /**
The ondblclick event occurs when the pointing device button is double The ondblclick event occurs when the pointing device button is double
clicked over an element. This attribute may be used with most elements. clicked over an element. This attribute may be used with most elements.
@param The script @param The script
*/ */
public void setOnDblClick(String script) public void setOnDblClick(String script)
{ {
addAttribute ( "ondblclick", script ); addAttribute ( "ondblclick", script );
} }
/** /**
The onmousedown event occurs when the pointing device button is pressed The onmousedown event occurs when the pointing device button is pressed
over an element. This attribute may be used with most elements. over an element. This attribute may be used with most elements.
@param The script @param The script
*/ */
public void setOnMouseDown(String script) public void setOnMouseDown(String script)
{ {
addAttribute ( "onmousedown", script ); addAttribute ( "onmousedown", script );
} }
/** /**
The onmouseup event occurs when the pointing device button is released The onmouseup event occurs when the pointing device button is released
over an element. This attribute may be used with most elements. over an element. This attribute may be used with most elements.
@param The script @param The script
*/ */
public void setOnMouseUp(String script) public void setOnMouseUp(String script)
{ {
addAttribute ( "onmouseup", script ); addAttribute ( "onmouseup", script );
} }
/** /**
The onmouseover event occurs when the pointing device is moved onto an The onmouseover event occurs when the pointing device is moved onto an
element. This attribute may be used with most elements. element. This attribute may be used with most elements.
@param The script @param The script
*/ */
public void setOnMouseOver(String script) public void setOnMouseOver(String script)
{ {
addAttribute ( "onmouseover", script ); addAttribute ( "onmouseover", script );
} }
/** /**
The onmousemove event occurs when the pointing device is moved while it The onmousemove event occurs when the pointing device is moved while it
is over an element. This attribute may be used with most elements. is over an element. This attribute may be used with most elements.
@param The script @param The script
*/ */
public void setOnMouseMove(String script) public void setOnMouseMove(String script)
{ {
addAttribute ( "onmousemove", script ); addAttribute ( "onmousemove", script );
} }
/** /**
The onmouseout event occurs when the pointing device is moved away from The onmouseout event occurs when the pointing device is moved away from
an element. This attribute may be used with most elements. an element. This attribute may be used with most elements.
@param The script @param The script
*/ */
public void setOnMouseOut(String script) public void setOnMouseOut(String script)
{ {
addAttribute ( "onmouseout", script ); addAttribute ( "onmouseout", script );
} }
/** /**
The onkeypress event occurs when a key is pressed and released over an The onkeypress event occurs when a key is pressed and released over an
element. This attribute may be used with most elements. element. This attribute may be used with most elements.
@param The script @param The script
*/ */
public void setOnKeyPress(String script) public void setOnKeyPress(String script)
{ {
addAttribute ( "onkeypress", script ); addAttribute ( "onkeypress", script );
} }
/** /**
The onkeydown event occurs when a key is pressed down over an element. The onkeydown event occurs when a key is pressed down over an element.
This attribute may be used with most elements. This attribute may be used with most elements.
@param The script @param The script
*/ */
public void setOnKeyDown(String script) public void setOnKeyDown(String script)
{ {
addAttribute ( "onkeydown", script ); addAttribute ( "onkeydown", script );
} }
/** /**
The onkeyup event occurs when a key is released over an element. This The onkeyup event occurs when a key is released over an element. This
attribute may be used with most elements. attribute may be used with most elements.
@param The script @param The script
*/ */
public void setOnKeyUp(String script) public void setOnKeyUp(String script)
{ {
addAttribute ( "onkeyup", script ); addAttribute ( "onkeyup", script );
} }
} }