⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 compositeview.html

📁 API資料大全
💻 HTML
📖 第 1 页 / 共 4 页
字号:
</TR></TABLE><A NAME="loadChildren(javax.swing.text.ViewFactory)"><!-- --></A><H3>loadChildren</H3><PRE>protected void <B>loadChildren</B>(<A HREF="../../../javax/swing/text/ViewFactory.html">ViewFactory</A>&nbsp;f)</PRE><DL><DD>Loads all of the children to initialize the view. This is called by the <a href="#setParent">setParent</a>  method.  Subclasses can reimplement this to initialize  their child views in a different manner.  The default implementation creates a child view for each  child element.<DD><DL><DT><B>Parameters:</B><DD><CODE>f</CODE> - the view factory<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/text/CompositeView.html#setParent(javax.swing.text.View)"><CODE>setParent(javax.swing.text.View)</CODE></A></DL></DD></DL><HR><A NAME="setParent(javax.swing.text.View)"><!-- --></A><H3>setParent</H3><PRE>public void <B>setParent</B>(<A HREF="../../../javax/swing/text/View.html">View</A>&nbsp;parent)</PRE><DL><DD>Sets the parent of the view. This is reimplemented to provide the superclass behavior as well as calling the <code>loadChildren</code> method if this view does not already have children.   The children should not be loaded in the  constructor because the act of setting the parent may cause them to try to search up the hierarchy (to get the hosting Container for example). If this view has children (the view is being moved from one place in the view hierarchy to another),  the <code>loadChildren</code> method will not be called.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/swing/text/View.html#setParent(javax.swing.text.View)">setParent</A></CODE> in class <CODE><A HREF="../../../javax/swing/text/View.html">View</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>parent</CODE> - the parent of the view, null if none</DL></DD></DL><HR><A NAME="getViewCount()"><!-- --></A><H3>getViewCount</H3><PRE>public int <B>getViewCount</B>()</PRE><DL><DD>Returns the number of child views of this view.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/swing/text/View.html#getViewCount()">getViewCount</A></CODE> in class <CODE><A HREF="../../../javax/swing/text/View.html">View</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the number of views >= 0<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/text/CompositeView.html#getView(int)"><CODE>getView(int)</CODE></A></DL></DD></DL><HR><A NAME="getView(int)"><!-- --></A><H3>getView</H3><PRE>public <A HREF="../../../javax/swing/text/View.html">View</A> <B>getView</B>(int&nbsp;n)</PRE><DL><DD>Gets the n-th view in this container.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/swing/text/View.html#getView(int)">getView</A></CODE> in class <CODE><A HREF="../../../javax/swing/text/View.html">View</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>n</CODE> - the number of the view to get, >= 0 && < getViewCount()<DT><B>Returns:</B><DD>the view</DL></DD></DL><HR><A NAME="replace(int, int, javax.swing.text.View[])"><!-- --></A><H3>replace</H3><PRE>public void <B>replace</B>(int&nbsp;offset,                    int&nbsp;length,                    <A HREF="../../../javax/swing/text/View.html">View</A>[]&nbsp;views)</PRE><DL><DD>Replace child views.  If there are no views to remove this acts as an insert.  If there are no views to add this acts as a remove.  Views being removed will have the parent set to null, and the internal reference to them removed so that they can be garbage collected.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/swing/text/View.html#replace(int, int, javax.swing.text.View[])">replace</A></CODE> in class <CODE><A HREF="../../../javax/swing/text/View.html">View</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>index</CODE> - the starting index into the child views to insert   the new views.  This should be a value >= 0 and <= getViewCount.<DD><CODE>length</CODE> - the number of existing child views to remove.   This should be a value >= 0 and <= (getViewCount() - offset).<DD><CODE>views</CODE> - the child views to add.  This value can be null   to indicate no children are being added (useful to remove).</DL></DD></DL><HR><A NAME="getChildAllocation(int, java.awt.Shape)"><!-- --></A><H3>getChildAllocation</H3><PRE>public <A HREF="../../../java/awt/Shape.html">Shape</A> <B>getChildAllocation</B>(int&nbsp;index,                                <A HREF="../../../java/awt/Shape.html">Shape</A>&nbsp;a)</PRE><DL><DD>Fetches the allocation for the given child view.  This enables finding out where various views are located.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/swing/text/View.html#getChildAllocation(int, java.awt.Shape)">getChildAllocation</A></CODE> in class <CODE><A HREF="../../../javax/swing/text/View.html">View</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>index</CODE> - the index of the child, >= 0 && < getViewCount()<DD><CODE>a</CODE> - the allocation to this view.<DT><B>Returns:</B><DD>the allocation to the child</DL></DD></DL><HR><A NAME="modelToView(int, java.awt.Shape, javax.swing.text.Position.Bias)"><!-- --></A><H3>modelToView</H3><PRE>public <A HREF="../../../java/awt/Shape.html">Shape</A> <B>modelToView</B>(int&nbsp;pos,                         <A HREF="../../../java/awt/Shape.html">Shape</A>&nbsp;a,                         <A HREF="../../../javax/swing/text/Position.Bias.html">Position.Bias</A>&nbsp;b)                  throws <A HREF="../../../javax/swing/text/BadLocationException.html">BadLocationException</A></PRE><DL><DD>Provides a mapping from the document model coordinate space to the coordinate space of the view mapped to it.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/swing/text/View.html#modelToView(int, java.awt.Shape, javax.swing.text.Position.Bias)">modelToView</A></CODE> in class <CODE><A HREF="../../../javax/swing/text/View.html">View</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>pos</CODE> - the position to convert >= 0<DD><CODE>a</CODE> - the allocated region to render into<DT><B>Returns:</B><DD>the bounding box of the given position<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/swing/text/BadLocationException.html">BadLocationException</A></CODE> - if the given position does   not represent a valid location in the associated document<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/text/View.html#modelToView(int, java.awt.Shape, javax.swing.text.Position.Bias)"><CODE>View.modelToView(int, java.awt.Shape, javax.swing.text.Position.Bias)</CODE></A></DL></DD></DL><HR><A NAME="modelToView(int, javax.swing.text.Position.Bias, int, javax.swing.text.Position.Bias, java.awt.Shape)"><!-- --></A><H3>modelToView</H3><PRE>public <A HREF="../../../java/awt/Shape.html">Shape</A> <B>modelToView</B>(int&nbsp;p0,                         <A HREF="../../../javax/swing/text/Position.Bias.html">Position.Bias</A>&nbsp;b0,                         int&nbsp;p1,                         <A HREF="../../../javax/swing/text/Position.Bias.html">Position.Bias</A>&nbsp;b1,                         <A HREF="../../../java/awt/Shape.html">Shape</A>&nbsp;a)                  throws <A HREF="../../../javax/swing/text/BadLocationException.html">BadLocationException</A></PRE><DL><DD>Provides a mapping from the document model coordinate space to the coordinate space of the view mapped to it.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/swing/text/View.html#modelToView(int, javax.swing.text.Position.Bias, int, javax.swing.text.Position.Bias, java.awt.Shape)">modelToView</A></CODE> in class <CODE><A HREF="../../../javax/swing/text/View.html">View</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>p0</CODE> - the position to convert >= 0<DD><CODE>b0</CODE> - the bias toward the previous character or the  next character represented by p0, in case the   position is a boundary of two views.<DD><CODE>p1</CODE> - the position to convert >= 0<DD><CODE>b1</CODE> - the bias toward the previous character or the  next character represented by p1, in case the   position is a boundary of two views.<DD><CODE>a</CODE> - the allocated region to render into<DT><B>Returns:</B><DD>the bounding box of the given position is returned<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/swing/text/BadLocationException.html">BadLocationException</A></CODE> - if the given position does   not represent a valid location in the associated document<DD><CODE><A HREF="../../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - for an invalid bias argument<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/text/View.html#viewToModel(float, float, java.awt.Shape, javax.swing.text.Position.Bias[])"><CODE>View.viewToModel(float, float, java.awt.Shape, javax.swing.text.Position.Bias[])</CODE></A></DL></DD></DL><HR><A NAME="viewToModel(float, float, java.awt.Shape, javax.swing.text.Position.Bias[])"><!-- --></A><H3>viewToModel</H3><PRE>public int <B>viewToModel</B>(float&nbsp;x,                       float&nbsp;y,                       <A HREF="../../../java/awt/Shape.html">Shape</A>&nbsp;a,                       <A HREF="../../../javax/swing/text/Position.Bias.html">Position.Bias</A>[]&nbsp;bias)</PRE><DL><DD>Provides a mapping from the view coordinate space to the logical coordinate space of the model.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/swing/text/View.html#viewToModel(float, float, java.awt.Shape, javax.swing.text.Position.Bias[])">viewToModel</A></CODE> in class <CODE><A HREF="../../../javax/swing/text/View.html">View</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>x</CODE> - x coordinate of the view location to convert >= 0<DD><CODE>y</CODE> - y coordinate of the view location to convert >= 0<DD><CODE>a</CODE> - the allocated region to render into<DT><B>Returns:</B><DD>the location within the model that best represents the  given point in the view >= 0<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/text/View.html#viewToModel(float, float, java.awt.Shape, javax.swing.text.Position.Bias[])"><CODE>View.viewToModel(float, float, java.awt.Shape, javax.swing.text.Position.Bias[])</CODE></A></DL></DD></DL><HR><A NAME="getNextVisualPositionFrom(int, javax.swing.text.Position.Bias, java.awt.Shape, int, javax.swing.text.Position.Bias[])"><!-- --></A><H3>getNextVisualPositionFrom</H3><PRE>public int <B>getNextVisualPositionFrom</B>(int&nbsp;pos,                                     <A HREF="../../../javax/swing/text/Position.Bias.html">Position.Bias</A>&nbsp;b,                                     <A HREF="../../../java/awt/Shape.html">Shape</A>&nbsp;a,                                     int&nbsp;direction,                                     <A HREF="../../../javax/swing/text/Position.Bias.html">Position.Bias</A>[]&nbsp;biasRet)                              throws <A HREF="../../../javax/swing/text/BadLocationException.html">BadLocationException</A></PRE><DL><DD>Provides a way to determine the next visually represented model  location that one might place a caret.  Some views may not be visible, they might not be in the same order found in the model, or they just might not allow access to some of the locations in the model.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/swing/text/View.html#getNextVisualPositionFrom(int, javax.swing.text.Position.Bias, java.awt.Shape, int, javax.swing.text.Position.Bias[])">getNextVisualPositionFrom</A></CODE> in class <CODE><A HREF="../../../javax/swing/text/View.html">View</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>pos</CODE> - the position to convert >= 0<DD><CODE>a</CODE> - the allocated region to render into<DD><CODE>direction</CODE> - 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.<DT><B>Returns:</B><DD>the location within the model that best represents the next  location visual position.<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/swing/text/BadLocationException.html">BadLocationException</A></CODE> - &nbsp;<DD><CODE><A HREF="../../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - for an invalid direction</DL></DD></DL><HR><A NAME="getViewIndex(int, javax.swing.text.Position.Bias)"><!-- --></A><H3>getViewIndex</H3><PRE>public int <B>getViewIndex</B>(int&nbsp;pos,                        <A HREF="../../../javax/swing/text/Position.Bias.html">Position.Bias</A>&nbsp;b)</PRE><DL><DD>Returns the child view index representing the given position in the model.  This is implemented to call the getViewIndexByPosition method for backward compatibility.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/swing/text/View.html#getViewIndex(int, javax.swing.text.Position.Bias)">getViewIndex</A></CODE> in class <CODE><A HREF="../../../javax/swing/text/View.html">View</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>pos</CODE> - the position >= 0</DL></DD></DL><HR><A NAME="isBefore(int, int, java.awt.Rectangle)"><!-- --></A><H3>isBefore</H3><PRE>protected abstract boolean <B>isBefore</B>(int&nbsp;x,                                    int&nbsp;y,                                    <A HREF="../../../java/awt/Rectangle.html">Rectangle</A>&nbsp;alloc)</PRE><DL><DD>Tests whether a point lies before the rectangle range.<DD><DL><DT><B>Parameters:</B><DD><CODE>x</CODE> - the X coordinate >= 0<DD><CODE>y</CODE> - the Y coordinate >= 0<DD><CODE>alloc</CODE> - the rectangle<DT><B>Returns:</B><DD>true if the point is before the specified range</DL></DD></DL><HR><A NAME="isAfter(int, int, java.awt.Rectangle)"><!-- --></A><H3>isAfter</H3><PRE>protected abstract boolean <B>isAfter</B>(int&nbsp;x,                                   int&nbsp;y,                                   <A HREF="../../../java/awt/Rectangle.html">Rectangle</A>&nbsp;alloc)</PRE><DL><DD>Tests whether a point lies after the rectangle range.<DD><DL><DT><B>Parameters:</B><DD><CODE>x</CODE> - the X coordinate >= 0<DD><CODE>y</CODE> - the Y coordinate >= 0<DD><CODE>alloc</CODE> - the rectangle<DT><B>Returns:</B><DD>true if the point is after the specified range</DL></DD></DL><HR><A NAME="getViewAtPoint(int, int, java.awt.Rectangle)"><!-- --></A><H3>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -