aboutsummaryrefslogtreecommitdiffstats
path: root/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/ParagraphProperties.java
blob: f1c78be1d9d5dfec5313a622b46a24aa48d9d884 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
/* ====================================================================
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
==================================================================== */

package org.apache.poi.hwpf.usermodel;

import org.apache.poi.common.Duplicatable;
import org.apache.poi.hwpf.model.types.PAPAbstractType;

@SuppressWarnings("unused")
public final class ParagraphProperties extends PAPAbstractType implements Duplicatable {

    private boolean jcLogical;

    public ParagraphProperties() {
        setAnld(new byte[84]);
        setPhe(new byte[12]);
    }

    public ParagraphProperties(ParagraphProperties other) {
        super(other);
        jcLogical = other.jcLogical;
    }

    @Override
    public ParagraphProperties copy() {
        return new ParagraphProperties(this);
    }

    public BorderCode getBarBorder()
    {
        return super.getBrcBar();
    }

    public BorderCode getBottomBorder()
    {
        return super.getBrcBottom();
    }

    public DropCapSpecifier getDropCap()
    {
        return super.getDcs();
    }

    public int getFirstLineIndent()
    {
        return super.getDxaLeft1();
    }

    public int getFontAlignment()
    {
        return super.getWAlignFont();
    }

    public int getIndentFromLeft()
    {
        return super.getDxaLeft();
    }

    public int getIndentFromRight()
    {
        return super.getDxaRight();
    }

    public int getJustification()
    {
        if ( jcLogical )
        {
            if ( !getFBiDi() )
                return getJc();

            switch ( getJc() )
            {
                case 0:
                    return 2;
                case 2:
                    return 0;
                default:
                    return getJc();
            }
        }

        return getJc();
    }

    public BorderCode getLeftBorder()
    {
        return super.getBrcLeft();
    }

    public LineSpacingDescriptor getLineSpacing()
    {
        return super.getLspd();
    }

    public BorderCode getRightBorder()
    {
        return super.getBrcRight();
    }

    public ShadingDescriptor getShading()
    {
        return super.getShd();
    }

    public int getSpacingAfter()
    {
        return super.getDyaAfter();
    }

    public int getSpacingBefore()
    {
        return super.getDyaBefore();
    }

    public BorderCode getTopBorder()
    {
        return super.getBrcTop();
    }

    public boolean isAutoHyphenated()
    {
        return !super.getFNoAutoHyph();
    }

    public boolean isBackward()
    {
        return super.isFBackward();
    }

    public boolean isKinsoku()
    {
        return super.getFKinsoku();
    }

    public boolean isLineNotNumbered()
    {
        return super.getFNoLnn();
    }

    public boolean isSideBySide()
    {
        return super.getFSideBySide();
    }

    public boolean isVertical()
    {
        return super.isFVertical();
    }

    public boolean isWidowControlled()
    {
        return super.getFWidowControl();
    }

    public boolean isWordWrapped()
    {
        return super.getFWordWrap();
    }

    public boolean keepOnPage()
    {
        return super.getFKeep();
    }

    public boolean keepWithNext()
    {
        return super.getFKeepFollow();
    }

    public boolean pageBreakBefore()
    {
        return super.getFPageBreakBefore();
    }

    public void setAutoHyphenated( boolean auto )
    {
        super.setFNoAutoHyph( !auto );
    }

    public void setBackward( boolean bward )
    {
        super.setFBackward( bward );
    }

    public void setBarBorder( BorderCode bar )
    {
        super.setBrcBar( bar );
    }

    public void setBottomBorder( BorderCode bottom )
    {
        super.setBrcBottom( bottom );
    }

    public void setDropCap( DropCapSpecifier dcs )
    {
        super.setDcs( dcs );
    }

    public void setFirstLineIndent( int first )
    {
        super.setDxaLeft1( first );
    }

    public void setFontAlignment( int align )
    {
        super.setWAlignFont( align );
    }

    public void setIndentFromLeft( int dxaLeft )
    {
        super.setDxaLeft( dxaLeft );
    }

    public void setIndentFromRight( int dxaRight )
    {
        super.setDxaRight( dxaRight );
    }

    public void setJustification( byte jc )
    {
        super.setJc( jc );
        this.jcLogical = false;
    }

    public void setJustificationLogical( byte jc )
    {
        super.setJc( jc );
        this.jcLogical = true;
    }

    public void setKeepOnPage( boolean fKeep )
    {
        super.setFKeep( fKeep );
    }

    public void setKeepWithNext( boolean fKeepFollow )
    {
        super.setFKeepFollow( fKeepFollow );
    }

    public void setKinsoku( boolean kinsoku )
    {
        super.setFKinsoku( kinsoku );
    }

    public void setLeftBorder( BorderCode left )
    {
        super.setBrcLeft( left );
    }

    public void setLineNotNumbered( boolean fNoLnn )
    {
        super.setFNoLnn( fNoLnn );
    }

    public void setLineSpacing( LineSpacingDescriptor lspd )
    {
        super.setLspd( lspd );
    }

    public void setPageBreakBefore( boolean fPageBreak )
    {
        super.setFPageBreakBefore( fPageBreak );
    }

    public void setRightBorder( BorderCode right )
    {
        super.setBrcRight( right );
    }

    public void setShading( ShadingDescriptor shd )
    {
        super.setShd( shd );
    }

    public void setSideBySide( boolean fSideBySide )
    {
        super.setFSideBySide( fSideBySide );
    }

    public void setSpacingAfter( int after )
    {
        super.setDyaAfter( after );
    }

    public void setSpacingBefore( int before )
    {
        super.setDyaBefore( before );
    }

    public void setTopBorder( BorderCode top )
    {
        super.setBrcTop( top );
    }

    public void setVertical( boolean vertical )
    {
        super.setFVertical( vertical );
    }

    public void setWidowControl( boolean widowControl )
    {
        super.setFWidowControl( widowControl );
    }

    public void setWordWrapped( boolean wrap )
    {
        super.setFWordWrap( wrap );
    }

}