ilog.cpl.table.selection
Class IlpDefaultTableSelectionModel

java.lang.Object
  extended by ilog.cpl.table.selection.IlpDefaultTableSelectionModel
All Implemented Interfaces:
IlpTableSelectionModel, IlpObjectSelectionModel, IlpRepresentationObjectSelectionModel

public class IlpDefaultTableSelectionModel
extends Object
implements IlpTableSelectionModel

Default data model for selection of IlpRepresentationObjects. This class delegates the work to the right selection model according to the chosen selection mode.

Since:
JTGO 3.0

Constructor Summary
IlpDefaultTableSelectionModel()
          Default constructor
IlpDefaultTableSelectionModel(IlpTableSelectionMode selectionMode)
          Constructor
 
Method Summary
 void addSelection(IlpArea area)
          Adds an IlpArea to the selection.
 void addSelection(IlpRepresentationObject object, IlpAttribute attribute)
          Adds a new selection.
 void addSelectionListener(TableSelectionListener listener)
          Registers a listener to selection change events.
 void addSelectionObject(IlpObject object)
          Adds the given IlpObject to the selection.
 void addSelectionRepresentationObject(IlpRepresentationObject object)
          Adds the given IlpRepresentationObject to the selection.
 void clearSelection()
          Clears the selection.
 IlpAttribute getAnchorAttribute()
          Returns the attribute which has the focus.
 IlpRepresentationObject getAnchorObject()
          Returns the representation object that has the focus.
 IlpArea getLeadSelection()
          Retrieves the IlpArea composing the temporary lead selection.
 IlpRepresentationObjectMapper getRepresentationObjectMapper()
          Returns the IlpRepresentationObjectMapper used to find the IlpRepresentationObject associated with an IlpObject.
 IlpObject getSelectedObject()
          Returns the first selected IlpObject from the collection of selected objects.
 Collection getSelectedObjects()
          Returns the set of selected IlpObjects.
 IlpRepresentationObject getSelectedRepresentationObject()
          Returns the first selected IlpRepresentationObject from the collection of selected representation objects.
 Collection getSelectedRepresentationObjects()
          Returns the set of selected IlpRepresentationObjects.
 Collection getSelection()
          Retrieves the collection of IlpAreas composing the selection.
 IlpTableSelectionMode getSelectionMode()
          Returns the selection mode.
 boolean isAdjusting()
          Returns if the selection model is currently being adjusted.
 boolean isObjectSelected(IlpObject object)
          Returns true if the given IlpObject is selected, false otherwise.
 boolean isRepresentationObjectSelected(IlpRepresentationObject object)
          Returns true if the given IlpRepresentationObject is selected, false otherwise.
 boolean isSelected(IlpArea area)
          Returns whether an IlpArea is selected.
 boolean isSelected(IlpRepresentationObject object, IlpAttribute attribute)
          Returns whether cell (that is, an attribute for a representation object) is selected.
 void removeSelection(IlpArea area)
          Removes an IlpArea from the selection.
 void removeSelection(IlpRepresentationObject object, IlpAttribute attribute)
          Removes an attribute for a representation object from the selection.
 void removeSelectionListener(TableSelectionListener listener)
          Removes a listener to object selection events.
 void removeSelectionObject(IlpObject object)
          Removes the given IlpObject from the selection.
 void removeSelectionRepresentationObject(IlpRepresentationObject object)
          Removes the given IlpRepresentationObject from the selection.
 void removeSelectionRepresentationObjects(Collection ros)
          Removes the given IlpRepresentationObjects from the selection.
 void setAdjusting(boolean adjusting)
          Indicates that the selection model will be changed.
 void setAnchor(IlpRepresentationObject object, IlpAttribute attribute)
          Sets the cell (that is, the attribute of the representation object) that has the focus in the table.
 void setLeadSelection(IlpArea newLeadSelection)
          Sets the IlpArea composing the temporary lead selection.
 void setRepresentationObjectMapper(IlpRepresentationObjectMapper representationObjectMapper)
          Sets the IlpRepresentationObjectMapper which will be used to know the IlpRepresentationObject associated to an IlpObject.
 void setSelectedObject(IlpObject object)
          Sets the selected IlpObject.
 void setSelectedObjects(Collection objects)
          Sets the set of selected IlpObjects.
 void setSelectedRepresentationObject(IlpRepresentationObject object)
          Sets the selected IlpRepresentationObject.
 void setSelectedRepresentationObjects(Collection selected)
          Sets the set of selected IlpRepresentationObjects.
 void setSelection(IlpArea newSelection)
          Applies a new selection.
 void setSelection(IlpRepresentationObject object, IlpAttribute attribute)
          Applies a new selection.
 void setSelectionMode(IlpTableSelectionMode selectionMode)
          Sets the selection mode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlpDefaultTableSelectionModel

public IlpDefaultTableSelectionModel()
Default constructor


IlpDefaultTableSelectionModel

public IlpDefaultTableSelectionModel(IlpTableSelectionMode selectionMode)
Constructor

Parameters:
selectionMode - Selection mode
Method Detail

setSelectionMode

public void setSelectionMode(IlpTableSelectionMode selectionMode)
Sets the selection mode. See IlpTableResizeMode for possible values.

Parameters:
selectionMode - The Selection mode to set.
Throws:
IllegalArgumentException - if the given selection mode is null.
See Also:
getSelectionMode(), IlpTableSelectionMode

getSelectionMode

public IlpTableSelectionMode getSelectionMode()
Returns the selection mode.

See Also:
setSelectionMode(ilog.cpl.table.selection.IlpTableSelectionMode), IlpTableSelectionMode

setSelection

public void setSelection(IlpRepresentationObject object,
                         IlpAttribute attribute)
Applies a new selection.

Specified by:
setSelection in interface IlpTableSelectionModel
Parameters:
object - The representation object whose attribute will be selected; the entire row of the given representation object is selected if the given attribute equals null.
attribute - The attribute which will be selected for the given representation object; the entire column of the given attribute is selected if the given representation object equals null.

setSelection

public void setSelection(IlpArea newSelection)
Applies a new selection.

Specified by:
setSelection in interface IlpTableSelectionModel
Parameters:
newSelection - The area which will become the new selection; if this parameter equals null, the selection will be cleared.

getSelection

public Collection getSelection()
Retrieves the collection of IlpAreas composing the selection.

Specified by:
getSelection in interface IlpTableSelectionModel
Returns:
A collection of the selected IlpAreas; returns an empty collection when there is no selected area.

setLeadSelection

public void setLeadSelection(IlpArea newLeadSelection)
Sets the IlpArea composing the temporary lead selection.

Specified by:
setLeadSelection in interface IlpTableSelectionModel
Parameters:
newLeadSelection - The IlpArea composing the lead selection; if this parameter equals null, the lead selection will be removed.

getLeadSelection

public IlpArea getLeadSelection()
Retrieves the IlpArea composing the temporary lead selection.

Specified by:
getLeadSelection in interface IlpTableSelectionModel
Returns:
The IlpArea composing the lead selection; returns null if there is no lead selection.

addSelection

public void addSelection(IlpRepresentationObject object,
                         IlpAttribute attribute)
Adds a new selection.

Specified by:
addSelection in interface IlpTableSelectionModel
Parameters:
object - The representation object whose attribute will added to the selection; the entire row of the given representation object is selected if the given attribute equals null.
attribute - The attribute which will be added to the selection for the given representation object; the entire column of the given attribute is selected if the given representation object equals null.

addSelection

public void addSelection(IlpArea area)
Adds an IlpArea to the selection. This implementation does nothing.

Specified by:
addSelection in interface IlpTableSelectionModel
Parameters:
area - The area which will be added to the current selection; if this parameter equals null, the selection will be cleared.

removeSelection

public void removeSelection(IlpRepresentationObject object,
                            IlpAttribute attribute)
Removes an attribute for a representation object from the selection.

Specified by:
removeSelection in interface IlpTableSelectionModel
Parameters:
object - The representation object whose attribute will removed from the selection; the entire row of the given representation object is deselected if the given attribute equals null.
attribute - The attribute which will be removed from the selection for the given representation object; the entire column of the given attribute is deselected if the given representation object equals null.

removeSelection

public void removeSelection(IlpArea area)
Removes an IlpArea from the selection.

Specified by:
removeSelection in interface IlpTableSelectionModel
Parameters:
area - The area which will removed from the current selection; if this parameter equals null, the method has no effect.

clearSelection

public void clearSelection()
Clears the selection.

Specified by:
clearSelection in interface IlpTableSelectionModel
Specified by:
clearSelection in interface IlpObjectSelectionModel
Specified by:
clearSelection in interface IlpRepresentationObjectSelectionModel

isSelected

public boolean isSelected(IlpRepresentationObject object,
                          IlpAttribute attribute)
Returns whether cell (that is, an attribute for a representation object) is selected.

Specified by:
isSelected in interface IlpTableSelectionModel
Parameters:
object - The representation object whose attribute is selected or not.
attribute - The attribute which is selected or not for the given representation object.
Returns:
true if the cell displaying the given attribute for the given representation object is selected.

isSelected

public boolean isSelected(IlpArea area)
Returns whether an IlpArea is selected.

Specified by:
isSelected in interface IlpTableSelectionModel
Parameters:
area - The area concerned.
Returns:
true if the cell displaying the given attribute for the given representation object is selected.

setAnchor

public void setAnchor(IlpRepresentationObject object,
                      IlpAttribute attribute)
Sets the cell (that is, the attribute of the representation object) that has the focus in the table.

Specified by:
setAnchor in interface IlpTableSelectionModel
Parameters:
object - The representation object that currently has the focus; may be null.
attribute - The attribute that currently has the focus; may be null.

getAnchorObject

public IlpRepresentationObject getAnchorObject()
Returns the representation object that has the focus.

Specified by:
getAnchorObject in interface IlpTableSelectionModel
Returns:
The representation object that currently has the focus; may be null.

getAnchorAttribute

public IlpAttribute getAnchorAttribute()
Returns the attribute which has the focus.

Specified by:
getAnchorAttribute in interface IlpTableSelectionModel
Returns:
The attribute which currently has the focus; may be null.

isAdjusting

public boolean isAdjusting()
Description copied from interface: IlpTableSelectionModel
Returns if the selection model is currently being adjusted. return true if changes are being performed in the selection model.

Specified by:
isAdjusting in interface IlpTableSelectionModel

setAdjusting

public void setAdjusting(boolean adjusting)
Description copied from interface: IlpTableSelectionModel
Indicates that the selection model will be changed.

Specified by:
setAdjusting in interface IlpTableSelectionModel
Parameters:
adjusting - Flag indicating if changes are being performed or not in the selection model.

addSelectionListener

public void addSelectionListener(TableSelectionListener listener)
Registers a listener to selection change events.

Specified by:
addSelectionListener in interface IlpTableSelectionModel
Parameters:
listener - The listener to be registered.

removeSelectionListener

public void removeSelectionListener(TableSelectionListener listener)
Removes a listener to object selection events.

Specified by:
removeSelectionListener in interface IlpTableSelectionModel
Parameters:
listener - The listener to be removed.

getSelectedObject

public IlpObject getSelectedObject()
Returns the first selected IlpObject from the collection of selected objects. Returns null if there is no selected object.

Specified by:
getSelectedObject in interface IlpObjectSelectionModel

getSelectedObjects

public Collection getSelectedObjects()
Returns the set of selected IlpObjects. The set should be ordered if the component implementing this interface supports an ordered selection. Returns an empty set if there is no selected object.

Specified by:
getSelectedObjects in interface IlpObjectSelectionModel
Returns:
An unmodifiable Collection of IlpObjects.

isObjectSelected

public boolean isObjectSelected(IlpObject object)
Returns true if the given IlpObject is selected, false otherwise.

Specified by:
isObjectSelected in interface IlpObjectSelectionModel
Parameters:
object - The object which may be selected.

addSelectionObject

public void addSelectionObject(IlpObject object)
Adds the given IlpObject to the selection. This has no effect if the given object is null.

Specified by:
addSelectionObject in interface IlpObjectSelectionModel
Parameters:
object - The object that will be added to the selection.

removeSelectionObject

public void removeSelectionObject(IlpObject object)
Removes the given IlpObject from the selection. This has no effect if the given object is null.

Specified by:
removeSelectionObject in interface IlpObjectSelectionModel
Parameters:
object - The object that will be removed from the selection.

setSelectedObject

public void setSelectedObject(IlpObject object)
Sets the selected IlpObject. This has no effect if the given object is already selected.

Specified by:
setSelectedObject in interface IlpObjectSelectionModel
Parameters:
object - The object that will become the selection.
Since:
JTGO 4.0

setSelectedObjects

public void setSelectedObjects(Collection objects)
Sets the set of selected IlpObjects.

Specified by:
setSelectedObjects in interface IlpObjectSelectionModel
Parameters:
objects - The collection of objects that will become the selection.
Since:
JTGO 4.0

getSelectedRepresentationObject

public IlpRepresentationObject getSelectedRepresentationObject()
Returns the first selected IlpRepresentationObject from the collection of selected representation objects. Returns null if there is no selected object.

Specified by:
getSelectedRepresentationObject in interface IlpRepresentationObjectSelectionModel
Returns:
the first selected representation object, or null if the selection is empty.

getSelectedRepresentationObjects

public Collection getSelectedRepresentationObjects()
Returns the set of selected IlpRepresentationObjects. The set should be ordered if the component implementing this interface supports an ordered selection. Returns an empty set if there is no selected object.

Specified by:
getSelectedRepresentationObjects in interface IlpRepresentationObjectSelectionModel
Returns:
an unmodifiable Collection of IlpRepresentationObjects

isRepresentationObjectSelected

public boolean isRepresentationObjectSelected(IlpRepresentationObject object)
Returns true if the given IlpRepresentationObject is selected, false otherwise.

Specified by:
isRepresentationObjectSelected in interface IlpRepresentationObjectSelectionModel
Parameters:
object - The representation object which may be selected.

addSelectionRepresentationObject

public void addSelectionRepresentationObject(IlpRepresentationObject object)
Adds the given IlpRepresentationObject to the selection. This has no effect if the given object is null.

Specified by:
addSelectionRepresentationObject in interface IlpRepresentationObjectSelectionModel
Parameters:
object - The representation object that will be added to the selection.

removeSelectionRepresentationObject

public void removeSelectionRepresentationObject(IlpRepresentationObject object)
Removes the given IlpRepresentationObject from the selection. This has no effect if the given object is null.

Specified by:
removeSelectionRepresentationObject in interface IlpRepresentationObjectSelectionModel
Parameters:
object - The representation object that will be removed from the selection.

removeSelectionRepresentationObjects

public void removeSelectionRepresentationObjects(Collection ros)
Removes the given IlpRepresentationObjects from the selection. This has no effect if the given objects are null or if they are currently unselected.

Specified by:
removeSelectionRepresentationObjects in interface IlpRepresentationObjectSelectionModel
Parameters:
ros - The collection of representation objects to be removed
Since:
JViews 7.5

setSelectedRepresentationObject

public void setSelectedRepresentationObject(IlpRepresentationObject object)
Sets the selected IlpRepresentationObject. This has no effect if the given object is already selected.

Specified by:
setSelectedRepresentationObject in interface IlpRepresentationObjectSelectionModel
Parameters:
object - The object that will become the selection.
Since:
JTGO 4.0

setSelectedRepresentationObjects

public void setSelectedRepresentationObjects(Collection selected)
Sets the set of selected IlpRepresentationObjects. This has no effect if the given object is null or if it is already selected.

Specified by:
setSelectedRepresentationObjects in interface IlpRepresentationObjectSelectionModel
Parameters:
selected - The collection of representation objects that will become the selection.
Since:
JTGO 4.0

setRepresentationObjectMapper

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

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

getRepresentationObjectMapper

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

Specified by:
getRepresentationObjectMapper in interface IlpTableSelectionModel
Returns:
The representation object mapper used; can be null.


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