|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.as400.util.html.HTMLTagAttributes | +--com.ibm.as400.util.html.HTMLImage
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:
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 |
public HTMLImage()
public HTMLImage(java.lang.String source, java.lang.String alt)
source
- The absolute or relative URL.alt
- The alternate text.Method Detail |
public java.lang.String getAlign()
public java.lang.String getAlt()
public int getBorder()
public int getHeight()
public int getHSpace()
public java.lang.String getName()
public java.lang.String getSrc()
public int getVSpace()
public int getWidth()
width
- The Widthpublic java.lang.String getTag()
public void setAlign(java.lang.String align)
align
- The alignment. One of the following constants
defined in HTMLConstants: LEFT, RIGHT, TOP, TEXTTOP, MIDDLE, ABSMIDDLE, BASELINE, BOTTOM, or ABSBOTTOM .HTMLConstants
public void setAlt(java.lang.String alt)
alt
- The alternate text.public void setBorder(int border)
border
- The border thickness.public void setHeight(int height)
height
- The height.public void setHSpace(int hspace)
hspace
- The horizontal space.public void setName(java.lang.String name)
name
- The name.public void setSrc(java.lang.String source)
source
- The source.public void setVSpace(int vspace)
vspace
- The vertical space.public void setWidth(int width)
width
- The width.public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |