Class PageMarginBoxContextNode
- java.lang.Object
-
- com.itextpdf.styledxmlparser.css.CssContextNode
-
- com.itextpdf.styledxmlparser.css.page.PageMarginBoxContextNode
-
- All Implemented Interfaces:
ICustomElementNode
,IElementNode
,INode
,IStylesContainer
public class PageMarginBoxContextNode extends CssContextNode implements ICustomElementNode
CssContextNode
implementation for page margin box contexts.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
PageMarginBoxContextNode.AttributesStub
A simpleIAttributes
implementation.
-
Field Summary
Fields Modifier and Type Field Description private Rectangle
containingBlockForMarginBox
private java.lang.String
marginBoxName
The margin box name.static java.lang.String
PAGE_MARGIN_BOX_TAG
The Constant PAGE_MARGIN_BOX_TAG.private Rectangle
pageMarginBoxRectangle
-
Constructor Summary
Constructors Constructor Description PageMarginBoxContextNode(INode parentNode, java.lang.String marginBoxName)
Creates a newPageMarginBoxContextNode
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAdditionalHtmlStyles(java.util.Map<java.lang.String,java.lang.String> styles)
Adds additional HTML styles.java.util.List<java.util.Map<java.lang.String,java.lang.String>>
getAdditionalHtmlStyles()
Gets additional styles, more specifically styles that affect an element based on its position in the HTML DOM, e.g.java.lang.String
getAttribute(java.lang.String key)
Gets an attribute.IAttributes
getAttributes()
Gets the attributes.Rectangle
getContainingBlockForMarginBox()
java.lang.String
getLang()
Gets the language.java.lang.String
getMarginBoxName()
Gets the margin box name.Rectangle
getPageMarginBoxRectangle()
Gets the rectangle in which page margin box contents should be shown.java.lang.String
name()
Gets the name of the element node.void
setContainingBlockForMarginBox(Rectangle containingBlockForMarginBox)
Sets the containing block rectangle for the margin box, which is used for calculating some of the margin box properties relative values.void
setPageMarginBoxRectangle(Rectangle pageMarginBoxRectangle)
Sets the rectangle in which page margin box contents are shown.-
Methods inherited from class com.itextpdf.styledxmlparser.css.CssContextNode
addChild, childNodes, getStyles, parentNode, setStyles
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.itextpdf.styledxmlparser.node.INode
addChild, childNodes, parentNode
-
Methods inherited from interface com.itextpdf.styledxmlparser.node.IStylesContainer
getStyles, setStyles
-
-
-
-
Field Detail
-
PAGE_MARGIN_BOX_TAG
public static final java.lang.String PAGE_MARGIN_BOX_TAG
The Constant PAGE_MARGIN_BOX_TAG.- See Also:
- Constant Field Values
-
marginBoxName
private java.lang.String marginBoxName
The margin box name.
-
pageMarginBoxRectangle
private Rectangle pageMarginBoxRectangle
-
containingBlockForMarginBox
private Rectangle containingBlockForMarginBox
-
-
Constructor Detail
-
PageMarginBoxContextNode
public PageMarginBoxContextNode(INode parentNode, java.lang.String marginBoxName)
Creates a newPageMarginBoxContextNode
instance.- Parameters:
parentNode
- the parent nodemarginBoxName
- the margin box name
-
-
Method Detail
-
getMarginBoxName
public java.lang.String getMarginBoxName()
Gets the margin box name.- Returns:
- the margin box name
-
setPageMarginBoxRectangle
public void setPageMarginBoxRectangle(Rectangle pageMarginBoxRectangle)
Sets the rectangle in which page margin box contents are shown.- Parameters:
pageMarginBoxRectangle
- theRectangle
defining position and dimensions of the margin box content area
-
getPageMarginBoxRectangle
public Rectangle getPageMarginBoxRectangle()
Gets the rectangle in which page margin box contents should be shown.- Returns:
- the
Rectangle
defining position and dimensions of the margin box content area
-
setContainingBlockForMarginBox
public void setContainingBlockForMarginBox(Rectangle containingBlockForMarginBox)
Sets the containing block rectangle for the margin box, which is used for calculating some of the margin box properties relative values.- Parameters:
containingBlockForMarginBox
- theRectangle
which is used as a reference for some margin box relative properties calculations.
-
getContainingBlockForMarginBox
public Rectangle getContainingBlockForMarginBox()
- Returns:
- the
Rectangle
which is used as a reference for some margin box relative properties calculations.
-
name
public java.lang.String name()
Description copied from interface:IElementNode
Gets the name of the element node.- Specified by:
name
in interfaceIElementNode
- Returns:
- the string
-
getAttributes
public IAttributes getAttributes()
Description copied from interface:IElementNode
Gets the attributes.- Specified by:
getAttributes
in interfaceIElementNode
- Returns:
- the attributes
-
getAttribute
public java.lang.String getAttribute(java.lang.String key)
Description copied from interface:IElementNode
Gets an attribute.- Specified by:
getAttribute
in interfaceIElementNode
- Parameters:
key
- the key of the attribute we want to get- Returns:
- the value of the attribute
-
getAdditionalHtmlStyles
public java.util.List<java.util.Map<java.lang.String,java.lang.String>> getAdditionalHtmlStyles()
Description copied from interface:IElementNode
Gets additional styles, more specifically styles that affect an element based on its position in the HTML DOM, e.g. cell borders that are set due to the parent table "border" attribute, or styles from "col" tags that affect table elements, or blocks horizontal alignment that is the result of parent's "align" attribute.- Specified by:
getAdditionalHtmlStyles
in interfaceIElementNode
- Returns:
- the additional html styles
-
addAdditionalHtmlStyles
public void addAdditionalHtmlStyles(java.util.Map<java.lang.String,java.lang.String> styles)
Description copied from interface:IElementNode
Adds additional HTML styles.- Specified by:
addAdditionalHtmlStyles
in interfaceIElementNode
- Parameters:
styles
- the styles
-
getLang
public java.lang.String getLang()
Description copied from interface:IElementNode
Gets the language.- Specified by:
getLang
in interfaceIElementNode
- Returns:
- the language value
-
-