|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpl.edu.agh.cast.resource.ResourceRegistry
public class ResourceRegistry
Default implementation of IResourceRegistry
.
Constructor Summary | |
---|---|
ResourceRegistry()
Constructor. |
Method Summary | |
---|---|
void |
dispose()
Disposes all hold resources including loaded images. |
IVisualResource |
getResource(String id)
Looks up and returns a resource with the given id. |
IVisualResource |
getResource(String id,
String defaultId)
Looks up and returns a resource with the given id. |
List<IVisualResource> |
getResources(String tag)
Returns list of all resources marked with given tag. |
void |
initalize()
Initialize the resource registry. |
void |
register(IVisualResource resource)
Creates a new resource on base of the given entry and register it by given id and tags (all included in entry object). |
protected void |
setResourcesProvidersReader(pl.edu.agh.cast.resource.ResourceRegistry.IVisualResourcesProvidersReader reader)
|
boolean |
unregister(String id)
Unregisters a resource with the given id. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ResourceRegistry()
Method Detail |
---|
public IVisualResource getResource(String id)
null
is returned.
getResource
in interface IResourceRegistry
id
- resource id
null
if no resource with given id is registered.IResourceRegistry.getResource(java.lang.String)
public IVisualResource getResource(String id, String defaultId)
null
is returned.
getResource
in interface IResourceRegistry
id
- resource iddefaultId
- default resource id
null
if no resource with given id and default
id is registered.IResourceRegistry.getResource(java.lang.String, java.lang.String)
public List<IVisualResource> getResources(String tag)
getResources
in interface IResourceRegistry
tag
- tag which identifies resource family.
IResourceRegistry.getResources(java.lang.String)
public void initalize() throws ResourceException
initalize
in interface IResourceRegistry
ResourceException
IResourceRegistry.initalize()
public void dispose()
dispose
in interface IResourceRegistry
IResourceRegistry.dispose()
public void register(IVisualResource resource) throws ResourceException
register
in interface IResourceRegistry
resource
- resource to register
ResourceException
- when any error occur during creating resource or a resource with the same id already exists in the
registrypl.edu.agh.cast.resource.IResourceRegistry#register(pl.edu.agh.cast.resource.VisualResourceEntry)
public boolean unregister(String id) throws ResourceException
Unregisters a resource with the given id.
Note: the method disposes all images associated with resource making it unavailable in the application. It should be used carefully, only from performance reasons.
unregister
in interface IResourceRegistry
id
- resource id to unregister
ResourceException
- when any error occurs during unregistering resource.IResourceRegistry.unregister(java.lang.String)
protected void setResourcesProvidersReader(pl.edu.agh.cast.resource.ResourceRegistry.IVisualResourcesProvidersReader reader)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |