📄 treeselectionmodel.html
字号:
<PRE>public void <B>removeSelectionPath</B>(<A HREF="../../../javax/swing/tree/TreePath.html">TreePath</A> path)</PRE><DL><DD>Removes path from the selection. If path is in the selection The TreeSelectionListeners are notified. This has no effect if <code>path</code> is null.<DD><DL><DT><B>Parameters:</B><DD><CODE>path</CODE> - the path to remove from the selection</DL></DD></DL><HR><A NAME="removeSelectionPaths(javax.swing.tree.TreePath[])"><!-- --></A><H3>removeSelectionPaths</H3><PRE>public void <B>removeSelectionPaths</B>(<A HREF="../../../javax/swing/tree/TreePath.html">TreePath</A>[] paths)</PRE><DL><DD>Removes paths from the selection. If any of the paths in <code>paths</code> are in the selection, the TreeSelectionListeners are notified. This method has no effect if <code>paths</code> is null.<DD><DL><DT><B>Parameters:</B><DD><CODE>paths</CODE> - the path to remove from the selection</DL></DD></DL><HR><A NAME="getSelectionPath()"><!-- --></A><H3>getSelectionPath</H3><PRE>public <A HREF="../../../javax/swing/tree/TreePath.html">TreePath</A> <B>getSelectionPath</B>()</PRE><DL><DD>Returns the first path in the selection. How first is defined is up to implementors, and may not necessarily be the TreePath with the smallest integer value as determined from the <code>RowMapper</code>.</DL><HR><A NAME="getSelectionPaths()"><!-- --></A><H3>getSelectionPaths</H3><PRE>public <A HREF="../../../javax/swing/tree/TreePath.html">TreePath</A>[] <B>getSelectionPaths</B>()</PRE><DL><DD>Returns the paths in the selection. This will return null (or an empty array) if nothing is currently selected.</DL><HR><A NAME="getSelectionCount()"><!-- --></A><H3>getSelectionCount</H3><PRE>public int <B>getSelectionCount</B>()</PRE><DL><DD>Returns the number of paths that are selected.</DL><HR><A NAME="isPathSelected(javax.swing.tree.TreePath)"><!-- --></A><H3>isPathSelected</H3><PRE>public boolean <B>isPathSelected</B>(<A HREF="../../../javax/swing/tree/TreePath.html">TreePath</A> path)</PRE><DL><DD>Returns true if the path, <code>path</code>, is in the current selection.</DL><HR><A NAME="isSelectionEmpty()"><!-- --></A><H3>isSelectionEmpty</H3><PRE>public boolean <B>isSelectionEmpty</B>()</PRE><DL><DD>Returns true if the selection is currently empty.</DL><HR><A NAME="clearSelection()"><!-- --></A><H3>clearSelection</H3><PRE>public void <B>clearSelection</B>()</PRE><DL><DD>Empties the current selection. If this represents a change in the current selection, the selection listeners are notified.</DL><HR><A NAME="setRowMapper(javax.swing.tree.RowMapper)"><!-- --></A><H3>setRowMapper</H3><PRE>public void <B>setRowMapper</B>(<A HREF="../../../javax/swing/tree/RowMapper.html">RowMapper</A> newMapper)</PRE><DL><DD>Sets the RowMapper instance. This instance is used to determine the row for a particular TreePath.</DL><HR><A NAME="getRowMapper()"><!-- --></A><H3>getRowMapper</H3><PRE>public <A HREF="../../../javax/swing/tree/RowMapper.html">RowMapper</A> <B>getRowMapper</B>()</PRE><DL><DD>Returns the RowMapper instance that is able to map a TreePath to a row.</DL><HR><A NAME="getSelectionRows()"><!-- --></A><H3>getSelectionRows</H3><PRE>public int[] <B>getSelectionRows</B>()</PRE><DL><DD>Returns all of the currently selected rows. This will return null (or an empty array) if there are no selected TreePaths or a RowMapper has not been set.</DL><HR><A NAME="getMinSelectionRow()"><!-- --></A><H3>getMinSelectionRow</H3><PRE>public int <B>getMinSelectionRow</B>()</PRE><DL><DD>Returns the smallest value obtained from the RowMapper for the current set of selected TreePaths. If nothing is selected, or there is no RowMapper, this will return -1.</DL><HR><A NAME="getMaxSelectionRow()"><!-- --></A><H3>getMaxSelectionRow</H3><PRE>public int <B>getMaxSelectionRow</B>()</PRE><DL><DD>Returns the largest value obtained from the RowMapper for the current set of selected TreePaths. If nothing is selected, or there is no RowMapper, this will return -1.</DL><HR><A NAME="isRowSelected(int)"><!-- --></A><H3>isRowSelected</H3><PRE>public boolean <B>isRowSelected</B>(int row)</PRE><DL><DD>Returns true if the row identitifed by row is selected.</DL><HR><A NAME="resetRowSelection()"><!-- --></A><H3>resetRowSelection</H3><PRE>public void <B>resetRowSelection</B>()</PRE><DL><DD>Updates this object's mapping from TreePaths to rows. This should be invoked when the mapping from TreePaths to integers has changed (for example, a node has been expanded). <p> You do not normally have to call this; JTree and its associated listeners will invoke this for you. If you are implementing your own view class, then you will have to invoke this.</DL><HR><A NAME="getLeadSelectionRow()"><!-- --></A><H3>getLeadSelectionRow</H3><PRE>public int <B>getLeadSelectionRow</B>()</PRE><DL><DD>Returns the lead selection index. That is the last index that was added.</DL><HR><A NAME="getLeadSelectionPath()"><!-- --></A><H3>getLeadSelectionPath</H3><PRE>public <A HREF="../../../javax/swing/tree/TreePath.html">TreePath</A> <B>getLeadSelectionPath</B>()</PRE><DL><DD>Returns the last path that was added. This may differ from the leadSelectionPath property maintained by the JTree.</DL><HR><A NAME="addPropertyChangeListener(java.beans.PropertyChangeListener)"><!-- --></A><H3>addPropertyChangeListener</H3><PRE>public void <B>addPropertyChangeListener</B>(<A HREF="../../../java/beans/PropertyChangeListener.html">PropertyChangeListener</A> listener)</PRE><DL><DD>Adds a PropertyChangeListener to the listener list. The listener is registered for all properties. <p> A PropertyChangeEvent will get fired when the selection mode changes.<DD><DL><DT><B>Parameters:</B><DD><CODE>listener</CODE> - the PropertyChangeListener to be added</DL></DD></DL><HR><A NAME="removePropertyChangeListener(java.beans.PropertyChangeListener)"><!-- --></A><H3>removePropertyChangeListener</H3><PRE>public void <B>removePropertyChangeListener</B>(<A HREF="../../../java/beans/PropertyChangeListener.html">PropertyChangeListener</A> listener)</PRE><DL><DD>Removes a PropertyChangeListener from the listener list. This removes a PropertyChangeListener that was registered for all properties.<DD><DL><DT><B>Parameters:</B><DD><CODE>listener</CODE> - the PropertyChangeListener to be removed</DL></DD></DL><HR><A NAME="addTreeSelectionListener(javax.swing.event.TreeSelectionListener)"><!-- --></A><H3>addTreeSelectionListener</H3><PRE>public void <B>addTreeSelectionListener</B>(<A HREF="../../../javax/swing/event/TreeSelectionListener.html">TreeSelectionListener</A> x)</PRE><DL><DD>Adds x to the list of listeners that are notified each time the set of selected TreePaths changes.<DD><DL><DT><B>Parameters:</B><DD><CODE>x</CODE> - the new listener to be added</DL></DD></DL><HR><A NAME="removeTreeSelectionListener(javax.swing.event.TreeSelectionListener)"><!-- --></A><H3>removeTreeSelectionListener</H3><PRE>public void <B>removeTreeSelectionListener</B>(<A HREF="../../../javax/swing/event/TreeSelectionListener.html">TreeSelectionListener</A> x)</PRE><DL><DD>Removes x from the list of listeners that are notified each time the set of selected TreePaths changes.<DD><DL><DT><B>Parameters:</B><DD><CODE>x</CODE> - the listener to remove</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/TreeSelectionModel.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/tree/TreeNode.html"><B>PREV CLASS</B></A> NEXT CLASS</FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="TreeSelectionModel.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | <A HREF="#field_summary">FIELD</A> | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: <A HREF="#field_detail">FIELD</A> | CONSTR | <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 + -