You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
930 B
58 lines
930 B
/*
|
|
* Copyright (c) 1998, 2004, Oracle and/or its affiliates. All rights reserved.
|
|
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
|
|
*
|
|
*
|
|
*
|
|
*
|
|
*
|
|
*
|
|
*
|
|
*
|
|
*
|
|
*
|
|
*
|
|
*
|
|
*
|
|
*
|
|
*
|
|
*
|
|
*
|
|
*
|
|
*
|
|
*
|
|
*/
|
|
package javax.swing.text.html;
|
|
|
|
import javax.swing.text.*;
|
|
|
|
/**
|
|
* Processes the <BR> tag. In other words, forces a line break.
|
|
*
|
|
* @author Sunita Mani
|
|
*/
|
|
class BRView extends InlineView {
|
|
|
|
/**
|
|
* Creates a new view that represents a <BR> element.
|
|
*
|
|
* @param elem the element to create a view for
|
|
*/
|
|
public BRView(Element elem) {
|
|
super(elem);
|
|
}
|
|
|
|
/**
|
|
* Forces a line break.
|
|
*
|
|
* @return View.ForcedBreakWeight
|
|
*/
|
|
public int getBreakWeight(int axis, float pos, float len) {
|
|
if (axis == X_AXIS) {
|
|
return ForcedBreakWeight;
|
|
} else {
|
|
return super.getBreakWeight(axis, pos, len);
|
|
}
|
|
}
|
|
}
|