com.ibm.as400.util.html
Class HTMLImage

java.lang.Object
  |
  +--com.ibm.as400.util.html.HTMLTagAttributes
        |
        +--com.ibm.as400.util.html.HTMLImage
All Implemented Interfaces:
HTMLConstants, HTMLTagElement, java.io.Serializable

public class HTMLImage
extends HTMLTagAttributes
implements HTMLConstants, java.io.Serializable

The HTMLImage class represents an image tag within an HTML page.

This example creates a HTMLImage tag:

  // Create an HTMLImage.
  HTMLImage image = new HTMLImage("http://myWebPage/pic.gif", "alternate text");
  image.setHeight(50);
  image.setWidth(50);
  System.out.println(image);
  

Here is the output of the HTMLImage tag:

  <img src="http://myWebPage/pic.gif" alt="alternate text" height="50" width="50" />
  

HTMLImage objects generate the following events:

See Also:
Serialized Form

Fields inherited from interface com.ibm.as400.util.html.HTMLConstants
ABSBOTTOM, ABSMIDDLE, BASELINE, BOTTOM, CAPITALS, CENTER, CIRCLE, DISC, JUSTIFY, LARGE_ROMAN, LEFT, LOWER_CASE, LTR, MIDDLE, NUMBERS, RIGHT, RTL, SMALL_ROMAN, SQUARE, TARGET_BLANK, TARGET_PARENT, TARGET_SELF, TARGET_TOP, TEXTTOP, TOP
 
Constructor Summary
HTMLImage()
          Constructs a default HTMLImage object.
HTMLImage(java.lang.String source, java.lang.String alt)
          Constructs an HTMLImage object with the specified source and alternate text.
 
Method Summary
 java.lang.String getAlign()
          Returns the alignment of the image.
 java.lang.String getAlt()
          Returns the alternate text.
 int getBorder()
          Returns the thickness of the border around the image.
 int getHeight()
          Returns the height of the image.
 int getHSpace()
          Returns the horizontal space around the image in pixels.
 java.lang.String getName()
          Returns the unique name of the image.
 java.lang.String getSrc()
          Returns the absolute or relative URL to reference the image.
 java.lang.String getTag()
          Returns the element tag.
 int getVSpace()
          Returns the vertical space around the Image in pixels.
 int getWidth()
          Sets the width of the image in pixels.
 void setAlign(java.lang.String align)
          Sets the alignment of text following the image tag relative to the graphic on screen.
 void setAlt(java.lang.String alt)
          Sets the alternate text to be displayed in place of the image.
 void setBorder(int border)
          Sets the thickness of the border around the image.
 void setHeight(int height)
          Sets the height of the image in pixels.
 void setHSpace(int hspace)
          Sets the horizontal space around the image in pixels.
 void setName(java.lang.String name)
          Set the a unique name of the image.
 void setSrc(java.lang.String source)
          Sets the absolute or relative URL to reference the image.
 void setVSpace(int vspace)
          Sets the vertical space around the image in pixels.
 void setWidth(int width)
          Sets the width of the image in pixels.
 java.lang.String toString()
          Returns a String representation for the HTMLImage tag.
 
Methods inherited from class com.ibm.as400.util.html.HTMLTagAttributes
addPropertyChangeListener, getAttributes, getAttributeString, removePropertyChangeListener, setAttributes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HTMLImage

public HTMLImage()
Constructs a default HTMLImage object.

HTMLImage

public HTMLImage(java.lang.String source,
                 java.lang.String alt)
Constructs an HTMLImage object with the specified source and alternate text.
Parameters:
source - The absolute or relative URL.
alt - The alternate text.
Method Detail

getAlign

public java.lang.String getAlign()
Returns the alignment of the image.
Returns:
The alignment.

getAlt

public java.lang.String getAlt()
Returns the alternate text.
Returns:
The alternate text.

getBorder

public int getBorder()
Returns the thickness of the border around the image.
Returns:
The border.

getHeight

public int getHeight()
Returns the height of the image.
Returns:
The height.

getHSpace

public int getHSpace()
Returns the horizontal space around the image in pixels.
Returns:
The horizontal space.

getName

public java.lang.String getName()
Returns the unique name of the image.
Returns:
The name.

getSrc

public java.lang.String getSrc()
Returns the absolute or relative URL to reference the image.
Returns:
The source.

getVSpace

public int getVSpace()
Returns the vertical space around the Image in pixels.
Returns:
The vertical space.

getWidth

public int getWidth()
Sets the width of the image in pixels.
Parameters:
width - The Width

getTag

public java.lang.String getTag()
Returns the element tag.
Returns:
The tag.

setAlign

public void setAlign(java.lang.String align)
Sets the alignment of text following the image tag relative to the graphic on screen.
Parameters:
align - The alignment. One of the following constants defined in HTMLConstants: LEFT, RIGHT, TOP, TEXTTOP, MIDDLE, ABSMIDDLE, BASELINE, BOTTOM, or ABSBOTTOM .
See Also:
HTMLConstants

setAlt

public void setAlt(java.lang.String alt)
Sets the alternate text to be displayed in place of the image. This text will be displayed for browsers that can not handle this ability or that have disabled this ability.
Parameters:
alt - The alternate text.

setBorder

public void setBorder(int border)
Sets the thickness of the border around the image.
Parameters:
border - The border thickness.

setHeight

public void setHeight(int height)
Sets the height of the image in pixels.
Parameters:
height - The height.

setHSpace

public void setHSpace(int hspace)
Sets the horizontal space around the image in pixels.
Parameters:
hspace - The horizontal space.

setName

public void setName(java.lang.String name)
Set the a unique name of the image.
Parameters:
name - The name.

setSrc

public void setSrc(java.lang.String source)
Sets the absolute or relative URL to reference the image.
Parameters:
source - The source.

setVSpace

public void setVSpace(int vspace)
Sets the vertical space around the image in pixels.
Parameters:
vspace - The vertical space.

setWidth

public void setWidth(int width)
Sets the width of the image in pixels.
Parameters:
width - The width.

toString

public java.lang.String toString()
Returns a String representation for the HTMLImage tag.
Overrides:
toString in class java.lang.Object
Returns:
The tag.