All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class oracle.forms.demos.Utils

java.lang.Object
   |
   +----oracle.forms.demos.Utils

public class Utils
extends Object

Oracle Forms Server 6i PJC Example

This class provides a series of common methods that are used by different demonstration PJCs. It provides common functions such as debugging messages, type conversion for common type mappings and the creation of URLs.

This public methods in this class are static so the class does not need to be instantiated, the methods can just be invoked on the class itself.

Version:
1.05 09/03/1999 added createURL method
1.0 08/18/1999 created
Author:
Steve Button (sbutton@oracle.com)

Constructor Index

 o Utils()

Method Index

 o createURL(String)
Create a URL based on a given resource name.
 o debug(String, String)
Writes a debug message to the screen in the format of
  • [CLASSNAME] : debugging message
  • if the debug status for the class is enabled.
     o getColorFromRGBString(String)
    Create and return a color object derived from RGB values in a string.
     o getColorFromRGBString(String, Color)
    Create a color object from the RGB values in a string value representation of a color to a Color object.
     o getColorFromString(String)
    Uses the default colors defined in Color to map a string value representation of a color to a Color object.
     o getColorFromString(String, Color)
    Use the default colors defined in Color to map a string value representation of a color to a Color object.
     o setDebug(String, boolean)
    Set the debugging status for a class identified as cls.

    Constructors

     o Utils
     public Utils()
    

    Methods

     o setDebug
     public static void setDebug(String cls,
                                 boolean value)
    
    Set the debugging status for a class identified as cls.

    Parameters:
    cls - the name of the class
    value - the debugging status
     o debug
     public static void debug(String cls,
                              String msg)
    
    Writes a debug message to the screen in the format of
  • [CLASSNAME] : debugging message
  • if the debug status for the class is enabled. The debug messages will be written if the class has the debug status set to true.

    Parameters:
    cls - the name of the class
     o getColorFromString
     public static Color getColorFromString(String color)
    
    Uses the default colors defined in Color to map a string value representation of a color to a Color object. Defaults to returning Color.white if the color can't be mapped.

    Parameters:
    color - the string representation of the color
    Returns:
    Color object that matches the color specified in the string
     o getColorFromString
     public static Color getColorFromString(String color,
                                            Color def)
    
    Use the default colors defined in Color to map a string value representation of a color to a Color object.

    Parameters:
    color - the string representation of the color
    def - the color that should be returned if no match is found
    Returns:
    Color object that matches the color specified in the string
     o getColorFromRGBString
     public static Color getColorFromRGBString(String color)
    
    Create and return a color object derived from RGB values in a string. Will return Color.red in the case where the string is incorrect or a color could not be created from the input string.

    Parameters:
    color - the string representation of the color
    def - the default color to return in case of a screwup
    Returns:
    Color object that matches the color specified in the string
     o getColorFromRGBString
     public static Color getColorFromRGBString(String color,
                                               Color def)
    
    Create a color object from the RGB values in a string value representation of a color to a Color object.

    Parameters:
    color - the string representation of the color
    def - the default color to return in case of a screwup
    Returns:
    Color object that matches the color specified in the string
     o createURL
     public static URL createURL(String fileName)
    
    Create a URL based on a given resource name. Firstly a network URL will attempt to be created and failing that, a file based URL will be created.

    Parameters:
    fileName - the resource to use for the URL
    Returns:
    URL a URL that maps to the given resource

    All Packages  Class Hierarchy  This Package  Previous  Next  Index