KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > batik > gvt > flow > RegionInfo


1 /*
2
3    Copyright 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
19 package org.apache.batik.gvt.flow;
20
21 import java.awt.Shape JavaDoc;
22
23 /**
24  * This class holds the neccessary information to render a
25  * <batik:regin> that is defined within the <batik:flowRegion>
26  * element. Namely it holds the bounds of the region and the desired
27  * vertical alignment.
28  */

29 public class RegionInfo
30 {
31     private Shape JavaDoc shape;
32     private float verticalAlignment = 0.0f;
33
34     public RegionInfo(Shape JavaDoc s, float verticalAlignment) {
35         this.shape = s;
36         this.verticalAlignment = verticalAlignment;
37     }
38
39     public Shape JavaDoc getShape() {
40         return shape;
41     }
42
43     public void setShape(Shape JavaDoc s) {
44         this.shape = s;
45     }
46
47     /**
48      * Gets the vertical alignment for this flow region.
49      * @return the vertical alignment for this flow region.
50      * It will be 0.0 for top, 0.5 for middle and 1.0 for bottom.
51      */

52     public float getVerticalAlignment() {
53         return verticalAlignment;
54     }
55
56     /**
57      * Sets the alignment position of the text within this flow region.
58      * The value must be 0.0 for top, 0.5 for middle and 1.0 for bottom.
59      * @param verticalAlignment the vertical alignment of the text.
60      */

61     public void setVerticalAlignment(float verticalAlignment) {
62         this.verticalAlignment = verticalAlignment;
63     }
64 }
65
Popular Tags