Revision 637

tmp/org.txm.wordcloud.core/src/org/txm/wordcloud/core/functions/WordCloud.java (revision 637)
65 65
	 * @param index
66 66
	 */
67 67
	private void initWith(Index index) {
68
		List<Line> lines = index.getAllLines();
69
		this.freqs = new int[lines.size()];
70
		this.labels = new String[lines.size()];
71
		
72
		int i = 0;
73
		for (Line line : lines) {
74
			freqs[i] = line.getFrequency();
75
			labels[i] = line.toString("_"); //$NON-NLS-1$
76
			i++;
68
		// only if the index has not been computed
69
		if(!this.hasBeenComputedOnce)	{
70
			List<Line> lines = index.getAllLines();
71
			this.freqs = new int[lines.size()];
72
			this.labels = new String[lines.size()];
73
			
74
			int i = 0;
75
			for (Line line : lines) {
76
				freqs[i] = line.getFrequency();
77
				labels[i] = line.toString("_"); //$NON-NLS-1$
78
				i++;
79
			}
77 80
		}
78 81
	}
79 82

  

Also available in: Unified diff