38 |
|
|
39 |
package javax.swing.text; |
package javax.swing.text; |
40 |
|
|
41 |
// TODO: Implement this class. |
/** |
42 |
public class ParagraphView |
* A {@link FlowView} that flows it's children horizontally and boxes the rows |
43 |
extends FlowView |
* vertically. |
44 |
|
* |
45 |
|
* @author Roman Kennke (roman@kennke.org) |
46 |
|
*/ |
47 |
|
public class ParagraphView extends FlowView implements TabExpander |
48 |
{ |
{ |
49 |
|
/** |
50 |
|
* A specialized horizontal <code>BoxView</code> that represents exactly |
51 |
|
* one row in a <code>ParagraphView</code>. |
52 |
|
*/ |
53 |
|
class Row extends BoxView |
54 |
|
{ |
55 |
|
/** |
56 |
|
* Creates a new instance of <code>Row</code>. |
57 |
|
*/ |
58 |
|
Row(Element el) |
59 |
|
{ |
60 |
|
super(el, X_AXIS); |
61 |
|
} |
62 |
|
} |
63 |
|
|
64 |
/** |
/** |
65 |
* Creates a new <code>ParagraphView</code> for the given |
* Creates a new <code>ParagraphView</code> for the given |
67 |
* |
* |
68 |
* @param element the element that is rendered by this ParagraphView |
* @param element the element that is rendered by this ParagraphView |
69 |
*/ |
*/ |
70 |
public ParagraphView(Element element) |
public ParagraphView(Element element) |
71 |
|
{ |
72 |
|
super(element, Y_AXIS); |
73 |
|
} |
74 |
|
|
75 |
|
public float nextTabStop(float x, int tabOffset) |
76 |
|
{ |
77 |
|
throw new InternalError("Not implemented yet"); |
78 |
|
} |
79 |
|
|
80 |
|
/** |
81 |
|
* Creates a new view that represents a row within a flow. |
82 |
|
* |
83 |
|
* @return a view for a new row |
84 |
|
*/ |
85 |
|
protected View createRow() |
86 |
{ |
{ |
87 |
super(element); |
return new Row(getElement()); |
88 |
} |
} |
89 |
} |
} |