KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > nextapp > echo2 > app > layout > SplitPaneLayoutData


1 /*
2  * This file is part of the Echo Web Application Framework (hereinafter "Echo").
3  * Copyright (C) 2002-2005 NextApp, Inc.
4  *
5  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
6  *
7  * The contents of this file are subject to the Mozilla Public License Version
8  * 1.1 (the "License"); you may not use this file except in compliance with
9  * the License. You may obtain a copy of the License at
10  * http://www.mozilla.org/MPL/
11  *
12  * Software distributed under the License is distributed on an "AS IS" basis,
13  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
14  * for the specific language governing rights and limitations under the
15  * License.
16  *
17  * Alternatively, the contents of this file may be used under the terms of
18  * either the GNU General Public License Version 2 or later (the "GPL"), or
19  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
20  * in which case the provisions of the GPL or the LGPL are applicable instead
21  * of those above. If you wish to allow use of your version of this file only
22  * under the terms of either the GPL or the LGPL, and not to allow others to
23  * use your version of this file under the terms of the MPL, indicate your
24  * decision by deleting the provisions above and replace them with the notice
25  * and other provisions required by the GPL or the LGPL. If you do not delete
26  * the provisions above, a recipient may use your version of this file under
27  * the terms of any one of the MPL, the GPL or the LGPL.
28  */

29
30 package nextapp.echo2.app.layout;
31
32 import nextapp.echo2.app.Alignment;
33 import nextapp.echo2.app.FillImage;
34 import nextapp.echo2.app.Color;
35 import nextapp.echo2.app.Extent;
36 import nextapp.echo2.app.Insets;
37 import nextapp.echo2.app.LayoutData;
38
39 /**
40  * A <code>LayoutData</code> object used to describe how a
41  * <code>Component</code> is rendered within a <code>SplitPane</code>.
42  */

43 public class SplitPaneLayoutData
44 implements LayoutData {
45     
46     public static final int OVERFLOW_AUTO = 0;
47     public static final int OVERFLOW_HIDDEN = 1;
48     public static final int OVERFLOW_SCROLL = 2;
49     
50     private int overflow;
51     private Alignment alignment;
52     private Color background;
53     private Extent maximumSize;
54     private Extent minimumSize;
55     private FillImage backgroundImage;
56     private Insets insets;
57     
58     /**
59      * Returns the alignment of the containing pane.
60      *
61      * @return the alignment
62      */

63     public Alignment getAlignment() {
64         return alignment;
65     }
66     
67     /**
68      * Returns the background color of the containing pane.
69      *
70      * @return the background color
71      */

72     public Color getBackground() {
73         return background;
74     }
75     
76     /**
77      * Returns the <code>BackgroundImage</code> displayed in the
78      * containing pane.
79      *
80      * @return the background image
81      */

82     public FillImage getBackgroundImage() {
83         return backgroundImage;
84     }
85     
86     /**
87      * Returns the inset margins of the containing pane.
88      * This property is not rendered when the <code>SplitPaneLayoutData</code>
89      * instance is attached to a <code>Pane</code> component.
90      *
91      * @return the inset margins
92      */

93     public Insets getInsets() {
94         return insets;
95     }
96     
97     /**
98      * Returns the preferred maximum size of the containing pane.
99      * This property only supports <code>Extent</code>s with
100      * pixel units.
101      *
102      * @return the maximum size
103      */

104     public Extent getMaximumSize() {
105         return maximumSize;
106     }
107     
108     /**
109      * Returns the preferred minimum size of the containing pane.
110      * This property only supports <code>Extent</code>s with
111      * pixel units.
112      *
113      * @return the minimum size
114      */

115     public Extent getMinimumSize() {
116         return minimumSize;
117     }
118     
119     /**
120      * Returns the overflow state, describing how the pane will behave when
121      * the content is larger than display area.
122      *
123      * @return the overflow state, one of the following values:
124      * <ul>
125      * <li><code>OVERFLOW_AUTO</code>: provide scrollbars as necessary</li>
126      * <li><code>OVERFLOW_HIDDEN</code>: never display scrollbars, hide overflow content</li>
127      * <li><code>OVERFLOW_SCROLL</code>: always display scrollbars</li>
128      * </ul>
129      */

130     public int getOverflow() {
131         return overflow;
132     }
133     
134     /**
135      * Sets the alignment of the containing pane.
136      *
137      * @param newValue the new alignment
138      */

139     public void setAlignment(Alignment newValue) {
140         alignment = newValue;
141     }
142     
143     /**
144      * Sets the background color of the containing pane.
145      *
146      * @param newValue the new background color
147      */

148     public void setBackground(Color newValue) {
149         background = newValue;
150     }
151     
152     /**
153      * Sets the <code>BackgroundImage</code> displayed in the
154      * containing pane.
155      *
156      * @param newValue the new <code>BackgroundImage</code>
157      */

158     public void setBackgroundImage(FillImage newValue) {
159         backgroundImage = newValue;
160     }
161     
162     /**
163      * Sets the inset margins of the containing pane.
164      * This property is not rendered when the <code>SplitPaneLayoutData</code>
165      * instance is attached to a <code>Pane</code> component.
166      *
167      * @param newValue the new inset margins
168      */

169     public void setInsets(Insets newValue) {
170         insets = newValue;
171     }
172     
173     /**
174      * Sets the preferred maximum size of the containing pane.
175      * This property only supports <code>Extent</code>s with
176      * pixel units.
177      *
178      * @param newValue the new maximum size
179      */

180     public void setMaximumSize(Extent newValue) {
181         maximumSize = newValue;
182     }
183     
184     /**
185      * Sets the preferred minimum size of the containing pane.
186      * This property only supports <code>Extent</code>s with
187      * pixel units.
188      *
189      * @param newValue the new minimum size
190      */

191     public void setMinimumSize(Extent newValue) {
192         minimumSize = newValue;
193     }
194
195     /**
196      * Sets the overflow state, describing how the pane will behave when
197      * the content is larger than display area.
198      *
199      * @param newValue the overflow state, one of the following values:
200      * <ul>
201      * <li><code>OVERFLOW_AUTO</code>: provide scrollbars as necessary</li>
202      * <li><code>OVERFLOW_HIDDEN</code>: never display scrollbars, hide overflow content</li>
203      * <li><code>OVERFLOW_SCROLL</code>: always display scrollbars</li>
204      * </ul>
205      */

206     public void setOverflow(int newValue) {
207         overflow = newValue;
208     }
209 }
210
Popular Tags