/** * This implementation processes paragraph attributes that are relevant to the <p> tag, as * well as delegates to the parent class to process text leaft attributes that are also relevant * to the <p> tag. * * <p>Paragraph attributes include: * * <ul> * <li><b>textAlign</b> (String): [left, center, right, justify] The alignment of the text * relative to the text box edges. Default is left. * <li><b>textAlignLast</b> (String): [left, center, right, justify]: The alignment of the last * line of the paragraph, applies if textAlign is justify. Default is left. * <li><b>textIndent</b> (Number): The indentation of the first line of text in a paragraph. The * indent is relative to the left margin. Measured in pixels. Default is 0. Can be negative. * <li><b>marginLeft</b> (Number): The indentation applied to the left edge. Measured in pixels. * Default is 0. * <li><b>marginRight</b> (Number): The indentation applied to the right edge. Measured in * pixels. Default is 0. * <li><b>marginTop</b> (Number): This is the "space before" the paragraph. Default is 0. * Minimum is 0. * <li><b>marginBottom</b> (Number): This is the "spaceAfter" the paragraph. Default is 0. * Minimum is 0. * <li><b>direction</b> (String): [ltr, rtl] Controls the dominant writing direction for the * paragraphs (left-to-right or right-to-left), Default is ltr. * <li><b>blockProgression</b> (String): [tb, rl] Controls the direction in which lines are * stacked. * </ul> * * @param name the attribute name * @param value the attribute value * @see AbstractTextNode#setAttribute(String, String) */ @Override public void setAttribute(String name, String value) { if (FXG_TEXTALIGN_ATTRIBUTE.equals(name)) { textAlign = TextHelper.getTextAlign(this, value); } else if (FXG_TEXTALIGNLAST_ATTRIBUTE.equals(name)) { textAlignLast = TextHelper.getTextAlign(this, value); } else if (FXG_TEXTINDENT_ATTRIBUTE.equals(name)) { textIndent = DOMParserHelper.parseDouble( this, value, name, TEXTINDENT_MIN_INCLUSIVE, TEXTINDENT_MAX_INCLUSIVE, textIndent); } else if (FXG_PARAGRAPHSTARTINDENT_ATTRIBUTE.equals(name)) { paragraphStartIndent = DOMParserHelper.parseDouble( this, value, name, PARAGRAPH_INDENT_MIN_INCLUSIVE, PARAGRAPH_INDENT_MAX_INCLUSIVE, paragraphStartIndent); } else if (FXG_PARAGRAPHENDINDENT_ATTRIBUTE.equals(name)) { paragraphEndIndent = DOMParserHelper.parseDouble( this, value, name, PARAGRAPH_INDENT_MIN_INCLUSIVE, PARAGRAPH_INDENT_MAX_INCLUSIVE, paragraphEndIndent); } else if (FXG_PARAGRAPHSPACEBEFORE_ATTRIBUTE.equals(name)) { paragraphSpaceBefore = DOMParserHelper.parseDouble( this, value, name, PARAGRAPH_SPACE_MIN_INCLUSIVE, PARAGRAPH_SPACE_MAX_INCLUSIVE, paragraphSpaceBefore); } else if (FXG_PARAGRAPHSPACEAFTER_ATTRIBUTE.equals(name)) { paragraphSpaceAfter = DOMParserHelper.parseDouble( this, value, name, PARAGRAPH_SPACE_MIN_INCLUSIVE, PARAGRAPH_SPACE_MAX_INCLUSIVE, paragraphSpaceAfter); } else if (FXG_DIRECTION_ATTRIBUTE.equals(name)) { direction = TextHelper.getDirection(this, value); } else if (FXG_JUSTIFICATIONRULE_ATTRIBUTE.equals(name)) { justificationRule = TextHelper.getJustificationRule(this, value); } else if (FXG_JUSTIFICATIONSTYLE_ATTRIBUTE.equals(name)) { justificationStyle = TextHelper.getJustificationStyle(this, value); } else if (FXG_TEXTJUSTIFY_ATTRIBUTE.equals(name)) { textJustify = TextHelper.getTextJustify(this, value); } else if (FXG_LEADINGMODEL_ATTRIBUTE.equals(name)) { leadingModel = TextHelper.getLeadingModel(this, value); } else if (FXG_TABSTOPS_ATTRIBUTE.equals(name)) { tabStops = value; } else { super.setAttribute(name, value); return; } // Remember attribute was set on this node. rememberAttribute(name, value); }