Class ImageMapReplacedElementFactory
java.lang.Object
org.xhtmlrenderer.swing.SwingReplacedElementFactory
ImageMapReplacedElementFactory
- All Implemented Interfaces:
ReplacedElementFactory
Sample for handling image maps in XHTML, as replaced elements.
Sample is incomplete in current state and meant as a starting point for future work.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private final ImageMapListener
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
Fields inherited from class org.xhtmlrenderer.swing.SwingReplacedElementFactory
repaintListener
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static boolean
private static boolean
areEqualIgnoreCase
(String str1, String str2) createReplacedElement
(LayoutContext context, BlockBox box, UserAgentCallback uac, int cssWidth, int cssHeight) NOTE: Only block equivalent elements can be replaced.private boolean
isNotBlank
(String _v) protected ReplacedElement
replaceImageMap
(UserAgentCallback uac, LayoutContext context, Element elem, String usemapAttr, int cssWidth, int cssHeight) Methods inherited from class org.xhtmlrenderer.swing.SwingReplacedElementFactory
addForm, getForm, getParentForm, lookupImageReplacedElement, newIrreplaceableImageElement, remove, replaceImage, reset, setFormSubmissionListener, storeImageReplacedElement
-
Field Details
-
listener
-
IMG_USEMAP_ATTR
- See Also:
-
MAP_ELT
- See Also:
-
MAP_NAME_ATTR
- See Also:
-
AREA_ELT
- See Also:
-
AREA_SHAPE_ATTR
- See Also:
-
AREA_COORDS_ATTR
- See Also:
-
AREA_HREF_ATTR
- See Also:
-
RECT_SHAPE
- See Also:
-
RECTANGLE_SHAPE
- See Also:
-
CIRC_SHAPE
- See Also:
-
CIRCLE_SHAPE
- See Also:
-
POLY_SHAPE
- See Also:
-
POLYGON_SHAPE
- See Also:
-
-
Constructor Details
-
ImageMapReplacedElementFactory
-
-
Method Details
-
createReplacedElement
public ReplacedElement createReplacedElement(LayoutContext context, BlockBox box, UserAgentCallback uac, int cssWidth, int cssHeight) Description copied from interface:ReplacedElementFactory
NOTE: Only block equivalent elements can be replaced.- Specified by:
createReplacedElement
in interfaceReplacedElementFactory
- Overrides:
createReplacedElement
in classSwingReplacedElementFactory
cssWidth
- The CSS width of the element in dots (or-1
if width isauto
)cssHeight
- The CSS height of the element in dots (or-1
if the height should be treated asauto
)- Returns:
- The
ReplacedElement
ornull
if noReplacedElement
applies
-
isNotBlank
-
replaceImageMap
protected ReplacedElement replaceImageMap(UserAgentCallback uac, LayoutContext context, Element elem, String usemapAttr, int cssWidth, int cssHeight) -
areEqual
-
areEqualIgnoreCase
-