Class DrawConverter
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intIdentifies objects that should be positioned absolute (using the css attribute postion:absolute)static final intIdentifies objects that should be placed centeredstatic final intIdentifies objects that should be displayed as floats, either alone or with text wrap (using the css attribute float:left or float:right)static final intIdentifies objects that should fill the entire screenstatic final intIdentifies objects that should be displayed inline. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconvertDrawContent(Element onode) Create form, if there is a form in this documentvoidflushFrames(Element hnode) flushFullscreenFrames(Element hnode) getDrawAnchor(Element onode) A draw element with a hyperlink is represented as two elements, eg.getRealDrawElement(Element onode) A draw element with a hyperlink is represented as two elements, eg.voidhandleDrawElement(Element onode, Element hnodeBlock, Element hnodeInline, int nMode) Convert a draw element to xhtml.insertCoverImage(Element hnode)
-
Field Details
-
INLINE
public static final int INLINEIdentifies objects that should be displayed inline.- See Also:
-
FLOATING
public static final int FLOATINGIdentifies objects that should be displayed as floats, either alone or with text wrap (using the css attribute float:left or float:right)- See Also:
-
ABSOLUTE
public static final int ABSOLUTEIdentifies objects that should be positioned absolute (using the css attribute postion:absolute)- See Also:
-
CENTERED
public static final int CENTEREDIdentifies objects that should be placed centered- See Also:
-
FULL_SCREEN
public static final int FULL_SCREENIdentifies objects that should fill the entire screen- See Also:
-
-
Constructor Details
-
DrawConverter
-
-
Method Details
-
convertDrawContent
-
createForm
Create form, if there is a form in this document
- Returns:
- the form element, or null if there are no forms in the document
-
getRealDrawElement
A draw element with a hyperlink is represented as two elements, eg.
<draw:a><draw:image/></draw:a>. We thus need methods to switch between the two elements.This method takes a
draw-element. If this element is a hyperlink, the child element is returned. Otherwise the argument is returned unchanged.- Parameters:
onode- thedraw:aelement- Returns:
- the corresponding element
-
getDrawAnchor
A draw element with a hyperlink is represented as two elements, eg.
<draw:a><draw:image/></draw:a>. We thus need methods to switch between the two elements.This method takes a
draw-element. If this element is contained in a hyperlink, the hyperlink is returned. Otherwise null is returned.- Parameters:
onode- thedraw:aelement- Returns:
- the hyperlink element, if any
-
insertCoverImage
-
flushFullscreenFrames
-
flushFrames
-
handleDrawElement
Convert a draw element to xhtml. The presentation depends on the parameter
nMode:DrawConverter.INLINE: Presented inline. The hnode must accept inline content. An inline container must be provided.DrawConverter.FLOAT: Presented as a float. The hnode must accept block/flow content. A block container must be provided.DrawConverter.ABSOLUTE: Presented at an absolute position. A block container must be provided.
Containers for block and inline elements should be supplied. The containers may be identical (flow container).
Note: A draw:text-box will be ignored in inline mode.
- Parameters:
onode- the draw elementhnodeBlock- the xhtml element to attach the converted element to if it's a block elementhnodeInline- the xhtml element to attach the converted element to if it's an inline elementnMode- identifies how the element should be presented
-