Class DefaultFigureSelection
- java.lang.Object
- 
- com.bc.ceres.swing.figure.AbstractFigure
- 
- com.bc.ceres.swing.figure.support.DefaultFigureCollection
- 
- com.bc.ceres.swing.figure.support.DefaultFigureSelection
 
 
 
- 
- All Implemented Interfaces:
- Extensible,- Figure,- FigureCollection,- FigureSelection,- Selection,- Restorable,- ClipboardOwner,- Cloneable
 
 public class DefaultFigureSelection extends DefaultFigureCollection implements FigureSelection 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface com.bc.ceres.swing.figure.FigureFigure.Rank
 
- 
 - 
Field Summary- 
Fields inherited from class com.bc.ceres.swing.figure.AbstractFigureNO_FIGURES, NO_HANDLES
 
- 
 - 
Constructor SummaryConstructors Constructor Description DefaultFigureSelection()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanaddFigureImpl(int index, Figure figure)The default implementation throws an [@code IllegalStateException}.protected Figure[]addFiguresImpl(Figure[] figures)FigureSelectionclone()Creates and returns a copy of this selection.TransferablecreateTransferable(boolean copy)Creates a transferable representation of this selection.voiddraw(Rendering rendering)Draws this figure using the given rendering.<E> EgetExtension(Class<E> extensionType)Gets the extension for this object corresponding to a specified extension type.Handle[]getHandles()Gets the handles associated with the current selection stage.StringgetPresentationName()Returns a localized, human-readable description of this selection, suitable for use in a change log or menu entry, for example.HandlegetSelectedHandle()ObjectgetSelectedValue()Gets the selected value.Object[]getSelectedValues()Gets the selected values of a multiple selection.intgetSelectionStage()Gets the current selection stage.booleanisEmpty()booleanisSelectable()The default implementation returnsfalse.booleanisSelected()Tests if the figure is selected.voidlostOwnership(Clipboard clipboard, Transferable contents)Notifies this object that it is no longer the clipboard owner.Figure[]removeAllFigures()Removes all child figures from this figure.protected booleanremoveFigureImpl(Figure figure)The default implementation throws an [@code IllegalStateException}.protected Figure[]removeFiguresImpl()voidsetSelected(boolean selected)Sets the selected state.voidsetSelectedHandle(Handle handle)voidsetSelectionStage(int selectionStage)Sets the current selection stage.StringtoString()- 
Methods inherited from class com.bc.ceres.swing.figure.support.DefaultFigureCollectionaddFigureImpl, computeBounds, contains, createHandles, createMemento, dispose, getBounds, getFigure, getFigure, getFigureCount, getFigureIndex, getFigures, getFigures, getMaxSelectionStage, getRank, isCloseTo, isCollection, move, rotate, scale, setMemento
 - 
Methods inherited from class com.bc.ceres.swing.figure.AbstractFigureaddChangeListener, addFigure, addFigure, addFigures, addSegment, createScaleHandles, fireFigureChanged, fireFigureChanged, fireFiguresAdded, fireFiguresRemoved, getChangeListeners, getEffectiveStyle, getHandleStyle, getNormalStyle, getSegment, getSelectedHandleStyle, getSelectedStyle, removeChangeListener, removeFigure, removeFigures, removeFiguresImpl, removeSegment, setNormalStyle, setSegment, setSelectable, setSelectedStyle
 - 
Methods inherited from class java.lang.Objectequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface com.bc.ceres.swing.figure.FigureaddChangeListener, addFigure, addFigure, addFigures, addSegment, contains, createHandles, dispose, getBounds, getChangeListeners, getEffectiveStyle, getFigure, getFigure, getFigureCount, getFigureIndex, getFigures, getFigures, getMaxSelectionStage, getNormalStyle, getRank, getSegment, getSelectedStyle, isCloseTo, isCollection, move, removeChangeListener, removeFigure, removeFigures, removeSegment, rotate, scale, setNormalStyle, setSegment, setSelectedStyle
 - 
Methods inherited from interface com.bc.ceres.swing.undo.RestorablecreateMemento, setMemento
 
- 
 
- 
- 
- 
Method Detail- 
getExtensionpublic <E> E getExtension(Class<E> extensionType) Description copied from interface:ExtensibleGets the extension for this object corresponding to a specified extension type.- Specified by:
- getExtensionin interface- Extensible
- Parameters:
- extensionType- the extension type.
- Returns:
- the extension for this object corresponding to the specified type,
         or nullif an extension of typeextensionTypecannot be delivered.
 
 - 
getSelectionStagepublic int getSelectionStage() Description copied from interface:FigureSelectionGets the current selection stage. The maximum selection stage is given by the selected figure(s).- Specified by:
- getSelectionStagein interface- FigureSelection
- Returns:
- The current selection stage.
- See Also:
- Figure.getMaxSelectionStage(),- Figure.createHandles(int)
 
 - 
setSelectionStagepublic void setSelectionStage(int selectionStage) Description copied from interface:FigureSelectionSets the current selection stage. The maximum selection stage is given by the selected figure(s).- Specified by:
- setSelectionStagein interface- FigureSelection
- Parameters:
- selectionStage- The current selection stage.
 
 - 
getHandlespublic Handle[] getHandles() Description copied from interface:FigureSelectionGets the handles associated with the current selection stage.- For a single selection, the handles are the ones created by the selected figure's
 Figure.createHandles(int)factory method.
- For a multiple selection, the handles are the ones created by this figure selection's
 Figure.createHandles(int)factory method.
- If the selection is empty, an empty handle array is returned.
 - Specified by:
- getHandlesin interface- FigureSelection
- Returns:
- The handles associated with the current selection stage.
- See Also:
- FigureSelection.getSelectionStage()
 
- For a single selection, the handles are the ones created by the selected figure's
 
 - 
getSelectedHandlepublic Handle getSelectedHandle() - Specified by:
- getSelectedHandlein interface- FigureSelection
 
 - 
setSelectedHandlepublic void setSelectedHandle(Handle handle) - Specified by:
- setSelectedHandlein interface- FigureSelection
 
 - 
isSelectablepublic boolean isSelectable() Description copied from class:AbstractFigureThe default implementation returnsfalse.- Specified by:
- isSelectablein interface- Figure
- Overrides:
- isSelectablein class- DefaultFigureCollection
- Returns:
- Always false.
 
 - 
isSelectedpublic boolean isSelected() Description copied from interface:FigureTests if the figure is selected.- Specified by:
- isSelectedin interface- Figure
- Overrides:
- isSelectedin class- DefaultFigureCollection
- Returns:
- true, if so.
 
 - 
setSelectedpublic void setSelected(boolean selected) Description copied from interface:FigureSets the selected state.- Specified by:
- setSelectedin interface- Figure
- Overrides:
- setSelectedin class- DefaultFigureCollection
- Parameters:
- selected- The selected state.
 
 - 
getPresentationNamepublic String getPresentationName() Description copied from interface:SelectionReturns a localized, human-readable description of this selection, suitable for use in a change log or menu entry, for example.- Specified by:
- getPresentationNamein interface- Selection
- Returns:
- A presentation name for this selection.
 
 - 
getSelectedValuepublic Object getSelectedValue() Description copied from interface:SelectionGets the selected value. The method returnsnullif this selectionis empty.- Specified by:
- getSelectedValuein interface- Selection
- Returns:
- The selected value, or null.
 
 - 
getSelectedValuespublic Object[] getSelectedValues() Description copied from interface:SelectionGets the selected values of a multiple selection. The method returns an empty array if this selectionis empty.- Specified by:
- getSelectedValuesin interface- Selection
- Returns:
- The array of selected values.
 
 - 
isEmptypublic boolean isEmpty() 
 - 
createTransferablepublic Transferable createTransferable(boolean copy) Description copied from interface:SelectionCreates a transferable representation of this selection.- Specified by:
- createTransferablein interface- Selection
- Parameters:
- copy- If- true, the returned- Transferableshould hold a copy-of rather than a reference-to the selection.
- Returns:
- A transferable representation of this selection or nullif this is not possible.
 
 - 
addFigureImplprotected boolean addFigureImpl(int index, Figure figure)Description copied from class:AbstractFigureThe default implementation throws an [@code IllegalStateException}.- Overrides:
- addFigureImplin class- DefaultFigureCollection
- Parameters:
- index- The index.
- figure- The figure.
- Returns:
- Does never return normally.
 
 - 
addFiguresImplprotected Figure[] addFiguresImpl(Figure[] figures) - Overrides:
- addFiguresImplin class- AbstractFigure
 
 - 
removeFigureImplprotected boolean removeFigureImpl(Figure figure) Description copied from class:AbstractFigureThe default implementation throws an [@code IllegalStateException}.- Overrides:
- removeFigureImplin class- DefaultFigureCollection
- Parameters:
- figure- The figure.
- Returns:
- Does never return normally.
 
 - 
removeFiguresImplprotected Figure[] removeFiguresImpl() - Overrides:
- removeFiguresImplin class- DefaultFigureCollection
 
 - 
lostOwnershippublic void lostOwnership(Clipboard clipboard, Transferable contents) Notifies this object that it is no longer the clipboard owner. This method will be called when another application or another object within this application asserts ownership of the clipboard.- Specified by:
- lostOwnershipin interface- ClipboardOwner
- Parameters:
- clipboard- the clipboard that is no longer owned
- contents- the contents which this owner had placed on the clipboard
 
 - 
clonepublic FigureSelection clone() Description copied from interface:SelectionCreates and returns a copy of this selection.
 - 
removeAllFigurespublic Figure[] removeAllFigures() Description copied from interface:FigureRemoves all child figures from this figure.- Specified by:
- removeAllFiguresin interface- Figure
- Overrides:
- removeAllFiguresin class- AbstractFigure
- Returns:
- The array of child figures that actually have been removed.
 
 
- 
 
-