All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class COM.ibm.desktop.ModelSelection

java.lang.Object
   |
   +----COM.ibm.desktop.ModelSelection

public abstract class ModelSelection
extends Object
implements Serializable, Transferable, Cloneable
ModelSelection is an abstract class for the specification of model data. It can specify some or all of the data contained in a model. It has a state: empty or not empty. It is cloneable. It implements the Transferable interface so that it can be transferred to/from the clipboard.

 Copyright (c) Taligent, Inc.  1996 - 1997.
 Copyright (c) IBM Corporation 1996 - 1997.
 All Rights Reserved.
 

See Also:
ModelSelectionOwner

Constructor Index

 o ModelSelection(ModelSelection)
Copy constructor.
 o ModelSelection(ModelSelectionOwner, IModel)
Construct a model selection.

Method Index

 o canDelete()
Can the model selection be deleted?
 o canPasteFrom(Transferable)
Can objects be pasted into the model selection?
 o clone()
Return a clone of the model selection.
 o delete()
Delete objects in the model selection.
 o deselectAll()
Deselect all objects in the model.
 o getModel()
Return the model.
 o getModelSelectionOwner()
Return the owner of the model selection.
 o getTransferData(DataFlavor)
Return an object which represents the data to be transferred.
 o getTransferDataFlavors()
Return an array of DataFlavor objects indicating the flavors the data can be provided in.
 o isDataFlavorSupported(DataFlavor)
Return whether or not the specified data flavor is supported for this object.
 o isEmpty()
Is the model selection empty?
 o isNotEmpty()
Is the model selection not empty?
 o isStringSelection()
Temporary workaround for JDK 1.1 beta bug.
 o pasteFrom(Transferable)
Paste objects into the model selection.
 o selectAll()
Select all objects in the model.
 o setEmpty()
Set the model selection state to empty.
 o setModel(IModel)
Set the model selection's model object.
 o setModelSelectionOwner(ModelSelectionOwner)
Set the owner of the model selection.
 o setNotEmpty()
Set the model selection state to not empty.
 o undoDelete(Object)
Undo the delete operation.
 o undoPaste(Object)
Undo paste operation.

Constructors

 o ModelSelection
 public ModelSelection(ModelSelectionOwner owner,
                       IModel model)
Construct a model selection.

Parameters:
owner - owner of the model selection
model - the model upon which the selection operates
 o ModelSelection
 public ModelSelection(ModelSelection selection)
Copy constructor.

Methods

 o clone
 public abstract Object clone()
Return a clone of the model selection.

Overrides:
clone in class Object
 o setModel
 public void setModel(IModel model)
Set the model selection's model object.

 o selectAll
 public void selectAll()
Select all objects in the model.

 o deselectAll
 public void deselectAll()
Deselect all objects in the model.

 o setEmpty
 public void setEmpty()
Set the model selection state to empty.

 o setNotEmpty
 public void setNotEmpty()
Set the model selection state to not empty.

 o isEmpty
 public boolean isEmpty()
Is the model selection empty?

 o isNotEmpty
 public boolean isNotEmpty()
Is the model selection not empty?

 o getModel
 public IModel getModel()
Return the model.

 o getModelSelectionOwner
 public ModelSelectionOwner getModelSelectionOwner()
Return the owner of the model selection.

 o setModelSelectionOwner
 public void setModelSelectionOwner(ModelSelectionOwner owner)
Set the owner of the model selection.

 o canDelete
 public boolean canDelete()
Can the model selection be deleted?

 o delete
 public Object delete()
Delete objects in the model selection.

Returns:
Return data that allows the delete to be undone.
 o undoDelete
 public void undoDelete(Object undoData)
Undo the delete operation.

Parameters:
undoData - data for undoing the previous delete.
 o canPasteFrom
 public boolean canPasteFrom(Transferable contents)
Can objects be pasted into the model selection?

Parameters:
contents - clipboard contents
 o pasteFrom
 public Object pasteFrom(Transferable contents)
Paste objects into the model selection.

Parameters:
contents - clipboard contents
Returns:
Return data that allows the paste to be undone.
 o undoPaste
 public void undoPaste(Object undoData)
Undo paste operation.

Parameters:
undoData - data for undoing the previous paste.
 o getTransferDataFlavors
 public synchronized DataFlavor[] getTransferDataFlavors()
Return an array of DataFlavor objects indicating the flavors the data can be provided in. The array should be ordered according to preference for providing the data (from most richly descriptive to least descriptive).

Returns:
an array of data flavors in which this data can be transferred
 o isDataFlavorSupported
 public boolean isDataFlavorSupported(DataFlavor dataFlavor)
Return whether or not the specified data flavor is supported for this object.

Parameters:
flavor - the requested flavor for the data
Returns:
boolean indicating whether or not the data flavor is supported
 o getTransferData
 public synchronized Object getTransferData(DataFlavor dataFlavor) throws IOException, UnsupportedFlavorException
Return an object which represents the data to be transferred. The class of the object returned is defined by the representation class of the flavor. If the requested data flavor is not supported, an UnsupportedFlavorException is thrown. If the data is no longer available in the requested flavor, an IOException is thrown

Parameters:
flavor - the requested flavor for the data
Throws: UnsupportedFlavorException
if the requested data flavor is not supported
 o isStringSelection
 protected boolean isStringSelection()
Temporary workaround for JDK 1.1 beta bug. Determine if the model selection is a StringSelection, which is the only Transferable that the clipboard accepts.


All Packages  Class Hierarchy  This Package  Previous  Next  Index