com.sas.servlet.beans.html
Class Image

java.lang.Object
  |
  +--com.sas.Component
        |
        +--com.sas.servlet.beans.BaseTransformation
              |
              +--com.sas.servlet.beans.BaseImage
                    |
                    +--com.sas.servlet.beans.html.Image

public class Image
extends BaseImage

Transformation bean definition for creating an HTML form image.

Problem: Create a document using JSP that contains an image

Solution: Write a Java scriptlet in a JSP page that uses the Image Transformation Bean to create the HTML element.

JSP Page:

 <html>
 <body>
 
 <p> This example shows a simple image generated by the 
 Image Transformation Bean. </p>
 <FORM>
 <%
    // Create a new image object
    com.sas.servlet.beans.ImageInterface image = 
       new com.sas.servlet.beans.html.Image(); 

image.setName("stuff"); image.setImage("images/beavis.gif"); image.write(out); %> </FORM> </body> </html>

HTML output:

 <html>
 <body>
 
 <p> This example shows a simple image generated by the 
 Image Transformation Bean. </p>
 <FORM>
 <INPUT TYPE=image NAME="stuff" SRC="images/beavis.gif">
 </FORM>
 </body>
 </html>
 

Live element:

See Also:
Serialized Form

Constructor Summary
Image()
          Constructs a new Image Transformation Bean
Image(String name)
          Constructs a new Image Transformation Bean
Image(String name, String image)
          Constructs a new Image Transformation Bean
Image(String name, String image, int width, int height)
          Constructs a new Image Transformation Bean
 
Method Summary
 void write(PrintWriter out)
          Writes the transformed representation of the object
 
Methods inherited from class com.sas.servlet.beans.BaseImage
getAlignment, getAlternateText, getHeight, getHorizontalSpace, getImage, getName, getVerticalSpace, getWidth, setAlignment, setAlternateText, setHeight, setHorizontalSpace, setImage, setName, setVerticalSpace, setWidth
 
Methods inherited from class com.sas.servlet.beans.BaseTransformation
getCustomAttributes, getDescription, getParent, getRequest, getResponse, setCustomAttributes, setDescription, setParent, setRequest, setResponse, toString, write, write, write
 
Methods inherited from class com.sas.Component
addLink, addPropertyChangeListener, addVetoableChangeListener, anyPropertyChangeListeners, attachModel, attachView, beansIsDesignTime, beansSetDesignTime, clone, clone, detachModel, detachView, dumpComponent, firePropertyChange, firePropertyChange, fireVetoableChange, getComponentDescription, getComponentSupportInfo, getEventMethod, getEventValues, getExtendedBeanInfo, getLinkInfo, getModelInterface, getRequiredInterfaces, getResources, getStringResource, getViewInterfaceSupportInfo, initialize, initializeComponent, isDesignTime, isLinked, propertyChange, queryLinks, queryLinks, refresh, removeAllLinks, removeInterfaceTraps, removeLink, removePropertyChangeListener, removeVetoableChangeListener, setComponentDescription, setComponentSupportInfo, setDefaultValues, setLinkInfo, setModelInterface, setRequiredInterfaces, setViewInterfaceSupportInfo, supportsListenerInterface, supportsRequiredInterfaces, trapInterfaceEvents, validateObject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Image

public Image()
Constructs a new Image Transformation Bean

Image

public Image(String name)
Constructs a new Image Transformation Bean
Parameters:
name - The image name

Image

public Image(String name,
             String image)
Constructs a new Image Transformation Bean
Parameters:
name - The image field name
image - The image source

Image

public Image(String name,
             String image,
             int width,
             int height)
Constructs a new Image Transformation Bean
Parameters:
name - The image field name
image - The image source
width - The image width
height - The image height
Method Detail

write

public void write(PrintWriter out)
           throws IOException
Writes the transformed representation of the object
Parameters:
out - The output stream Examples of image output are:
Overrides:
write in class BaseTransformation


Version: 1.2.20000317.001 Formatted: 2000/07/06 15:57:33PM