001package com.hfg.xml.msofficexml.docx.wordprocessingml.style; 002 003 004import com.hfg.graphics.units.GfxSize; 005import com.hfg.graphics.units.GfxUnits; 006import com.hfg.xml.XMLTag; 007import com.hfg.xml.msofficexml.docx.wordprocessingml.WmlXML; 008 009public class WmlSpacing extends XMLTag 010{ 011 012 //--------------------------------------------------------------------------- 013 public WmlSpacing() 014 { 015 super(WmlXML.SPACING); 016 } 017 018 //--------------------------------------------------------------------------- 019 /** 020 Specifies the spacing that should be added after the last line in this paragraph 021 in the document in absolute units. 022 */ 023 public WmlSpacing setAfter(GfxSize inValue) 024 { 025 setAttribute(WmlXML.AFTER_ATT, inValue.to(GfxUnits.dxa)); 026 return this; 027 } 028 029 //--------------------------------------------------------------------------- 030 /** 031 Specifies the spacing that should be added above the first line in this paragraph 032 in the document in absolute units. 033 */ 034 public WmlSpacing setBefore(GfxSize inValue) 035 { 036 setAttribute(WmlXML.BEFORE_ATT, inValue.to(GfxUnits.dxa)); 037 return this; 038 } 039 040 //--------------------------------------------------------------------------- 041 /** 042 This attribute specifies the amount of vertical spacing between lines of text within this paragraph. 043 If the value of the lineRule attribute is auto, then the value of the line attribute shall be interpreted 044 as 240ths of a line, in the manner described by the simple type's values. 045 */ 046 public WmlSpacing setLine(GfxSize inValue) 047 { 048 setAttribute(WmlXML.LINE_ATT, inValue.to(GfxUnits.dxa)); 049 return this; 050 } 051 052 //--------------------------------------------------------------------------- 053 /** 054 Specifies as 'auto' how the spacing between lines is calculated as stored in the line attribute. 055 */ 056 public WmlSpacing setAutoLineRule() 057 { 058 setAttribute(WmlXML.LINE_RULE_ATT, "auto"); 059 return this; 060 } 061 062 //--------------------------------------------------------------------------- 063 /** 064 Specifies how the spacing between lines is calculated as stored in the line attribute. 065 */ 066/* public WmlSpacing setLineRule(GfxSize inValue) 067 { 068 setAttribute(WmlXML.LINE_RULE_ATT, inValue.to(GfxUnits.dxa)); 069 return this; 070 } 071*/ 072}