org.PingOO.DLAI.lib.util
Class CursorManager

java.lang.Object
  |
  +--org.PingOO.DLAI.lib.util.Manager
        |
        +--org.PingOO.DLAI.lib.util.CursorManager

public final class CursorManager
extends Manager

Manages the cursors for the DLAI

Since:
PingOO 2.0
Version:
2.0
Author:
Fabrice Bouyé (bouye@cur-archamps.fr)

Field Summary
private static java.lang.String DEFAULT_MODULE
          The default module for cursors.
private static java.util.Hashtable HOTSPOT_TABLE
          Contains the cursors, indexed by modules, identifiers and hotspots.
private static java.util.Hashtable ICON_TABLE
          Contains the icons used to create the cursors indexed by modules and identifiers.
 
Fields inherited from class org.PingOO.DLAI.lib.util.Manager
classLoader
 
Constructor Summary
private CursorManager()
          Hides the constructor from the outside.
 
Method Summary
static void clearCache()
          Clears the cache used in this manager.
private static java.util.Hashtable getCache(java.lang.String module, java.util.Hashtable parentTable)
          Return the correct cache.
private static java.util.Hashtable getCache(java.lang.String module, java.lang.String identifier, java.util.Hashtable parentTable)
          Return the correct cache.
static java.awt.Cursor getCursor(javax.swing.Icon icon)
          Returns the cursor of the icon.
static java.awt.Cursor getCursor(javax.swing.Icon icon, java.awt.Point hotSpot)
          Returns the cursor of the icon.
static java.awt.Cursor getCursor(java.lang.String identifier)
          Returns an cursor from the default set.
static java.awt.Cursor getCursor(java.lang.String module, java.lang.String identifier)
          Returns an icon from a different set.
static java.awt.Cursor getCursor(java.lang.String module, java.lang.String identifier, java.awt.Point hotSpot)
          Returns an icon from a different set.
private static void initialize()
          Initializes caches.
 
Methods inherited from class org.PingOO.DLAI.lib.util.Manager
findFile, findFile, findFile, findFile
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

ICON_TABLE

private static java.util.Hashtable ICON_TABLE
Contains the icons used to create the cursors indexed by modules and identifiers.

HOTSPOT_TABLE

private static java.util.Hashtable HOTSPOT_TABLE
Contains the cursors, indexed by modules, identifiers and hotspots.

DEFAULT_MODULE

private static final java.lang.String DEFAULT_MODULE
The default module for cursors.
Constructor Detail

CursorManager

private CursorManager()
Hides the constructor from the outside.
Method Detail

initialize

private static final void initialize()
Initializes caches.

getCache

private static final java.util.Hashtable getCache(java.lang.String module,
                                                  java.util.Hashtable parentTable)
Return the correct cache.
Parameters:
module - The module to use.
parentTable - The parent cache of the desired cache.
Returns:
The correct cache.

getCache

private static final java.util.Hashtable getCache(java.lang.String module,
                                                  java.lang.String identifier,
                                                  java.util.Hashtable parentTable)
Return the correct cache.
Parameters:
module - The module to use.
identifier - the cursor identifier.
parentTable - The parent cache of the desired cache.
Returns:
The correct cache.

clearCache

public static void clearCache()
Clears the cache used in this manager.

getCursor

public static final java.awt.Cursor getCursor(java.lang.String identifier)
Returns an cursor from the default set.
In case the icon is not found the program will then try to retrieve it by removing the default extension.
By default the search occurs in the cursor directory, then if the icon is still not found it will take place in the big icon and then in the mini icon directory.
Parameters:
identifier - The identifier need to get the icon from its file. You do not need to provide the .gif extension.
Returns:
The expected icon, or null if the file was not found.

getCursor

public static final java.awt.Cursor getCursor(javax.swing.Icon icon)
Returns the cursor of the icon.
Returns:
The cursor of the icon, or null if the icon has no image.

getCursor

public static final java.awt.Cursor getCursor(javax.swing.Icon icon,
                                              java.awt.Point hotSpot)
Returns the cursor of the icon.
Returns:
The image of the icon, or null if the icon has no image.

getCursor

public static final java.awt.Cursor getCursor(java.lang.String module,
                                              java.lang.String identifier)
Returns an icon from a different set.
In case the icon is not found the program will then try to retrieve it by removing the default extension.
If the icon is still not found then the search will continue in the default set, using the same way as with the specific module.
By default the search occurs in the cursor directory, then if the icon is still not found it will take place in the big icon and then in the mini icon directory.
Parameters:
module - The appli's name.
identifier - The identifier need to get the icon from its file. You do not need to provide the .gif extension.
Returns:
The expected icon, or an cursor of the default icon if the file was not found.

getCursor

public static final java.awt.Cursor getCursor(java.lang.String module,
                                              java.lang.String identifier,
                                              java.awt.Point hotSpot)
Returns an icon from a different set.
In case the icon is not found the program will then try to retrieve it by removing the default extension.
If the icon is still not found then the search will continue in the default set, using the same way as with the specific module.
By default the search occurs in the cursor directory, then if the icon is still not found it will take place in the big icon and then in the mini icon directory.
Parameters:
module - The appli's name.
identifier - The identifier need to get the icon from its file. You do not need to provide the .gif extension.
Returns:
The expected icon, or an cursor of the default icon if the file was not found.