KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > swing > text > html > BRView


1 /*
2  * @(#)BRView.java 1.11 04/03/05
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7 package javax.swing.text.html;
8
9 import javax.swing.text.*;
10
11 /**
12  * Processes the <BR> tag. In other words, forces a line break.
13  *
14  * @author Sunita Mani
15  * @version 1.11 03/05/04
16  */

17 class BRView extends InlineView JavaDoc {
18
19     /**
20      * Creates a new view that represents a <BR> element.
21      *
22      * @param elem the element to create a view for
23      */

24     public BRView(Element elem) {
25     super(elem);
26     }
27
28     /**
29      * Forces a line break.
30      *
31      * @return View.ForcedBreakWeight
32      */

33     public int getBreakWeight(int axis, float pos, float len) {
34     if (axis == X_AXIS) {
35         return ForcedBreakWeight;
36     } else {
37         return super.getBreakWeight(axis, pos, len);
38     }
39     }
40 }
41
Popular Tags