|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.text.View
javax.swing.text.PlainView
javax.swing.text.FieldView
public class FieldView
Field Summary |
---|
Fields inherited from class javax.swing.text.PlainView |
---|
metrics |
Fields inherited from class javax.swing.text.View |
---|
BadBreakWeight, ExcellentBreakWeight, ForcedBreakWeight, GoodBreakWeight, X_AXIS, Y_AXIS |
Fields inherited from interface javax.swing.SwingConstants |
---|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
Constructor Summary | |
---|---|
FieldView(Element elem)
|
Method Summary | |
---|---|
protected Shape |
adjustAllocation(Shape shape)
Vertically centers the single line of text within the bounds of the input shape. |
void |
changedUpdate(DocumentEvent ev,
Shape shape,
ViewFactory vf)
This method is called when attributes were changed in the Document in a location that this view is responsible for. |
protected FontMetrics |
getFontMetrics()
|
float |
getPreferredSpan(int axis)
Returns the preferred span along the specified axis. |
int |
getResizeWeight(int axis)
Returns the resize weight of this view. |
void |
insertUpdate(DocumentEvent ev,
Shape shape,
ViewFactory vf)
This method is called when something is inserted into the Document that this View is displaying. |
Shape |
modelToView(int pos,
Shape a,
Position.Bias bias)
Maps a position in the document into the coordinate space of the View. |
void |
paint(Graphics g,
Shape s)
|
void |
removeUpdate(DocumentEvent ev,
Shape shape,
ViewFactory vf)
This method is called when something is removed from the Document that this View is displaying. |
int |
viewToModel(float fx,
float fy,
Shape a,
Position.Bias[] bias)
Maps coordinates from the View 's space into a position
in the document model. |
Methods inherited from class javax.swing.text.PlainView |
---|
damageLineRange, drawLine, drawSelectedText, drawUnselectedText, getLineBuffer, getTabSize, lineToRect, nextTabStop, updateDamage, updateMetrics |
Methods inherited from class javax.swing.text.View |
---|
append, breakView, createFragment, dump, forwardUpdate, forwardUpdateToView, getAlignment, getAttributes, getBreakWeight, getChildAllocation, getContainer, getDocument, getElement, getEndOffset, getGraphics, getMaximumSpan, getMinimumSpan, getNextVisualPositionFrom, getParent, getStartOffset, getToolTipText, getView, getViewCount, getViewFactory, getViewIndex, getViewIndex, insert, isVisible, modelToView, modelToView, preferenceChanged, remove, removeAll, replace, setParent, setSize, updateChildren, updateLayout, viewToModel |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FieldView(Element elem)
Method Detail |
---|
protected FontMetrics getFontMetrics()
protected Shape adjustAllocation(Shape shape)
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.
shape
- the shape within which the line is beeing centeredpublic float getPreferredSpan(int axis)
View
getPreferredSpan
in class PlainView
axis
- the axis
public int getResizeWeight(int axis)
View
0
or less
means this view is not resizeable. Positive values make the view
resizeable. The default implementation returns 0
unconditionally.
getResizeWeight
in class View
axis
- the axis
public Shape modelToView(int pos, Shape a, Position.Bias bias) throws BadLocationException
View
modelToView
in class PlainView
pos
- the position of the character in the modela
- the area that is occupied by the viewbias
- either Position.Bias.Forward
or
Position.Bias.Backward
depending on the preferred
direction bias. If null
this defaults to
Position.Bias.Forward
BadLocationException
- if pos
is invalidpublic void paint(Graphics g, Shape s)
paint
in class PlainView
public void insertUpdate(DocumentEvent ev, Shape shape, ViewFactory vf)
PlainView
insertUpdate
in class PlainView
ev
- the DocumentEvent for the changes.shape
- the allocation of the Viewvf
- the ViewFactory used to rebuildpublic void removeUpdate(DocumentEvent ev, Shape shape, ViewFactory vf)
PlainView
removeUpdate
in class PlainView
ev
- the DocumentEvent for the changes.shape
- the allocation of the Viewvf
- the ViewFactory used to rebuildpublic void changedUpdate(DocumentEvent ev, Shape shape, ViewFactory vf)
PlainView
changedUpdate
in class PlainView
ev
- the DocumentEvent that describes the changeshape
- the shape of the viewvf
- the ViewFactory for creating child viewspublic int viewToModel(float fx, float fy, Shape a, Position.Bias[] bias)
PlainView
View
's space into a position
in the document model.
viewToModel
in class PlainView
fx
- the x coordinate in the view spacefy
- the y coordinate in the view spacea
- the allocation of this View
bias
- the bias to use
x, y
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |