Class DefaultFigureEditor
java.lang.Object
com.bc.ceres.core.ExtensibleObject
com.bc.ceres.swing.figure.support.DefaultFigureEditor
- All Implemented Interfaces:
Extensible,ViewportAware,FigureEditor,InteractorAware,SelectionChangeEmitter,SelectionContext,SelectionSource
A default implementation of a figure editor.
- Since:
- Ceres 0.10
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultFigureEditor(JComponent editorComponent) DefaultFigureEditor(JComponent editorComponent, Viewport viewport, UndoContext undoContext, FigureCollection figureCollection, FigureFactory figureFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a selection change listener to this emitter.booleanbooleancanInsert(Transferable contents) Tests whether the current contents (e.g.booleanvoidchangeFigure(Figure figure, Object figureMemento, String presentationName) voiddeleteFigures(boolean performDelete, Figure... figures) voidDeletes the current selection.voidCallsvoiddrawFigureCollection(Rendering rendering) voiddrawFigureSelection(Rendering rendering) voiddrawSelectionRectangle(Rendering rendering) Gets all registered selection change listeners.voidinsert(Transferable contents) Inserts a selection represented by the givenTransferableinto this context.voidinsertFigures(boolean performInsert, Figure... figures) voidRemoves a selection change listener from this emitter.voidSelects all items.voidsetDefaultLineStyle(FigureStyle defaultLineStyle) voidsetDefaultPolygonStyle(FigureStyle defaultPolygonStyle) voidsetFigureCollection(FigureCollection figureCollection) voidsetFigureFactory(FigureFactory figureFactory) voidsetInteractor(Interactor interactor) voidsetSelection(Selection selection) Sets a new selection.voidsetSelectionRectangle(Rectangle newRect) Methods inherited from class com.bc.ceres.core.ExtensibleObject
getExtensionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.bc.ceres.core.Extensible
getExtension
-
Constructor Details
-
DefaultFigureEditor
-
DefaultFigureEditor
public DefaultFigureEditor(JComponent editorComponent, Viewport viewport, UndoContext undoContext, FigureCollection figureCollection, FigureFactory figureFactory)
-
-
Method Details
-
getUndoContext
- Specified by:
getUndoContextin interfaceFigureEditor
-
getEditorComponent
- Specified by:
getEditorComponentin interfaceFigureEditor
-
insertFigures
- Specified by:
insertFiguresin interfaceFigureEditor
-
deleteFigures
- Specified by:
deleteFiguresin interfaceFigureEditor
-
changeFigure
- Specified by:
changeFigurein interfaceFigureEditor
-
getSelectionContext
- Specified by:
getSelectionContextin interfaceFigureEditor
-
getSelectionRectangle
- Specified by:
getSelectionRectanglein interfaceFigureEditor
-
setSelectionRectangle
- Specified by:
setSelectionRectanglein interfaceFigureEditor
-
getFigureCollection
- Specified by:
getFigureCollectionin interfaceFigureEditor
-
setFigureCollection
-
getFigureSelection
- Specified by:
getFigureSelectionin interfaceFigureEditor
-
getFigureFactory
- Specified by:
getFigureFactoryin interfaceFigureEditor
-
setFigureFactory
-
getSelection
- Specified by:
getSelectionin interfaceSelectionSource- Returns:
- The current selection. The selection may be empty, but never
null. - See Also:
-
setSelection
Description copied from interface:SelectionContextSets a new selection.- Specified by:
setSelectionin interfaceSelectionContext- Parameters:
selection- The new selection.
-
addSelectionChangeListener
Description copied from interface:SelectionChangeEmitterAdds a selection change listener to this emitter.- Specified by:
addSelectionChangeListenerin interfaceSelectionChangeEmitter- Parameters:
listener- The listener.
-
removeSelectionChangeListener
Description copied from interface:SelectionChangeEmitterRemoves a selection change listener from this emitter.- Specified by:
removeSelectionChangeListenerin interfaceSelectionChangeEmitter- Parameters:
listener- The listener.
-
getSelectionChangeListeners
Description copied from interface:SelectionChangeEmitterGets all registered selection change listeners.- Specified by:
getSelectionChangeListenersin interfaceSelectionChangeEmitter- Returns:
- An array containing all registered listeners.
-
insert
Description copied from interface:SelectionContextInserts a selection represented by the givenTransferableinto this context.- Specified by:
insertin interfaceSelectionContext- Parameters:
contents- The transferable object.- Throws:
IOException- if an I/O error occursUnsupportedFlavorException- See Also:
-
canDeleteSelection
public boolean canDeleteSelection()- Specified by:
canDeleteSelectionin interfaceSelectionContext- Returns:
trueif the current selection can be deleted.- See Also:
-
deleteSelection
public void deleteSelection()Description copied from interface:SelectionContextDeletes the current selection.- Specified by:
deleteSelectionin interfaceSelectionContext- See Also:
-
canInsert
Description copied from interface:SelectionContextTests whether the current contents (e.g. from clipboard, drag and drop) can be inserted into this selection context.- Specified by:
canInsertin interfaceSelectionContext- Parameters:
contents- The contents.- Returns:
trueif the given contents can be inserted into this context.- See Also:
-
selectAll
public void selectAll()Description copied from interface:SelectionContextSelects all items.- Specified by:
selectAllin interfaceSelectionContext- See Also:
-
canSelectAll
public boolean canSelectAll()- Specified by:
canSelectAllin interfaceSelectionContext- Returns:
trueif all items can be selected.- See Also:
-
getInteractor
- Specified by:
getInteractorin interfaceInteractorAware
-
setInteractor
- Specified by:
setInteractorin interfaceFigureEditor
-
getViewport
- Specified by:
getViewportin interfaceViewportAware- Returns:
- The viewport.
-
getDefaultLineStyle
- Specified by:
getDefaultLineStylein interfaceFigureEditor
-
setDefaultLineStyle
-
getDefaultPolygonStyle
- Specified by:
getDefaultPolygonStylein interfaceFigureEditor
-
setDefaultPolygonStyle
-
draw
CallsdrawFigureCollection(rendering); drawFigureSelection(rendering); drawSelectionRectangle(rendering);
- Parameters:
rendering- The rendering.
-
drawFigureCollection
-
drawFigureSelection
-
drawSelectionRectangle
-