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. import javax.swing.text.*;
  9. /**
  10. * Processes the <BR> tag. In other words, forces a line break.
  11. *
  12. * @author Sunita Mani
  13. * @version 1.11 03/05/04
  14. */
  15. class BRView extends InlineView {
  16. /**
  17. * Creates a new view that represents a <BR> element.
  18. *
  19. * @param elem the element to create a view for
  20. */
  21. public BRView(Element elem) {
  22. super(elem);
  23. }
  24. /**
  25. * Forces a line break.
  26. *
  27. * @return View.ForcedBreakWeight
  28. */
  29. public int getBreakWeight(int axis, float pos, float len) {
  30. if (axis == X_AXIS) {
  31. return ForcedBreakWeight;
  32. } else {
  33. return super.getBreakWeight(axis, pos, len);
  34. }
  35. }
  36. }