1 /* 2 * Copyright 2011-2013 smartics, Kronseder & Reiner GmbH 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package de.smartics.tagcloud; 17 18 /** 19 * Base implementation of the {@link TagCloudFactory} interface. 20 * 21 * @author <a href="mailto:robert.reiner@smartics.de">Robert Reiner</a> 22 * @version $Revision:591 $ 23 */ 24 public abstract class AbstractTagCloudFactory implements TagCloudFactory 25 { 26 // ********************************* Fields ********************************* 27 28 // --- constants ------------------------------------------------------------ 29 30 // --- members -------------------------------------------------------------- 31 32 /** 33 * The minimum weight for the font. 34 */ 35 protected double minWeight = 0.0d; 36 37 /** 38 * The maximum weight for the font. 39 */ 40 protected double maxWeight = 36.0d; 41 42 /** 43 * The maximum number of tags to display. 44 */ 45 protected int maxTagsToDisplay; 46 47 /** 48 * The filter removes Java reserved words from the tag cloud. 49 */ 50 protected boolean useJavaReservedWordsFilter; 51 52 /** 53 * The filter removes usual Java words from the tag cloud. 54 */ 55 protected boolean useUsualWordsFilter; 56 57 /** 58 * The list of words to be removed from the tag cloud. This allows an 59 * individual configuration. 60 */ 61 protected String[] wordsToFilter; 62 63 // ****************************** Initializer ******************************* 64 65 // ****************************** Constructors ****************************** 66 67 /** 68 * Default constructor. 69 */ 70 protected AbstractTagCloudFactory() 71 { 72 } 73 74 // ****************************** Inner Classes ***************************** 75 76 // ********************************* Methods ******************************** 77 78 // --- init ----------------------------------------------------------------- 79 80 // --- get&set -------------------------------------------------------------- 81 82 /** 83 * {@inheritDoc} 84 * 85 * @see de.smartics.tagcloud.TagCloudFactory#setMinWeight(double) 86 */ 87 @Override 88 public void setMinWeight(final double minWeight) 89 { 90 this.minWeight = minWeight; 91 } 92 93 /** 94 * {@inheritDoc} 95 * 96 * @see de.smartics.tagcloud.TagCloudFactory#setMaxWeight(double) 97 */ 98 @Override 99 public void setMaxWeight(final double maxWeight) 100 { 101 this.maxWeight = maxWeight; 102 } 103 104 /** 105 * {@inheritDoc} 106 * 107 * @see de.smartics.tagcloud.TagCloudFactory#setMaxTagsToDisplay(int) 108 */ 109 @Override 110 public void setMaxTagsToDisplay(final int maxTagsToDisplay) 111 { 112 this.maxTagsToDisplay = maxTagsToDisplay; 113 } 114 115 /** 116 * {@inheritDoc} 117 * 118 * @see de.smartics.tagcloud.TagCloudFactory#setUseJavaReservedWordsFilter(boolean) 119 */ 120 @Override 121 public void setUseJavaReservedWordsFilter( 122 final boolean useJavaReservedWordsFilter) 123 { 124 this.useJavaReservedWordsFilter = useJavaReservedWordsFilter; 125 } 126 127 /** 128 * {@inheritDoc} 129 * 130 * @see de.smartics.tagcloud.TagCloudFactory#setUseUsualWordsFilter(boolean) 131 */ 132 @Override 133 public void setUseUsualWordsFilter(final boolean useUsualWordsFilter) 134 { 135 this.useUsualWordsFilter = useUsualWordsFilter; 136 } 137 138 /** 139 * {@inheritDoc} 140 * 141 * @see de.smartics.tagcloud.TagCloudFactory#setWordsToFilter(java.lang.String[]) 142 */ 143 @Override 144 public void setWordsToFilter(final String[] wordsToFilter) // NOPMD 145 { 146 this.wordsToFilter = wordsToFilter; 147 } 148 149 // --- business ------------------------------------------------------------- 150 151 // --- object basics -------------------------------------------------------- 152 153 }