|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--y.module.YPackage
Represents a collection of YModule
objects.
Additionally a YPackage can contain YPackage objects itself.
This class provides a JMenu that holds entries for each YModule in the package.
Field Summary | |
protected YList |
moduleNames
The name of the modules in the order as they was inserted, important for menu creation |
protected Hashtable |
modules
mapping of module-names to modules |
protected String |
name
name of the package |
protected YList |
packages
The subpackages of this package |
protected PropertyChangeSupport |
propertyChangeSupport
the support which is used to notify listeners about changes in the modulelist and subpackagelist |
Constructor Summary | |
YPackage(InputStream is)
Read Package description from an InputStream. |
|
YPackage(String name)
Creates a new Package |
|
YPackage(URL url)
Initializes a YPackage from a resource located at the given url. |
Method Summary | |
void |
addModule(String className)
Adds a module by its class name. |
void |
addModule(String moduleName,
String className)
Adds a module by its class name. |
void |
addModule(String modName,
YModule module)
Adds a module to this package. |
void |
addModule(YModule module)
Adds a module to this package. |
void |
addPackage(YPackage pack)
Adds a subpackage to the package This only affects menuhandling This method will fire a PropertyChangeEvent for "packageList" |
void |
addPropertyChangeListener(PropertyChangeListener listener)
Registers PropertyChangeListener to receive events. |
void |
addToMenu(JMenu menu,
YPackageMenuListener listener)
Deprecated. yEd does not use this method any longer, just add and remove modules and subpackages, yEd will take care of the menus. |
JMenu |
createMenu(YPackageMenuListener listener)
Deprecated. yEd does not use this method any longer, just add and remove modules and subpackages, yEd will take care of the menus. |
static YPackage |
createPackage(String resourcePath)
|
YModule |
getModule(String name)
Get a registered module by name. |
YCursor |
getModuleNames()
Get all module names |
Hashtable |
getModules()
Get all Modules |
String |
getName()
Get the name of the package |
YCursor |
getPackages()
Get all subpackages |
void |
initPackage(InputStream is)
Initializes a YPackage from a Input stream |
void |
listModules()
Convenience method to print out the names of all modules in the package |
void |
removeModule(String moduleName)
Removes a module by its name. |
void |
removePackage(YPackage pack)
Removes a subpackage from the package This method will fire a PropertyChangeEvent for "packageList" |
void |
removePropertyChangeListener(PropertyChangeListener listener)
Removes PropertyChangeListener from the list of listeners. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected String name
protected Hashtable modules
protected YList moduleNames
protected YList packages
protected PropertyChangeSupport propertyChangeSupport
Constructor Detail |
public YPackage(String name)
name
- The name of the packagepublic YPackage(InputStream is)
public YPackage(URL url)
Method Detail |
public void initPackage(InputStream is)
public static YPackage createPackage(String resourcePath)
public String getName()
public YModule getModule(String name)
public YCursor getModuleNames()
public YCursor getPackages()
public Hashtable getModules()
public void addModule(YModule module)
public void addModule(String modName, YModule module)
public void addModule(String className)
className
- The complete name of the class of the modulepublic void addModule(String moduleName, String className)
className
- The complete name of the class of the modulemoduleName
- The name of the modulepublic void removeModule(String moduleName)
moduleName
- The name of the modulepublic void addPackage(YPackage pack)
pack
- A YPackagepublic void removePackage(YPackage pack)
pack
- A YPackagepublic JMenu createMenu(YPackageMenuListener listener)
listener
- Specifies what to do is a module is selected
public void addToMenu(JMenu menu, YPackageMenuListener listener)
listener
- Specifies what to do is a module is selected
public void listModules()
public void addPropertyChangeListener(PropertyChangeListener listener)
listener
- The listener to register.public void removePropertyChangeListener(PropertyChangeListener listener)
listener
- The listener to remove.
|
© Copyright 2000-2003, yWorks GmbH. All rights reserved. 2003 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |