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
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.bc.ceres.swing.figure.Figure
Figure.Rank -
Field Summary
Fields inherited from class com.bc.ceres.swing.figure.AbstractFigure
NO_FIGURES, NO_HANDLES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanaddFigureImpl(int index, Figure figure) The default implementation throws an [@code IllegalStateException}.protected Figure[]addFiguresImpl(Figure[] figures) clone()Creates and returns a copy of this selection.createTransferable(boolean copy) Creates a transferable representation of this selection.voidDraws this figure using the given rendering.<E> EgetExtension(Class<E> extensionType) Gets the extension for this object corresponding to a specified extension type.Handle[]Gets the handles associated with the current selection stage.Returns a localized, human-readable description of this selection, suitable for use in a change log or menu entry, for example.Gets the selected value.Object[]Gets the selected values of a multiple selection.intGets the current selection stage.booleanisEmpty()booleanThe default implementation returnsfalse.booleanTests if the figure is selected.voidlostOwnership(Clipboard clipboard, Transferable contents) Notifies this object that it is no longer the clipboard owner.Figure[]Removes all child figures from this figure.protected booleanremoveFigureImpl(Figure figure) The default implementation throws an [@code IllegalStateException}.protected Figure[]voidsetSelected(boolean selected) Sets the selected state.voidsetSelectedHandle(Handle handle) voidsetSelectionStage(int selectionStage) Sets the current selection stage.toString()Methods inherited from class com.bc.ceres.swing.figure.support.DefaultFigureCollection
addFigureImpl, computeBounds, contains, createHandles, createMemento, dispose, getBounds, getFigure, getFigure, getFigureCount, getFigureIndex, getFigures, getFigures, getMaxSelectionStage, getRank, isCloseTo, isCollection, move, rotate, scale, setMementoMethods inherited from class com.bc.ceres.swing.figure.AbstractFigure
addChangeListener, addFigure, addFigure, addFigures, addSegment, createScaleHandles, fireFigureChanged, fireFigureChanged, fireFiguresAdded, fireFiguresRemoved, getChangeListeners, getEffectiveStyle, getHandleStyle, getNormalStyle, getSegment, getSelectedHandleStyle, getSelectedStyle, removeChangeListener, removeFigure, removeFigures, removeFiguresImpl, removeSegment, setNormalStyle, setSegment, setSelectable, setSelectedStyleMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.bc.ceres.swing.figure.Figure
addChangeListener, 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, setSelectedStyleMethods inherited from interface com.bc.ceres.swing.undo.Restorable
createMemento, setMemento
-
Constructor Details
-
DefaultFigureSelection
public DefaultFigureSelection()
-
-
Method Details
-
getExtension
Description copied from interface:ExtensibleGets the extension for this object corresponding to a specified extension type.- Specified by:
getExtensionin interfaceExtensible- Parameters:
extensionType- the extension type.- Returns:
- the extension for this object corresponding to the specified type,
or
nullif an extension of typeextensionTypecannot be delivered.
-
getSelectionStage
public 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 interfaceFigureSelection- Returns:
- The current selection stage.
- See Also:
-
setSelectionStage
public 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 interfaceFigureSelection- Parameters:
selectionStage- The current selection stage.
-
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 interfaceFigureSelection- Returns:
- The handles associated with the current selection stage.
- See Also:
- For a single selection, the handles are the ones created by the selected figure's
-
getSelectedHandle
- Specified by:
getSelectedHandlein interfaceFigureSelection
-
setSelectedHandle
- Specified by:
setSelectedHandlein interfaceFigureSelection
-
isSelectable
public boolean isSelectable()Description copied from class:AbstractFigureThe default implementation returnsfalse.- Specified by:
isSelectablein interfaceFigure- Overrides:
isSelectablein classDefaultFigureCollection- Returns:
- Always
false.
-
isSelected
public boolean isSelected()Description copied from interface:FigureTests if the figure is selected.- Specified by:
isSelectedin interfaceFigure- Overrides:
isSelectedin classDefaultFigureCollection- Returns:
true, if so.
-
setSelected
public void setSelected(boolean selected) Description copied from interface:FigureSets the selected state.- Specified by:
setSelectedin interfaceFigure- Overrides:
setSelectedin classDefaultFigureCollection- Parameters:
selected- The selected state.
-
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 interfaceSelection- Returns:
- A presentation name for this selection.
-
getSelectedValue
Description copied from interface:SelectionGets the selected value. The method returnsnullif this selectionis empty.- Specified by:
getSelectedValuein interfaceSelection- Returns:
- The selected value, or
null.
-
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 interfaceSelection- Returns:
- The array of selected values.
-
isEmpty
public boolean isEmpty() -
createTransferable
Description copied from interface:SelectionCreates a transferable representation of this selection.- Specified by:
createTransferablein interfaceSelection- Parameters:
copy- Iftrue, the returnedTransferableshould hold a copy-of rather than a reference-to the selection.- Returns:
- A transferable representation of this selection or
nullif this is not possible.
-
addFigureImpl
Description copied from class:AbstractFigureThe default implementation throws an [@code IllegalStateException}.- Overrides:
addFigureImplin classDefaultFigureCollection- Parameters:
index- The index.figure- The figure.- Returns:
- Does never return normally.
-
addFiguresImpl
- Overrides:
addFiguresImplin classAbstractFigure
-
removeFigureImpl
Description copied from class:AbstractFigureThe default implementation throws an [@code IllegalStateException}.- Overrides:
removeFigureImplin classDefaultFigureCollection- Parameters:
figure- The figure.- Returns:
- Does never return normally.
-
removeFiguresImpl
- Overrides:
removeFiguresImplin classDefaultFigureCollection
-
lostOwnership
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 interfaceClipboardOwner- Parameters:
clipboard- the clipboard that is no longer ownedcontents- the contents which this owner had placed on the clipboard
-
clone
Description copied from interface:SelectionCreates and returns a copy of this selection. -
toString
-
removeAllFigures
Description copied from interface:FigureRemoves all child figures from this figure.- Specified by:
removeAllFiguresin interfaceFigure- Overrides:
removeAllFiguresin classAbstractFigure- Returns:
- The array of child figures that actually have been removed.
-
draw
Description copied from interface:FigureDraws this figure using the given rendering.- Specified by:
drawin interfaceFigure- Overrides:
drawin classDefaultFigureCollection- Parameters:
rendering- The rendering used to draw the figure.
-