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 009//------------------------------------------------------------------------------ 010/** 011 Represents an Office Open XML paragraph indentation (<w:ind>) tag. 012 013 @author J. Alex Taylor, hairyfatguy.com 014 */ 015//------------------------------------------------------------------------------ 016// com.hfg XML/HTML Coding Library 017// 018// This library is free software; you can redistribute it and/or 019// modify it under the terms of the GNU Lesser General Public 020// License as published by the Free Software Foundation; either 021// version 2.1 of the License, or (at your option) any later version. 022// 023// This library is distributed in the hope that it will be useful, 024// but WITHOUT ANY WARRANTY; without even the implied warranty of 025// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 026// Lesser General Public License for more details. 027// 028// You should have received a copy of the GNU Lesser General Public 029// License along with this library; if not, write to the Free Software 030// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 031// 032// J. Alex Taylor, President, Founder, CEO, COO, CFO, OOPS hairyfatguy.com 033// jataylor@hairyfatguy.com 034//------------------------------------------------------------------------------ 035 036public class WmlIndentation extends XMLTag 037{ 038 039 //########################################################################## 040 // CONSTRUCTORS 041 //########################################################################## 042 043 //--------------------------------------------------------------------------- 044 public WmlIndentation() 045 { 046 super(WmlXML.INDENTATION); 047 } 048 049 //########################################################################## 050 // PUBLIC METHODS 051 //########################################################################## 052 053 //--------------------------------------------------------------------------- 054 /** 055 Specifies the left indentation for this paragraph in absolute units. 056 */ 057 public WmlIndentation setLeft(GfxSize inValue) 058 { 059 setAttribute(WmlXML.LEFT_ATT, inValue.to(GfxUnits.dxa)); 060 return this; 061 } 062 063 //--------------------------------------------------------------------------- 064 /** 065 Specifies the right indentation for this paragraph in absolute units. 066 */ 067 public WmlIndentation setRight(GfxSize inValue) 068 { 069 setAttribute(WmlXML.RIGHT_ATT, inValue.to(GfxUnits.dxa)); 070 return this; 071 } 072 073 //--------------------------------------------------------------------------- 074 /** 075 Specifies the indentation removed from the first line of this paragraph in absolute units. 076 */ 077 public WmlIndentation setHanging(GfxSize inValue) 078 { 079 setAttribute(WmlXML.HANGING_ATT, inValue.to(GfxUnits.dxa)); 080 return this; 081 } 082 083 //--------------------------------------------------------------------------- 084 /** 085 Specifies the indentation added to the first line of this paragraph in absolute units. 086 */ 087 public WmlIndentation setFirstLine(GfxSize inValue) 088 { 089 setAttribute(WmlXML.FIRST_LINE_ATT, inValue.to(GfxUnits.dxa)); 090 return this; 091 } 092 093}