1
/* ========================================================================
2
* JCommon : a free general purpose class library for the Java(tm) platform
3
* ========================================================================
5
* (C) Copyright 2000-2005, by Object Refinery Limited and Contributors.
7
* Project Info: http://www.jfree.org/jcommon/index.html
9
* This library is free software; you can redistribute it and/or modify it
10
* under the terms of the GNU Lesser General Public License as published by
11
* the Free Software Foundation; either version 2.1 of the License, or
12
* (at your option) any later version.
14
* This library is distributed in the hope that it will be useful, but
15
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
17
* License for more details.
19
* You should have received a copy of the GNU Lesser General Public
20
* License along with this library; if not, write to the Free Software
21
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
24
* [Java is a trademark or registered trademark of Sun Microsystems, Inc.
25
* in the United States and other countries.]
27
* ------------------------
28
* BootableProjectInfo.java
29
* ------------------------
30
* (C)opyright 2004, by Thomas Morgner and Contributors.
32
* Original Author: Thomas Morgner;
33
* Contributor(s): David Gilbert (for Object Refinery Limited);
35
* $Id: BootableProjectInfo.java,v 1.4 2006/03/23 19:47:05 taqua Exp $
39
* 07-Jun-2004 : Added source headers (DG);
43
package org.jfree.base;
45
import java.util.ArrayList;
48
* Project info for a bootable project. A bootable project provides a controlled
49
* way of initalizing all subsystems by providing a Boot loader implementation.
51
* @author Thomas Morgner
53
public class BootableProjectInfo extends BasicProjectInfo {
55
/** The boot class. */
56
private String bootClass;
58
/** The auto-boot flag. */
59
private boolean autoBoot;
62
* Creates a new instance.
64
public BootableProjectInfo() {
69
* Creates a new library reference.
71
* @param name the name.
72
* @param version the version.
73
* @param licence the licence.
74
* @param info the web address or other info.
76
public BootableProjectInfo(final String name, final String version,
77
final String licence, final String info) {
81
setLicenceName(licence);
86
* Creates a new library reference.
88
* @param name the name.
89
* @param version the version.
90
* @param info the info (for example, the project URL).
91
* @param copyright the copyright statement.
92
* @param licenceName the license name.
94
public BootableProjectInfo(final String name, final String version, final String info,
95
final String copyright, final String licenceName) {
99
setLicenceName(licenceName);
101
setCopyright(copyright);
105
* Returns the dependencies.
107
* @return The dependencies.
109
public BootableProjectInfo[] getDependencies() {
110
final ArrayList dependencies = new ArrayList();
111
final Library[] libraries = getLibraries();
112
for (int i = 0; i < libraries.length; i++) {
113
Library lib = libraries[i];
114
if (lib instanceof BootableProjectInfo) {
115
dependencies.add(lib);
119
final Library[] optionalLibraries = getOptionalLibraries();
120
for (int i = 0; i < optionalLibraries.length; i++) {
121
Library lib = optionalLibraries[i];
122
if (lib instanceof BootableProjectInfo) {
123
dependencies.add(lib);
126
return (BootableProjectInfo[]) dependencies.toArray
127
(new BootableProjectInfo[dependencies.size()]);
133
* @param projectInfo the project.
134
* @deprecated use 'addLibrary' instead.
136
public void addDependency(final BootableProjectInfo projectInfo) {
137
if (projectInfo == null) {
138
throw new NullPointerException();
140
addLibrary(projectInfo);
144
* Returns the name of the boot class.
146
* @return The name of the boot class.
148
public String getBootClass() {
149
return this.bootClass;
153
* Sets the boot class name.
155
* @param bootClass the boot class name.
157
public void setBootClass(final String bootClass) {
158
this.bootClass = bootClass;
162
* Returns, whether the project should be booted automaticly.
164
* @return The auto-boot flag.
166
public boolean isAutoBoot() {
167
return this.autoBoot;
171
* Sets the auto boot flag.
173
* @param autoBoot true, if the project should be booted automaticly, false otherwise.
175
public void setAutoBoot(final boolean autoBoot) {
176
this.autoBoot = autoBoot;