KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > batik > extension > svg > MarginInfo


1 /*
2
3    Copyright 2002-2003 The Apache Software Foundation
4
5    Licensed under the Apache License, Version 2.0 (the "License");
6    you may not use this file except in compliance with the License.
7    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  */

18 package org.apache.batik.extension.svg;
19
20 public class MarginInfo {
21     public final static int JUSTIFY_START = 0;
22     public final static int JUSTIFY_MIDDLE = 1;
23     public final static int JUSTIFY_END = 2;
24     public final static int JUSTIFY_FULL = 3;
25
26     protected float top;
27     protected float right;
28     protected float bottom;
29     protected float left;
30
31     protected float indent;
32
33     protected int justification;
34     protected boolean flowRegionBreak;
35
36
37     public MarginInfo(float top, float right, float bottom, float left,
38                       float indent, int justification,
39                       boolean flowRegionBreak) {
40         this.top = top;
41         this.right = right;
42         this.bottom = bottom;
43         this.left = left;
44
45         this.indent = indent;
46
47         this.justification = justification;
48         this.flowRegionBreak = flowRegionBreak;
49     }
50
51     public MarginInfo(float margin, int justification) {
52         setMargin(margin);
53         this.indent = 0;
54         this.justification = justification;
55         this.flowRegionBreak = false;
56     }
57
58     public void setMargin(float margin) {
59         this.top = margin;
60         this.right = margin;
61         this.bottom = margin;
62         this.left = margin;
63     }
64
65     public float getTopMargin() { return top; }
66     public float getRightMargin() { return right; }
67     public float getBottomMargin() { return bottom; }
68     public float getLeftMargin() { return left; }
69
70     public float getIndent() { return indent; }
71
72     public int getJustification() { return justification; }
73     public boolean isFlowRegionBreak() { return flowRegionBreak; }
74 }
75
Popular Tags