com.arsdigita.bebop
Class Image

java.lang.Object
  extended bycom.arsdigita.bebop.Completable
      extended bycom.arsdigita.bebop.SimpleComponent
          extended bycom.arsdigita.bebop.TextStylable
              extended bycom.arsdigita.bebop.BlockStylable
                  extended bycom.arsdigita.bebop.Image
All Implemented Interfaces:
Cloneable, Component, Lockable

public class Image
extends BlockStylable

A simple wrapper class for images.

Version:
$Id: //core-platform/dev/src/com/arsdigita/bebop/Image.java#8 $
Author:
David Lutterkort, Stanislav Freidin

Field Summary
static String versionId
           
 
Fields inherited from class com.arsdigita.bebop.BlockStylable
ABSBOTTOM, ABSMIDDLE, BASELINE, BOTTOM, CENTER, FULL_WIDTH, INSERT, LEFT, MIDDLE, RIGHT, TEXTTOP, TOP
 
Fields inherited from class com.arsdigita.bebop.SimpleComponent
m_attr
 
Fields inherited from interface com.arsdigita.bebop.Component
BEBOP_XML_NS, CLASS, ID, ON_CLICK, STYLE
 
Constructor Summary
Image(PrintListener l)
          Creates a new Image that uses the print listener to generate output.
Image(String imageURL)
           
Image(String imageURL, String alt)
           
 
Method Summary
 void addPrintListener(PrintListener listener)
          Adds a print listener.
protected  Image firePrintEvent(PageState state)
           
 void generateXML(PageState state, Element parent)
          Writes the output to a DOM to be used with the XSLT template to produce the appropriate output.
 void removePrintListener(PrintListener listener)
          Removes a previously added print listener.
 void setAlt(String alt)
           
 void setBorder(String border)
           
 void setHeight(String height)
           
 void setImageURL(String imageURL)
           
 void setWidth(String width)
           
 
Methods inherited from class com.arsdigita.bebop.BlockStylable
setBorder, setBorder, setBorderColor, setHorizontalAlignment, setMargin, setMargin, setPadding, setPadding, setVerticalAlignment
 
Methods inherited from class com.arsdigita.bebop.TextStylable
setBackgroundColor, setColor
 
Methods inherited from class com.arsdigita.bebop.SimpleComponent
children, clone, exportAttributes, getAttribute, getClassAttr, getIdAttr, getKey, getMetaDataAttribute, getStyleAttr, hasAttributes, isLocked, isVisible, lock, register, register, respond, setAttribute, setClassAttr, setIdAttr, setKey, setMetaDataAttribute, setStyleAttr, setVisible
 
Methods inherited from class com.arsdigita.bebop.Completable
addCompletionListener, fireCompletionEvent
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

versionId

public static final String versionId
See Also:
Constant Field Values
Constructor Detail

Image

public Image(String imageURL,
             String alt)

Image

public Image(String imageURL)

Image

public Image(PrintListener l)
Creates a new Image that uses the print listener to generate output.

Parameters:
l - the print listener used to produce output
Method Detail

setImageURL

public void setImageURL(String imageURL)

setAlt

public void setAlt(String alt)

setHeight

public void setHeight(String height)

setWidth

public void setWidth(String width)

setBorder

public void setBorder(String border)

addPrintListener

public void addPrintListener(PrintListener listener)
                      throws IllegalStateException,
                             IllegalArgumentException
Adds a print listener. Only one print listener can be set for an image, since the PrintListener is expected to modify the target of the PrintEvent.

Parameters:
listener - the print listener
Throws:
IlegalArgumentException - if listener is null.
IllegalStateException - if a print listener has previously been added.
IllegalArgumentException

removePrintListener

public void removePrintListener(PrintListener listener)
                         throws IllegalArgumentException
Removes a previously added print listener. If listener is not the listener that was added with addPrintListener, an IllegalArgumentException will be thrown.

Parameters:
listener - the listener that was previously added with addPrintListener
Throws:
IllegalArgumentException - if listener is not the currently registered print listener or is null.

generateXML

public void generateXML(PageState state,
                        Element parent)
Writes the output to a DOM to be used with the XSLT template to produce the appropriate output.

Generates DOM fragment:

 <bebop:image [src=...] [alt=...] [height=...]
       [width=...] [border=...]/>
 

Specified by:
generateXML in interface Component
Overrides:
generateXML in class SimpleComponent
Parameters:
parent - the XML element to which the form adds its XML representation

firePrintEvent

protected Image firePrintEvent(PageState state)


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 21 2004:2337 UTC