Cytoscape 2.5.1 (c) 2006,2007 ISB, MSKCC, UCSD

cytoscape.plugin
Class PluginInfo

java.lang.Object
  extended by cytoscape.plugin.PluginInfo

public class PluginInfo
extends Object

Author:
skillcoy Object describes a plugin

Nested Class Summary
 class PluginInfo.AuthorInfo
          Describes an author for a given plugin.
static class PluginInfo.FileType
          Jar and Zip files currently supported
 class PluginInfo.License
          Fetches and keeps a plugin license if one is available.
 
Constructor Summary
PluginInfo()
          Initializes a PluginInfo object with the following defaults: setName("Unknown"); setDescription("No pluginDescription"); setPluginVersion("0.1"); setCytoscapeVersion( cytoscape.cytoscapeVersion.version ); setCategory("Uncategorized"); setProjectUrl(CytoscapeInit.getProperties().getProperty("defaultPluginUrl"));
PluginInfo(String UniqueID)
          See PluginInfo()
 
Method Summary
 void addAuthor(String authorName, String institution)
          Adds an author to the list of authors.
 void clearAuthorList()
          Clears author list.
 List<PluginInfo.AuthorInfo> getAuthors()
           
 String getCategory()
           
 String getCytoscapeVersion()
           
 String getDescription()
           
 String getDownloadUrl()
           
 List<String> getFileList()
           
 PluginInfo.FileType getFileType()
           
 String getID()
           
 String getInstallLocation()
           
 String getLicenseText()
           
 String getName()
           
 String getPluginClassName()
           
 File getPluginDirectory()
          Gets the full install path for this plugin.
 String getPluginVersion()
           
 String getProjectUrl()
           
 String getReleaseDate()
           
 String getUrl()
           
 String htmlOutput()
           
 boolean isCytoscapeVersionCurrent()
           
 boolean isLicenseRequired()
           
 boolean isNewerPluginVersion(PluginInfo New)
          Compare the version of the object to the given object.
 void setCategory(Category catName)
          Sets the category for the plugin using the enum PluginInfo.Category
 void setCategory(String category)
          Sets a category for the plugin.
 void setCytoscapeVersion(String version)
          Sets the Cytoscape version this plugin is compatible with.
 void setDescription(String description)
          Sets a description of the plugin.
 void setLicense(String licenseText, boolean alwaysRequired)
          Sets the license information for the plugin.
 void setLicense(URL url)
          Sets the license information for the plugin.
 void setName(String name)
          Sets name of plugin.
 void setPluginVersion(double Version)
          Sets the version of the plugin.
 void setProjectUrl(String url)
          Sets the url of a site describing this plugin project
 void setReleaseDate(String date)
          Sets the release date of a plugin.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PluginInfo

public PluginInfo()
Initializes a PluginInfo object with the following defaults: setName("Unknown"); setDescription("No pluginDescription"); setPluginVersion("0.1"); setCytoscapeVersion( cytoscape.cytoscapeVersion.version ); setCategory("Uncategorized"); setProjectUrl(CytoscapeInit.getProperties().getProperty("defaultPluginUrl"));


PluginInfo

public PluginInfo(String UniqueID)
See PluginInfo()

Parameters:
UniqueID - Additionally this sets the unique identifier that will be used to find a new version of the plugin at the given project url.
Method Detail

setName

public void setName(String name)
Sets name of plugin. This will be displayed to users.

Parameters:
name -

setReleaseDate

public void setReleaseDate(String date)
Sets the release date of a plugin. Displayed to users;

Parameters:
date -

setDescription

public void setDescription(String description)
Sets a description of the plugin. This will be displayed to users.

Parameters:
description -

setPluginVersion

public void setPluginVersion(double Version)
                      throws NumberFormatException
Sets the version of the plugin. Defaults to 0.1

Parameters:
version - String version with format \d+.\d+
Throws:
NumberFormatException - If the string version is of a format other than \d+.\d+

setCytoscapeVersion

public void setCytoscapeVersion(String version)
                         throws NumberFormatException
Sets the Cytoscape version this plugin is compatible with.

Parameters:
version -
Throws:
NumberFormatException

setProjectUrl

public void setProjectUrl(String url)
Sets the url of a site describing this plugin project

Parameters:
url -

setCategory

public void setCategory(String category)
Sets a category for the plugin. Defaults to "Uncategorized"

Parameters:
category -

setCategory

public void setCategory(Category catName)
Sets the category for the plugin using the enum PluginInfo.Category

Parameters:
catName -

addAuthor

public void addAuthor(String authorName,
                      String institution)
Adds an author to the list of authors.

Parameters:
authorName -
institution -

clearAuthorList

public void clearAuthorList()
Clears author list.


setLicense

public void setLicense(URL url)
Sets the license information for the plugin. Not required.

Parameters:
java.net.URL - object where license can be downloaded from.

setLicense

public void setLicense(String licenseText,
                       boolean alwaysRequired)
Sets the license information for the plugin. Not required.

Parameters:
Text - string of license.
alwaysRequired - If the user expects the license to be required for both install and update at all times (true) or only at install (false)

getPluginDirectory

public File getPluginDirectory()
Gets the full install path for this plugin. Should look like /.cytoscape//plugins/


getInstallLocation

public String getInstallLocation()
Returns:
String of the installation location for the plugin and all of it's files. Generally this is .cytoscape/[cytoscape version]/plugins/PluginName-version

getReleaseDate

public String getReleaseDate()

getLicenseText

public String getLicenseText()
Returns:
The text of the license for this plugin if available.

isLicenseRequired

public boolean isLicenseRequired()
Returns:
If the license is always required to be accepted for installs and updates this returns true. If it only is required at install time (never at update) returns false.

getID

public String getID()
Returns:
The unique id for this object.

getFileType

public PluginInfo.FileType getFileType()
Returns:
FileType of file type for plugin. PluginInfo.JAR or PluginInfo.ZIP

getName

public String getName()
Returns:
pluginName of plugin

getPluginClassName

public String getPluginClassName()
Returns:
Java class name

getAuthors

public List<PluginInfo.AuthorInfo> getAuthors()
Returns:
List of authors.

getDescription

public String getDescription()
Returns:
Plugin pluginDescription.

getPluginVersion

public String getPluginVersion()
Returns:
Plugin version.

getCytoscapeVersion

public String getCytoscapeVersion()
Returns:
Compatible Cytoscape version

getUrl

public String getUrl()
Returns:
Url to download plugin from

getProjectUrl

public String getProjectUrl()
Returns:
Url that points to a site describing this plugin project

getDownloadUrl

public String getDownloadUrl()
Returns:
Url that returns the document of available plugins this plugin came from. Example http://cytoscape.org/plugins/all_plugins.xml

getCategory

public String getCategory()
Returns:
Plugin category.

getFileList

public List<String> getFileList()
Returns:
List of files installed with this plugin (includes plugin jar file).

toString

public String toString()
Overrides:
toString in class Object
Returns:
Returns String of plugin name and version

isNewerPluginVersion

public boolean isNewerPluginVersion(PluginInfo New)
Compare the version of the object to the given object.

Parameters:
New - Potentially newer PluginInfo object
Returns:
true if given version is newer

isCytoscapeVersionCurrent

public boolean isCytoscapeVersionCurrent()
Returns:
true if the plugin is compatible with the current Cytoscape version major.minor (bugfix is only checked if the plugin specifies a bugfix version)

htmlOutput

public String htmlOutput()

www.cytoscape.org