Constructor and Description |
---|
TagCloud(Composite parent,
int style)
Creates a new Tag cloud on the given parent.
|
TagCloud(Composite parent,
int style,
int accuracy,
int maxSize)
Creates a new Tag cloud on the given parent.
|
Modifier and Type | Method and Description |
---|---|
void |
addMouseListener(MouseListener listener) |
void |
addMouseMoveListener(MouseMoveListener listener) |
void |
addMouseTrackListener(MouseTrackListener listener) |
void |
addMouseWheelListener(MouseWheelListener listener) |
void |
addSelectionListener(SelectionListener listener) |
protected void |
calcExtents(IProgressMonitor monitor)
Calculates the bounds of each word, by determining the
Rectangle
a path would require to render an element. |
int |
getBoost() |
float |
getBoostFactor() |
protected Rectangle |
getCloudArea()
Returns the maximum cloud area.
|
ImageData |
getImageData()
Returns the
ImageData of the text layer image (all rendered
elements, unscaled, without highlighted selection). |
ILayouter |
getLayouter() |
int |
getMaxFontSize() |
int |
getMinFontSize() |
java.util.Set<Word> |
getSelection()
Returns the set of selected elements.
|
Color |
getSelectionColor() |
java.util.List<Word> |
getWords() |
double |
getZoom() |
int |
layoutCloud(IProgressMonitor monitor,
boolean recalc)
Does a full relayout of all displayed elements.
|
protected int |
layoutWords(java.util.Collection<Word> wordsToUse,
IProgressMonitor monitor)
Generates the layout of the given words.
|
void |
redrawTextLayerImage() |
void |
removeMouseListener(MouseListener listener) |
void |
removeMouseMoveListener(MouseMoveListener listener) |
void |
removeMouseTrackListener(MouseTrackListener listener) |
void |
removeMouseWheelListener(MouseWheelListener listener) |
void |
removeSelectionListener(SelectionListener listener) |
void |
setAntiAlias(boolean enabled)
Enable or disable antialiasing.
|
void |
setBackground(Color color) |
void |
setBackgroundMask(ImageData bgData)
Set a background mask to define the drawable area of the cloud.
|
void |
setBoost(int boost)
Enable boosting for the first
boost elements. |
void |
setBoostFactor(float boostFactor) |
void |
setLayouter(ILayouter layouter) |
void |
setMaxFontSize(int maxSize)
Sets the maximum font size (which must be a value greater 0).
|
void |
setMinFontSize(int size)
Sets the minimum font size.
|
void |
setOpacity(int opacity)
Sets the opacity of the words, which must be a value between 0 and 255
(inclusive).
|
void |
setSelection(java.util.Set<Word> words)
Marks the set of elements as selected.
|
void |
setSelectionColor(Color color)
Sets the highlight color of the cloud.
|
int |
setWords(java.util.List<Word> values,
IProgressMonitor monitor)
Sets the given list as input of the tag cloud, replacing any previous
content.
|
void |
zoomFit()
Resets the zoom such that the generated cloud will fit exactly into the
available space (unless the zoom factor is too small or too large).
|
void |
zoomIn()
Zooms in, by the factor of 10 percent.
|
void |
zoomOut()
Zooms out, by the factor of 10 percent.
|
void |
zoomReset()
Resets the zoom to 100 % (original size)
|
drawBackground, getCaret, getIME, scroll, setCaret, setFont, setIME
changed, checkSubclass, computeSize, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList
computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar
addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removePaintListener, removeTouchListener, removeTraverseListener, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString
public TagCloud(Composite parent, int style, int accuracy, int maxSize)
accuracy
defines the size of the raster used when
placing strings, and must be a value greater than 0
. An
accuracy of 1
will theoretically give best results, as the
drawable area is analyzed most detailed, but this will also be very slow.
maxSize
defines the maximum size of the drawable
area and must be a power of accuracy
,
such that accuracy^n=maxSize
holds. SWT.HORIZONTAL
and
SWT.VERTICAL
.accuracy
- maxSize
- parent
- style
- public TagCloud(Composite parent, int style)
SWT.HORIZONTAL
and SWT.VERTICAL
. This is a
shortcut to TagCloud(Composite, int, int, int)
, which sets the
accuracy to 5
and the maximum size of the drawable area to
5120
.parent
- style
- public void zoomReset()
public double getZoom()
public void zoomFit()
public void zoomIn()
public void zoomOut()
protected Rectangle getCloudArea()
protected void calcExtents(IProgressMonitor monitor)
Rectangle
a path would require to render an element.monitor
- protected int layoutWords(java.util.Collection<Word> wordsToUse, IProgressMonitor monitor)
wordsToUse
- monitor
- may be null
.public int setWords(java.util.List<Word> values, IProgressMonitor monitor)
values
- monitor
- public void setBackgroundMask(ImageData bgData)
bgData
is null
, the old mask will be removed.bgData
- a square containing black and white pixels onlypublic void addMouseListener(MouseListener listener)
addMouseListener
in class Control
public void addMouseMoveListener(MouseMoveListener listener)
addMouseMoveListener
in class Control
public void addMouseTrackListener(MouseTrackListener listener)
addMouseTrackListener
in class Control
public void addMouseWheelListener(MouseWheelListener listener)
addMouseWheelListener
in class Control
public void addSelectionListener(SelectionListener listener)
public void removeMouseListener(MouseListener listener)
removeMouseListener
in class Control
public void removeMouseMoveListener(MouseMoveListener listener)
removeMouseMoveListener
in class Control
public void removeMouseTrackListener(MouseTrackListener listener)
removeMouseTrackListener
in class Control
public void removeMouseWheelListener(MouseWheelListener listener)
removeMouseWheelListener
in class Control
public void removeSelectionListener(SelectionListener listener)
public void setSelection(java.util.Set<Word> words)
words
- must not be null
.public void redrawTextLayerImage()
public java.util.Set<Word> getSelection()
null
.public void setSelectionColor(Color color)
color
- public void setBackground(Color color)
setBackground
in class Control
public int layoutCloud(IProgressMonitor monitor, boolean recalc)
monitor
- public void setMaxFontSize(int maxSize)
maxSize
- public void setOpacity(int opacity)
opacity
- public void setMinFontSize(int size)
accuracy
is recommended). By default, this value is 12.size
- public ImageData getImageData()
ImageData
of the text layer image (all rendered
elements, unscaled, without highlighted selection). Can be used to print
or export the cloud.public void setBoost(int boost)
boost
elements. By default, no
elements are boosted.boost
- public void setAntiAlias(boolean enabled)
enabled
- public void setBoostFactor(float boostFactor)
public Color getSelectionColor()
public void setLayouter(ILayouter layouter)
public int getMaxFontSize()
public int getMinFontSize()
public int getBoost()
public float getBoostFactor()
public java.util.List<Word> getWords()
public ILayouter getLayouter()
Copyright (c) 2000, 2012 itemis AG and others. All rights reserved.