javax.swing.text

Class FieldView

public class FieldView extends PlainView

Constructor Summary
FieldView(Element elem)
Method Summary
protected ShapeadjustAllocation(Shape shape)
Vertically centers the single line of text within the bounds of the input shape.
voidchangedUpdate(DocumentEvent ev, Shape shape, ViewFactory vf)
protected FontMetricsgetFontMetrics()
floatgetPreferredSpan(int axis)
intgetResizeWeight(int axis)
voidinsertUpdate(DocumentEvent ev, Shape shape, ViewFactory vf)
ShapemodelToView(int pos, Shape a, Position.Bias bias)
voidpaint(Graphics g, Shape s)
voidremoveUpdate(DocumentEvent ev, Shape shape, ViewFactory vf)
intviewToModel(float fx, float fy, Shape a, Position.Bias[] bias)

Constructor Detail

FieldView

public FieldView(Element elem)

Method Detail

adjustAllocation

protected Shape adjustAllocation(Shape shape)
Vertically centers the single line of text within the bounds of the input shape. The returned Rectangle is centered vertically within shape and has a height of the preferred span along the Y axis. Horizontal adjustment is done according to the horizontalAligment property of the component that is rendered.

Parameters: shape the shape within which the line is beeing centered

changedUpdate

public void changedUpdate(DocumentEvent ev, Shape shape, ViewFactory vf)

getFontMetrics

protected FontMetrics getFontMetrics()

getPreferredSpan

public float getPreferredSpan(int axis)

getResizeWeight

public int getResizeWeight(int axis)

insertUpdate

public void insertUpdate(DocumentEvent ev, Shape shape, ViewFactory vf)

modelToView

public Shape modelToView(int pos, Shape a, Position.Bias bias)

paint

public void paint(Graphics g, Shape s)

removeUpdate

public void removeUpdate(DocumentEvent ev, Shape shape, ViewFactory vf)

viewToModel

public int viewToModel(float fx, float fy, Shape a, Position.Bias[] bias)