public class Resources
extends java.lang.Object
Resources(Class)
constructor, for resources embed in different jar than
the JHelp utilities.Modifier and Type | Field and Description |
---|---|
private boolean |
externalFiles
Indicates if resources are outside the jar
|
private java.lang.Class<?> |
referenceClass
Reference class
|
private java.lang.String |
relativePathFormClass
Path relative to Resources class
|
private java.util.Hashtable<java.lang.String,ResourceText> |
resourcesTexts
Map of already loaded resources text
|
Constructor and Description |
---|
Resources()
Create a new instance of Resources.
|
Resources(java.lang.Class<?> referenceClass)
Create a new instance of Resources with a reference class.
|
Resources(java.lang.String pathOfEmbedResources)
Create a new instance of Resources with a relative base path.
|
Modifier and Type | Method and Description |
---|---|
java.awt.image.BufferedImage |
obtainBufferedImage(java.lang.String path)
Obtain a buffered image
|
javax.swing.ImageIcon |
obtainImageIcon(java.lang.String path)
Obtain a image icon
|
JHelpImage |
obtainJHelpImage(java.lang.String path)
Obtain a
JHelpImage |
java.io.InputStream |
obtainResourceStream(java.lang.String path)
Open stream to a resource
|
ResourceText |
obtainResourceText(java.lang.String path)
Obtain a resource of texts
|
java.net.URL |
obtainResourceURL(java.lang.String path)
URL of a resource
|
private final boolean externalFiles
private final java.lang.Class<?> referenceClass
private final java.lang.String relativePathFormClass
private final java.util.Hashtable<java.lang.String,ResourceText> resourcesTexts
public Resources()
public Resources(java.lang.Class<?> referenceClass)
referenceClass
- Reference classpublic Resources(java.lang.String pathOfEmbedResources)
pathOfEmbedResources
- Relative path where found resourcespublic java.awt.image.BufferedImage obtainBufferedImage(java.lang.String path) throws java.io.IOException
path
- Relative path of the image (Separator is "/")java.io.IOException
- On reading resource failurepublic javax.swing.ImageIcon obtainImageIcon(java.lang.String path)
path
- Relative path of the image (Separator is "/")public JHelpImage obtainJHelpImage(java.lang.String path) throws java.io.IOException
JHelpImage
path
- Relative path of the image (Separator is "/")java.io.IOException
- On reading resource failurepublic java.io.InputStream obtainResourceStream(java.lang.String path)
path
- Relative path of the resource (Separator is "/")public ResourceText obtainResourceText(java.lang.String path)
path
- Relative path of the resource of texts (Separator is "/")public java.net.URL obtainResourceURL(java.lang.String path)
path
- Relative path of the resource (Separator is "/")