Package org.eclipse.zest.cloudio
Class TagCloudViewer
java.lang.Object
org.eclipse.jface.viewers.Viewer
org.eclipse.jface.viewers.ContentViewer
org.eclipse.zest.cloudio.TagCloudViewer
- All Implemented Interfaces:
- IInputProvider,- IInputSelectionProvider,- ISelectionProvider
A model-based adapter for a 
TagCloud.- 
Field SummaryFields inherited from class org.eclipse.jface.viewers.ViewerWIDGET_DATA_KEY
- 
Constructor SummaryConstructorsConstructorDescriptionTagCloudViewer(TagCloud cloud) Create a new TagCloudViewer for the givenTagCloud, which must not benull.
- 
Method SummaryModifier and TypeMethodDescriptiongetCloud()Returns theTagCloudmanaged by this viewer.intReturns the maximum number of elements which will be displayed by the cloud.Returns the currently selected elements, as anIStructuredSelection.protected voidInitialize the default tag cloud listeners.protected voidInitialize the mouse wheel listener to support zooming in and out.protected voidInitialize default selection behaviour: Words can be selected by mouse click, and selection listeners are notified when the selection changed.protected voidInitialize tool tip support when the cursor hovers a word.protected voidinputChanged(Object input, Object oldInput) voidrefresh()voidreset(IProgressMonitor monitor, boolean recalc) Resets theTagCloud.voidsetBoost(int boost) voidsetBoostFactor(float boostFactor) voidsetContentProvider(IContentProvider contentProvider) Sets the content provider of this viewer, which must be anIStructuredContentProvider.voidsetInput(Object input, IProgressMonitor progressMonitor) Same asContentViewer.setInput(Object), but with anIProgressMonitorto provide feedback during the layout phase.voidsetLabelProvider(IBaseLabelProvider labelProvider) Sets the label provider of this viewer, which must be anICloudLabelProvider.voidsetLayouter(ILayouter layouter) voidsetMaxWords(int words) Sets the maximum number of elements which will be displayed by the cloud.voidsetSelection(ISelection selection, boolean reveal) voidzoomFit()CallsTagCloud.zoomFit()to scale the cloud such that it fits the current visible area.voidzoomIn()Zooms invoidzoomOut()Zooms outvoidResets the zoom to 100%Methods inherited from class org.eclipse.jface.viewers.ContentViewergetContentProvider, getInput, getLabelProvider, handleDispose, handleLabelProviderChanged, hookControl, labelProviderChanged, setInputMethods inherited from class org.eclipse.jface.viewers.VieweraddHelpListener, addSelectionChangedListener, fireHelpRequested, fireSelectionChanged, getData, handleHelpRequest, removeHelpListener, removeSelectionChangedListener, scrollDown, scrollUp, setData, setSelection
- 
Constructor Details- 
TagCloudViewerCreate a new TagCloudViewer for the givenTagCloud, which must not benull.- Parameters:
- cloud-
 
 
- 
- 
Method Details- 
initListenersprotected void initListeners()Initialize the default tag cloud listeners. Can be overridden to modify the behaviour of the viewer.
- 
initToolTipSupportprotected void initToolTipSupport()Initialize tool tip support when the cursor hovers a word.
- 
initMouseWheelListenerprotected void initMouseWheelListener()Initialize the mouse wheel listener to support zooming in and out.
- 
initSelectionListenerprotected void initSelectionListener()Initialize default selection behaviour: Words can be selected by mouse click, and selection listeners are notified when the selection changed.
- 
getControl- Specified by:
- getControlin class- Viewer
 
- 
getSelectionReturns the currently selected elements, as anIStructuredSelection. Returns an empty selection if no elements are selected.- Specified by:
- getSelectionin interface- ISelectionProvider
- Specified by:
- getSelectionin class- Viewer
 
- 
refreshpublic void refresh()
- 
setSelection- Specified by:
- setSelectionin class- Viewer
 
- 
resetResets theTagCloud. Ifrecalcistrue, the displayed elements will be updated with the values provided by usedICloudLabelProvider. Otherwise, the cloud will only be re-layouted, keeping fonts, colors and angles untouched.- Parameters:
- monitor-
- recalc-
 
- 
getCloudReturns theTagCloudmanaged by this viewer.
- 
setLabelProviderSets the label provider of this viewer, which must be anICloudLabelProvider.- Overrides:
- setLabelProviderin class- ContentViewer
 
- 
setContentProviderSets the content provider of this viewer, which must be anIStructuredContentProvider.- Overrides:
- setContentProviderin class- ContentViewer
 
- 
inputChanged- Overrides:
- inputChangedin class- Viewer
 
- 
setMaxWordspublic void setMaxWords(int words) Sets the maximum number of elements which will be displayed by the cloud. Note that there is no guarantee that this amount of elements will actually be displayed, as this depends on additional factors.
- 
zoomFitpublic void zoomFit()CallsTagCloud.zoomFit()to scale the cloud such that it fits the current visible area.
- 
zoomInpublic void zoomIn()Zooms in
- 
zoomOutpublic void zoomOut()Zooms out
- 
zoomResetpublic void zoomReset()Resets the zoom to 100%
- 
setBoostpublic void setBoost(int boost) 
- 
getMaxWordspublic int getMaxWords()Returns the maximum number of elements which will be displayed by the cloud. Note that there is no guarantee that this amount of elements will actually be displayed, as this depends on additional factors.
- 
setInputSame asContentViewer.setInput(Object), but with anIProgressMonitorto provide feedback during the layout phase.- Parameters:
- input-
- progressMonitor-
 
- 
setBoostFactorpublic void setBoostFactor(float boostFactor) 
- 
setLayouter
- 
getLayouter
 
-