📄 glyphview.html
字号:
<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="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>[] biasReturn)</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> - the X coordinate >= 0<DD><CODE>y</CODE> - the Y coordinate >= 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 of 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="getBreakWeight(int, float, float)"><!-- --></A><H3>getBreakWeight</H3><PRE>public int <B>getBreakWeight</B>(int axis, float pos, float len)</PRE><DL><DD>Determines how attractive a break opportunity in this view is. This can be used for determining which view is the most attractive to call <code>breakView</code> on in the process of formatting. The higher the weight, the more attractive the break. A value equal to or lower than <code>View.BadBreakWeight</code> should not be considered for a break. A value greater than or equal to <code>View.ForcedBreakWeight</code> should be broken. <p> This is implemented to forward to the superclass for the Y_AXIS. Along the X_AXIS the following values may be returned. <dl> <dt><b>View.ExcellentBreakWeight</b> <dd>if there is whitespace proceeding the desired break location. <dt><b>View.BadBreakWeight</b> <dd>if the desired break location results in a break location of the starting offset. <dt><b>View.GoodBreakWeight</b> <dd>if the other conditions don't occur. </dl> This will normally result in the behavior of breaking on a whitespace location if one can be found, otherwise breaking between characters.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/swing/text/View.html#getBreakWeight(int, float, float)">getBreakWeight</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<DD><CODE>pos</CODE> - the potential location of the start of the broken view >= 0. This may be useful for calculating tab positions.<DD><CODE>len</CODE> - specifies the relative length from <em>pos</em> where a potential break is desired >= 0.<DT><B>Returns:</B><DD>the weight, which should be a value between View.ForcedBreakWeight and View.BadBreakWeight.<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/text/LabelView.html"><CODE>LabelView</CODE></A>, <A HREF="../../../javax/swing/text/ParagraphView.html"><CODE>ParagraphView</CODE></A>, <A HREF="../../../javax/swing/text/View.html#BadBreakWeight"><CODE>View.BadBreakWeight</CODE></A>, <A HREF="../../../javax/swing/text/View.html#GoodBreakWeight"><CODE>View.GoodBreakWeight</CODE></A>, <A HREF="../../../javax/swing/text/View.html#ExcellentBreakWeight"><CODE>View.ExcellentBreakWeight</CODE></A>, <A HREF="../../../javax/swing/text/View.html#ForcedBreakWeight"><CODE>View.ForcedBreakWeight</CODE></A></DL></DD></DL><HR><A NAME="breakView(int, int, float, float)"><!-- --></A><H3>breakView</H3><PRE>public <A HREF="../../../javax/swing/text/View.html">View</A> <B>breakView</B>(int axis, int p0, float pos, float len)</PRE><DL><DD>Breaks this view on the given axis at the given length. This is implemented to attempt to break on a whitespace location, and returns a fragment with the whitespace at the end. If a whitespace location can't be found, the nearest character is used.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/swing/text/View.html#breakView(int, int, float, float)">breakView</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<DD><CODE>p0</CODE> - the location in the model where the fragment should start it's representation >= 0.<DD><CODE>pos</CODE> - the position along the axis that the broken view would occupy >= 0. This may be useful for things like tab calculations.<DD><CODE>len</CODE> - specifies the distance along the axis where a potential break is desired >= 0.<DT><B>Returns:</B><DD>the fragment of the view that represents the given span, if the view can be broken. If the view doesn't support breaking behavior, the view itself is returned.<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/text/View.html#breakView(int, int, float, float)"><CODE>View.breakView(int, int, float, float)</CODE></A></DL></DD></DL><HR><A NAME="createFragment(int, int)"><!-- --></A><H3>createFragment</H3><PRE>public <A HREF="../../../javax/swing/text/View.html">View</A> <B>createFragment</B>(int p0, int p1)</PRE><DL><DD>Creates a view that represents a portion of the element. This is potentially useful during formatting operations for taking measurements of fragments of the view. If the view doesn't support fragmenting (the default), it should return itself. <p> This view does support fragmenting. It is implemented to return a nested class that shares state in this view representing only a portion of the view.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/swing/text/View.html#createFragment(int, int)">createFragment</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 starting offset >= 0. This should be a value greater or equal to the element starting offset and less than the element ending offset.<DD><CODE>p1</CODE> - the ending offset > p0. This should be a value less than or equal to the elements end offset and greater than the elements starting offset.<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/text/LabelView.html"><CODE>LabelView</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 pos, <A HREF="../../../javax/swing/text/Position.Bias.html">Position.Bias</A> b, <A HREF="../../../java/awt/Shape.html">Shape</A> a, int direction, <A HREF="../../../javax/swing/text/Position.Bias.html">Position.Bias</A>[] 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> - <DD><CODE><A HREF="../../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - for an invalid direction</DL></DD></DL><HR><A NAME="insertUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)"><!-- --></A><H3>insertUpdate</H3><PRE>public void <B>insertUpdate</B>(<A HREF="../../../javax/swing/event/DocumentEvent.html">DocumentEvent</A> e, <A HREF="../../../java/awt/Shape.html">Shape</A> a, <A HREF="../../../javax/swing/text/ViewFactory.html">ViewFactory</A> f)</PRE><DL><DD>Gives notification that something was inserted into the document in a location that this view is responsible for. This is implemented to call preferenceChanged along the axis the glyphs are rendered.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/swing/text/View.html#insertUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)">insertUpdate</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>e</CODE> - the change information from the associated document<DD><CODE>a</CODE> - the current allocation of the view<DD><CODE>f</CODE> - the factory to use to rebuild if the view has children<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/text/View.html#insertUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)"><CODE>View.insertUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)</CODE></A></DL></DD></DL><HR><A NAME="removeUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)"><!-- --></A><H3>removeUpdate</H3><PRE>public void <B>removeUpdate</B>(<A HREF="../../../javax/swing/event/DocumentEvent.html">DocumentEvent</A> e, <A HREF="../../../java/awt/Shape.html">Shape</A> a, <A HREF="../../../javax/swing/text/ViewFactory.html">ViewFactory</A> f)</PRE><DL><DD>Gives notification that something was removed from the document in a location that this view is responsible for. This is implemented to call preferenceChanged along the axis the glyphs are rendered.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/swing/text/View.html#removeUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)">removeUpdate</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>e</CODE> - the change information from the associated document<DD><CODE>a</CODE> - the current allocation of the view<DD><CODE>f</CODE> - the factory to use to rebuild if the view has children<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/text/View.html#removeUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)"><CODE>View.removeUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)</CODE></A></DL></DD></DL><HR><A NAME="changedUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)"><!-- --></A><H3>changedUpdate</H3><PRE>public void <B>changedUpdate</B>(<A HREF="../../../javax/swing/event/DocumentEvent.html">DocumentEvent</A> e, <A HREF="../../../java/awt/Shape.html">Shape</A> a, <A HREF="../../../javax/swing/text/ViewFactory.html">ViewFactory</A> f)</PRE><DL><DD>Gives notification from the document that attributes were changed in a location that this view is responsible for. This is implemented to call preferenceChanged along both the horizontal and vertical axis.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/swing/text/View.html#changedUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)">changedUpdate</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>e</CODE> - the change information from the associated document<DD><CODE>a</CODE> - the current allocation of the view<DD><CODE>f</CODE> - the factory to use to rebuild if the view has children<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/text/View.html#changedUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)"><CODE>View.changedUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)</CODE></A></DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/GlyphView.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Java<sup><font size=-2>TM</font></sup> 2 Platform<br>Std. Ed. v1.3</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../javax/swing/text/GapContent.html"><B>PREV CLASS</B></A> <A HREF="../../../javax/swing/text/GlyphView.GlyphPainter.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="GlyphView.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: <A HREF="#inner_class_summary">INNER</A> | <A HREF="#fields_inherited_from_class_javax.swing.text.View">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><font size="-1"><a href="http://java.sun.com/cgi-bin/bugreport.cgi">Submit a bug or feature</a><br>For further API reference and developer documentation, see <a href="http://java.sun.com/products/jdk/1.3/devdocs-vs-specs.html">Java 2 SDK SE Developer Documentation</a>. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. <p>Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.<br>Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road<br>Palo Alto, California, 94303, U.S.A. All Rights Reserved.</font></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -