📄 boxview.html
字号:
<A NAME="setSize(float, float)"><!-- --></A><H3>setSize</H3><PRE>public void <B>setSize</B>(float width, float height)</PRE><DL><DD>Sets the size of the view. If the size has changed, layout is redone. The size is the full size of the view including the inset areas.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/swing/text/View.html#setSize(float, float)">setSize</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>width</CODE> - the width >= 0<DD><CODE>height</CODE> - the height >= 0</DL></DD></DL><HR><A NAME="paint(java.awt.Graphics, java.awt.Shape)"><!-- --></A><H3>paint</H3><PRE>public void <B>paint</B>(<A HREF="../../../java/awt/Graphics.html">Graphics</A> g, <A HREF="../../../java/awt/Shape.html">Shape</A> allocation)</PRE><DL><DD>Renders using the given rendering surface and area on that surface. Only the children that intersect the clip bounds of the given Graphics will be rendered.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/swing/text/View.html#paint(java.awt.Graphics, java.awt.Shape)">paint</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>g</CODE> - the rendering surface to use<DD><CODE>allocation</CODE> - the allocated region to render into<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/text/View.html#paint(java.awt.Graphics, java.awt.Shape)"><CODE>View.paint(java.awt.Graphics, java.awt.Shape)</CODE></A></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 index, <A HREF="../../../java/awt/Shape.html">Shape</A> a)</PRE><DL><DD>Fetches the allocation for the given child view. This enables finding out where various views are located. This is implemented to return null if the layout is invalid, otherwise the superclass behavior is executed.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/swing/text/CompositeView.html#getChildAllocation(int, java.awt.Shape)">getChildAllocation</A></CODE> in class <CODE><A HREF="../../../javax/swing/text/CompositeView.html">CompositeView</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 pos, <A HREF="../../../java/awt/Shape.html">Shape</A> a, <A HREF="../../../javax/swing/text/Position.Bias.html">Position.Bias</A> 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. This makes sure the allocation is valid before letting the superclass do its thing.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/swing/text/CompositeView.html#modelToView(int, java.awt.Shape, javax.swing.text.Position.Bias)">modelToView</A></CODE> in class <CODE><A HREF="../../../javax/swing/text/CompositeView.html">CompositeView</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="viewToModel(float, float, java.awt.Shape, javax.swing.text.Position.Bias[])"><!-- --></A><H3>viewToModel</H3><PRE>public int <B>viewToModel</B>(float x, float y, <A HREF="../../../java/awt/Shape.html">Shape</A> a, <A HREF="../../../javax/swing/text/Position.Bias.html">Position.Bias</A>[] 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/CompositeView.html#viewToModel(float, float, java.awt.Shape, javax.swing.text.Position.Bias[])">viewToModel</A></CODE> in class <CODE><A HREF="../../../javax/swing/text/CompositeView.html">CompositeView</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="getAlignment(int)"><!-- --></A><H3>getAlignment</H3><PRE>public float <B>getAlignment</B>(int axis)</PRE><DL><DD>Determines the desired alignment for this view along an axis. This is implemented to give the total alignment needed to position the children with the alignment points lined up along the axis orthoginal to the axis that is being tiled. The axis being tiled will request to be centered (i.e. 0.5f).<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/swing/text/View.html#getAlignment(int)">getAlignment</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>axis</CODE> - may be either View.X_AXIS or View.Y_AXIS<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - for an invalid axis</DL></DD></DL><HR><A NAME="getPreferredSpan(int)"><!-- --></A><H3>getPreferredSpan</H3><PRE>public float <B>getPreferredSpan</B>(int axis)</PRE><DL><DD>Determines the preferred span for this view along an axis.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/swing/text/View.html#getPreferredSpan(int)">getPreferredSpan</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>axis</CODE> - may be either View.X_AXIS or View.Y_AXIS<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - for an invalid axis type</DL></DD></DL><HR><A NAME="getMinimumSpan(int)"><!-- --></A><H3>getMinimumSpan</H3><PRE>public float <B>getMinimumSpan</B>(int axis)</PRE><DL><DD>Determines the minimum span for this view along an axis.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/swing/text/View.html#getMinimumSpan(int)">getMinimumSpan</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>axis</CODE> - may be either View.X_AXIS or View.Y_AXIS<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - for an invalid axis type</DL></DD></DL><HR><A NAME="getMaximumSpan(int)"><!-- --></A><H3>getMaximumSpan</H3><PRE>public float <B>getMaximumSpan</B>(int axis)</PRE><DL><DD>Determines the maximum span for this view along an axis.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/swing/text/View.html#getMaximumSpan(int)">getMaximumSpan</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>axis</CODE> - may be either View.X_AXIS or View.Y_AXIS<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - for an invalid axis type</DL></DD></DL><HR><A NAME="isAllocationValid()"><!-- --></A><H3>isAllocationValid</H3><PRE>protected boolean <B>isAllocationValid</B>()</PRE><DL><DD>Are the allocations for the children still valid?<DD><DL><DT><B>Returns:</B><DD>true if allocations still valid</DL></DD></DL><HR><A NAME="isBefore(int, int, java.awt.Rectangle)"><!-- --></A><H3>isBefore</H3><PRE>protected boolean <B>isBefore</B>(int x, int y, <A HREF="../../../java/awt/Rectangle.html">Rectangle</A> innerAlloc)</PRE><DL><DD>Determines if a point falls before an allocated region.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/swing/text/CompositeView.html#isBefore(int, int, java.awt.Rectangle)">isBefore</A></CODE> in class <CODE><A HREF="../../../javax/swing/text/CompositeView.html">CompositeView</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>x</CODE> - the X coordinate >= 0<DD><CODE>y</CODE> - the Y coordinate >= 0<DD><CODE>innerAlloc</CODE> - the allocated region. This is the area inside of the insets.<DT><B>Returns:</B><DD>true if the point lies before the region else false</DL></DD></DL><HR><A NAME="isAfter(int, int, java.awt.Rectangle)"><!-- --></A><H3>isAfter</H3><PRE>protected boolean <B>isAfter</B>(int x, int y, <A HREF="../../../java/awt/Rectangle.html">Rectangle</A> innerAlloc)</PRE><DL><DD>Determines if a point falls after an allocated region.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/swing/text/CompositeView.html#isAfter(int, int, java.awt.Rectangle)">isAfter</A></CODE> in class <CODE><A HREF="../../../javax/swing/text/CompositeView.html">CompositeView</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>x</CODE> - the X coordinate >= 0<DD><CODE>y</CODE> - the Y coordinate >= 0<DD><CODE>innerAlloc</CODE> - the allocated region. This is the area inside of the insets.<DT><B>Returns:</B><DD>true if the point lies after the region else false</DL></DD></DL><HR><A NAME="getViewAtPoint(int, int, java.awt.Rectangle)"><!-- --></A><H3>getViewAtPoint</H3><PRE>protected <A HREF="../../../javax/swing/text/View.html">View</A> <B>getViewAtPoint</B>(int x, int y, <A HREF="../../../java/awt/Rectangle.html">Rectangle</A> alloc)</PRE><DL><DD>Fetches the child view at the given point.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/swing/text/CompositeView.html#getViewAtPoint(int, int, java.awt.Rectangle)">getViewAtPoint</A></CODE> in class <CODE><A HREF="../../../javax/swing/text/CompositeView.html">CompositeView</A></CODE></DL></DD><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 parents inner allocation on entry, which should be changed to the childs allocation on exit.<DT><B>Returns:</B><DD>the view</DL></DD></DL><HR>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -