com.arsdigita.bebop
Class Image
java.lang.Object
com.arsdigita.bebop.Completable
com.arsdigita.bebop.SimpleComponent
com.arsdigita.bebop.TextStylable
com.arsdigita.bebop.BlockStylable
com.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
Fields inherited from class com.arsdigita.bebop.BlockStylable |
ABSBOTTOM, ABSMIDDLE, BASELINE, BOTTOM, CENTER, FULL_WIDTH, INSERT, LEFT, MIDDLE, RIGHT, TEXTTOP, TOP |
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 |
versionId
public static final String versionId
- See Also:
- Constant Field Values
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
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