|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.text.View javax.swing.plaf.basic.BasicTextUI.RootView
Root view that acts as a gateway between the component and the View hierarchy.
Field Summary | |
private View |
view
|
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 | |
(package private) |
BasicTextUI.RootView()
|
Method Summary | |
View |
breakView(int axis,
float len,
Shape a)
Breaks this view on the given axis at the given length. |
void |
changedUpdate(DocumentEvent e,
Shape a,
ViewFactory f)
Gives notification from the document that attributes were changed in a location that this view is responsible for. |
float |
getAlignment(int axis)
Determines the desired alignment for this view along an axis. |
AttributeSet |
getAttributes()
Fetches the attributes to use when rendering. |
Shape |
getChildAllocation(int index,
Shape a)
Fetches the allocation for the given child view. |
Container |
getContainer()
Fetches the container hosting the view. |
Document |
getDocument()
Returns the document model underlying the view. |
Element |
getElement()
Gets the element that this view is mapped to. |
int |
getEndOffset()
Returns the ending offset into the model for this view. |
float |
getMaximumSpan(int axis)
Determines the maximum span for this view along an axis. |
float |
getMinimumSpan(int axis)
Determines the minimum span for this view along an axis. |
int |
getNextVisualPositionFrom(int pos,
Position.Bias b,
Shape a,
int direction,
Position.Bias[] biasRet)
Provides a way to determine the next visually represented model location that one might place a caret. |
float |
getPreferredSpan(int axis)
Determines the preferred span for this view along an axis. |
int |
getResizeWeight(int axis)
Determines the resizability of the view along the given axis. |
int |
getStartOffset()
Returns the starting offset into the model for this view. |
View |
getView(int n)
Gets the n-th view in this container. |
int |
getViewCount()
Returns the number of views in this view. |
ViewFactory |
getViewFactory()
Fetches the factory to be used for building the various view fragments that make up the view that represents the model. |
int |
getViewIndex(int pos,
Position.Bias b)
Returns the child view index representing the given position in the model. |
void |
insertUpdate(DocumentEvent e,
Shape a,
ViewFactory f)
Gives notification that something was inserted into the document in a location that this view is responsible for. |
Shape |
modelToView(int p0,
Position.Bias b0,
int p1,
Position.Bias b1,
Shape a)
Provides a mapping from the document model coordinate space to the coordinate space of the view mapped to it. |
Shape |
modelToView(int pos,
Shape a,
Position.Bias b)
Provides a mapping from the document model coordinate space to the coordinate space of the view mapped to it. |
void |
paint(Graphics g,
Shape allocation)
Renders the view. |
void |
preferenceChanged(View child,
boolean width,
boolean height)
Specifies that a preference has changed. |
void |
removeUpdate(DocumentEvent e,
Shape a,
ViewFactory f)
Gives notification that something was removed from the document in a location that this view is responsible for. |
void |
setParent(View parent)
Sets the view parent. |
void |
setSize(float width,
float height)
Sets the view size. |
(package private) void |
setView(View v)
|
int |
viewToModel(float x,
float y,
Shape a,
Position.Bias[] bias)
Provides a mapping from the view coordinate space to the logical coordinate space of the model. |
Methods inherited from class javax.swing.text.View |
append, breakView, createFragment, forwardUpdate, forwardUpdateToView, getBreakWeight, getGraphics, getParent, getToolTipText, getViewIndex, insert, isVisible, modelToView, remove, removeAll, replace, updateChildren, updateLayout, viewToModel |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private View view
Constructor Detail |
BasicTextUI.RootView()
Method Detail |
void setView(View v)
public AttributeSet getAttributes()
getAttributes
in class View
public float getPreferredSpan(int axis)
getPreferredSpan
in class View
axis
- may be either X_AXIS or Y_AXIS
View.getPreferredSpan(int)
public float getMinimumSpan(int axis)
getMinimumSpan
in class View
axis
- may be either X_AXIS or Y_AXIS
View.getPreferredSpan(int)
public float getMaximumSpan(int axis)
getMaximumSpan
in class View
axis
- may be either X_AXIS or Y_AXIS
View.getPreferredSpan(int)
public void preferenceChanged(View child, boolean width, boolean height)
This can be called on a different thread from the event dispatching thread and is basically unsafe to propagate into the component. To make this safe, the operation is transferred over to the event dispatching thread for completion. It is a design goal that all view methods be safe to call without concern for concurrency, and this behavior helps make that true.
preferenceChanged
in class View
child
- the child viewwidth
- true if the width preference has changedheight
- true if the height preference has changedJComponent.revalidate()
public float getAlignment(int axis)
getAlignment
in class View
axis
- may be either X_AXIS or Y_AXIS
public void paint(Graphics g, Shape allocation)
paint
in class View
g
- the graphics contextallocation
- the region to render intoView.paint(java.awt.Graphics, java.awt.Shape)
public void setParent(View parent)
setParent
in class View
parent
- the parent viewpublic int getViewCount()
getViewCount
in class View
getView(int)
public View getView(int n)
getView
in class View
n
- the number of the view to get
public int getViewIndex(int pos, Position.Bias b)
getViewIndex
in class View
pos
- the position >= 0
public Shape getChildAllocation(int index, Shape a)
getChildAllocation
in class View
index
- the index of the childa
- the allocation to this view.
public Shape modelToView(int pos, Shape a, Position.Bias b) throws BadLocationException
modelToView
in class View
pos
- the position to converta
- the allocated region to render intob
- the bias toward the previous character or the
next character represented by the offset, in case the
position is a boundary of two views; b
will have one
of these values:
Position.Bias.Forward
Position.Bias.Backward
BadLocationException
- if the specified position does
not represent a valid location in the associated documentView.viewToModel(float, float, java.awt.Shape, javax.swing.text.Position.Bias[])
public Shape modelToView(int p0, Position.Bias b0, int p1, Position.Bias b1, Shape a) throws BadLocationException
modelToView
in class View
p0
- the position to convert >= 0b0
- the bias toward the previous character or the
next character represented by p0, in case the
position is a boundary of two views.p1
- the position to convert >= 0b1
- the bias toward the previous character or the
next character represented by p1, in case the
position is a boundary of two views.a
- the allocated region to render into
BadLocationException
- if the given position does
not represent a valid location in the associated document
IllegalArgumentException
- for an invalid bias argumentView.viewToModel(float, float, java.awt.Shape, javax.swing.text.Position.Bias[])
public int viewToModel(float x, float y, Shape a, Position.Bias[] bias)
viewToModel
in class View
x
- x coordinate of the view location to converty
- y coordinate of the view location to converta
- the allocated region to render into
public int getNextVisualPositionFrom(int pos, Position.Bias b, Shape a, int direction, Position.Bias[] biasRet) throws BadLocationException
getNextVisualPositionFrom
in class View
pos
- the position to convert >= 0a
- the allocated region to render intodirection
- the direction from the current position that can
be thought of as the arrow keys typically found on a keyboard.
This may be SwingConstants.WEST, SwingConstants.EAST,
SwingConstants.NORTH, or SwingConstants.SOUTH.
BadLocationException
IllegalArgumentException
- for an invalid directionpublic void insertUpdate(DocumentEvent e, Shape a, ViewFactory f)
insertUpdate
in class View
e
- the change information from the associated documenta
- the current allocation of the viewf
- the factory to use to rebuild if the view has childrenView.insertUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)
public void removeUpdate(DocumentEvent e, Shape a, ViewFactory f)
removeUpdate
in class View
e
- the change information from the associated documenta
- the current allocation of the viewf
- the factory to use to rebuild if the view has childrenView.removeUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)
public void changedUpdate(DocumentEvent e, Shape a, ViewFactory f)
changedUpdate
in class View
e
- the change information from the associated documenta
- the current allocation of the viewf
- the factory to use to rebuild if the view has childrenView.changedUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)
public Document getDocument()
getDocument
in class View
View.getDocument()
public int getStartOffset()
getStartOffset
in class View
View.getStartOffset()
public int getEndOffset()
getEndOffset
in class View
View.getEndOffset()
public Element getElement()
getElement
in class View
View.getElement()
public View breakView(int axis, float len, Shape a)
axis
- may be either X_AXIS or Y_AXISlen
- specifies where a break is desired in the span
public int getResizeWeight(int axis)
getResizeWeight
in class View
axis
- may be either X_AXIS or Y_AXIS
public void setSize(float width, float height)
setSize
in class View
width
- the widthheight
- the heightpublic Container getContainer()
getContainer
in class View
public ViewFactory getViewFactory()
getViewFactory
in class View
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |