net.xoetrope.deprecated.xui
Class XResourceManager

java.lang.Object
  extended by net.xoetrope.deprecated.xui.XResourceManager

public class XResourceManager
extends java.lang.Object

    

A class used to manage access to resources. This class wraps access to resources such as the files, images, readers and application objects such as Window and Frame references.
File access is provided so that the resource manager can determine the source of the file by searching the classpath.

Copyright (c) Xoetrope Ltd., 1998-2003
License: see license.txt $Revision: 1.4 $


Constructor Summary
protected XResourceManager(XProject proj)
          Deprecated. since 2.0 use XProject instead
 
Method Summary
 void addCustomClassLoader(java.lang.ClassLoader c)
          Deprecated. since 2.0 use XProject instead
 java.awt.Frame getAppFrame()
          Deprecated. since 2.0 use XProject instead
 java.applet.Applet getApplet()
          Deprecated. since 2.0 use XProject instead
 java.awt.Window getAppWindow()
          Deprecated. since 2.0 use XProject instead
 java.io.BufferedInputStream getBufferedInputStream(java.io.File file)
          Deprecated. since 2.0 use XProject instead
 java.io.BufferedInputStream getBufferedInputStream(java.lang.String s)
          Deprecated. since 2.0 use XProject instead
 java.io.BufferedOutputStream getBufferedOutputStream(java.lang.String file)
          Deprecated. since 2.0 use XProject instead
 java.io.BufferedOutputStream getBufferedOutputStream(java.lang.String file, boolean useProjectParent)
          Deprecated. since 2.0 use XProject instead
 java.io.BufferedReader getBufferedReader(java.io.File file, java.lang.String encoding)
          Deprecated. since 2.0 use XProject instead
 java.io.BufferedReader getBufferedReader(java.lang.String file)
          Deprecated. since 2.0 use XProject instead
 java.io.BufferedReader getBufferedReader(java.lang.String file, java.lang.String encoding)
          Deprecated. since 2.0 use XProject instead
 java.lang.String getDefaultEncoding()
          Deprecated. since 2.0 use XProject instead
 java.net.URL getDocumentBase()
          Deprecated. since 2.0 use XProject instead
 javax.swing.Icon getIcon(java.lang.String name)
          Deprecated. since 2.0 use XProject instead
 java.awt.Image getImage(java.lang.String name)
          Deprecated. since 2.0 use XProject instead
 void getImage(XImageHolder holder, java.lang.String name)
          Deprecated. since 2.0 use XProject instead
 java.io.InputStream getInputStream(java.io.File file)
          Deprecated. since 2.0 use XProject instead
 java.io.InputStream getInputStream(java.lang.String fileName)
          Deprecated. since 2.0 use XProject instead
static XResourceManager getInstance()
          Deprecated. since 1.0.3
 java.io.OutputStream getOutputStream(java.lang.String file)
          Deprecated. since 2.0 use XProject instead
 java.io.OutputStream getOutputStream(java.lang.String file, boolean useProjectParent)
          Deprecated. since 2.0 use XProject instead
 java.lang.String getPackageName()
          Deprecated. since 2.0 use XProject instead
 java.util.ResourceBundle getResourceBundle(java.lang.String name)
          Deprecated. since 2.0 use XProject instead
 ResourceBundleLoader getResourceBundleLoader()
          Deprecated. since 2.0 use XProject instead
 java.lang.String getStartupParam(java.lang.String name)
          Deprecated. since 1.0.3 use project.getStartupParam
 int getStartupParamAsInt(java.lang.String name)
          Deprecated. since 1.0.3 use XProject.getStartupParamAsInt
 java.net.URL getUrl(java.lang.String fileName)
          Deprecated. since 2.0 use XProject instead
 void reset()
          Deprecated. since 2.0 use XProject instead
 void setAppFrame(java.awt.Frame frame)
          Deprecated. since 2.0 use XProject instead
 void setApplet(java.applet.Applet applet)
          Deprecated. since 2.0 use XProject instead
 void setAppWindow(java.awt.Window window)
          Deprecated. since 2.0 use XProject instead
 void setDefaultEncoding(java.lang.String encoding)
          Deprecated. since 2.0 use XProject instead
 void setDefaultFile(java.lang.String file)
          Deprecated. since 2.0 use XProject instead
 void setDocumentBase(java.net.URL u)
          Deprecated. since 2.0 use XProject instead
 void setPackageName(java.lang.String pn)
          Deprecated. since 2.0 use XProject instead
 void setResourceBundleLoader(ResourceBundleLoader loader)
          Deprecated. since 2.0 use XProject instead
 void setStartupFile(java.lang.String fileName)
          Deprecated. since 1.0.3 use XProject.setStatupFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XResourceManager

protected XResourceManager(XProject proj)
Deprecated. since 2.0 use XProject instead

Method Detail

getInstance

public static XResourceManager getInstance()
Deprecated. since 1.0.3

Gets an instance of the resource manager

Returns:
the XResourceManager instance

getIcon

public javax.swing.Icon getIcon(java.lang.String name)
Deprecated. since 2.0 use XProject instead

Loads an image icon

Parameters:
name - the image resource name
Returns:
the image

getImage

public java.awt.Image getImage(java.lang.String name)
Deprecated. since 2.0 use XProject instead

Loads an image resource

Parameters:
name - the image resource name
Returns:
the image

getImage

public void getImage(XImageHolder holder,
                     java.lang.String name)
Deprecated. since 2.0 use XProject instead

Loads an image resource in a background thread

Parameters:
holder - the component containing to display the image
name - the image resource name

setStartupFile

public void setStartupFile(java.lang.String fileName)
Deprecated. since 1.0.3 use XProject.setStatupFile

Sets the startup file and loads the associated resource.

Parameters:
fileName - the name of the startup resource file.

getStartupParam

public java.lang.String getStartupParam(java.lang.String name)
Deprecated. since 1.0.3 use project.getStartupParam

Gets a startup parameter

Parameters:
name - the paramenter name
Returns:
the value

getStartupParamAsInt

public int getStartupParamAsInt(java.lang.String name)
Deprecated. since 1.0.3 use XProject.getStartupParamAsInt

Gets a startup parameter

Parameters:
name - the paramenter name
Returns:
the value

getInputStream

public java.io.InputStream getInputStream(java.lang.String fileName)
Deprecated. since 2.0 use XProject instead

Gets a stream for a resource

Parameters:
fileName - the resource file name
Returns:
the InputStream

getBufferedInputStream

public java.io.BufferedInputStream getBufferedInputStream(java.lang.String s)
Deprecated. since 2.0 use XProject instead

Gets a buffered stream for a resource

Parameters:
s - the resource name
Returns:
the input stream

getUrl

public java.net.URL getUrl(java.lang.String fileName)
Deprecated. since 2.0 use XProject instead

Gets a URL for a resource

Parameters:
fileName - the resource file name
Returns:
the InputStream

addCustomClassLoader

public void addCustomClassLoader(java.lang.ClassLoader c)
Deprecated. since 2.0 use XProject instead

Add a custom class loader. Customer class loaders are sometimes added to help locate resources in file structures, jars, remote locations etc...

Parameters:
c - the classloader

getInputStream

public java.io.InputStream getInputStream(java.io.File file)
Deprecated. since 2.0 use XProject instead

Gets a stream for a file

Parameters:
file - the file
Returns:
the input stream

getBufferedInputStream

public java.io.BufferedInputStream getBufferedInputStream(java.io.File file)
Deprecated. since 2.0 use XProject instead

Gets a buffered stream for a file

Parameters:
file - the file
Returns:
the input stream

getBufferedReader

public java.io.BufferedReader getBufferedReader(java.lang.String file)
                                         throws java.lang.Exception
Deprecated. since 2.0 use XProject instead

Gets a BufferedReader for a resource

Parameters:
file - the resource file name
Returns:
the BufferedReader
Throws:
java.lang.Exception

getBufferedReader

public java.io.BufferedReader getBufferedReader(java.lang.String file,
                                                java.lang.String encoding)
                                         throws java.lang.Exception
Deprecated. since 2.0 use XProject instead

Gets a BufferedReader for a resource

Parameters:
file - the resource file name
encoding - the input encoding e.g. "UTF8" or null for the default encoding (UTF8 unless it has been changed)
Returns:
the BufferedReader
Throws:
java.lang.Exception

getBufferedReader

public java.io.BufferedReader getBufferedReader(java.io.File file,
                                                java.lang.String encoding)
                                         throws java.lang.Exception
Deprecated. since 2.0 use XProject instead

Gets a BufferedReader for a resource

Parameters:
file - the resource file
encoding - the input encoding e.g. "UTF8" or null for the default encoding (UTF8 unless it has been changed)
Returns:
the BufferedReader
Throws:
java.lang.Exception

getOutputStream

public java.io.OutputStream getOutputStream(java.lang.String file)
Deprecated. since 2.0 use XProject instead

Gets a stream for a file

Parameters:
file - the file
Returns:
the output stream

getBufferedOutputStream

public java.io.BufferedOutputStream getBufferedOutputStream(java.lang.String file)
Deprecated. since 2.0 use XProject instead

Gets a buffered stream for a file

Parameters:
file - the file
Returns:
the output stream

getOutputStream

public java.io.OutputStream getOutputStream(java.lang.String file,
                                            boolean useProjectParent)
Deprecated. since 2.0 use XProject instead

Gets a stream for a file

Parameters:
file - the file
useProjectParent - use the projects default file specification to locate the file
Returns:
the output stream

getBufferedOutputStream

public java.io.BufferedOutputStream getBufferedOutputStream(java.lang.String file,
                                                            boolean useProjectParent)
Deprecated. since 2.0 use XProject instead

Gets a buffered stream for a file

Parameters:
file - the file
useProjectParent - use the projects default file specification to locate the file
Returns:
the output stream

setPackageName

public void setPackageName(java.lang.String pn)
Deprecated. since 2.0 use XProject instead

Set the default package name. The default package name is used when constructing widgets.

Parameters:
pn -

getPackageName

public java.lang.String getPackageName()
Deprecated. since 2.0 use XProject instead

Get the default package name

Returns:
the default package name

getDocumentBase

public java.net.URL getDocumentBase()
Deprecated. since 2.0 use XProject instead

Get the applet document base.

Returns:
the url

setDocumentBase

public void setDocumentBase(java.net.URL u)
Deprecated. since 2.0 use XProject instead

Set/Record the URL from which the applet was loaded

Parameters:
u -

setApplet

public void setApplet(java.applet.Applet applet)
Deprecated. since 2.0 use XProject instead

Set tbe applet reference

Parameters:
applet -

setAppFrame

public void setAppFrame(java.awt.Frame frame)
Deprecated. since 2.0 use XProject instead

Set the main Frame reference

Parameters:
frame -

setAppWindow

public void setAppWindow(java.awt.Window window)
Deprecated. since 2.0 use XProject instead

Set the main Window reference

Parameters:
window -

getApplet

public java.applet.Applet getApplet()
Deprecated. since 2.0 use XProject instead

Get a reference to the applet object

Returns:
a reference to the applet

getAppFrame

public java.awt.Frame getAppFrame()
Deprecated. since 2.0 use XProject instead

Get a areference to the applet's Frame

Returns:
a reference to the frame

getAppWindow

public java.awt.Window getAppWindow()
Deprecated. since 2.0 use XProject instead

Get a reference to the application's main Window

Returns:
a reference to the Window

reset

public void reset()
Deprecated. since 2.0 use XProject instead

Reset the reference to the resourceManager singleton


getDefaultEncoding

public java.lang.String getDefaultEncoding()
Deprecated. since 2.0 use XProject instead

Get the default file encoding (UTF8 unless modified)

Returns:
the encoding

setDefaultEncoding

public void setDefaultEncoding(java.lang.String encoding)
Deprecated. since 2.0 use XProject instead

Set the default file encoding (UTF8 unless modified)

Parameters:
encoding - the encoding e.g. "UTF8" or "ISO-8859-1"
See Also:
http://java.sun.com/j2se/1.4.2/docs/guide/intl/encoding.doc.html

setResourceBundleLoader

public void setResourceBundleLoader(ResourceBundleLoader loader)
Deprecated. since 2.0 use XProject instead

Set the object to load language resource bundles

Parameters:
loader - the new loader

getResourceBundleLoader

public ResourceBundleLoader getResourceBundleLoader()
Deprecated. since 2.0 use XProject instead

Get the resource bundle loader

Returns:
the loader

getResourceBundle

public java.util.ResourceBundle getResourceBundle(java.lang.String name)
Deprecated. since 2.0 use XProject instead

Get a resource bundle

Parameters:
name - the unqualified name of the resource bundle

setDefaultFile

public void setDefaultFile(java.lang.String file)
Deprecated. since 2.0 use XProject instead

Set the default file/directory specification used to locate files by the getOutputStream( String file, boolean useProjectParent ) method

Parameters:
file - the file or directory specification