Package com.openhtmltopdf.swing
Class SwingReplacedElementFactory
java.lang.Object
com.openhtmltopdf.swing.SwingReplacedElementFactory
- All Implemented Interfaces:
ReplacedElementFactory
@Deprecated public abstract class SwingReplacedElementFactory extends Object implements ReplacedElementFactory
Deprecated.
A ReplacedElementFactory where Elements are replaced by Swing components.
-
Field Summary
Fields Modifier and Type Field Description protected LinkedHashMapformsDeprecated.Cache of XhtmlForms keyed by Element.protected MapimageComponentsDeprecated.Cache of image components (ReplacedElements) for quick lookup, keyed by Element.protected RepaintListenerrepaintListenerDeprecated. -
Constructor Summary
Constructors Constructor Description SwingReplacedElementFactory()Deprecated.SwingReplacedElementFactory(RepaintListener repaintListener)Deprecated.SwingReplacedElementFactory(RepaintListener listener, ImageResourceLoader irl)Deprecated. -
Method Summary
Modifier and Type Method Description protected voidaddForm(Element e, XhtmlForm f)Deprecated.Adds a form to a local cache for quick lookup.ReplacedElementcreateReplacedElement(LayoutContext context, BlockBox box, UserAgentCallback uac, int cssWidth, int cssHeight)Deprecated.NOTE: Only block equivalent elements can be replaced.protected XhtmlFormgetForm(Element e)Deprecated.Returns the XhtmlForm associated with an Element in cache, or null if not found.protected ElementgetParentForm(Element e, LayoutContext context)Deprecated.protected ReplacedElementlookupImageReplacedElement(Element e, String uri)Deprecated.Retrieves a ReplacedElement for an image from cache, or null if not found.protected ReplacedElementnewIrreplaceableImageElement(int cssWidth, int cssHeight)Deprecated.Returns a ReplacedElement for some element in the stream which should be replaceable, but is not.voidremove(Element e)Deprecated.protected ReplacedElementreplaceImage(UserAgentCallback uac, LayoutContext context, Element elem, int cssWidth, int cssHeight)Deprecated.Handles replacement of image elements in the document.voidreset()Deprecated.Clears out any references to elements or items created by this factory so far.voidsetFormSubmissionListener(FormSubmissionListener fsl)Deprecated.protected voidstoreImageReplacedElement(Element e, ReplacedElement cc, String uri, int cssWidth, int cssHeight)Deprecated.Adds a ReplacedElement containing an image to a cache of images for quick lookup.
-
Field Details
-
imageComponents
Deprecated.Cache of image components (ReplacedElements) for quick lookup, keyed by Element. -
forms
Deprecated.Cache of XhtmlForms keyed by Element. -
repaintListener
Deprecated.
-
-
Constructor Details
-
SwingReplacedElementFactory
public SwingReplacedElementFactory()Deprecated. -
SwingReplacedElementFactory
Deprecated. -
SwingReplacedElementFactory
Deprecated.
-
-
Method Details
-
createReplacedElement
public ReplacedElement createReplacedElement(LayoutContext context, BlockBox box, UserAgentCallback uac, int cssWidth, int cssHeight)Deprecated.NOTE: Only block equivalent elements can be replaced.- Specified by:
createReplacedElementin interfaceReplacedElementFactorycssWidth- The CSS width of the element in dots (or-1if width isauto)cssHeight- The CSS height of the element in dots (or-1if the height should be treated asauto)- Returns:
- The
ReplacedElementornullif noReplacedElementapplies
-
replaceImage
protected ReplacedElement replaceImage(UserAgentCallback uac, LayoutContext context, Element elem, int cssWidth, int cssHeight)Deprecated.Handles replacement of image elements in the document. May return the same ReplacedElement for a given image on multiple calls. Image will be automatically scaled to cssWidth and cssHeight assuming these are non-zero positive values. The element is assume to have a src attribute (e.g. it's an <img> element)- Parameters:
uac- Used to retrieve images on demand from some source.context- The layout contextelem- The element with the image referencecssWidth- Target width of the imagecssHeight- Target height of the image @return A ReplacedElement for the image; will not be null.- Returns:
- the replaced image elemnt created
-
newIrreplaceableImageElement
Deprecated.Returns a ReplacedElement for some element in the stream which should be replaceable, but is not. This might be the case for an element like img, where the source isn't provided.- Parameters:
cssWidth- Target width for the element.cssHeight- Target height for the element- Returns:
- A ReplacedElement to substitute for one that can't be generated.
-
storeImageReplacedElement
protected void storeImageReplacedElement(Element e, ReplacedElement cc, String uri, int cssWidth, int cssHeight)Deprecated.Adds a ReplacedElement containing an image to a cache of images for quick lookup.- Parameters:
e- The element under which the image is keyed.cc- The replaced element containing the image, or another ReplacedElement to be used in its placeuri-cssWidth-cssHeight-
-
lookupImageReplacedElement
Deprecated.Retrieves a ReplacedElement for an image from cache, or null if not found.- Parameters:
e- The element by which the image is keyeduri-- Returns:
- The ReplacedElement for the image, or null if there is none.
-
addForm
Deprecated.Adds a form to a local cache for quick lookup.- Parameters:
e- The element under which the form is keyed (e.g. "<form>" in HTML)f- The form element being stored.
-
getForm
Deprecated.Returns the XhtmlForm associated with an Element in cache, or null if not found.- Parameters:
e- The Element to which the form is keyed- Returns:
- The form, or null if not found.
-
getParentForm
Deprecated.- Parameters:
e-
-
reset
public void reset()Deprecated.Clears out any references to elements or items created by this factory so far. -
remove
Deprecated. -
setFormSubmissionListener
Deprecated.
-