1 43 44 package org.jfree.ui.about; 45 46 import java.awt.Image ; 47 import java.util.Iterator ; 48 import java.util.List ; 49 50 import org.jfree.base.BootableProjectInfo; 51 import org.jfree.base.Library; 52 53 58 public class ProjectInfo extends BootableProjectInfo { 59 60 61 private Image logo; 62 63 64 private String licenceText; 65 66 67 private List contributors; 68 69 72 public ProjectInfo() { 73 } 75 76 87 public ProjectInfo(final String name, 88 final String version, 89 final String info, 90 final Image logo, 91 final String copyright, 92 final String licenceName, 93 final String licenceText) { 94 95 super(name, version, info, copyright, licenceName); 96 this.logo = logo; 97 this.licenceText = licenceText; 98 99 } 100 101 106 public Image getLogo() { 107 return this.logo; 108 } 109 110 115 public void setLogo(final Image logo) { 116 this.logo = logo; 117 } 118 119 124 public String getLicenceText() { 125 return this.licenceText; 126 } 127 128 133 public void setLicenceText(final String licenceText) { 134 this.licenceText = licenceText; 135 } 136 137 142 public List getContributors() { 143 return this.contributors; 144 } 145 146 151 public void setContributors(final List contributors) { 152 this.contributors = contributors; 153 } 154 155 160 public String toString() { 161 162 final StringBuffer result = new StringBuffer (); 163 result.append(getName()); 164 result.append(" version "); 165 result.append(getVersion()); 166 result.append(".\n"); 167 result.append(getCopyright()); 168 result.append(".\n"); 169 result.append("\n"); 170 result.append("For terms of use, see the licence below.\n"); 171 result.append("\n"); 172 result.append("FURTHER INFORMATION:"); 173 result.append(getInfo()); 174 result.append("\n"); 175 result.append("CONTRIBUTORS:"); 176 if (this.contributors != null) { 177 final Iterator iterator = this.contributors.iterator(); 178 while (iterator.hasNext()) { 179 final Contributor contributor = (Contributor) iterator.next(); 180 result.append(contributor.getName()); 181 result.append(" ("); 182 result.append(contributor.getEmail()); 183 result.append(")."); 184 } 185 } 186 else { 187 result.append("None"); 188 } 189 190 result.append("\n"); 191 result.append("OTHER LIBRARIES USED BY "); 192 result.append(getName()); 193 result.append(":"); 194 final Library[] libraries = getLibraries(); 195 if (libraries.length != 0) { 196 for (int i = 0; i < libraries.length; i++) { 197 final Library lib = libraries[i]; 198 result.append(lib.getName()); 199 result.append(" "); 200 result.append(lib.getVersion()); 201 result.append(" ("); 202 result.append(lib.getInfo()); 203 result.append(")."); 204 } 205 } 206 else { 207 result.append("None"); 208 } 209 result.append("\n"); 210 result.append(getName()); 211 result.append(" LICENCE TERMS:"); 212 result.append("\n"); 213 result.append(getLicenceText()); 214 215 return result.toString(); 216 217 } 218 219 } 220 | Popular Tags |