All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sdsu.html.Image

java.lang.Object
   |
   +----sdsu.html.Image

public class Image
extends Object
implements HTML
Represents an inline image that can be part of a web page. An image is constructed with a URL to the actual image. Supported formats depend on the browser used to render the html. GIF 87a (.gif) is very common.

Version:
0.8 1 April 1997
Author:
Roger Whitney (whitney@cs.sdsu.edu)

Constructor Index

 o Image(String)
Create an html reference to an image to be displayed in a web page.
 o Image(String, String)
Create an html reference to an image to be displayed in a web page with alternative text.

Method Index

 o alignCenter()
Center the image in the page.
 o alignLeft()
Make the image line up against the left margin, and text will flow around it.
 o alignRight()
Make the image line up against the right margin, and text will flow around it.
 o alignTextBelow()
Place text following the image on the line below the image.
 o alignTextBottom()
Alight text following the image at bottom of the image.
 o alignTextMiddle()
Alight text following the image at middle of the image.
 o alignTextTop()
Alight text following the image at top of the image.
 o blackSDSU()
Returns a image that the black SDSU logo.
 o dividerBar(String)
Returns a image that is a divider bar of a given color.
 o link(String)
Makes image a link to the given url An example of a url string for a relative link is notes/diagram.gif An example of a url string for a absolute link is http://www.eli.sdsu.edu/courses/brokenPipe.gif.
 o redDividerBar()
Returns a image that is a red divider bar that will span the entire window.
 o redSDSU()
Returns a image that the red SDSU logo.
 o setBorderSize(int)
Size of the border drawn around an image that is a link
 o setHeight(int)
Width of the image in pixels.
 o setWidth(int)
Width of the image in pixels.
 o setWidthPercent(int)
Width of the image in percent of the window width.
 o toString()
Returns the html string represented by this object.

Constructors

 o Image
 public Image(String URL)
Create an html reference to an image to be displayed in a web page. URL gives the relative or absolute location for the actual image. An example of a url string for a relative relative is notes/happy.gif An example of a url string for a absolute location is http://www.sdsu.edu/graphics/divider_red.gif. That is the url string should not start with '<A HREF=', end with '</A>', nor quote the url

 o Image
 public Image(String URL,
              String textVersion)
Create an html reference to an image to be displayed in a web page with alternative text. URL gives the relative or absolute location for the actual image. An example of a url string for a relative relative is notes/happy.gif An example of a url string for a absolute location is http://www.sdsu.edu/graphics/divider_red.gif. That is the url string should not start with '<A HREF=', end with '</A>', nor quote the url

Parameters:
URL - location of the image
textVersion - text to be displayed in text-only browsers

Methods

 o redSDSU
 public static Image redSDSU()
Returns a image that the red SDSU logo. Image is from SDSU Graphics Library. The image looks like:

 o blackSDSU
 public static Image blackSDSU()
Returns a image that the black SDSU logo. Image is from SDSU Graphics Library. The image looks like:

 o redDividerBar
 public static Image redDividerBar()
Returns a image that is a red divider bar that will span the entire window. Image is from SDSU Graphics Library. The bar looks like:

 o dividerBar
 public static Image dividerBar(String color)
Returns a image that is a divider bar of a given color. Valid colors are: red, blue, green, teal, yellow, rainbow Images are from SDSU Graphics Library. The bar looks like:

 o alignLeft
 public void alignLeft()
Make the image line up against the left margin, and text will flow around it. Only one of alignLeft, alignCenter, alignRight, alignTextTop, alignTextMiddle, alignTextBottom can be used. If more than one are called, the last one called is used.

 o alignCenter
 public void alignCenter()
Center the image in the page. Text will not flow around it. Text will appear on the next line after image. Only one of alignLeft, alignCenter, alignRight, alignTextTop, alignTextMiddle, alignTextBottom can be used. If more than one are called, the last one called is used.

 o alignRight
 public void alignRight()
Make the image line up against the right margin, and text will flow around it. Only one of alignLeft, alignCenter, alignRight, alignTextTop, alignTextMiddle, alignTextBottom can be used. If more than one are called, the last one called is used.

 o alignTextTop
 public void alignTextTop()
Alight text following the image at top of the image. Only one of alignLeft, alignCenter, alignRight, alignTextTop, alignTextMiddle, alignTextBottom can be used. If more than one are called, the last one called is used.

 o alignTextMiddle
 public void alignTextMiddle()
Alight text following the image at middle of the image. Only one of alignLeft, alignCenter, alignRight, alignTextTop, alignTextMiddle, alignTextBottom can be used. If more than one are called, the last one called is used.

 o alignTextBottom
 public void alignTextBottom()
Alight text following the image at bottom of the image. Only one of alignLeft, alignCenter, alignRight, alignTextTop, alignTextMiddle, alignTextBottom can be used. If more than one are called, the last one called is used.

 o alignTextBelow
 public void alignTextBelow()
Place text following the image on the line below the image. Text is not aligned wiht image, just put on the next line. Can be used with other align methods.

 o setWidth
 public void setWidth(int pixelWidth)
Width of the image in pixels. Width & Height allow browsers to lay out the page in advance of downloading the image

 o setWidthPercent
 public void setWidthPercent(int percentOfWindowWidth)
Width of the image in percent of the window width. The image will be stretched or compressed to the given size. Should only be used for decorative items like color divider bars.

Parameters:
percentOfWindowWidth - number between 0 and 100
 o setHeight
 public void setHeight(int pixelHeight)
Width of the image in pixels. Width & Height allow browsers to lay out the page in advance of downloading the image

 o setBorderSize
 public void setBorderSize(int pixelSize)
Size of the border drawn around an image that is a link

 o link
 public void link(String url)
Makes image a link to the given url An example of a url string for a relative link is notes/diagram.gif An example of a url string for a absolute link is http://www.eli.sdsu.edu/courses/brokenPipe.gif. That is the url string should not start with '<A HREF=', end with '</A>', nor quote the url

 o toString
 public String toString()
Returns the html string represented by this object.

Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index