public class ElementFactory extends Object
Modifier and Type | Field and Description |
---|---|
private FontProvider |
provider
The font provider that will be used to fetch fonts.
|
Constructor and Description |
---|
ElementFactory()
Creates a new instance of FactoryProperties.
|
Modifier and Type | Method and Description |
---|---|
Chunk |
createChunk(String content,
ChainedProperties chain)
Creates an iText Chunk
|
Image |
createImage(String src,
Map<String,String> attrs,
ChainedProperties chain,
DocListener document,
ImageProvider img_provider,
HashMap<String,Image> img_store,
String img_baseurl) |
LineSeparator |
createLineSeparator(Map<String,String> attrs,
float offset)
Creates a LineSeparator.
|
List |
createList(String tag,
ChainedProperties chain) |
ListItem |
createListItem(ChainedProperties chain)
Creates an iText Paragraph object using the properties
of the different tags and properties in the hierarchy chain.
|
Paragraph |
createParagraph(ChainedProperties chain)
Creates an iText Paragraph object using the properties
of the different tags and properties in the hierarchy chain.
|
Font |
getFont(ChainedProperties chain)
Creates a Font object based on a chain of properties.
|
FontProvider |
getFontProvider()
Getter for the font provider
|
HyphenationEvent |
getHyphenation(ChainedProperties chain)
Gets a HyphenationEvent based on the hyphenation entry in
the hierarchy chain.
|
void |
setFontProvider(FontProvider provider)
Setter for the font provider
|
protected static void |
setParagraphLeading(Paragraph paragraph,
String leading)
Sets the leading of a Paragraph object.
|
protected void |
updateElement(Paragraph paragraph,
ChainedProperties chain)
Method that does the actual Element creating for
the createParagraph and createListItem method.
|
private FontProvider provider
public ElementFactory()
public void setFontProvider(FontProvider provider)
provider
- public FontProvider getFontProvider()
public Font getFont(ChainedProperties chain)
chain
- chain of propertiespublic Chunk createChunk(String content, ChainedProperties chain)
content
- the content of the Chunkchain
- the hierarchy chainpublic Paragraph createParagraph(ChainedProperties chain)
chain
- the hierarchy chainpublic ListItem createListItem(ChainedProperties chain)
chain
- the hierarchy chainprotected void updateElement(Paragraph paragraph, ChainedProperties chain)
paragraph
- chain
- protected static void setParagraphLeading(Paragraph paragraph, String leading)
paragraph
- the Paragraph for which we set the leadingleading
- the String value of the leadingpublic HyphenationEvent getHyphenation(ChainedProperties chain)
chain
- the hierarchy chainpublic LineSeparator createLineSeparator(Map<String,String> attrs, float offset)
attrs
- the attributesoffset
- public Image createImage(String src, Map<String,String> attrs, ChainedProperties chain, DocListener document, ImageProvider img_provider, HashMap<String,Image> img_store, String img_baseurl) throws DocumentException, IOException
src
- attrs
- chain
- document
- img_provider
- img_store
- img_baseurl
- DocumentException
IOException
public List createList(String tag, ChainedProperties chain)
tag
- chain
- WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses