Class DrawConverter
- java.lang.Object
-
- writer2latex.xhtml.ConverterHelper
-
- writer2latex.xhtml.DrawConverter
-
public class DrawConverter extends ConverterHelper
-
-
Field Summary
Fields Modifier and Type Field Description static intABSOLUTEIdentifies objects that should be positioned absolute (using the css attribute postion:absolute)static intCENTEREDIdentifies objects that should be placed centeredstatic intFLOATINGIdentifies objects that should be displayed as floats, either alone or with text wrap (using the css attribute float:left or float:right)static intFULL_SCREENIdentifies objects that should fill the entire screenstatic intINLINEIdentifies objects that should be displayed inline.-
Fields inherited from class writer2latex.xhtml.ConverterHelper
config, converter, ofr
-
-
Constructor Summary
Constructors Constructor Description DrawConverter(OfficeReader ofr, XhtmlConfig config, Converter converter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconvertDrawContent(org.w3c.dom.Element onode)org.w3c.dom.ElementcreateForm()Create form, if there is a form in this documentvoidflushFrames(org.w3c.dom.Element hnode)org.w3c.dom.ElementflushFullscreenFrames(org.w3c.dom.Element hnode)org.w3c.dom.ElementgetDrawAnchor(org.w3c.dom.Element onode)A draw element with a hyperlink is represented as two elements, eg.org.w3c.dom.ElementgetRealDrawElement(org.w3c.dom.Element onode)A draw element with a hyperlink is represented as two elements, eg.voidhandleDrawElement(org.w3c.dom.Element onode, org.w3c.dom.Element hnodeBlock, org.w3c.dom.Element hnodeInline, int nMode)Convert a draw element to xhtml.org.w3c.dom.ElementinsertCoverImage(org.w3c.dom.Element hnode)-
Methods inherited from class writer2latex.xhtml.ConverterHelper
applyStyle, getCellSc, getDrawCv, getFrameSc, getHeadingSc, getListSc, getMathCv, getPageSc, getParSc, getPresentationSc, getRowSc, getSectionSc, getStyleCv, getTableCv, getTableSc, getTextCv, getTextSc
-
-
-
-
Field Detail
-
INLINE
public static final int INLINE
Identifies objects that should be displayed inline.- See Also:
- Constant Field Values
-
FLOATING
public static final int FLOATING
Identifies objects that should be displayed as floats, either alone or with text wrap (using the css attribute float:left or float:right)- See Also:
- Constant Field Values
-
ABSOLUTE
public static final int ABSOLUTE
Identifies objects that should be positioned absolute (using the css attribute postion:absolute)- See Also:
- Constant Field Values
-
CENTERED
public static final int CENTERED
Identifies objects that should be placed centered- See Also:
- Constant Field Values
-
FULL_SCREEN
public static final int FULL_SCREEN
Identifies objects that should fill the entire screen- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DrawConverter
public DrawConverter(OfficeReader ofr, XhtmlConfig config, Converter converter)
-
-
Method Detail
-
convertDrawContent
public void convertDrawContent(org.w3c.dom.Element onode)
-
createForm
public org.w3c.dom.Element 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
public org.w3c.dom.Element getRealDrawElement(org.w3c.dom.Element onode)
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
public org.w3c.dom.Element getDrawAnchor(org.w3c.dom.Element onode)
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
public org.w3c.dom.Element insertCoverImage(org.w3c.dom.Element hnode)
-
flushFullscreenFrames
public org.w3c.dom.Element flushFullscreenFrames(org.w3c.dom.Element hnode)
-
flushFrames
public void flushFrames(org.w3c.dom.Element hnode)
-
handleDrawElement
public void handleDrawElement(org.w3c.dom.Element onode, org.w3c.dom.Element hnodeBlock, org.w3c.dom.Element hnodeInline, int nMode)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
-
-