Package org.opensourcephysics.tools
Class LibraryCollection
java.lang.Object
org.opensourcephysics.tools.LibraryResource
org.opensourcephysics.tools.LibraryCollection
- All Implemented Interfaces:
Comparable<LibraryResource>
This represents a collection of library resources.
- Version:
- 1.0
- Author:
- Douglas Brown
-
Nested Class Summary
Nested classes/interfaces inherited from class org.opensourcephysics.tools.LibraryResource
LibraryResource.Metadata
-
Field Summary
Fields inherited from class org.opensourcephysics.tools.LibraryResource
allResourceTypes, bodyFont, COLLECTION_TYPE, collectionIcon, collectionPath, DATA_TYPE, dataIcon, displayName, EJS_TYPE, ejsIcon, h1Font, h2Font, h3Font, HTML_TYPE, htmlIcon, IMAGE_TYPE, imageIcon, loaderMetadata, megabyteFormat, META_AUTHOR, META_CONTACT, META_KEYWORDS, META_TYPES, parent, PDF_TYPE, pdfIcon, RESOURCE_TYPES, target, TRACKER_TYPE, trackerIcon, treePath, UNKNOWN_TYPE, unknownIcon, URL_TYPE, urlIcon, VIDEO_TYPE, videoIcon
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addResource
(LibraryResource resource) Adds a resource to the end of this collection.void
Clears resources.static XML.ObjectLoader
Returns an ObjectLoader to save and load data for this class.Gets the array of resources in this collection.getType()
Gets the type of resource.boolean
insertResource
(LibraryResource resource, int index) Inserts a resource into this collection at a specified index.void
removeResource
(LibraryResource resource) Removes a resource from this collection.boolean
Sets the target of this collection.boolean
Overrides LibraryResource method.Methods inherited from class org.opensourcephysics.tools.LibraryResource
addMetadata, compareTo, equals, getAbsoluteTarget, getBasePath, getBodyStyle, getClone, getCollectionPath, getDescription, getDisplayString, getH1Style, getH2Style, getH3Style, getHTMLBody, getHTMLCode, getHTMLPath, getHTMLStyles, getIcon, getInheritedBasePath, getMetadata, getMetadata, getName, getProperty, getPropertyNames, getPStyle, getStyleSheetCode, getTarget, getThumbnail, getTitle, getTreePath, insertLineBreaks, removeMetadata, setBasePath, setDescription, setHTMLPath, setMetadata, setName, setProperty, setThumbnail, toString
-
Constructor Details
-
LibraryCollection
Constructor.- Parameters:
name
- the name of the collection
-
-
Method Details
-
getType
Gets the type of resource.- Overrides:
getType
in classLibraryResource
- Returns:
- collection type
-
setType
Overrides LibraryResource method.- Overrides:
setType
in classLibraryResource
- Parameters:
type
- ignored- Returns:
- false, since never changes
-
setTarget
Sets the target of this collection.- Overrides:
setTarget
in classLibraryResource
- Parameters:
path
- the target path- Returns:
- true if changed
-
addResource
Adds a resource to the end of this collection.- Parameters:
resource
- the resource
-
insertResource
Inserts a resource into this collection at a specified index.- Parameters:
resource
- the resourceindex
- the index- Returns:
- true if inserted
-
removeResource
Removes a resource from this collection.- Parameters:
resource
- the resource to remove
-
getResources
Gets the array of resources in this collection.- Returns:
- an array of resources
-
clearResources
public void clearResources()Clears resources. -
getLoader
Returns an ObjectLoader to save and load data for this class.- Returns:
- the object loader
-