Class FigureSelectionContext
java.lang.Object
com.bc.ceres.core.ExtensibleObject
com.bc.ceres.swing.figure.support.FigureSelectionContext
- All Implemented Interfaces:
Extensible
,SelectionChangeEmitter
,SelectionContext
,SelectionSource
-
Constructor Summary
ConstructorsConstructorDescriptionFigureSelectionContext
(FigureEditor figureEditor) FigureSelectionContext
(FigureEditor figureEditor, FigureCollection figureCollection, FigureSelection figureSelection) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a selection change listener to this emitter.boolean
boolean
canInsert
(Transferable contents) Tests whether the current contents (e.g.boolean
void
Deletes the current selection.Gets all registered selection change listeners.void
insert
(Transferable contents) Inserts a selection represented by the givenTransferable
into this context.void
Removes a selection change listener from this emitter.void
Selects all items.void
setSelection
(Selection selection) Sets a new selection.Methods inherited from class com.bc.ceres.core.ExtensibleObject
getExtension
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.bc.ceres.core.Extensible
getExtension
-
Constructor Details
-
FigureSelectionContext
-
FigureSelectionContext
public FigureSelectionContext(FigureEditor figureEditor, FigureCollection figureCollection, FigureSelection figureSelection)
-
-
Method Details
-
getFigureEditor
-
getFigureCollection
-
getFigureSelection
-
getSelection
- Specified by:
getSelection
in interfaceSelectionSource
- Returns:
- The current selection. The selection may be empty, but never
null
. - See Also:
-
setSelection
Description copied from interface:SelectionContext
Sets a new selection.- Specified by:
setSelection
in interfaceSelectionContext
- Parameters:
selection
- The new selection.
-
addSelectionChangeListener
Description copied from interface:SelectionChangeEmitter
Adds a selection change listener to this emitter.- Specified by:
addSelectionChangeListener
in interfaceSelectionChangeEmitter
- Parameters:
listener
- The listener.
-
removeSelectionChangeListener
Description copied from interface:SelectionChangeEmitter
Removes a selection change listener from this emitter.- Specified by:
removeSelectionChangeListener
in interfaceSelectionChangeEmitter
- Parameters:
listener
- The listener.
-
getSelectionChangeListeners
Description copied from interface:SelectionChangeEmitter
Gets all registered selection change listeners.- Specified by:
getSelectionChangeListeners
in interfaceSelectionChangeEmitter
- Returns:
- An array containing all registered listeners.
-
insert
Description copied from interface:SelectionContext
Inserts a selection represented by the givenTransferable
into this context.- Specified by:
insert
in interfaceSelectionContext
- Parameters:
contents
- The transferable object.- Throws:
IOException
- if an I/O error occursUnsupportedFlavorException
- See Also:
-
canDeleteSelection
public boolean canDeleteSelection()- Specified by:
canDeleteSelection
in interfaceSelectionContext
- Returns:
true
if the current selection can be deleted.- See Also:
-
deleteSelection
public void deleteSelection()Description copied from interface:SelectionContext
Deletes the current selection.- Specified by:
deleteSelection
in interfaceSelectionContext
- See Also:
-
canInsert
Description copied from interface:SelectionContext
Tests whether the current contents (e.g. from clipboard, drag and drop) can be inserted into this selection context.- Specified by:
canInsert
in interfaceSelectionContext
- Parameters:
contents
- The contents.- Returns:
true
if the given contents can be inserted into this context.- See Also:
-
selectAll
public void selectAll()Description copied from interface:SelectionContext
Selects all items.- Specified by:
selectAll
in interfaceSelectionContext
- See Also:
-
canSelectAll
public boolean canSelectAll()- Specified by:
canSelectAll
in interfaceSelectionContext
- Returns:
true
if all items can be selected.- See Also:
-