|
Generated by JDiff |
||||||||
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES |
This file contains all the changes in documentation in the packagejavax.swing.tree
as colored differences. Deletions are shownlike this, and additions are shown like this.
If no deletions or additions are shown in an entry, the HTML tags will be what has changed. The new HTML tags are shown in the differences. If no documentation existed, and then some was added in a later version, this change is noted in the appropriate class pages of differences, but the change is not shown on this page. Only changes in existing text are shown here. Similarly, documentation which was inherited from another class or interface is not shown here.
Note that an HTML error in the new documentation may cause the display of other documentation changes to be presented incorrectly. For instance, failure to close a <code> tag will cause all subsequent paragraphs to be displayed differently.
Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. A future release of Swing will provide support for long term persistence. @version 1.6 0810 02/2802/9800 @author Scott Violet
ADefaultMutableTreeNode
is a general-purpose node in a tree data structure. For examples of using default mutable tree nodes see How to Use Trees in The Java Tutorial.A tree node may have at most one parent and 0 or more children.
DefaultMutableTreeNode
provides operations for examining and modifying a node's parent and children and also operations for examining the tree that the node is a part of. A node's tree is the set of all nodes that can be reached by starting at the node and following all the possible links to parents and children. A node with no parent is the root of its tree; a node with no children is a leaf. A tree may consist of many subtrees each node acting as the root for its own subtree.This class provides enumerations for efficiently traversing a tree or subtree in various orders or for following the path between two nodes. A
DefaultMutableTreeNode
may also hold a reference to a user object the use of which is left to the user. Asking aDefaultMutableTreeNode
for its string representation withtoString()
returns the string representation of its user object.This is not a thread safe class.If you intend to use a DefaultMutableTreeNode (or a tree of TreeNodes) in more than one thread you need to do your own synchronizing. A good convention to adopt is synchronizing on the root node of a tree.
While DefaultMutableTreeNode implements the MutableTreeNode interface and will allow you to add in any implementation of MutableTreeNode not all of the methods in DefaultMutableTreeNode will be applicable to all MutableTreeNodes implementations. Especially with some of the enumerations that are provided using some of these methods assumes the DefaultMutableTreeNode contains only DefaultMutableNode instances. All of the TreeNode/MutableTreeNode methods will behave as defined no matter what implementations are added.
Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. A future release of Swing will provide support for long term persistence. @see MutableTreeNode @version 1.
11 0815 02/2802/9800 @author Rob Davis
A TreeCellEditor. You need to supply an instance of DefaultTreeCellRenderer so that the icons can be obtained. You can optionaly supply a TreeCellEditor that will be layed out according to the icon in the DefaultTreeCellRenderer. If you do not supply a TreeCellEditor a TextField will be used. Editing is started on a triple mouse click or after a click pause click and a delay of 1200 miliseconds.Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. A future release of Swing will provide support for long term persistence. @see javax.swing.JTree @version 1.
14 0417 02/2202/9900 @author Scott Violet
Displays an entry in a tree. See How to Use Trees in The Java Tutorial for examples of customizing node display using this class.Class DefaultTreeCellRenderer, Component getTreeCellRendererComponent(JTree, Object, boolean, boolean, boolean, int, boolean)Implementation Note: This class overrides
validate
revalidate
repaint
andfirePropertyChange
solely to improve performance. If not overridden these frequently called methods would execute code paths that are unnecessary for the default tree cell renderer. If you write your own renderer take care to weigh the benefits and drawbacks of overriding these methods.Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. A future release of Swing will provide support for long term persistence. @version 1.
31 0440 02/2202/9900 @author Rob Davis @author Ray Ryan @author Scott Violet
Configures the renderer based on the passed in components. The value is set from messagingClass DefaultTreeCellRenderer, void revalidate()valuethe tree withconvertValueToText
which ultimately invokestoString
on()value
. The foreground color is set based on the selection and the icon is set based on on leaf and expanded.
Class DefaultTreeCellRenderer, void setBackground(Color)SupportOverridden fordeferredperformanceautomatic layout. Calls invalidate() and then adds this components validateRoot to a list of components that need to be validated. Validation will occur after all currently pending events have been dispatched. In other words after this method is called the first validateRoot (if any) found when walking up the containment hierarchy of this component will be validated. By default JRootPane JScrollPane and JTextField return true from isValidateRoot(). This method will automatically be called on this component when a property value changes such that size location or internal layout of this component has been affectedreasons.ThisSeeautomatic updating differs from the AWT because programs generally no longer need to invoke validate() to get the contents oftheGUI to update.Implementation@seeNotejava.awt.Component#invalidatefor@seemorejava.awtinformation.Container#validate @see #isValidateRoot @see RepaintManager#addInvalidComponent
Subclassed toClass DefaultTreeCellRenderer, void setFont(Font)onlymapacceptColorUIResource
s to null. Ifcolor
is null or aColorUIResource
this has the effect of letting the background color of the JTree show through. On the other hand ifitcolor
isisn'tnon-null and not aColorUIResource
the background becomescolor
.
Subclassed toClass DefaultTreeCellRenderer, void validate()onlymapacceptFontUIResource
s to null. Iffont
is null or aFontUIResource
this has the effect of letting the font of the JTree show through. On the other hand ifitfont
is non-nullisn'tand not aFontUIResource
the font becomesfont
.
Validates this containerOverridden for performanceand all of its subcomponentsreasons.AWT uses validate to cause a container to laySeeout its subcomponents again afterthecomponents it containsImplementationhaveNotebeen addedfor moreto or modifiedinformation.@see #validate @see Component#invalidate
A simple tree data model that uses TreeNodes. For further information and examples that use DefaultTreeModel see How to Use Trees in The Java Tutorial.Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. A future release of Swing will provide support for long term persistence. @version 1.
37 0441 02/2202/9900 @author Rob Davis @author Ray Ryan @author Scott Violet
Class DefaultTreeSelectionModel, constructor DefaultTreeSelectionModel()ImplementationDefault implementation of TreeSelectionModel. Listeners are notified whenever the paths in the selection change not the rows. In order to be able to track row changes you may wish to become a listener for expansion events on the tree and test for changes from there.resetRowSelection is called from any of the methods that update the selected paths. If you subclass
andany of these methods to filter what is allowed to be selected be sure and messageresetRowSelection
if you do not message super.Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. A future release of Swing will provide support for long term persistence. @see javax.swing.JTree @version 1.
25 1137 02/1702/9800 @author Scott Violet
Creates a new instance of DefaultTreeSelectionModel that is emptyClass DefaultTreeSelectionModel, void addPropertyChangeListener(PropertyChangeListener)andwithhavinga selection mode of DISCONTIGUOUS_TREE_SELECTION.
Class DefaultTreeSelectionModel, void addSelectionPath(TreePath)AddAdds a PropertyChangeListener to the listener list. The listener is registered for all properties.A PropertyChangeEvent will get fired
inwhenresponse to an explicit setFont setBackground or SetForeground on the current component. Note that ifthecurrent component is inheriting its foreground background orselectionfontmodefrom its container then no event will be fired in response to a change in the inherited propertychanges. @param listenerThethe PropertyChangeListener to be added
Adds path to the current selection. If path is not currently in the selection the TreeSelectionListeners are notified. This has no effect ifClass DefaultTreeSelectionModel, void addSelectionPaths(TreePath[])path
is null. @param path the new path to add to the current selection.
Adds paths to the current selection. If any of the paths in paths are not currently in the selection the TreeSelectionListeners are notified. This has no effect ifClass DefaultTreeSelectionModel, void addTreeSelectionListener(TreeSelectionListener)paths
is null.The lead path is set to the last element in
paths
.If the selection mode is
@param path the new path to add to the current selectionCONTIGUOUS_TREE_SELECTION
and adding the new paths would make the selection discontiguous. Then two things can result: if the TreePaths inpaths
are contiguous then the selection becomes these TreePaths otherwise the TreePaths aren't contiguous and the selection becomes the first TreePath inpaths
..
Adds x to the list of listeners that are notified each time theClass DefaultTreeSelectionModel, boolean arePathsContiguous(TreePath[])selectionset of selected TreePaths changes. @param x the new listener to be added.
Returns true if the paths are contiguous or this object has no RowMapper.Class DefaultTreeSelectionModel, boolean canPathsBeAdded(TreePath[])
Class DefaultTreeSelectionModel, Object clone()ReturnsUsedtrueto test iftheapathsparticular set ofTreePath
s can be added. This will return true ifpaths
is null (or empty) or this object haswithout breakingno RowMapper or nothing is currently selected or thecontinuityselectionofmode isDISCONTIGUOUS_TREE_SELECTION
or adding the paths to themodelcurrent selection still results in a contiguous set ofTreePath
s.
Returns a clone ofClass DefaultTreeSelectionModel, TreePath getLeadSelectionPath()the recieverthis object with the same selection.selectionListeners andThisPropertyListeners aremethod does notduplicated. @exception CloneNotSupportedException ifduplicatethe receiver doesselectionnot bothlisteners and(a)propertyimplementlisteners.the@exceptionCloneable interface andCloneNotSupportedException never thrown(b)bydefine ainstances ofclonethismethod.class
Returns the last path that was added. This may differ from the leadSelectionPath property maintained by the JTree.Class DefaultTreeSelectionModel, int getMaxSelectionRow()
Class DefaultTreeSelectionModel, int getMinSelectionRow()GetsReturns thelastlargest value obtained from the RowMapper for the current set of selected TreePaths. If nothing is selectedrowor there is no RowMapper this will return -1.
Class DefaultTreeSelectionModel, RowMapper getRowMapper()GetsReturns thefirstsmallest value obtained from the RowMapper for the current set of selected TreePaths. If nothing is selectedrowor there is no RowMapper this will return -1.
Returns the RowMapper instance that is able to map aClass DefaultTreeSelectionModel, int getSelectionMode()pathTreePath to a row.
Returns the selection mode one ofClass DefaultTreeSelectionModel, TreePath getSelectionPath()SINGLE_TREE_SELECTION
DISCONTIGUOUS_TREE_SELECTION
orCONTIGUOUS_TREE_SELECTION
.
Returns the first path in the selection. This is useful if there if only one item currently selected.Class DefaultTreeSelectionModel, TreePath[] getSelectionPaths()
Returns the paths in the selection. This will return null (or an empty array) if nothing is currently selected.Class DefaultTreeSelectionModel, int[] getSelectionRows()
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. This may return an array of length less that than of the selected TreePaths if some of the rows are not visible (that is the RowMapper returned -1 for the row corresponding to the TreePath).Class DefaultTreeSelectionModel, void insureRowContinuity()
Class DefaultTreeSelectionModel, void insureUniqueness()UsefulMakes sure the currently selected TreePaths are valid for the current selection mode. If the selection mode isCONTIGUOUS_TREE_SELECTION
.Ifand a RowMapper exists this will make sure all the rowsthatareselectedcontiguous.are notIf thecontiguousselection isn'tthencontiguous the selection is reset tobecontain the first set of contiguous paths.Or ifIf the selection mode is
single selectionSINGLE_TREE_SELECTION
and more than onethisTreePath is selected the selection is reset to contain the first path currently selected.
Class DefaultTreeSelectionModel, boolean isPathSelected(TreePath)InsuresThis methodthat all the elements in pathis obsolete and its implementation isarenow auniquenoop.ThisIt'sdoes not check for a nullstill called by setSelectionPaths and addSelectionPathsselectionbut only for backwards compatability.
Returns true if the path path
is in the current selection.
Class DefaultTreeSelectionModel, void removePropertyChangeListener(PropertyChangeListener)Class DefaultTreeSelectionModel, void removeSelectionPath(TreePath)RemoveRemoves a PropertyChangeListener from the listener list. This removes a PropertyChangeListener that was registered for all properties. @param listenerThethe PropertyChangeListener to be removed
Removes path from the selection. If path is in the selection The TreeSelectionListeners are notified. This has no effect ifClass DefaultTreeSelectionModel, void removeSelectionPaths(TreePath[])path
is null. @param path the path to remove from the selection.
Removes paths from the selection. If any of the paths in paths are in the selection the TreeSelectionListeners are notified. This has no effect ifClass DefaultTreeSelectionModel, void removeTreeSelectionListener(TreeSelectionListener)paths
is null. @param path the path to remove from the selection.
Removes x from the list of listeners that are notified each time theClass DefaultTreeSelectionModel, void resetRowSelection()selectionset of selected TreePaths changes. @param x the listener to remove.
Class DefaultTreeSelectionModel, void setRowMapper(RowMapper)Recalculates whatUpdates this object's mapping from TreePath to rows.are selected by askingThis should be invoked when theRowMappermapping from TreePaths to integers has changed (fortheexample a node has beenrowexpanded).You do not normally have to call this JTree
and its associated Listeners will invoke this foreachyou. If you are implementing your own View class then you will have to invoke this.This will invoke
insureRowContinuity
to make sure the currently selected TreePaths are still valid based on the selectionpathmode.
Sets the RowMapper instance. This instance is used to determineClass DefaultTreeSelectionModel, void setSelectionMode(int)whatthe rowcorrespondsforto what patha particular TreePath.
Sets the selection model which must be one of SINGLE_TREE_SELECTION CONTIGUOUS_TREE_SELECTION or DISCONTIGUOUS_TREE_SELECTION. If mode is not one of the defined valueClass DefaultTreeSelectionModel, void setSelectionPath(TreePath)DISCONTIGUOUS_TREE_SELECTION
is assumed.This may change the selection if the current selection is not valid for the new mode. For example if three TreePaths are selected when the mode is changed to
SINGLE_TREE_SELECTION
only one TreePath will remain selected. It is up to the particular implementation to decide what TreePath remains selected.Setting the mode to something other than the defined types will result in the mode becoming
DISCONTIGUOUS_TREE_SELECTION
.
Sets the selection to path. If this represents a change then the TreeSelectionListeners are notified. IfClass DefaultTreeSelectionModel, void setSelectionPaths(TreePath[])path
is null this has the same effect as invokingclearSelection
. @param path new path to select
Sets the selection to the paths in paths. If this represents a change the TreeSelectionListeners are notified. Potentially paths will be held byClass DefaultTreeSelectionModel, DefaultListSelectionModel listSelectionModelthethisrecieverobject; in other words don't change any of the objects in the array once passed in.If
paths
is null this has the same effect as invokingclearSelection
.The lead path is set to the last path in
pPaths
.If the selection mode is
@param paths new selectionCONTIGUOUS_TREE_SELECTION
and adding the new paths would make the selection discontiguous the selection is reset to the first TreePath inpaths
..
Handles maintaining the list selection model. The RowMapper is used to map from a TreePath to a row and the value is then placed here.
Exception used to stop and expand/collapse from happening. See How to Write a Tree-Will-Expand Listener in The Java Tutorial for further information and examples. @version 1.4 087 02/2602/9800 @author Scott Violet
NOTE: This will become more open in a future release.Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. A future release of Swing will provide support for long term persistence. @version 1.
10 0413 02/2202/9900 @author Scott Violet
Defines the requirements for a tree node object that can change -- by adding or removing child nodes or by changing the contents of a user object stored in the node. @see DefaultMutableTreeNode @see javax.swing.JTree @version 1.5 098 02/2102/9800 @author Rob Davis @author Scott Violet
Defines the requirements for an object that translates paths in the tree into display rows. @version 1.8 0910 02/2102/9800 @author Scott Violet
Adds to CellEditor the extensions necessary to configure an editor in a tree. @see javax.swing.JTree @version 1.7 0910 02/2102/9800 @author Scott Violet
Defines the requirements for an object that displays a tree node. See How to Use Trees in The Java Tutorial for an example of implementing a tree cell renderer that displays custom icons. @version 1.13 0916 02/2102/9800 @author Rob Davis @author Ray Ryan @author Scott Violet
The interface that defines a suitable data model for a JTree. For further information on tree models including an example of a custom implementation see How to Use Trees in The Java Tutorial. @version 1.13 0816 02/2602/9800 @author Rob Davis @author Ray Ryan
Defines the requirements for an object that can be used as a tree node in a JTree.For further information and examples of using tree nodes see How to Use Tree Nodes in The Java Tutorial. @version 1.
14 0917 02/2102/9800 @author Rob Davis @author Scott Violet
Represents a path to a node. A TreePath is an array of Objects that are vended from a TreeModel. The elements of the array are ordered such that the root is always the first element (index 0) of the array. TreePath is Serializable but if any components of the path are not serializable it will not be written out.Class TreePath, constructor TreePath()For further information and examples of using tree paths see How to Use Trees in The Java Tutorial.
Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. A future release of Swing will provide support for long term persistence. @version 1.
20 0825 02/2802/9800 @author Scott Violet @author Philip Milne
Primarily provided for subclasses thatClass TreePath, constructor TreePath(Object)don'trepresentwish topaths inuse theapath ivardifferent manner. If a subclass uses this constructor it should alsosubclassoverride thegetPath
()getPathCount
and()getPathComponent
()methods and possibly theequals method.
Constructs a TreePathClass TreePath, constructor TreePath(TreePath, Object)whencontainingthereonly a single element. This isonlyusually used toitemconstructina TreePath for thepaththe root of the TreeModel.@param singlePath an Object representing the path to a node @see #TreePath(Object[])
Constructs a new TreePathClass TreePath, boolean equals(Object)thiswhich is thecombination of all thepathelements inidentified byparent
withendinga last path component ofinlastElement
.
Tests two TreePaths for equality by checking each element of the paths for equality. Two paths are considered equal if they are of the same length and contain the same elements (.equals
). @param o the Object to compare
Class TreePath, Object getLastPathComponent()Returns the last component of this path. For a path returned byClass TreePath, TreePath getParentPath()theDefaultTreeModelthat is the TreeNode object forthisthe node specified by the pathwill return an instance of TreeNode. @return the Object at the end of the path @see #TreePath(Object[])
Returns a path containing all the elements ofClass TreePath, Object[] getPath()the receiver acceptthis object except the last path component.
Returns an ordered array of Objects containing the components of this TreePath. The first element (index 0) is the root. @return an array of Objects representing the TreePath @see #TreePath(Object[])Class TreePath, boolean isDescendant(TreePath)
Returns true ifClass TreePath, TreePath pathByAddingChild(Object)the specified nodeaTreePath
is a descendant of this TreePath. A TreePathchildP1 is a descendent ofanothera TreePathparentP2 ifchildP1 contains all of the components that make upparentP2's path. For example if this object has the path [a b] andaTreePath
has the path [a b c] thenaTreePath
is a descendant of this object. However ifaTreePath
has the path [a] then it is not a descendant of this object. @return true ifaTreePath
is a descendant ofthethisreceiver.path
Returns a new path containing all the elements of thisreceiverobject pluschild
.child
will be the last element of the newly created TreePath. This will throw a NullPointerException if child is null.
This interface represents the current state of the selection for the tree component.Class TreeSelectionModel, void addPropertyChangeListener(PropertyChangeListener)It will keep trackFor information and examples oftheusingselectedtree selectionrowsmodelsbutsee How to Use Trees inorderThe Java Tutorial.The state of the tree selection is characterized by a set of TreePaths and optionally a set of integers. The mapping from TreePath to
selectinteger is done byrowway of an instance of RowMapper. It is not necessary for a TreeSelectionModel to have a RowMapper to correctly operate but without ayouRowMappergetSelectionRows
willneedreturn null.A TreeSelectionModel can be configured to allow only one path (
toSINGLE_TREE_SELECTION
) a number of continguous paths (CONTIGUOUS_TREE_SELECTION
) or a number of discontiguous paths (DISCONTIGUOUS_TREE_SELECTION
). ARowMapper
is usedgodetermine if TreePaths are contiguous. In the absence of a RowMapperCONTIGUOUS_TREE_SELECTION
andDISCONTIGUOUS_TREE_SELECTION
behave the same that is they allow any number ofdirectlypaths to be contained in thetreeTreeSelectionModel.
resetRowSelectionis calledFor afromselection model ofCONTIGUOUS_TREE_SELECTION
any time the paths are changed (setSelectionPath
addSelectionPath
...) the TreePaths are again checked to make they are contiguous. A check of themethodsTreePaths can also be forced by invokingresetRowSelection
. How a set of discontiguous TreePaths is mapped to a contiguous set is left to implementors of this interface to enforce a particular policy.Implementations should combine duplicate TreePaths
thatupdateare added to theselectedselection. For example the following codeTreePath[] paths= new TreePath[] { treePath treePath }; treeSelectionModel.setSelectionPaths(paths); should result in only one path being selected:treePath
and not two copies oftreePath
.The lead TreePath is the last path that was added (or set). The lead row is then the row that corresponds to the TreePath as determined from the RowMapper
. @version 1.13 1119 02/1702/9800 @author Scott Violet
Class TreeSelectionModel, void addSelectionPath(TreePath)AddAdds a PropertyChangeListener to the listener list. The listener is registered for all properties.A PropertyChangeEvent will get fired
inwhenresponse to an explicit setFont setBackground or SetForeground on the current component. Note that ifthecurrent component is inheriting its foreground background orselectionfontmodefrom its container then no event will be fired in response to a change in the inherited propertychanges. @param listenerThethe PropertyChangeListener to be added
Adds path to the current selection. If path is not currently in the selection the TreeSelectionListeners are notified. This has no effect ifClass TreeSelectionModel, void addSelectionPaths(TreePath[])path
is null. @param path the new path to add to the current selection.
Adds paths to the current selection. If any of the paths in paths are not currently in the selection the TreeSelectionListeners are notified. This has no effect ifClass TreeSelectionModel, void addTreeSelectionListener(TreeSelectionListener)paths
is null. @param path the new path to add to the current selection.
Adds x to the list of listeners that are notified each time theClass TreeSelectionModel, TreePath getLeadSelectionPath()selectionset of selected TreePaths changes. @param x the new listener to be added.
Returns the last path that was added. This may differ from the leadSelectionPath property maintained by the JTree.Class TreeSelectionModel, int getMaxSelectionRow()
Class TreeSelectionModel, int getMinSelectionRow()GetsReturns thelastlargest value obtained from the RowMapper for the current set of selected TreePaths. If nothing is selectedrowor there is no RowMapper this will return -1.
Class TreeSelectionModel, RowMapper getRowMapper()GetsReturns thefirstsmallest value obtained from the RowMapper for the current set of selected TreePaths. If nothing is selectedrowor there is no RowMapper this will return -1.
Returns the RowMapper instance that is able to map aClass TreeSelectionModel, int getSelectionMode()pathTreePath to a row.
Returns the current selection mode one ofClass TreeSelectionModel, TreePath getSelectionPath()SINGLE_TREE_SELECTION
CONTIGUOUS_TREE_SELECTION
orDISCONTIGUOUS_TREE_SELECTION
.
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 RowMapper
.
Class TreeSelectionModel, TreePath[] getSelectionPaths()Returns the paths in the selection. This will return null (or an empty array) if nothing is currently selected.Class TreeSelectionModel, int[] getSelectionRows()
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.Class TreeSelectionModel, boolean isPathSelected(TreePath)
Returns true if the path path
is in the current selection.
Class TreeSelectionModel, void removePropertyChangeListener(PropertyChangeListener)Class TreeSelectionModel, void removeSelectionPath(TreePath)RemoveRemoves a PropertyChangeListener from the listener list. This removes a PropertyChangeListener that was registered for all properties. @param listenerThethe PropertyChangeListener to be removed
Removes path from the selection. If path is in the selection The TreeSelectionListeners are notified. This has no effect ifClass TreeSelectionModel, void removeSelectionPaths(TreePath[])path
is null. @param path the path to remove from the selection.
Removes paths from the selection. If any of the paths inClass TreeSelectionModel, void removeTreeSelectionListener(TreeSelectionListener)paths
are in the selection the TreeSelectionListeners are notified. This method has no effect ifpaths
is null. @parampathpaths the path to remove from the selection.
Removes x from the list of listeners that are notified each time theClass TreeSelectionModel, void resetRowSelection()selectionset of selected TreePaths changes. @param x the listener to remove.
UpdatesClass TreeSelectionModel, void setRowMapper(RowMapper)whatthisrowsobject'saremapping from TreePaths toselectedrows. Thiscanshould beexternally called in case the location of the paths changeinvoked when the mapping from TreePaths to integers has changedbut(fornotexamplethea nodeactualhaspathsbeen expanded).You do not normally
needhave 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.
Sets the RowMapper instance. This instance is used to determineClass TreeSelectionModel, void setSelectionMode(int)whatthe rowcorrespondsforto what patha particular TreePath.
Sets the selection model which must be one of SINGLE_TREE_SELECTION CONTIGUOUS_TREE_SELECTION or DISCONTIGUOUS_TREE_SELECTION.Class TreeSelectionModel, void setSelectionPath(TreePath)This may change the selection if the current selection is not valid for the new mode. For example if three TreePaths are selected when the mode is changed to
SINGLE_TREE_SELECTION
only one TreePath will remain selected. It is up to the particular implementation to decide what TreePath remains selected.
Sets the selection to path. If this represents a change then the TreeSelectionListeners are notified. IfClass TreeSelectionModel, void setSelectionPaths(TreePath[])path
is null this has the same effect as invokingclearSelection
. @param path new path to select
Sets the selection toClass TreeSelectionModel, int CONTIGUOUS_TREE_SELECTIONthe the pathspath. If this represents a change then the TreeSelectionListeners are notified. Ifpaths
is null this has the same effect as invokingclearSelection
. @param paths new selection.
Selection can only be contiguous. This will only be enforced if a RowMapper instance is provided. That is if no RowMapper is set this behaves the same as DISCONTIGUOUS_TREE_SELECTION.
NOTE: This will become more open in a future release.Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. A future release of Swing will provide support for long term persistence. @version 1.
11 0413 02/2202/9900 @author Rob Davis @author Ray Ryan @author Scott Violet