public class XMLBox extends org.docgene.model.AbstractStyledElement implements ParagraphElementParent, org.docgene.model.Alignment
Modifier and Type | Field and Description |
---|---|
static short |
WIDTH_LIMITED
The type where the box width adapts to the text size.
|
static short |
WIDTH_SET
The type where the box width is explictly set.
|
static short |
WIDTH_UNLIMITED
The type where the box width is not limited.
|
TYPE_NONE
Constructor and Description |
---|
XMLBox(short type)
Constructor.
|
XMLBox(short type,
int width,
boolean isRelative)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addElement(ParagraphElement element)
Add an element.
|
char |
getAlignment()
Return the alignment of the box.
|
java.lang.String |
getDeclaration()
Return the declaration ID of the element.
|
java.util.List<ParagraphElement> |
getElements()
Return the list of elements.
|
int |
getWidth()
Return the box width.
|
short |
getWidthType()
Return true if the box width is limited to the content width.
|
boolean |
isRelativeWidth()
Return true if the box width is relative (in %).
|
void |
setAlignment(char align)
Set the alignment of the box.
|
void |
setElements(java.util.List<ParagraphElement> elements)
Set the list of elements.
|
void |
setWidth(int width,
boolean relWidth)
Set the box width.
|
getCustomStyles, getInlinedStyle, setCustomStyles, setInlinedStyle
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
countElements, getElement, getFirstElement, getLastElement, hasElements, isEmpty
getStyle, hasInlinedStyle, setCustomStyles
public static final short WIDTH_LIMITED
public static final short WIDTH_UNLIMITED
public static final short WIDTH_SET
public XMLBox(short type)
type
- the width typepublic XMLBox(short type, int width, boolean isRelative)
type
- the width typewidth
- the specified bow widthisRelative
- true for a relativ widthpublic java.lang.String getDeclaration()
getDeclaration
in interface StyledElement
public short getWidthType()
public void setWidth(int width, boolean relWidth)
width
- the box widthrelWidth
- true if the width is relative (in percent)public int getWidth()
public boolean isRelativeWidth()
public void setAlignment(char align)
setAlignment
in interface org.docgene.model.Alignment
align
- the alignmentAlignment
public char getAlignment()
getAlignment
in interface org.docgene.model.Alignment
Alignment
public void setElements(java.util.List<ParagraphElement> elements)
setElements
in interface ParagraphElementParent
elements
- the list of elementspublic void addElement(ParagraphElement element)
addElement
in interface ParagraphElementParent
element
- the elementpublic java.util.List<ParagraphElement> getElements()
getElements
in interface ParagraphElementParent
Copyright © 2016-2024 Herve Girod. All Rights Reserved. Documentation and source under the BSD licence