|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opensourcephysics.tools.Library
public class Library
A Library for a LibraryBrowser. Maintains its own collections and provides access to collections from comPADRE, OSP and imported libraries.
| Field Summary | |
|---|---|
protected java.lang.String |
chooserDir
|
protected org.opensourcephysics.tools.Library.Manager |
manager
|
protected java.lang.String[] |
openTabPaths
|
| Constructor Summary | |
|---|---|
Library()
|
|
| Method Summary | |
|---|---|
protected void |
addCollection(java.lang.String path,
java.lang.String name)
Adds a collection to this library. |
boolean |
addComPADRECollection(java.lang.String path,
java.lang.String name)
Adds a comPADRE collection. |
boolean |
addOSPLibrary(java.lang.String path)
Adds an OSP-sponsored library. |
protected boolean |
containsPath(java.lang.String path,
boolean allLists)
Returns true if this library contains a collection path. |
protected Library |
getCloneForExport()
Gets a clone of this library that is suitable for exporting. |
static XML.ObjectLoader |
getLoader()
Returns an ObjectLoader to save and load data for this class. |
protected org.opensourcephysics.tools.Library.Manager |
getManager(LibraryBrowser browser)
Gets the collections manager for this library. |
protected java.lang.String |
getName()
Gets the name of this library. |
protected java.util.Collection<java.lang.String> |
getNames()
Gets the names of all collections maintained by this library. |
boolean |
importLibrary(java.lang.String path)
Imports a library. |
protected boolean |
importLibrary(java.lang.String path,
Library library)
Imports a Library if not already imported. |
protected boolean |
isEmpty()
Returns true if this library has no collections. |
protected void |
load(java.lang.String path)
Loads this library from an xml file. |
protected void |
rebuildCollectionsMenu(LibraryBrowser browser)
Rebuilds the Collections menu. |
protected void |
renameCollection(java.lang.String path,
java.lang.String newName)
Renames a collection. |
protected void |
save(java.lang.String path)
Saves this library in an xml file. |
protected void |
setName(java.lang.String name)
Sets the name of this library. |
java.lang.String |
toString()
Returns a string representation of this library. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String[] openTabPaths
protected org.opensourcephysics.tools.Library.Manager manager
protected java.lang.String chooserDir
| Constructor Detail |
|---|
public Library()
| Method Detail |
|---|
public boolean addOSPLibrary(java.lang.String path)
path - the library path
public boolean importLibrary(java.lang.String path)
path - the library path
public boolean addComPADRECollection(java.lang.String path,
java.lang.String name)
path - the comPADRE queryname - the name of the collection
public java.lang.String toString()
toString in class java.lang.Objectprotected void setName(java.lang.String name)
name - the nameprotected java.lang.String getName()
protected void save(java.lang.String path)
path - the path to the saved fileprotected void load(java.lang.String path)
path - the path to the fileprotected java.util.Collection<java.lang.String> getNames()
protected boolean isEmpty()
protected boolean containsPath(java.lang.String path,
boolean allLists)
path - the collection path
protected void addCollection(java.lang.String path,
java.lang.String name)
path - the path to the collectionname - the menu item name for the collection
protected void renameCollection(java.lang.String path,
java.lang.String newName)
path - the path to the collectionnewName - the new nameprotected Library getCloneForExport()
protected org.opensourcephysics.tools.Library.Manager getManager(LibraryBrowser browser)
browser - a LibraryBrowser
protected void rebuildCollectionsMenu(LibraryBrowser browser)
browser - the LibraryBrowser that will display the menu
protected boolean importLibrary(java.lang.String path,
Library library)
path - the path to the librarylibrary - the library
public static XML.ObjectLoader getLoader()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||