Class PageMarginBoxContextNode
- java.lang.Object
-
- com.itextpdf.styledxmlparser.css.CssContextNode
-
- com.itextpdf.styledxmlparser.css.page.PageMarginBoxContextNode
-
- All Implemented Interfaces:
IAttributesContainer,ICustomElementNode,IElementNode,INameContainer,INode,IStylesContainer
public class PageMarginBoxContextNode extends CssContextNode implements ICustomElementNode
CssContextNodeimplementation for page margin box contexts.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classPageMarginBoxContextNode.AttributesStubA simpleIAttributesimplementation.
-
Field Summary
Fields Modifier and Type Field Description private RectanglecontainingBlockForMarginBoxprivate java.lang.StringmarginBoxNameThe margin box name.static java.lang.StringPAGE_MARGIN_BOX_TAGThe Constant PAGE_MARGIN_BOX_TAG.private RectanglepageMarginBoxRectangle
-
Constructor Summary
Constructors Constructor Description PageMarginBoxContextNode(INode parentNode, java.lang.String marginBoxName)Creates a newPageMarginBoxContextNodeinstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAdditionalHtmlStyles(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.StringgetAttribute(java.lang.String key)Gets an attribute.IAttributesgetAttributes()Gets the attributes.RectanglegetContainingBlockForMarginBox()java.lang.StringgetLang()Gets the language.java.lang.StringgetMarginBoxName()Gets the margin box name.RectanglegetPageMarginBoxRectangle()Gets the rectangle in which page margin box contents should be shown.java.lang.Stringname()Gets the name of the element node.voidsetContainingBlockForMarginBox(Rectangle containingBlockForMarginBox)Sets the containing block rectangle for the margin box, which is used for calculating some of the margin box properties relative values.voidsetPageMarginBoxRectangle(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 newPageMarginBoxContextNodeinstance.- 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- theRectangledefining 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
Rectangledefining 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- theRectanglewhich is used as a reference for some margin box relative properties calculations.
-
getContainingBlockForMarginBox
public Rectangle getContainingBlockForMarginBox()
- Returns:
- the
Rectanglewhich is used as a reference for some margin box relative properties calculations.
-
name
public java.lang.String name()
Description copied from interface:INameContainerGets the name of the element node.- Specified by:
namein interfaceINameContainer- Returns:
- the string
-
getAttributes
public IAttributes getAttributes()
Description copied from interface:IAttributesContainerGets the attributes.- Specified by:
getAttributesin interfaceIAttributesContainer- Returns:
- the attributes
-
getAttribute
public java.lang.String getAttribute(java.lang.String key)
Description copied from interface:IAttributesContainerGets an attribute.- Specified by:
getAttributein interfaceIAttributesContainer- 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:IElementNodeGets 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:
getAdditionalHtmlStylesin interfaceIElementNode- Returns:
- the additional html styles
-
addAdditionalHtmlStyles
public void addAdditionalHtmlStyles(java.util.Map<java.lang.String,java.lang.String> styles)
Description copied from interface:IElementNodeAdds additional HTML styles.- Specified by:
addAdditionalHtmlStylesin interfaceIElementNode- Parameters:
styles- the styles
-
getLang
public java.lang.String getLang()
Description copied from interface:IElementNodeGets the language.- Specified by:
getLangin interfaceIElementNode- Returns:
- the language value
-
-