Skip to main content
Jump to: navigation, search

GEF/GEF4/Cloudio

< GEF‎ | GEF4
Revision as of 13:28, 5 September 2011 by Schwiebert.spinfo.uni-koeln.de (Talk | contribs) (Added minimal howto.)

Example Tag Clouds

Below are some examples of tag clouds generated with Cloudio. The images were created with the help of the sample RCP application, modifying different parameters (such as colors, fonts or rotation angles).

Woyzeck

Zest cloudio woyzeck.png

Created from Georg Büchner's Woyzeck. The most frequent word was boosted.

Winnetou

Zest cloudio winnetou.png

Karl May's Winnetou III, using two different fonts, 45-degree rotation and a relatively large x-axis variation when placing the words.

Nietzsche

Zest cloudio nietzsche.png

'Also sprach Zarathustra', by Nietzsche. 90 degree rotation and a large x-axis variation.

Woyzeck Cluster

Zest cloudio woyzeck cluster.png

Same text as in the first example, but with a modified layout algorithm and label provider: Both labels and initial position are assigned based on the first character of the word (for instance, words starting with a to l are at the bottom left). Doesn't really look good, but shows how to extend the functionality to realize a cluster visualization or else...

How to use Cloudio programmatically

TagCloud

A minimal example to create and display a tag cloud.

   public static void main(String [] args) {
       final Display display = new Display();
       final Shell shell = new Shell(display);
       TagCloud cloud = new TagCloud(shell, SWT.NONE);
       // Generate some dummy words - color, weight and fontdata must
       // always be defined.
       List<Word> words = new ArrayList<Word>();
       Word w = new Word("Hello");
       w.setColor(display.getSystemColor(SWT.COLOR_DARK_CYAN));
       w.weight = 1;
       w.setFontData(cloud.getFont().getFontData().clone());
       words.add(w);
       w = new Word("Cloudio");
       w.setColor(display.getSystemColor(SWT.COLOR_DARK_GREEN));
       w.setFontData(cloud.getFont().getFontData().clone());
       w.weight = 0.5;
       w.angle = -45;
       words.add(w);
       shell.setBounds(50,50, 300, 300);
       cloud.setBounds(0,0, shell.getBounds().width, shell.getBounds().height);
       // Assign the list of words to the cloud:
       cloud.setWords(words, null);
       shell.open();
       while (!shell.isDisposed()) {
           if (!display.readAndDispatch()) display.sleep();
       }
       display.dispose();
   }

The result should look similar to this (String positions are assigned by random):

Zest cloudio snippet1.png

Back to the top