View (Java Platform SE 7 ) (original) (raw)
Modifier and Type
Method and Description
void
**[append](../../../javax/swing/text/View.html#append%28javax.swing.text.View%29)**([View](../../../javax/swing/text/View.html "class in javax.swing.text") v)
Appends a single child view.
[View](../../../javax/swing/text/View.html "class in javax.swing.text")
**[breakView](../../../javax/swing/text/View.html#breakView%28int,%20int,%20float,%20float%29)**(int axis, int offset, float pos, float len)
Tries to break this view on the given axis.
void
**[changedUpdate](../../../javax/swing/text/View.html#changedUpdate%28javax.swing.event.DocumentEvent,%20java.awt.Shape,%20javax.swing.text.ViewFactory%29)**([DocumentEvent](../../../javax/swing/event/DocumentEvent.html "interface in javax.swing.event") e,[Shape](../../../java/awt/Shape.html "interface in java.awt") a,[ViewFactory](../../../javax/swing/text/ViewFactory.html "interface in javax.swing.text") f)
Gives notification from the document that attributes were changed in a location that this view is responsible for.
[View](../../../javax/swing/text/View.html "class in javax.swing.text")
**[createFragment](../../../javax/swing/text/View.html#createFragment%28int,%20int%29)**(int p0, int p1)
Creates a view that represents a portion of the element.
protected void
**[forwardUpdate](../../../javax/swing/text/View.html#forwardUpdate%28javax.swing.event.DocumentEvent.ElementChange,%20javax.swing.event.DocumentEvent,%20java.awt.Shape,%20javax.swing.text.ViewFactory%29)**([DocumentEvent.ElementChange](../../../javax/swing/event/DocumentEvent.ElementChange.html "interface in javax.swing.event") ec,[DocumentEvent](../../../javax/swing/event/DocumentEvent.html "interface in javax.swing.event") e,[Shape](../../../java/awt/Shape.html "interface in java.awt") a,[ViewFactory](../../../javax/swing/text/ViewFactory.html "interface in javax.swing.text") f)
Forwards the given DocumentEvent
to the child views that need to be notified of the change to the model.
protected void
**[forwardUpdateToView](../../../javax/swing/text/View.html#forwardUpdateToView%28javax.swing.text.View,%20javax.swing.event.DocumentEvent,%20java.awt.Shape,%20javax.swing.text.ViewFactory%29)**([View](../../../javax/swing/text/View.html "class in javax.swing.text") v,[DocumentEvent](../../../javax/swing/event/DocumentEvent.html "interface in javax.swing.event") e,[Shape](../../../java/awt/Shape.html "interface in java.awt") a,[ViewFactory](../../../javax/swing/text/ViewFactory.html "interface in javax.swing.text") f)
Forwards the DocumentEvent
to the give child view.
float
**[getAlignment](../../../javax/swing/text/View.html#getAlignment%28int%29)**(int axis)
Determines the desired alignment for this view along an axis.
[AttributeSet](../../../javax/swing/text/AttributeSet.html "interface in javax.swing.text")
**[getAttributes](../../../javax/swing/text/View.html#getAttributes%28%29)**()
Fetches the attributes to use when rendering.
int
**[getBreakWeight](../../../javax/swing/text/View.html#getBreakWeight%28int,%20float,%20float%29)**(int axis, float pos, float len)
Determines how attractive a break opportunity in this view is.
[Shape](../../../java/awt/Shape.html "interface in java.awt")
**[getChildAllocation](../../../javax/swing/text/View.html#getChildAllocation%28int,%20java.awt.Shape%29)**(int index,[Shape](../../../java/awt/Shape.html "interface in java.awt") a)
Fetches the allocation for the given child view.
[Container](../../../java/awt/Container.html "class in java.awt")
**[getContainer](../../../javax/swing/text/View.html#getContainer%28%29)**()
Fetches the container hosting the view.
[Document](../../../javax/swing/text/Document.html "interface in javax.swing.text")
**[getDocument](../../../javax/swing/text/View.html#getDocument%28%29)**()
Fetches the model associated with the view.
[Element](../../../javax/swing/text/Element.html "interface in javax.swing.text")
**[getElement](../../../javax/swing/text/View.html#getElement%28%29)**()
Fetches the structural portion of the subject that this view is mapped to.
int
**[getEndOffset](../../../javax/swing/text/View.html#getEndOffset%28%29)**()
Fetches the portion of the model for which this view is responsible.
[Graphics](../../../java/awt/Graphics.html "class in java.awt")
**[getGraphics](../../../javax/swing/text/View.html#getGraphics%28%29)**()
Fetch a Graphics
for rendering.
float
**[getMaximumSpan](../../../javax/swing/text/View.html#getMaximumSpan%28int%29)**(int axis)
Determines the maximum span for this view along an axis.
float
**[getMinimumSpan](../../../javax/swing/text/View.html#getMinimumSpan%28int%29)**(int axis)
Determines the minimum span for this view along an axis.
int
**[getNextVisualPositionFrom](../../../javax/swing/text/View.html#getNextVisualPositionFrom%28int,%20javax.swing.text.Position.Bias,%20java.awt.Shape,%20int,%20javax.swing.text.Position.Bias[]%29)**(int pos,[Position.Bias](../../../javax/swing/text/Position.Bias.html "class in javax.swing.text") b,[Shape](../../../java/awt/Shape.html "interface in java.awt") a, int direction,[Position.Bias](../../../javax/swing/text/Position.Bias.html "class in javax.swing.text")[] biasRet)
Provides a way to determine the next visually represented model location at which one might place a caret.
[View](../../../javax/swing/text/View.html "class in javax.swing.text")
**[getParent](../../../javax/swing/text/View.html#getParent%28%29)**()
Returns the parent of the view.
abstract float
**[getPreferredSpan](../../../javax/swing/text/View.html#getPreferredSpan%28int%29)**(int axis)
Determines the preferred span for this view along an axis.
int
**[getResizeWeight](../../../javax/swing/text/View.html#getResizeWeight%28int%29)**(int axis)
Determines the resizability of the view along the given axis.
int
**[getStartOffset](../../../javax/swing/text/View.html#getStartOffset%28%29)**()
Fetches the portion of the model for which this view is responsible.
[String](../../../java/lang/String.html "class in java.lang")
**[getToolTipText](../../../javax/swing/text/View.html#getToolTipText%28float,%20float,%20java.awt.Shape%29)**(float x, float y,[Shape](../../../java/awt/Shape.html "interface in java.awt") allocation)
Returns the tooltip text at the specified location.
[View](../../../javax/swing/text/View.html "class in javax.swing.text")
**[getView](../../../javax/swing/text/View.html#getView%28int%29)**(int n)
Gets the _n_th child view.
int
**[getViewCount](../../../javax/swing/text/View.html#getViewCount%28%29)**()
Returns the number of views in this view.
[ViewFactory](../../../javax/swing/text/ViewFactory.html "interface in javax.swing.text")
**[getViewFactory](../../../javax/swing/text/View.html#getViewFactory%28%29)**()
Fetches the ViewFactory
implementation that is feeding the view hierarchy.
int
**[getViewIndex](../../../javax/swing/text/View.html#getViewIndex%28float,%20float,%20java.awt.Shape%29)**(float x, float y,[Shape](../../../java/awt/Shape.html "interface in java.awt") allocation)
Returns the child view index representing the given position in the view.
int
**[getViewIndex](../../../javax/swing/text/View.html#getViewIndex%28int,%20javax.swing.text.Position.Bias%29)**(int pos,[Position.Bias](../../../javax/swing/text/Position.Bias.html "class in javax.swing.text") b)
Returns the child view index representing the given position in the model.
void
**[insert](../../../javax/swing/text/View.html#insert%28int,%20javax.swing.text.View%29)**(int offs,[View](../../../javax/swing/text/View.html "class in javax.swing.text") v)
Inserts a single child view.
void
**[insertUpdate](../../../javax/swing/text/View.html#insertUpdate%28javax.swing.event.DocumentEvent,%20java.awt.Shape,%20javax.swing.text.ViewFactory%29)**([DocumentEvent](../../../javax/swing/event/DocumentEvent.html "interface in javax.swing.event") e,[Shape](../../../java/awt/Shape.html "interface in java.awt") a,[ViewFactory](../../../javax/swing/text/ViewFactory.html "interface in javax.swing.text") f)
Gives notification that something was inserted into the document in a location that this view is responsible for.
boolean
**[isVisible](../../../javax/swing/text/View.html#isVisible%28%29)**()
Returns a boolean that indicates whether the view is visible or not.
[Shape](../../../java/awt/Shape.html "interface in java.awt")
**[modelToView](../../../javax/swing/text/View.html#modelToView%28int,%20javax.swing.text.Position.Bias,%20int,%20javax.swing.text.Position.Bias,%20java.awt.Shape%29)**(int p0,[Position.Bias](../../../javax/swing/text/Position.Bias.html "class in javax.swing.text") b0, int p1,[Position.Bias](../../../javax/swing/text/Position.Bias.html "class in javax.swing.text") b1,[Shape](../../../java/awt/Shape.html "interface in java.awt") a)
Provides a mapping, for a given region, from the document model coordinate space to the view coordinate space.
[Shape](../../../java/awt/Shape.html "interface in java.awt")
**[modelToView](../../../javax/swing/text/View.html#modelToView%28int,%20java.awt.Shape%29)**(int pos,[Shape](../../../java/awt/Shape.html "interface in java.awt") a)
Deprecated.
abstract [Shape](../../../java/awt/Shape.html "interface in java.awt")
**[modelToView](../../../javax/swing/text/View.html#modelToView%28int,%20java.awt.Shape,%20javax.swing.text.Position.Bias%29)**(int pos,[Shape](../../../java/awt/Shape.html "interface in java.awt") a,[Position.Bias](../../../javax/swing/text/Position.Bias.html "class in javax.swing.text") b)
Provides a mapping, for a given character, from the document model coordinate space to the view coordinate space.
abstract void
**[paint](../../../javax/swing/text/View.html#paint%28java.awt.Graphics,%20java.awt.Shape%29)**([Graphics](../../../java/awt/Graphics.html "class in java.awt") g,[Shape](../../../java/awt/Shape.html "interface in java.awt") allocation)
Renders using the given rendering surface and area on that surface.
void
**[preferenceChanged](../../../javax/swing/text/View.html#preferenceChanged%28javax.swing.text.View,%20boolean,%20boolean%29)**([View](../../../javax/swing/text/View.html "class in javax.swing.text") child, boolean width, boolean height)
Child views can call this on the parent to indicate that the preference has changed and should be reconsidered for layout.
void
**[remove](../../../javax/swing/text/View.html#remove%28int%29)**(int i)
Removes one of the children at the given position.
void
**[removeAll](../../../javax/swing/text/View.html#removeAll%28%29)**()
Removes all of the children.
void
**[removeUpdate](../../../javax/swing/text/View.html#removeUpdate%28javax.swing.event.DocumentEvent,%20java.awt.Shape,%20javax.swing.text.ViewFactory%29)**([DocumentEvent](../../../javax/swing/event/DocumentEvent.html "interface in javax.swing.event") e,[Shape](../../../java/awt/Shape.html "interface in java.awt") a,[ViewFactory](../../../javax/swing/text/ViewFactory.html "interface in javax.swing.text") f)
Gives notification that something was removed from the document in a location that this view is responsible for.
void
**[replace](../../../javax/swing/text/View.html#replace%28int,%20int,%20javax.swing.text.View[]%29)**(int offset, int length,[View](../../../javax/swing/text/View.html "class in javax.swing.text")[] views)
Replaces child views.
void
**[setParent](../../../javax/swing/text/View.html#setParent%28javax.swing.text.View%29)**([View](../../../javax/swing/text/View.html "class in javax.swing.text") parent)
Establishes the parent view for this view.
void
**[setSize](../../../javax/swing/text/View.html#setSize%28float,%20float%29)**(float width, float height)
Sets the size of the view.
protected boolean
**[updateChildren](../../../javax/swing/text/View.html#updateChildren%28javax.swing.event.DocumentEvent.ElementChange,%20javax.swing.event.DocumentEvent,%20javax.swing.text.ViewFactory%29)**([DocumentEvent.ElementChange](../../../javax/swing/event/DocumentEvent.ElementChange.html "interface in javax.swing.event") ec,[DocumentEvent](../../../javax/swing/event/DocumentEvent.html "interface in javax.swing.event") e,[ViewFactory](../../../javax/swing/text/ViewFactory.html "interface in javax.swing.text") f)
Updates the child views in response to receiving notification that the model changed, and there is change record for the element this view is responsible for.
protected void
**[updateLayout](../../../javax/swing/text/View.html#updateLayout%28javax.swing.event.DocumentEvent.ElementChange,%20javax.swing.event.DocumentEvent,%20java.awt.Shape%29)**([DocumentEvent.ElementChange](../../../javax/swing/event/DocumentEvent.ElementChange.html "interface in javax.swing.event") ec,[DocumentEvent](../../../javax/swing/event/DocumentEvent.html "interface in javax.swing.event") e,[Shape](../../../java/awt/Shape.html "interface in java.awt") a)
Updates the layout in response to receiving notification of change from the model.
int
**[viewToModel](../../../javax/swing/text/View.html#viewToModel%28float,%20float,%20java.awt.Shape%29)**(float x, float y,[Shape](../../../java/awt/Shape.html "interface in java.awt") a)
Deprecated.
abstract int
**[viewToModel](../../../javax/swing/text/View.html#viewToModel%28float,%20float,%20java.awt.Shape,%20javax.swing.text.Position.Bias[]%29)**(float x, float y,[Shape](../../../java/awt/Shape.html "interface in java.awt") a,[Position.Bias](../../../javax/swing/text/Position.Bias.html "class in javax.swing.text")[] biasReturn)
Provides a mapping from the view coordinate space to the logical coordinate space of the model.