]> _ Git - cubeextranet.git/blob
fd9a4c2192e239924e0f47ca6d1efd8de09edc56
[cubeextranet.git] /
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements.  See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License.  You may obtain a copy of the License at
8  *
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 package org.apache.pdfbox.pdmodel.documentinterchange.taggedpdf;
18
19 import org.apache.pdfbox.cos.COSArray;
20 import org.apache.pdfbox.cos.COSBase;
21 import org.apache.pdfbox.cos.COSDictionary;
22 import org.apache.pdfbox.pdmodel.common.PDRectangle;
23 import org.apache.pdfbox.pdmodel.graphics.color.PDGamma;
24
25 /**
26  * A Layout attribute object.
27  * 
28  * @author <a href="mailto:Johannes%20Koch%20%3Ckoch@apache.org%3E">Johannes Koch</a>
29  * @version $Revision: $
30  */
31 public class PDLayoutAttributeObject extends PDStandardAttributeObject
32 {
33
34     /**
35      * standard attribute owner: Layout
36      */
37     public static final String OWNER_LAYOUT = "Layout";
38
39     private static final String PLACEMENT                    = "Placement";
40     private static final String WRITING_MODE                 = "WritingMode";
41     private static final String BACKGROUND_COLOR             = "BackgroundColor";
42     private static final String BORDER_COLOR                 = "BorderColor";
43     private static final String BORDER_STYLE                 = "BorderStyle";
44     private static final String BORDER_THICKNESS             = "BorderThickness";
45     private static final String PADDING                      = "Padding";
46     private static final String COLOR                        = "Color";
47     private static final String SPACE_BEFORE                 = "SpaceBefore";
48     private static final String SPACE_AFTER                  = "SpaceAfter";
49     private static final String START_INDENT                 = "StartIndent";
50     private static final String END_INDENT                   = "EndIndent";
51     private static final String TEXT_INDENT                  = "TextIndent";
52     private static final String TEXT_ALIGN                   = "TextAlign";
53     private static final String BBOX                         = "BBox";
54     private static final String WIDTH                        = "Width";
55     private static final String HEIGHT                       = "Height";
56     private static final String BLOCK_ALIGN                  = "BlockAlign";
57     private static final String INLINE_ALIGN                 = "InlineAlign";
58     private static final String T_BORDER_STYLE               = "TBorderStyle";
59     private static final String T_PADDING                    = "TPadding";
60     private static final String BASELINE_SHIFT               = "BaselineShift";
61     private static final String LINE_HEIGHT                  = "LineHeight";
62     private static final String TEXT_DECORATION_COLOR        = "TextDecorationColor";
63     private static final String TEXT_DECORATION_THICKNESS    = "TextDecorationThickness";
64     private static final String TEXT_DECORATION_TYPE         = "TextDecorationType";
65     private static final String RUBY_ALIGN                   = "RubyAlign";
66     private static final String RUBY_POSITION                = "RubyPosition";
67     private static final String GLYPH_ORIENTATION_VERTICAL   = "GlyphOrientationVertical";
68     private static final String COLUMN_COUNT                 = "ColumnCount";
69     private static final String COLUMN_GAP                   = "ColumnGap";
70     private static final String COLUMN_WIDTHS                = "ColumnWidths";
71
72     /**
73      * Placement: Block: Stacked in the block-progression direction within an
74      * enclosing reference area or parent BLSE.
75      */
76     public static final String PLACEMENT_BLOCK                 = "Block";
77     /**
78      * Placement: Inline: Packed in the inline-progression direction within an
79      * enclosing BLSE.
80      */
81     public static final String PLACEMENT_INLINE                = "Inline";
82     /**
83      * Placement: Before: Placed so that the before edge of the element’s
84      * allocation rectangle coincides with that of the nearest enclosing
85      * reference area. The element may float, if necessary, to achieve the
86      * specified placement. The element shall be treated as a block occupying
87      * the full extent of the enclosing reference area in the inline direction.
88      * Other content shall be stacked so as to begin at the after edge of the
89      * element’s allocation rectangle.
90      */
91     public static final String PLACEMENT_BEFORE                = "Before";
92     /**
93      * Placement: Start: Placed so that the start edge of the element’s
94      * allocation rectangle coincides with that of the nearest enclosing
95      * reference area. The element may float, if necessary, to achieve the
96      * specified placement. Other content that would intrude into the element’s
97      * allocation rectangle shall be laid out as a runaround.
98      */
99     public static final String PLACEMENT_START                 = "Start";
100     /**
101      * Placement: End: Placed so that the end edge of the element’s allocation
102      * rectangle coincides with that of the nearest enclosing reference area.
103      * The element may float, if necessary, to achieve the specified placement.
104      * Other content that would intrude into the element’s allocation rectangle
105      * shall be laid out as a runaround.
106      */
107     public static final String PLACEMENT_END                   = "End";
108     /**
109      * WritingMode: LrTb: Inline progression from left to right; block
110      * progression from top to bottom. This is the typical writing mode for
111      * Western writing systems.
112      */
113     public static final String WRITING_MODE_LRTB               = "LrTb";
114     /**
115      * WritingMode: RlTb: Inline progression from right to left; block
116      * progression from top to bottom. This is the typical writing mode for
117      * Arabic and Hebrew writing systems.
118      */
119     public static final String WRITING_MODE_RLTB               = "RlTb";
120     /**
121      * WritingMode: TbRl: Inline progression from top to bottom; block
122      * progression from right to left. This is the typical writing mode for
123      * Chinese and Japanese writing systems.
124      */
125     public static final String WRITING_MODE_TBRL               = "TbRl";
126     /**
127      * BorderStyle: None: No border. Forces the computed value of
128      * BorderThickness to be 0.
129      */
130     public static final String BORDER_STYLE_NONE               = "None";
131     /**
132      * BorderStyle: Hidden: Same as {@link #BORDER_STYLE_NONE}, except in terms
133      * of border conflict resolution for table elements.
134      */
135     public static final String BORDER_STYLE_HIDDEN             = "Hidden";
136     /**
137      * BorderStyle: Dotted: The border is a series of dots.
138      */
139     public static final String BORDER_STYLE_DOTTED             = "Dotted";
140     /**
141      * BorderStyle: Dashed: The border is a series of short line segments.
142      */
143     public static final String BORDER_STYLE_DASHED             = "Dashed";
144     /**
145      * BorderStyle: Solid: The border is a single line segment.
146      */
147     public static final String BORDER_STYLE_SOLID              = "Solid";
148     /**
149      * BorderStyle: Double: The border is two solid lines. The sum of the two
150      * lines and the space between them equals the value of BorderThickness.
151      */
152     public static final String BORDER_STYLE_DOUBLE             = "Double";
153     /**
154      * BorderStyle: Groove: The border looks as though it were carved into the
155      * canvas.
156      */
157     public static final String BORDER_STYLE_GROOVE             = "Groove";
158     /**
159      * BorderStyle: Ridge: The border looks as though it were coming out of the
160      * canvas (the opposite of {@link #BORDER_STYLE_GROOVE}).
161      */
162     public static final String BORDER_STYLE_RIDGE              = "Ridge";
163     /**
164      * BorderStyle: Inset: The border makes the entire box look as though it
165      * were embedded in the canvas.
166      */
167     public static final String BORDER_STYLE_INSET              = "Inset";
168     /**
169      * BorderStyle: Outset: The border makes the entire box look as though it
170      * were coming out of the canvas (the opposite of {@link #BORDER_STYLE_INSET}.
171      */
172     public static final String BORDER_STYLE_OUTSET             = "Outset";
173     /**
174      * TextAlign: Start: Aligned with the start edge.
175      */
176     public static final String TEXT_ALIGN_START                = "Start";
177     /**
178      * TextAlign: Center: Centered between the start and end edges.
179      */
180     public static final String TEXT_ALIGN_CENTER               = "Center";
181     /**
182      * TextAlign: End: Aligned with the end edge.
183      */
184     public static final String TEXT_ALIGN_END                  = "End";
185     /**
186      * TextAlign: Justify: Aligned with both the start and end edges, with
187      * internal spacing within each line expanded, if necessary, to achieve such
188      * alignment. The last (or only) line shall be aligned with the start edge
189      * only.
190      */
191     public static final String TEXT_ALIGN_JUSTIFY              = "Justify";
192     /**
193      * Width: Auto
194      */
195     public static final String WIDTH_AUTO                      = "Auto";
196     /**
197      * Height: Auto
198      */
199     public static final String HEIGHT_AUTO                     = "Auto";
200     /**
201      * BlockAlign: Before: Before edge of the first child’s allocation rectangle
202      * aligned with that of the table cell’s content rectangle.
203      */
204     public static final String BLOCK_ALIGN_BEFORE              = "Before";
205     /**
206      * BlockAlign: Middle: Children centered within the table cell. The distance
207      * between the before edge of the first child’s allocation rectangle and
208      * that of the table cell’s content rectangle shall be the same as the
209      * distance between the after edge of the last child’s allocation rectangle
210      * and that of the table cell’s content rectangle.
211      */
212     public static final String BLOCK_ALIGN_MIDDLE              = "Middle";
213     /**
214      * BlockAlign: After: After edge of the last child’s allocation rectangle
215      * aligned with that of the table cell’s content rectangle.
216      */
217     public static final String BLOCK_ALIGN_AFTER               = "After";
218     /**
219      * BlockAlign: Justify: Children aligned with both the before and after
220      * edges of the table cell’s content rectangle. The first child shall be
221      * placed as described for {@link #BLOCK_ALIGN_BEFORE} and the last child as
222      * described for {@link #BLOCK_ALIGN_AFTER}, with equal spacing between the
223      * children. If there is only one child, it shall be aligned with the before
224      * edge only, as for {@link #BLOCK_ALIGN_BEFORE}.
225      */
226     public static final String BLOCK_ALIGN_JUSTIFY             = "Justify";
227     /**
228      * InlineAlign: Start: Start edge of each child’s allocation rectangle
229      * aligned with that of the table cell’s content rectangle.
230      */
231     public static final String INLINE_ALIGN_START              = "Start";
232     /**
233      * InlineAlign: Center: Each child centered within the table cell. The
234      * distance between the start edges of the child’s allocation rectangle and
235      * the table cell’s content rectangle shall be the same as the distance
236      * between their end edges.
237      */
238     public static final String INLINE_ALIGN_CENTER             = "Center";
239     /**
240      * InlineAlign: End: End edge of each child’s allocation rectangle aligned
241      * with that of the table cell’s content rectangle.
242      */
243     public static final String INLINE_ALIGN_END                = "End";
244     /**
245      * LineHeight: NormalAdjust the line height to include any nonzero value
246      * specified for BaselineShift.
247      */
248     public static final String LINE_HEIGHT_NORMAL              = "Normal";
249     /**
250      * LineHeight: Auto: Adjustment for the value of BaselineShift shall not be
251      * made.
252      */
253     public static final String LINE_HEIGHT_AUTO                = "Auto";
254     /**
255      * TextDecorationType: None: No text decoration
256      */
257     public static final String TEXT_DECORATION_TYPE_NONE       = "None";
258     /**
259      * TextDecorationType: Underline: A line below the text
260      */
261     public static final String TEXT_DECORATION_TYPE_UNDERLINE  = "Underline";
262     /**
263      * TextDecorationType: Overline: A line above the text
264      */
265     public static final String TEXT_DECORATION_TYPE_OVERLINE   = "Overline";
266     /**
267      * TextDecorationType: LineThrough: A line through the middle of the text
268      */
269     public static final String TEXT_DECORATION_TYPE_LINE_THROUGH = "LineThrough";
270     /**
271      * RubyAlign: Start: The content shall be aligned on the start edge in the
272      * inline-progression direction.
273      */
274     public static final String RUBY_ALIGN_START                = "Start";
275     /**
276      * RubyAlign: Center: The content shall be centered in the
277      * inline-progression direction.
278      */
279     public static final String RUBY_ALIGN_CENTER               = "Center";
280     /**
281      * RubyAlign: End: The content shall be aligned on the end edge in the
282      * inline-progression direction.
283      */
284     public static final String RUBY_ALIGN_END                  = "End";
285     /**
286      * RubyAlign: Justify:  The content shall be expanded to fill the available
287      * width in the inline-progression direction.
288      */
289     public static final String RUBY_ALIGN_JUSTIFY              = "Justify";
290     /**
291      * RubyAlign: Distribute: The content shall be expanded to fill the
292      * available width in the inline-progression direction. However, space shall
293      * also be inserted at the start edge and end edge of the text. The spacing
294      * shall be distributed using a 1:2:1 (start:infix:end) ratio. It shall be
295      * changed to a 0:1:1 ratio if the ruby appears at the start of a text line
296      * or to a 1:1:0 ratio if the ruby appears at the end of the text line.
297      */
298     public static final String RUBY_ALIGN_DISTRIBUTE           = "Distribute";
299     /**
300      * RubyPosition: Before: The RT content shall be aligned along the before
301      * edge of the element.
302      */
303     public static final String RUBY_POSITION_BEFORE            = "Before";
304     /**
305      * RubyPosition: After: The RT content shall be aligned along the after edge
306      * of the element.
307      */
308     public static final String RUBY_POSITION_AFTER             = "After";
309     /**
310      * RubyPosition: Warichu: The RT and associated RP elements shall be
311      * formatted as a warichu, following the RB element.
312      */
313     public static final String RUBY_POSITION_WARICHU           = "Warichu";
314     /**
315      * RubyPosition: Inline: The RT and associated RP elements shall be
316      * formatted as a parenthesis comment, following the RB element.
317      */
318     public static final String RUBY_POSITION_INLINE            = "Inline";
319     /**
320      * GlyphOrientationVertical: Auto
321      */
322     public static final String GLYPH_ORIENTATION_VERTICAL_AUTO = "Auto";
323     /**
324      * GlyphOrientationVertical: -180°
325      */
326     public static final String GLYPH_ORIENTATION_VERTICAL_MINUS_180_DEGREES = "-180";
327     /**
328      * GlyphOrientationVertical: -90°
329      */
330     public static final String GLYPH_ORIENTATION_VERTICAL_MINUS_90_DEGREES = "-90";
331     /**
332      * GlyphOrientationVertical: 0°
333      */
334     public static final String GLYPH_ORIENTATION_VERTICAL_ZERO_DEGREES = "0";
335     /**
336      * GlyphOrientationVertical: 90°
337      */
338     public static final String GLYPH_ORIENTATION_VERTICAL_90_DEGREES = "90";
339     /**
340      * GlyphOrientationVertical: 180°
341      */
342     public static final String GLYPH_ORIENTATION_VERTICAL_180_DEGREES = "180";
343     /**
344      * GlyphOrientationVertical: 270°
345      */
346     public static final String GLYPH_ORIENTATION_VERTICAL_270_DEGREES = "270";
347     /**
348      * GlyphOrientationVertical: 360°
349      */
350     public static final String GLYPH_ORIENTATION_VERTICAL_360_DEGREES = "360";
351
352
353     /**
354      * Default constructor.
355      */
356     public PDLayoutAttributeObject()
357     {
358         this.setOwner(OWNER_LAYOUT);
359     }
360
361     /**
362      * Creates a new Layout attribute object with a given dictionary.
363      * 
364      * @param dictionary the dictionary
365      */
366     public PDLayoutAttributeObject(COSDictionary dictionary)
367     {
368         super(dictionary);
369     }
370
371
372     /**
373      * Gets the positioning of the element with respect to the enclosing
374      * reference area and other content (Placement). The default value is
375      * {@link #PLACEMENT_INLINE}.
376      * 
377      * @return the placement
378      */
379     public String getPlacement()
380     {
381         return this.getName(PLACEMENT, PLACEMENT_INLINE);
382     }
383
384     /**
385      * Sets the positioning of the element with respect to the enclosing
386      * reference area and other content (Placement). The value should be one of:
387      * <ul>
388      *   <li>{@link #PLACEMENT_BLOCK},</li>
389      *   <li>{@link #PLACEMENT_INLINE},</li>
390      *   <li>{@link #PLACEMENT_BEFORE},</li>
391      *   <li>{@link #PLACEMENT_START},</li>
392      *   <li>{@link #PLACEMENT_END}.</li>
393      * <ul>
394      * 
395      * @param placement the placement
396      */
397     public void setPlacement(String placement)
398     {
399         this.setName(PLACEMENT, placement);
400     }
401
402     /**
403      * Gets the writing mode (WritingMode). The default value is
404      * {@link #WRITING_MODE_LRTB}.
405      * 
406      * @return the writing mode
407      */
408     public String getWritingMode()
409     {
410         return this.getName(WRITING_MODE, WRITING_MODE_LRTB);
411     }
412
413     /**
414      * Sets the writing mode (WritingMode). The value should be one of:
415      * <ul>
416      *   <li>{@link #WRITING_MODE_LRTB},</li>
417      *   <li>{@link #WRITING_MODE_RLTB},</li>
418      *   <li>{@link #WRITING_MODE_TBRL}.</li>
419      * </ul>
420      * 
421      * @param writingMode the writing mode
422      */
423     public void setWritingMode(String writingMode)
424     {
425         this.setName(WRITING_MODE, writingMode);
426     }
427
428     /**
429      * Gets the background colour (BackgroundColor).
430      * 
431      * @return the background colour
432      */
433     public PDGamma getBackgroundColor()
434     {
435         return this.getColor(BACKGROUND_COLOR);
436     }
437
438     /**
439      * Sets the background colour (BackgroundColor).
440      * 
441      * @param backgroundColor the background colour
442      */
443     public void setBackgroundColor(PDGamma backgroundColor)
444     {
445         this.setColor(BACKGROUND_COLOR, backgroundColor);
446     }
447
448     /**
449      * Gets the border colour (BorderColor).
450      * 
451      * @return a single border colour ({@link PDGamma}) or four border colours
452      *  ({@link PDFourColours})
453      */
454     public Object getBorderColors()
455     {
456         return this.getColorOrFourColors(BORDER_COLOR);
457     }
458
459     /**
460      * Sets the same border colour for all four sides (BorderColor).
461      * 
462      * @param borderColor the border colour
463      */
464     public void setAllBorderColors(PDGamma borderColor)
465     {
466         this.setColor(BORDER_COLOR, borderColor);
467     }
468
469     /**
470      * Sets the border colours for four sides separately (BorderColor).
471      * 
472      * @param borderColors the border colours
473      */
474     public void setBorderColors(PDFourColours borderColors)
475     {
476         this.setFourColors(BORDER_COLOR, borderColors);
477     }
478
479     /**
480      * Gets the border style (BorderStyle). The default value is
481      * {@link #BORDER_STYLE_NONE}.
482      * 
483      * @return the border styles (a String or an array of four Strings)
484      */
485     public Object getBorderStyle()
486     {
487         return this.getNameOrArrayOfName(BORDER_STYLE, BORDER_STYLE_NONE);
488     }
489
490     /**
491      * Sets the same border style for all four sides (BorderStyle). The value
492      * should be one of:
493      * <ul>
494      *   <li>{@link #BORDER_STYLE_NONE},</li>
495      *   <li>{@link #BORDER_STYLE_HIDDEN},</li>
496      *   <li>{@link #BORDER_STYLE_DOTTED},</li>
497      *   <li>{@link #BORDER_STYLE_DASHED},</li>
498      *   <li>{@link #BORDER_STYLE_SOLID},</li>
499      *   <li>{@link #BORDER_STYLE_DOUBLE},</li>
500      *   <li>{@link #BORDER_STYLE_GROOVE},</li>
501      *   <li>{@link #BORDER_STYLE_RIDGE},</li>
502      *   <li>{@link #BORDER_STYLE_INSET},</li>
503      *   <li>{@link #BORDER_STYLE_OUTSET}.</li>
504      * </ul>
505      * 
506      * @param borderStyle the border style
507      */
508     public void setAllBorderStyles(String borderStyle)
509     {
510         this.setName(BORDER_STYLE, borderStyle);
511     }
512
513     /**
514      * Sets the border styles for four sides separately (BorderStyle). The
515      * values should be of:
516      * <ul>
517      *   <li>{@link #BORDER_STYLE_NONE},</li>
518      *   <li>{@link #BORDER_STYLE_HIDDEN},</li>
519      *   <li>{@link #BORDER_STYLE_DOTTED},</li>
520      *   <li>{@link #BORDER_STYLE_DASHED},</li>
521      *   <li>{@link #BORDER_STYLE_SOLID},</li>
522      *   <li>{@link #BORDER_STYLE_DOUBLE},</li>
523      *   <li>{@link #BORDER_STYLE_GROOVE},</li>
524      *   <li>{@link #BORDER_STYLE_RIDGE},</li>
525      *   <li>{@link #BORDER_STYLE_INSET},</li>
526      *   <li>{@link #BORDER_STYLE_OUTSET}.</li>
527      * </ul>
528      * 
529      * @param borderStyles the border styles (an array of four Strings)
530      */
531     public void setBorderStyles(String[] borderStyles)
532     {
533         this.setArrayOfName(BORDER_STYLE, borderStyles);
534     }
535
536     /**
537      * Gets the border thickness (BorderThickness).
538      * 
539      * @return the border thickness (a Float or an array of four floats)
540      */
541     public Object getBorderThickness()
542     {
543         return this.getNumberOrArrayOfNumber(BORDER_THICKNESS, UNSPECIFIED);
544     }
545
546     /**
547      * Sets the same border thickness for all four sides (BorderThickness).
548      * 
549      * @param borderThickness the border thickness
550      */
551     public void setAllBorderThicknesses(float borderThickness)
552     {
553         this.setNumber(BORDER_THICKNESS, borderThickness);
554     }
555
556     /**
557      * Sets the same border thickness for all four sides (BorderThickness).
558      * 
559      * @param borderThickness the border thickness
560      */
561     public void setAllBorderThicknesses(int borderThickness)
562     {
563         this.setNumber(BORDER_THICKNESS, borderThickness);
564     }
565
566     /**
567      * Sets the border thicknesses for four sides separately (BorderThickness).
568      * 
569      * @param borderThicknesses the border thickness (an array of four floats)
570      */
571     public void setBorderThicknesses(float[] borderThicknesses)
572     {
573         this.setArrayOfNumber(BORDER_THICKNESS, borderThicknesses);
574     }
575
576     /**
577      * Gets the padding (Padding). The default value is 0.
578      * 
579      * @return the padding (a Float or an array of float)
580      */
581     public Object getPadding()
582     {
583         return this.getNumberOrArrayOfNumber(PADDING, 0.f);
584     }
585
586     /**
587      * Sets the same padding for all four sides (Padding).
588      * 
589      * @param padding the padding
590      */
591     public void setAllPaddings(float padding)
592     {
593         this.setNumber(PADDING, padding);
594     }
595
596     /**
597      * Sets the same padding for all four sides (Padding).
598      * 
599      * @param padding the padding
600      */
601     public void setAllPaddings(int padding)
602     {
603         this.setNumber(PADDING, padding);
604     }
605
606     /**
607      * Sets the paddings for four sides separately (Padding).
608      * 
609      * @param paddings the paddings (an array of four floats)
610      */
611     public void setPaddings(float[] paddings)
612     {
613         this.setArrayOfNumber(PADDING, paddings);
614     }
615
616     /**
617      * Gets the color to be used for drawing text and the default value for the
618      * colour of table borders and text decorations (Color).
619      * 
620      * @return the colour
621      */
622     public PDGamma getColor()
623     {
624         return this.getColor(COLOR);
625     }
626
627     /**
628      * Sets the color to be used for drawing text and the default value for the
629      * colour of table borders and text decorations (Color).
630      * 
631      * @param color the colour
632      */
633     public void setColor(PDGamma color)
634     {
635         this.setColor(COLOR, color);
636     }
637
638     /**
639      * Gets the amount of extra space preceding the before edge of the BLSE in
640      * the block-progression direction (SpaceBefore). The default value is 0.
641      * 
642      * @return the space before
643      */
644     public float getSpaceBefore()
645     {
646         return this.getNumber(SPACE_BEFORE, 0.f);
647     }
648
649     /**
650      * Sets the amount of extra space preceding the before edge of the BLSE in
651      * the block-progression direction (SpaceBefore).
652      * 
653      * @param spaceBefore the space before
654      */
655     public void setSpaceBefore(float spaceBefore)
656     {
657         this.setNumber(SPACE_BEFORE, spaceBefore);
658     }
659
660     /**
661      * Sets the amount of extra space preceding the before edge of the BLSE in
662      * the block-progression direction (SpaceBefore).
663      * 
664      * @param spaceBefore the space before
665      */
666     public void setSpaceBefore(int spaceBefore)
667     {
668         this.setNumber(SPACE_BEFORE, spaceBefore);
669     }
670
671     /**
672      * Gets the amount of extra space following the after edge of the BLSE in
673      * the block-progression direction (SpaceAfter). The default value is 0.
674      * 
675      * @return the space after
676      */
677     public float getSpaceAfter()
678     {
679         return this.getNumber(SPACE_AFTER, 0.f);
680     }
681
682     /**
683      * Sets the amount of extra space following the after edge of the BLSE in
684      * the block-progression direction (SpaceAfter).
685      * 
686      * @param spaceAfter the space after
687      */
688     public void setSpaceAfter(float spaceAfter)
689     {
690         this.setNumber(SPACE_AFTER, spaceAfter);
691     }
692
693     /**
694      * Sets the amount of extra space following the after edge of the BLSE in
695      * the block-progression direction (SpaceAfter).
696      * 
697      * @param spaceAfter the space after
698      */
699     public void setSpaceAfter(int spaceAfter)
700     {
701         this.setNumber(SPACE_AFTER, spaceAfter);
702     }
703
704     /**
705      * Gets the distance from the start edge of the reference area to that of
706      * the BLSE in the inline-progression direction (StartIndent). The default value is 0.
707      * 
708      * @return the start indent
709      */
710     public float getStartIndent()
711     {
712         return this.getNumber(START_INDENT, 0.f);
713     }
714
715     /**
716      * Sets the distance from the start edge of the reference area to that of
717      * the BLSE in the inline-progression direction (StartIndent).
718      * 
719      * @param startIndent the start indent
720      */
721     public void setStartIndent(float startIndent)
722     {
723         this.setNumber(START_INDENT, startIndent);
724     }
725
726     /**
727      * Sets the distance from the start edge of the reference area to that of
728      * the BLSE in the inline-progression direction (StartIndent).
729      * 
730      * @param startIndent the start indent
731      */
732     public void setStartIndent(int startIndent)
733     {
734         this.setNumber(START_INDENT, startIndent);
735     }
736
737     /**
738      * Gets the distance from the end edge of the BLSE to that of the reference
739      * area in the inline-progression direction (EndIndent). The default value
740      * is 0.
741      * 
742      * @return the end indent
743      */
744     public float getEndIndent()
745     {
746         return this.getNumber(END_INDENT, 0.f);
747     }
748
749     /**
750      * Sets the distance from the end edge of the BLSE to that of the reference
751      * area in the inline-progression direction (EndIndent).
752      * 
753      * @param endIndent the end indent
754      */
755     public void setEndIndent(float endIndent)
756     {
757         this.setNumber(END_INDENT, endIndent);
758     }
759
760     /**
761      * Sets the distance from the end edge of the BLSE to that of the reference
762      * area in the inline-progression direction (EndIndent).
763      * 
764      * @param endIndent the end indent
765      */
766     public void setEndIndent(int endIndent)
767     {
768         this.setNumber(END_INDENT, endIndent);
769     }
770
771     /**
772      * Gets the additional distance in the inline-progression direction from the
773      * start edge of the BLSE, as specified by StartIndent, to that of the first
774      * line of text (TextIndent). The default value is 0.
775      * 
776      * @return the text indent
777      */
778     public float getTextIndent()
779     {
780         return this.getNumber(TEXT_INDENT, 0.f);
781     }
782
783     /**
784      * Sets the additional distance in the inline-progression direction from the
785      * start edge of the BLSE, as specified by StartIndent, to that of the first
786      * line of text (TextIndent).
787      * 
788      * @param textIndent the text indent
789      */
790     public void setTextIndent(float textIndent)
791     {
792         this.setNumber(TEXT_INDENT, textIndent);
793     }
794
795     /**
796      * Sets the additional distance in the inline-progression direction from the
797      * start edge of the BLSE, as specified by StartIndent, to that of the first
798      * line of text (TextIndent).
799      * 
800      * @param textIndent the text indent
801      */
802     public void setTextIndent(int textIndent)
803     {
804         this.setNumber(TEXT_INDENT, textIndent);
805     }
806
807     /**
808      * Gets the alignment, in the inline-progression direction, of text and
809      * other content within lines of the BLSE (TextAlign). The default value is
810      * {@link #TEXT_ALIGN_START}.
811      * 
812      * @return the text alignment
813      */
814     public String getTextAlign()
815     {
816         return this.getName(TEXT_ALIGN, TEXT_ALIGN_START);
817     }
818
819     /**
820      * Sets the alignment, in the inline-progression direction, of text and
821      * other content within lines of the BLSE (TextAlign). The value should be
822      * one of:
823      * <ul>
824      *   <li>{@link #TEXT_ALIGN_START},</li>
825      *   <li>{@link #TEXT_ALIGN_CENTER},</li>
826      *   <li>{@link #TEXT_ALIGN_END},</li>
827      *   <li>{@link #TEXT_ALIGN_JUSTIFY}.</li>
828      * </ul>
829      * 
830      * @param textIndent the text alignment
831      */
832     public void setTextAlign(String textIndent)
833     {
834         this.setName(TEXT_ALIGN, textIndent);
835     }
836
837     /**
838      * Gets the bounding box.
839      * 
840      * @return the bounding box.
841      */
842     public PDRectangle getBBox()
843     {
844         COSArray array =
845             (COSArray) this.getCOSDictionary().getDictionaryObject(BBOX);
846         if (array != null)
847         {
848             return new PDRectangle(array);
849         }
850         return null;
851     }
852
853     /**
854      * Sets the bounding box.
855      * 
856      * @param bbox the bounding box
857      */
858     public void setBBox(PDRectangle bbox)
859     {
860         String name = BBOX;
861         COSBase oldValue = this.getCOSDictionary().getDictionaryObject(name);
862         this.getCOSDictionary().setItem(name, bbox);
863         COSBase newValue = bbox == null ? null : bbox.getCOSObject();
864         this.potentiallyNotifyChanged(oldValue, newValue);
865     }
866
867     /**
868      * Gets the width of the element’s content rectangle in the
869      * inline-progression direction (Width). The default value is
870      * {@link #WIDTH_AUTO}.
871      * 
872      * @return the width (a Float or a String)
873      */
874     public Object getWidth()
875     {
876         return this.getNumberOrName(WIDTH, WIDTH_AUTO);
877     }
878
879     /**
880      * Sets the width of the element’s content rectangle in the
881      * inline-progression direction (Width) to {@link #WIDTH_AUTO}.
882      */
883     public void setWidthAuto()
884     {
885         this.setName(WIDTH, WIDTH_AUTO);
886     }
887
888     /**
889      * Sets the width of the element’s content rectangle in the
890      * inline-progression direction (Width).
891      * 
892      * @param width the width
893      */
894     public void setWidth(float width)
895     {
896         this.setNumber(WIDTH, width);
897     }
898
899     /**
900      * Sets the width of the element’s content rectangle in the
901      * inline-progression direction (Width).
902      * 
903      * @param width the width
904      */
905     public void setWidth(int width)
906     {
907         this.setNumber(WIDTH, width);
908     }
909
910     /**
911      * Gets the height of the element’s content rectangle in the
912      * block-progression direction (Height). The default value is
913      * {@link #HEIGHT_AUTO}.
914      * 
915      * @return the height (a Float or a String)
916      */
917     public Object getHeight()
918     {
919         return this.getNumberOrName(HEIGHT, HEIGHT_AUTO);
920     }
921
922     /**
923      * Sets the height of the element’s content rectangle in the
924      * block-progression direction (Height) to {@link #HEIGHT_AUTO}.
925      */
926     public void setHeightAuto()
927     {
928         this.setName(HEIGHT, HEIGHT_AUTO);
929     }
930
931     /**
932      * Sets the height of the element’s content rectangle in the
933      * block-progression direction (Height).
934      * 
935      * @param height the height
936      */
937     public void setHeight(float height)
938     {
939         this.setNumber(HEIGHT, height);
940     }
941
942     /**
943      * Sets the height of the element’s content rectangle in the
944      * block-progression direction (Height).
945      * 
946      * @param height the height
947      */
948     public void setHeight(int height)
949     {
950         this.setNumber(HEIGHT, height);
951     }
952
953     /**
954      * Gets the alignment, in the block-progression direction, of content within
955      * the table cell (BlockAlign). The default value is
956      * {@link #BLOCK_ALIGN_BEFORE}.
957      * 
958      * @return the block alignment
959      */
960     public String getBlockAlign()
961     {
962         return this.getName(BLOCK_ALIGN, BLOCK_ALIGN_BEFORE);
963     }
964
965     /**
966      * Sets the alignment, in the block-progression direction, of content within
967      * the table cell (BlockAlign). The value should be one of:
968      * <ul>
969      *   <li>{@link #BLOCK_ALIGN_BEFORE},</li>
970      *   <li>{@link #BLOCK_ALIGN_MIDDLE},</li>
971      *   <li>{@link #BLOCK_ALIGN_AFTER},</li>
972      *   <li>{@link #BLOCK_ALIGN_JUSTIFY}.</li>
973      * </ul>
974      * 
975      * @param blockAlign the block alignment
976      */
977     public void setBlockAlign(String blockAlign)
978     {
979         this.setName(BLOCK_ALIGN, blockAlign);
980     }
981
982     /**
983      * Gets the alignment, in the inline-progression direction, of content
984      * within the table cell (InlineAlign). The default value is
985      * {@link #INLINE_ALIGN_START}.
986      * 
987      * @return the inline alignment
988      */
989     public String getInlineAlign()
990     {
991         return this.getName(INLINE_ALIGN, INLINE_ALIGN_START);
992     }
993
994     /**
995      * Sets the alignment, in the inline-progression direction, of content
996      * within the table cell (InlineAlign). The value should be one of
997      * <ul>
998      *   <li>{@link #INLINE_ALIGN_START},</li>
999      *   <li>{@link #INLINE_ALIGN_CENTER},</li>
1000      *   <li>{@link #INLINE_ALIGN_END}.</li>
1001      * </ul>
1002      * 
1003      * @param inlineAlign the inline alignment
1004      */
1005     public void setInlineAlign(String inlineAlign)
1006     {
1007         this.setName(INLINE_ALIGN, inlineAlign);
1008     }
1009
1010     /**
1011      * Gets the style of the border drawn on each edge of a table cell
1012      * (TBorderStyle).
1013      * 
1014      * @return
1015      */
1016     public Object getTBorderStyle()
1017     {
1018         return this.getNameOrArrayOfName(T_BORDER_STYLE, BORDER_STYLE_NONE);
1019     }
1020
1021     /**
1022      * Sets the same table border style for all four sides (TBorderStyle). The
1023      * value should be one of:
1024      * <ul>
1025      *   <li>{@link #BORDER_STYLE_NONE},</li>
1026      *   <li>{@link #BORDER_STYLE_HIDDEN},</li>
1027      *   <li>{@link #BORDER_STYLE_DOTTED},</li>
1028      *   <li>{@link #BORDER_STYLE_DASHED},</li>
1029      *   <li>{@link #BORDER_STYLE_SOLID},</li>
1030      *   <li>{@link #BORDER_STYLE_DOUBLE},</li>
1031      *   <li>{@link #BORDER_STYLE_GROOVE},</li>
1032      *   <li>{@link #BORDER_STYLE_RIDGE},</li>
1033      *   <li>{@link #BORDER_STYLE_INSET},</li>
1034      *   <li>{@link #BORDER_STYLE_OUTSET}.</li>
1035      * </ul>
1036      * 
1037      * @param tBorderStyle the table border style
1038      */
1039     public void setAllTBorderStyles(String tBorderStyle)
1040     {
1041         this.setName(T_BORDER_STYLE, tBorderStyle);
1042     }
1043
1044     /**
1045      * Sets the style of the border drawn on each edge of a table cell
1046      * (TBorderStyle). The values should be of:
1047      * <ul>
1048      *   <li>{@link #BORDER_STYLE_NONE},</li>
1049      *   <li>{@link #BORDER_STYLE_HIDDEN},</li>
1050      *   <li>{@link #BORDER_STYLE_DOTTED},</li>
1051      *   <li>{@link #BORDER_STYLE_DASHED},</li>
1052      *   <li>{@link #BORDER_STYLE_SOLID},</li>
1053      *   <li>{@link #BORDER_STYLE_DOUBLE},</li>
1054      *   <li>{@link #BORDER_STYLE_GROOVE},</li>
1055      *   <li>{@link #BORDER_STYLE_RIDGE},</li>
1056      *   <li>{@link #BORDER_STYLE_INSET},</li>
1057      *   <li>{@link #BORDER_STYLE_OUTSET}.</li>
1058      * </ul>
1059      * 
1060      * @param tBorderStyles
1061      */
1062     public void setTBorderStyles(String[] tBorderStyles)
1063     {
1064         this.setArrayOfName(T_BORDER_STYLE, tBorderStyles);
1065     }
1066
1067     /**
1068      * Gets the offset to account for the separation between the table cell’s
1069      * content rectangle and the surrounding border (TPadding). The default
1070      * value is 0.
1071      * 
1072      * @return the table padding (a Float or an array of float)
1073      */
1074     public Object getTPadding()
1075     {
1076         return this.getNumberOrArrayOfNumber(T_PADDING, 0.f);
1077     }
1078
1079     /**
1080      * Sets the same table padding for all four sides (TPadding).
1081      * 
1082      * @param tPadding the table padding
1083      */
1084     public void setAllTPaddings(float tPadding)
1085     {
1086         this.setNumber(T_PADDING, tPadding);
1087     }
1088
1089     /**
1090      * Sets the same table padding for all four sides (TPadding).
1091      * 
1092      * @param tPadding the table padding
1093      */
1094     public void setAllTPaddings(int tPadding)
1095     {
1096         this.setNumber(T_PADDING, tPadding);
1097     }
1098
1099     /**
1100      * Sets the table paddings for four sides separately (TPadding).
1101      * 
1102      * @param tPaddings the table paddings (an array of four floats)
1103      */
1104     public void setTPaddings(float[] tPaddings)
1105     {
1106         this.setArrayOfNumber(T_PADDING, tPaddings);
1107     }
1108
1109     /**
1110      * Gets the distance by which the element’s baseline shall be shifted
1111      * relative to that of its parent element (BaselineShift). The default value
1112      * is 0.
1113      * 
1114      * @return the baseline shift
1115      */
1116     public float getBaselineShift()
1117     {
1118         return this.getNumber(BASELINE_SHIFT, 0.f);
1119     }
1120
1121     /**
1122      * Sets the distance by which the element’s baseline shall be shifted
1123      * relative to that of its parent element (BaselineShift).
1124      * 
1125      * @param baselineShift the baseline shift
1126      */
1127     public void setBaselineShift(float baselineShift)
1128     {
1129         this.setNumber(BASELINE_SHIFT, baselineShift);
1130     }
1131
1132     /**
1133      * Sets the distance by which the element’s baseline shall be shifted
1134      * relative to that of its parent element (BaselineShift).
1135      * 
1136      * @param baselineShift the baseline shift
1137      */
1138     public void setBaselineShift(int baselineShift)
1139     {
1140         this.setNumber(BASELINE_SHIFT, baselineShift);
1141     }
1142
1143     /**
1144      * Gets the element’s preferred height in the block-progression direction
1145      * (LineHeight). The default value is {@link #LINE_HEIGHT_NORMAL}.
1146      * 
1147      * @return the line height (a Float or a String)
1148      */
1149     public Object getLineHeight()
1150     {
1151         return this.getNumberOrName(LINE_HEIGHT, LINE_HEIGHT_NORMAL);
1152     }
1153
1154     /**
1155      * Sets the element’s preferred height in the block-progression direction
1156      * (LineHeight) to {@link #LINE_HEIGHT_NORMAL}.
1157      */
1158     public void setLineHeightNormal()
1159     {
1160         this.setName(LINE_HEIGHT, LINE_HEIGHT_NORMAL);
1161     }
1162
1163     /**
1164      * Sets the element’s preferred height in the block-progression direction
1165      * (LineHeight) to {@link #LINE_HEIGHT_AUTO}.
1166      */
1167     public void setLineHeightAuto()
1168     {
1169         this.setName(LINE_HEIGHT, LINE_HEIGHT_AUTO);
1170     }
1171
1172     /**
1173      * Sets the element’s preferred height in the block-progression direction
1174      * (LineHeight).
1175      * 
1176      * @param lineHeight the line height
1177      */
1178     public void setLineHeight(float lineHeight)
1179     {
1180         this.setNumber(LINE_HEIGHT, lineHeight);
1181     }
1182
1183     /**
1184      * Sets the element’s preferred height in the block-progression direction
1185      * (LineHeight).
1186      * 
1187      * @param lineHeight the line height
1188      */
1189     public void setLineHeight(int lineHeight)
1190     {
1191         this.setNumber(LINE_HEIGHT, lineHeight);
1192     }
1193
1194     /**
1195      * Gets the colour to be used for drawing text decorations
1196      * (TextDecorationColor).
1197      * 
1198      * @return the text decoration colour
1199      */
1200     public PDGamma getTextDecorationColor()
1201     {
1202         return this.getColor(TEXT_DECORATION_COLOR);
1203     }
1204
1205     /**
1206      * Sets the colour to be used for drawing text decorations
1207      * (TextDecorationColor).
1208      * 
1209      * @param textDecorationColor the text decoration colour
1210      */
1211     public void setTextDecorationColor(PDGamma textDecorationColor)
1212     {
1213         this.setColor(TEXT_DECORATION_COLOR, textDecorationColor);
1214     }
1215
1216     /**
1217      * Gets the thickness of each line drawn as part of the text decoration
1218      * (TextDecorationThickness).
1219      * 
1220      * @return the text decoration thickness
1221      */
1222     public float getTextDecorationThickness()
1223     {
1224         return this.getNumber(TEXT_DECORATION_THICKNESS);
1225     }
1226
1227     /**
1228      * Sets the thickness of each line drawn as part of the text decoration
1229      * (TextDecorationThickness).
1230      * 
1231      * @param textDecorationThickness the text decoration thickness
1232      */
1233     public void setTextDecorationThickness(float textDecorationThickness)
1234     {
1235         this.setNumber(TEXT_DECORATION_THICKNESS, textDecorationThickness);
1236     }
1237
1238     /**
1239      * Sets the thickness of each line drawn as part of the text decoration
1240      * (TextDecorationThickness).
1241      * 
1242      * @param textDecorationThickness the text decoration thickness
1243      */
1244     public void setTextDecorationThickness(int textDecorationThickness)
1245     {
1246         this.setNumber(TEXT_DECORATION_THICKNESS, textDecorationThickness);
1247     }
1248
1249     /**
1250      * Gets the type of text decoration (TextDecorationType). The default value
1251      * is {@link #TEXT_DECORATION_TYPE_NONE}.
1252      * 
1253      * @return the type of text decoration
1254      */
1255     public String getTextDecorationType()
1256     {
1257         return this.getName(TEXT_DECORATION_TYPE, TEXT_DECORATION_TYPE_NONE);
1258     }
1259
1260     /**
1261      * Sets the type of text decoration (TextDecorationType). The value should
1262      * be one of:
1263      * <ul>
1264      *   <li>{@link #TEXT_DECORATION_TYPE_NONE},</li>
1265      *   <li>{@link #TEXT_DECORATION_TYPE_UNDERLINE},</li>
1266      *   <li>{@link #TEXT_DECORATION_TYPE_OVERLINE},</li>
1267      *   <li>{@link #TEXT_DECORATION_TYPE_LINE_THROUGH}.</li>
1268      * </ul>
1269      * 
1270      * @param textDecorationType the type of text decoration
1271      */
1272     public void setTextDecorationType(String textDecorationType)
1273     {
1274         this.setName(TEXT_DECORATION_TYPE, textDecorationType);
1275     }
1276
1277     /**
1278      * Gets the justification of the lines within a ruby assembly (RubyAlign).
1279      * The default value is {@link #RUBY_ALIGN_DISTRIBUTE}.
1280      * 
1281      * @return the ruby alignment
1282      */
1283     public String getRubyAlign()
1284     {
1285         return this.getName(RUBY_ALIGN, RUBY_ALIGN_DISTRIBUTE);
1286     }
1287
1288     /**
1289      * Sets the justification of the lines within a ruby assembly (RubyAlign).
1290      * The value should be one of:
1291      * <ul>
1292      *   <li>{@link #RUBY_ALIGN_START},</li>
1293      *   <li>{@link #RUBY_ALIGN_CENTER},</li>
1294      *   <li>{@link #RUBY_ALIGN_END},</li>
1295      *   <li>{@link #RUBY_ALIGN_JUSTIFY},</li>
1296      *   <li>{@link #RUBY_ALIGN_DISTRIBUTE},</li>
1297      * </ul>
1298      * 
1299      * @param rubyAlign the ruby alignment
1300      */
1301     public void setRubyAlign(String rubyAlign)
1302     {
1303         this.setName(RUBY_ALIGN, rubyAlign);
1304     }
1305
1306     /**
1307      * Gets the placement of the RT structure element relative to the RB element
1308      * in a ruby assembly (RubyPosition). The default value is
1309      * {@link #RUBY_POSITION_BEFORE}.
1310      * 
1311      * @return the ruby position
1312      */
1313     public String getRubyPosition()
1314     {
1315         return this.getName(RUBY_POSITION, RUBY_POSITION_BEFORE);
1316     }
1317
1318     /**
1319      * Sets the placement of the RT structure element relative to the RB element
1320      * in a ruby assembly (RubyPosition). The value should be one of:
1321      * <ul>
1322      *   <li>{@link #RUBY_POSITION_BEFORE},</li>
1323      *   <li>{@link #RUBY_POSITION_AFTER},</li>
1324      *   <li>{@link #RUBY_POSITION_WARICHU},</li>
1325      *   <li>{@link #RUBY_POSITION_INLINE}.</li>
1326      * </ul>
1327      * 
1328      * @param rubyPosition the ruby position
1329      */
1330     public void setRubyPosition(String rubyPosition)
1331     {
1332         this.setName(RUBY_POSITION, rubyPosition);
1333     }
1334
1335     /**
1336      * Gets the orientation of glyphs when the inline-progression direction is
1337      * top to bottom or bottom to top (GlyphOrientationVertical). The default
1338      * value is {@link #GLYPH_ORIENTATION_VERTICAL_AUTO}.
1339      * 
1340      * @return the vertical glyph orientation
1341      */
1342     public String getGlyphOrientationVertical()
1343     {
1344         return this.getName(GLYPH_ORIENTATION_VERTICAL,
1345             GLYPH_ORIENTATION_VERTICAL_AUTO);
1346     }
1347
1348     /**
1349      * Sets the orientation of glyphs when the inline-progression direction is
1350      * top to bottom or bottom to top (GlyphOrientationVertical). The value
1351      * should be one of:
1352      * <ul>
1353      *   <li>{@link #GLYPH_ORIENTATION_VERTICAL_AUTO},</li>
1354      *   <li>{@link #GLYPH_ORIENTATION_VERTICAL_MINUS_180_DEGREES},</li>
1355      *   <li>{@link #GLYPH_ORIENTATION_VERTICAL_MINUS_90_DEGREES},</li>
1356      *   <li>{@link #GLYPH_ORIENTATION_VERTICAL_ZERO_DEGREES},</li>
1357      *   <li>{@link #GLYPH_ORIENTATION_VERTICAL_90_DEGREES},</li>
1358      *   <li>{@link #GLYPH_ORIENTATION_VERTICAL_180_DEGREES},</li>
1359      *   <li>{@link #GLYPH_ORIENTATION_VERTICAL_270_DEGREES},</li>
1360      *   <li>{@link #GLYPH_ORIENTATION_VERTICAL_360_DEGREES}.</li>
1361      * </ul>
1362      * 
1363      * @param glyphOrientationVertical the vertical glyph orientation
1364      */
1365     public void setGlyphOrientationVertical(String glyphOrientationVertical)
1366     {
1367         this.setName(GLYPH_ORIENTATION_VERTICAL, glyphOrientationVertical);
1368     }
1369
1370     /**
1371      * Gets the number of columns in the content of the grouping element
1372      * (ColumnCount). The default value is 1.
1373      * 
1374      * @return the column count
1375      */
1376     public int getColumnCount()
1377     {
1378         return this.getInteger(COLUMN_COUNT, 1);
1379     }
1380
1381     /**
1382      * Sets the number of columns in the content of the grouping element
1383      * (ColumnCount).
1384      * 
1385      * @param columnCount the column count
1386      */
1387     public void setColumnCount(int columnCount)
1388     {
1389         this.setInteger(COLUMN_COUNT, columnCount);
1390     }
1391
1392     /**
1393      * Gets the desired space between adjacent columns in the inline-progression
1394      * direction (ColumnGap).
1395      * 
1396      * @return the column gap (FLoat or array of floats)
1397      */
1398     public Object getColumnGap()
1399     {
1400         return this.getNumberOrArrayOfNumber(COLUMN_GAP, UNSPECIFIED);
1401     }
1402
1403     /**
1404      * Sets the desired space between all columns in the inline-progression
1405      * direction (ColumnGap).
1406      * 
1407      * @param columnGap the column gap
1408      */
1409     public void setColumnGap(float columnGap)
1410     {
1411         this.setNumber(COLUMN_GAP, columnGap);
1412     }
1413
1414     /**
1415      * Sets the desired space between all columns in the inline-progression
1416      * direction (ColumnGap).
1417      * 
1418      * @param columnGap the column gap
1419      */
1420     public void setColumnGap(int columnGap)
1421     {
1422         this.setNumber(COLUMN_GAP, columnGap);
1423     }
1424
1425     /**
1426      * Sets the desired space between adjacent columns in the inline-progression
1427      * direction (ColumnGap), the first element specifying the space between the
1428      * first and second columns, the second specifying the space between the
1429      * second and third columns, and so on.
1430      * 
1431      * @param columnGaps the column gaps
1432      */
1433     public void setColumnGaps(float[] columnGaps)
1434     {
1435         this.setArrayOfNumber(COLUMN_GAP, columnGaps);
1436     }
1437
1438     /**
1439      * Gets the desired width of the columns, measured in default user space
1440      * units in the inline-progression direction (ColumnWidths).
1441      * 
1442      * @return the column widths (Float or array of floats)
1443      */
1444     public Object getColumnWidths()
1445     {
1446         return this.getNumberOrArrayOfNumber(COLUMN_WIDTHS, UNSPECIFIED);
1447     }
1448
1449     /**
1450      * Sets the same column width for all columns (ColumnWidths).
1451      * 
1452      * @param columnWidth the column width
1453      */
1454     public void setAllColumnWidths(float columnWidth)
1455     {
1456         this.setNumber(COLUMN_WIDTHS, columnWidth);
1457     }
1458
1459     /**
1460      * Sets the same column width for all columns (ColumnWidths).
1461      * 
1462      * @param columnWidth the column width
1463      */
1464     public void setAllColumnWidths(int columnWidth)
1465     {
1466         this.setNumber(COLUMN_WIDTHS, columnWidth);
1467     }
1468
1469     /**
1470      * Sets the column widths for the columns separately (ColumnWidths).
1471      * 
1472      * @param columnWidths the column widths
1473      */
1474     public void setColumnWidths(float[] columnWidths)
1475     {
1476         this.setArrayOfNumber(COLUMN_WIDTHS, columnWidths);
1477     }
1478
1479     @Override
1480     public String toString()
1481     {
1482         StringBuilder sb = new StringBuilder().append(super.toString());
1483         if (this.isSpecified(PLACEMENT))
1484         {
1485             sb.append(", Placement=").append(this.getPlacement());
1486         }
1487         if (this.isSpecified(WRITING_MODE))
1488         {
1489             sb.append(", WritingMode=").append(this.getWritingMode());
1490         }
1491         if (this.isSpecified(BACKGROUND_COLOR))
1492         {
1493             sb.append(", BackgroundColor=").append(this.getBackgroundColor());
1494         }
1495         if (this.isSpecified(BORDER_COLOR))
1496         {
1497             sb.append(", BorderColor=").append(this.getBorderColors());
1498         }
1499         if (this.isSpecified(BORDER_STYLE))
1500         {
1501             Object borderStyle = this.getBorderStyle();
1502             sb.append(", BorderStyle=");
1503             if (borderStyle instanceof String[])
1504             {
1505                 sb.append(arrayToString((String[]) borderStyle));
1506             }
1507             else
1508             {
1509                 sb.append(borderStyle);
1510             }
1511         }
1512         if (this.isSpecified(BORDER_THICKNESS))
1513         {
1514             Object borderThickness = this.getBorderThickness();
1515             sb.append(", BorderThickness=");
1516             if (borderThickness instanceof float[])
1517             {
1518                 sb.append(arrayToString((float[]) borderThickness));
1519             }
1520             else
1521             {
1522                 sb.append(String.valueOf((Float) borderThickness));
1523             }
1524         }
1525         if (this.isSpecified(PADDING))
1526         {
1527             Object padding = this.getPadding();
1528             sb.append(", Padding=");
1529             if (padding instanceof float[])
1530             {
1531                 sb.append(arrayToString((float[]) padding));
1532             }
1533             else
1534             {
1535                 sb.append(String.valueOf((Float) padding));
1536             }
1537         }
1538         if (this.isSpecified(COLOR))
1539         {
1540             sb.append(", Color=").append(this.getColor());
1541         }
1542         if (this.isSpecified(SPACE_BEFORE))
1543         {
1544             sb.append(", SpaceBefore=")
1545                 .append(String.valueOf(this.getSpaceBefore()));
1546         }
1547         if (this.isSpecified(SPACE_AFTER))
1548         {
1549             sb.append(", SpaceAfter=")
1550                 .append(String.valueOf(this.getSpaceAfter()));
1551         }
1552         if (this.isSpecified(START_INDENT))
1553         {
1554             sb.append(", StartIndent=")
1555                 .append(String.valueOf(this.getStartIndent()));
1556         }
1557         if (this.isSpecified(END_INDENT))
1558         {
1559             sb.append(", EndIndent=")
1560                 .append(String.valueOf(this.getEndIndent()));
1561         }
1562         if (this.isSpecified(TEXT_INDENT))
1563         {
1564             sb.append(", TextIndent=")
1565                 .append(String.valueOf(this.getTextIndent()));
1566         }
1567         if (this.isSpecified(TEXT_ALIGN))
1568         {
1569             sb.append(", TextAlign=").append(this.getTextAlign());
1570         }
1571         if (this.isSpecified(BBOX))
1572         {
1573             sb.append(", BBox=").append(this.getBBox());
1574         }
1575         if (this.isSpecified(WIDTH))
1576         {
1577             Object width = this.getWidth();
1578             sb.append(", Width=");
1579             if (width instanceof Float)
1580             {
1581                 sb.append(String.valueOf((Float) width));
1582             }
1583             else
1584             {
1585                 sb.append(width);
1586             }
1587         }
1588         if (this.isSpecified(HEIGHT))
1589         {
1590             Object height = this.getHeight();
1591             sb.append(", Height=");
1592             if (height instanceof Float)
1593             {
1594                 sb.append(String.valueOf((Float) height));
1595             }
1596             else
1597             {
1598                 sb.append(height);
1599             }
1600         }
1601         if (this.isSpecified(BLOCK_ALIGN))
1602         {
1603             sb.append(", BlockAlign=").append(this.getBlockAlign());
1604         }
1605         if (this.isSpecified(INLINE_ALIGN))
1606         {
1607             sb.append(", InlineAlign=").append(this.getInlineAlign());
1608         }
1609         if (this.isSpecified(T_BORDER_STYLE))
1610         {
1611             Object tBorderStyle = this.getTBorderStyle();
1612             sb.append(", TBorderStyle=");
1613             if (tBorderStyle instanceof String[])
1614             {
1615                 sb.append(arrayToString((String[]) tBorderStyle));
1616             }
1617             else
1618             {
1619                 sb.append(tBorderStyle);
1620             }
1621         }
1622         if (this.isSpecified(T_PADDING))
1623         {
1624             Object tPadding = this.getTPadding();
1625             sb.append(", TPadding=");
1626             if (tPadding instanceof float[])
1627             {
1628                 sb.append(arrayToString((float[]) tPadding));
1629             }
1630             else
1631             {
1632                 sb.append(String.valueOf((Float) tPadding));
1633             }
1634         }
1635         if (this.isSpecified(BASELINE_SHIFT))
1636         {
1637             sb.append(", BaselineShift=")
1638                 .append(String.valueOf(this.getBaselineShift()));
1639         }
1640         if (this.isSpecified(LINE_HEIGHT))
1641         {
1642             Object lineHeight = this.getLineHeight();
1643             sb.append(", LineHeight=");
1644             if (lineHeight instanceof Float)
1645             {
1646                 sb.append(String.valueOf((Float) lineHeight));
1647             }
1648             else
1649             {
1650                 sb.append(lineHeight);
1651             }
1652         }
1653         if (this.isSpecified(TEXT_DECORATION_COLOR))
1654         {
1655             sb.append(", TextDecorationColor=")
1656                 .append(this.getTextDecorationColor());
1657         }
1658         if (this.isSpecified(TEXT_DECORATION_THICKNESS))
1659         {
1660             sb.append(", TextDecorationThickness=")
1661                 .append(String.valueOf(this.getTextDecorationThickness()));
1662         }
1663         if (this.isSpecified(TEXT_DECORATION_TYPE))
1664         {
1665             sb.append(", TextDecorationType=")
1666                 .append(this.getTextDecorationType());
1667         }
1668         if (this.isSpecified(RUBY_ALIGN))
1669         {
1670             sb.append(", RubyAlign=").append(this.getRubyAlign());
1671         }
1672         if (this.isSpecified(RUBY_POSITION))
1673         {
1674             sb.append(", RubyPosition=").append(this.getRubyPosition());
1675         }
1676         if (this.isSpecified(GLYPH_ORIENTATION_VERTICAL))
1677         {
1678             sb.append(", GlyphOrientationVertical=")
1679                 .append(this.getGlyphOrientationVertical());
1680         }
1681         if (this.isSpecified(COLUMN_COUNT))
1682         {
1683             sb.append(", ColumnCount=")
1684                 .append(String.valueOf(this.getColumnCount()));
1685         }
1686         if (this.isSpecified(COLUMN_GAP))
1687         {
1688             Object columnGap = this.getColumnGap();
1689             sb.append(", ColumnGap=");
1690             if (columnGap instanceof float[])
1691             {
1692                 sb.append(arrayToString((float[]) columnGap));
1693             }
1694             else
1695             {
1696                 sb.append(String.valueOf((Float) columnGap));
1697             }
1698         }
1699         if (this.isSpecified(COLUMN_WIDTHS))
1700         {
1701             Object columnWidth = this.getColumnWidths();
1702             sb.append(", ColumnWidths=");
1703             if (columnWidth instanceof float[])
1704             {
1705                 sb.append(arrayToString((float[]) columnWidth));
1706             }
1707             else
1708             {
1709                 sb.append(String.valueOf((Float) columnWidth));
1710             }
1711         }
1712         return sb.toString();
1713     }
1714
1715 }