ilog.cpl.tree
Interface IlpTreeSelectionModel

All Superinterfaces:
IlpObjectSelectionModel, IlpRepresentationObjectSelectionModel, TreeSelectionModel
All Known Implementing Classes:
IlpDefaultTreeSelectionModel

public interface IlpTreeSelectionModel
extends TreeSelectionModel, IlpRepresentationObjectSelectionModel, IlpObjectSelectionModel

Tree selection model for the IlpTree. This model maintains the selection of IlpObjects as well as IlpRepresentationObjects.

In addition to the common TreePath and Row interfaces, Object and RepresentationObject interfaces are provided, which allows you to manipulate the selection of IlpObjects and IlpTreeNodes directly. ILOG strongly discourages the use of the Row interface and the CONTIGUOUS_TREE_SELECTION mode with IlpTreeView. In particular, you should be aware that the Row interface ignores the hidden nodes (descendants of collapsed nodes). So a node that is selected but hidden will not be returned by getSelectionRows(). In addition, contiguity is based on the expanded nodes, so you may lose selected hidden nodes when using CONTIGUOUS_TREE_SELECTION.

Since:
JTGO 3.0

Field Summary
 
Fields inherited from interface javax.swing.tree.TreeSelectionModel
CONTIGUOUS_TREE_SELECTION, DISCONTIGUOUS_TREE_SELECTION, SINGLE_TREE_SELECTION
 
Method Summary
 void addSelectionRepresentationObjects(Collection objects)
          Adds objects to the current selection.
 IlpRepresentationObject getLeadSelectionRepresentationObject()
          Returns the last object that was added.
 IlpRepresentationObjectMapper getRepresentationObjectMapper()
          Returns the IlpRepresentationObjectMapper used to find the IlpRepresentationObject associated with an IlpObject.
 void removeSelectionRepresentationObjects(Collection objects)
          Removes objects from the selection.
 void setRepresentationObjectMapper(IlpRepresentationObjectMapper representationObjectMapper)
          Sets the IlpRepresentationObjectMapper which will be used to find the IlpRepresentationObject associated with an IlpObject.
 void setSelectedRepresentationObject(IlpRepresentationObject object)
          Sets the selection to object.
 void setSelectionRepresentationObject(IlpRepresentationObject object)
          Deprecated. Please use setSelectedRepresentationObject instead.
 void setSelectionRepresentationObjects(Collection objects)
          Deprecated. Please use setSelectedRepresentationObjects instead.
 
Methods inherited from interface javax.swing.tree.TreeSelectionModel
addPropertyChangeListener, addSelectionPath, addSelectionPaths, addTreeSelectionListener, clearSelection, getLeadSelectionPath, getLeadSelectionRow, getMaxSelectionRow, getMinSelectionRow, getRowMapper, getSelectionCount, getSelectionMode, getSelectionPath, getSelectionPaths, getSelectionRows, isPathSelected, isRowSelected, isSelectionEmpty, removePropertyChangeListener, removeSelectionPath, removeSelectionPaths, removeTreeSelectionListener, resetRowSelection, setRowMapper, setSelectionMode, setSelectionPath, setSelectionPaths
 
Methods inherited from interface ilog.cpl.util.selection.IlpRepresentationObjectSelectionModel
addSelectionRepresentationObject, clearSelection, getSelectedRepresentationObject, getSelectedRepresentationObjects, isRepresentationObjectSelected, removeSelectionRepresentationObject, setSelectedRepresentationObjects
 
Methods inherited from interface ilog.cpl.util.selection.IlpObjectSelectionModel
addSelectionObject, clearSelection, getSelectedObject, getSelectedObjects, isObjectSelected, removeSelectionObject, setSelectedObject, setSelectedObjects
 

Method Detail

getLeadSelectionRepresentationObject

IlpRepresentationObject getLeadSelectionRepresentationObject()
Returns the last object that was added.


addSelectionRepresentationObjects

void addSelectionRepresentationObjects(Collection objects)
Adds objects to the current selection. If any of the representation objects in objects are not currently in the selection, the TreeSelectionListeners are notified. This method has no effect if objects is null.

The lead path is set to the last element in objects.

If the selection mode is CONTIGUOUS_TREE_SELECTION and adding the new objects makes the selection discontiguous, one of two situations may occur: if the IlpRepresentationObjects in objects are contiguous, these IlpRepresentationObjects will become the selection; if the IlpRepresentationObjects are not contiguous, the first IlpRepresentationObject in objects will become the selection.

Parameters:
objects - The new objects to be added to the current selection.

removeSelectionRepresentationObjects

void removeSelectionRepresentationObjects(Collection objects)
Removes objects from the selection. If any of the objects in objects are part of the selection, the TreeSelectionListeners are notified. This method has no effect if objects is null.

Specified by:
removeSelectionRepresentationObjects in interface IlpRepresentationObjectSelectionModel
Parameters:
objects - The objects to be removed from the selection.

setSelectionRepresentationObject

void setSelectionRepresentationObject(IlpRepresentationObject object)
Deprecated. Please use setSelectedRepresentationObject instead.

Sets the selection to object. If this operation represents a change, then the TreeSelectionListeners are notified. If object is null, this method has the same effect as invoking clearSelection.

Parameters:
object - The new object to select.
Deprecated Since:
JTGO 4.0

setSelectionRepresentationObjects

void setSelectionRepresentationObjects(Collection objects)
Deprecated. Please use setSelectedRepresentationObjects instead.

Sets the selection to the representation object in object. If this represents a change, the TreeSelectionListeners are notified.

If object is null, this method has the same effect as invoking clearSelection.

The lead path is set to the last object in objects.

If the selection mode is CONTIGUOUS_TREE_SELECTION, and adding the new objects makes the selection discontiguous, the selection is reset to the first IlpRepresentationObject in object.

Parameters:
objects - The new selection.
Deprecated Since:
JTGO 4.0

setSelectedRepresentationObject

void setSelectedRepresentationObject(IlpRepresentationObject object)
Sets the selection to object. If this operation represents a change, then the TreeSelectionListeners are notified. If object is null, this method has the same effect as invoking clearSelection.

Specified by:
setSelectedRepresentationObject in interface IlpRepresentationObjectSelectionModel
Parameters:
object - The new object to select.
Since:
JTGO 4.0

setRepresentationObjectMapper

void setRepresentationObjectMapper(IlpRepresentationObjectMapper representationObjectMapper)
Sets the IlpRepresentationObjectMapper which will be used to find the IlpRepresentationObject associated with an IlpObject.

Parameters:
representationObjectMapper - The representation object mapper to be used. If this parameter is null, the IlpObject selection API has no effect.

getRepresentationObjectMapper

IlpRepresentationObjectMapper getRepresentationObjectMapper()
Returns the IlpRepresentationObjectMapper used to find the IlpRepresentationObject associated with an IlpObject.

Returns:
The representation object mapper used; can be null.


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.   . All Rights Reserved.