|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthades.manager.ComponentInfo
ComponentInfo - A class to read, write, and manager Colibri CLB data. The ComponentInfo data is used to store dependency information, author, version, name attributes, and a short description text about Hades simulation models and design files.
The information is is stored as plain text in a '.clb'-file which stands for CoLiBri or Component_Library_Browser. For loading existing and creating new information files, two different constructors are provided.
The format of the file is as follows: every information consists of a tag line and the data line(s), tags are enclosed in [], some tags are a MUST while others are optional. The currently supported tags are:
[files x] MUST x lines with all filenames used by the component [references x] MUST x lines contain the URLs of all used sub-components [type] MUST the following line is the type of the component [archive] OPT. the following line is the filename of a jar-archive containing ALL the files listed here [start] OPT. name of the start class (sunw.demo.juggler.juggler) [init] OPT. the parameter of an init-method (eg. a filename) [icon] OPT. the filename of the component's icon [image] OPT. the component's (larger) image [html] OPT. the filename of a html file [description] OPT. the following line (only one!) is a component description with encoded control chars
Field Summary | |
static boolean |
debug
|
Constructor Summary | |
ComponentInfo()
Creates an empty ComponentInfo for new Components To store information call the set..() methods and finally saveComponentInfo() |
|
ComponentInfo(java.lang.String pathname)
Creates a new ComponentInfo and loads all the supported data out of the given file. |
Method Summary | |
void |
addFile(java.lang.String file)
Add a new file that belongs to this component. |
void |
addReference(java.lang.String ref)
Add a new Reference-URL. |
java.lang.String |
getArchive()
Get the archive name for the component. |
java.lang.String |
getAuthor()
|
java.lang.String |
getDescription()
Get the description for the component. |
java.util.Vector |
getFiles()
Get filenames that belong to this component. |
java.lang.String |
getHTML()
Get filenames that contain html information about this component. |
javax.swing.ImageIcon |
getIconObject()
Get the type-icon for the component. |
java.lang.String |
getIconpath()
Get the iconpath for the component. |
java.awt.Image |
getImageObject()
Get the thumbnail image for the component. |
java.lang.String |
getImagepath()
Get the pathname for the thumbnail image for the component. |
java.lang.String |
getInit()
Get the parameter for a possible init method (eg. |
java.lang.String |
getName()
|
java.lang.String |
getPathname()
return the component's "pathname" URL. |
java.util.Vector |
getReferences()
Get Reference-URLs of sub-components used by this component. |
java.lang.String |
getStart()
Get the start class/file for the component. |
java.lang.String |
getSubtype()
|
java.lang.String |
getType()
Get the type of the component. |
java.lang.String |
getVersion()
|
static void |
main(java.lang.String[] argv)
|
static void |
msg(java.lang.String s)
send a msg to the Console |
boolean |
removeFile(java.lang.String file)
Remove a component's file. |
boolean |
removeReference(java.lang.String ref)
Remove a Reference-URL. |
void |
saveComponentInfo()
Save the ComponentInfo information. |
void |
saveComponentInfo(java.lang.String pathname)
Save the ComponentInfo information to the location specified. |
boolean |
search(java.util.Vector keys)
|
void |
setArchive(java.lang.String archive)
Set the archive name for the component. |
void |
setAuthor(java.lang.String author)
Set the component's author. |
void |
setDescription(java.lang.String description)
Set the description for the component. |
void |
setHTML(java.lang.String file)
Set the file that contains information about this component. |
void |
setIconpath(java.lang.String iconpath)
Set the iconpath for the component. |
void |
setImagepath(java.lang.String imagepath)
Set the pathname for the thumbnail image for the component. |
void |
setInit(java.lang.String init)
Set the parameter for a possible init method (eg. |
void |
setName(java.lang.String name)
|
void |
setPathname(java.lang.String pathname)
|
void |
setStart(java.lang.String start)
Set the start/main class for the component. |
void |
setType(java.lang.String type)
Set the type of the component. |
void |
setVersion(java.lang.String s)
|
boolean |
showOpen()
will return true when "Open" in context menue should be enabled |
java.lang.String |
toString()
Returns the name of the component which is shown in the JTree! |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static boolean debug
Constructor Detail |
public ComponentInfo()
public ComponentInfo(java.lang.String pathname) throws java.io.FileNotFoundException, java.io.IOException
java.io.IOException
- if an Exception occurs while loading the file
java.io.FileNotFoundException
File
Method Detail |
public java.lang.String getSubtype()
public java.lang.String getName()
public void setName(java.lang.String name)
public java.lang.String getPathname()
public void setPathname(java.lang.String pathname)
public java.util.Vector getFiles()
public void addFile(java.lang.String file)
file
- filename as Stringpublic boolean removeFile(java.lang.String file)
file
- filename
public java.util.Vector getReferences()
public void addReference(java.lang.String ref)
ref
- Reference-URLpublic boolean removeReference(java.lang.String ref)
ref
- Reference-URL
public java.lang.String getStart()
public void setStart(java.lang.String start)
public java.lang.String getInit()
public void setInit(java.lang.String init)
init
- the parameter stringpublic java.lang.String getType()
ComponentType
public void setType(java.lang.String type)
type
- a component-type (as defined in ComponentType or custom)ComponentType
public java.lang.String getAuthor()
public void setAuthor(java.lang.String author)
author
- author of the componentpublic java.lang.String getVersion()
public void setVersion(java.lang.String s)
public java.lang.String getArchive()
public void setArchive(java.lang.String archive)
archive
- archive namepublic java.lang.String getImagepath()
public void setImagepath(java.lang.String imagepath)
public java.lang.String getIconpath()
public void setIconpath(java.lang.String iconpath)
iconpath
- filename of an imagepublic java.lang.String getDescription()
public void setDescription(java.lang.String description)
description
- text-descriptionpublic java.lang.String getHTML()
public void setHTML(java.lang.String file)
file
- filename as Stringpublic boolean showOpen()
public boolean search(java.util.Vector keys)
public javax.swing.ImageIcon getIconObject()
public java.awt.Image getImageObject()
public void saveComponentInfo() throws java.io.IOException
java.io.IOException
- if an Exception occurs while saving the datapublic void saveComponentInfo(java.lang.String pathname) throws java.io.IOException
pathname
- the pathname to store the information in
java.io.IOException
- if an Exception occurs while saving the datapublic java.lang.String toString()
public static void msg(java.lang.String s)
public static void main(java.lang.String[] argv) throws java.lang.Exception
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |