01: // ========================================================================
02: // $Id: Font.java,v 1.3 2004/05/09 20:31:28 gregwilkins Exp $
03: // Copyright 1996-2004 Mort Bay Consulting Pty. Ltd.
04: // ------------------------------------------------------------------------
05: // Licensed under the Apache License, Version 2.0 (the "License");
06: // you may not use this file except in compliance with the License.
07: // You may obtain a copy of the License at
08: // http://www.apache.org/licenses/LICENSE-2.0
09: // Unless required by applicable law or agreed to in writing, software
10: // distributed under the License is distributed on an "AS IS" BASIS,
11: // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12: // See the License for the specific language governing permissions and
13: // limitations under the License.
14: // ========================================================================
15:
16: package org.mortbay.html;
17:
18: /* -------------------------------------------------------------------- */
19: /** HTML Font Block.
20: * Each Element added to the List (which is a Composite) is treated
21: * as a new List Item.
22: * @see org.mortbay.html.Block
23: */
24: public class Font extends Block {
25: /* ----------------------------------------------------------------- */
26: public Font() {
27: super ("font");
28: }
29:
30: /* ----------------------------------------------------------------- */
31: public Font(int size) {
32: this ();
33: size(size);
34: }
35:
36: /* ----------------------------------------------------------------- */
37: public Font(int size, boolean relativeSize) {
38: this ();
39: size(((relativeSize && size >= 0) ? "+" : "") + size);
40: }
41:
42: /* ----------------------------------------------------------------- */
43: public Font(int size, String attributes) {
44: this ();
45: size(size);
46: this .attribute(attributes);
47: }
48:
49: /* ----------------------------------------------------------------- */
50: public Font(String attributes) {
51: super ("font", attributes);
52: }
53:
54: /* ----------------------------------------------------------------- */
55: public Font face(String face) {
56: attribute("face", face);
57: return this;
58: }
59:
60: }
|