Class sunsoft.jws.visual.rt.base.Util
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sunsoft.jws.visual.rt.base.Util

java.lang.Object
   |
   +----sunsoft.jws.visual.rt.base.Util

public class Util
extends Object
Utilities needed by run-time.

Variable Index

 o RELIEF_FLAT
 o RELIEF_GROOVE
 o RELIEF_RAISED
 o RELIEF_RIDGE
 o RELIEF_SUNKEN
 o WIN95_FIELD_BORDER
 o WIN95_RAISED
 o WIN95_SUNKEN
 o WIN95_WINDOW_BORDER

Constructor Index

 o Util()

Method Index

 o brighter(Color)
Returns a brighter version of this color.
 o darker(Color)
Returns a darker version of this color.
 o draw3DRect(Graphics, int, int, int, int, int, int)
Draw a 3D rectable with the given relief and border width.
 o fileToString(String)
Creates a string from the contents of a file.
 o getWorkaroundImage(Image, Component)
Get an image given another.
 o getWorkaroundImage(URL, Component)
Get an image given a url.
 o isEqual(Object, Object)
Compares two objects and returns if they are equal.
 o pack(Window)
A workaround routine for the Windows95 pack bug in 1.0.2
 o pathToURL(String, Applet)
Returns a URL based on a relative path to a file or directory.
 o qsort(String[])
Quicksort for strings.
 o readURLToString(URL)
Creates a string from reading a URL.
 o stringToFile(String, String)
Puts a string out to a file.

Variables

 o RELIEF_FLAT
  public final static int RELIEF_FLAT
 o RELIEF_RAISED
  public final static int RELIEF_RAISED
 o RELIEF_SUNKEN
  public final static int RELIEF_SUNKEN
 o RELIEF_RIDGE
  public final static int RELIEF_RIDGE
 o RELIEF_GROOVE
  public final static int RELIEF_GROOVE
 o WIN95_RAISED
  public final static int WIN95_RAISED
 o WIN95_SUNKEN
  public final static int WIN95_SUNKEN
 o WIN95_FIELD_BORDER
  public final static int WIN95_FIELD_BORDER
 o WIN95_WINDOW_BORDER
  public final static int WIN95_WINDOW_BORDER

Constructors

 o Util
  public Util()

Methods

 o brighter
  public Color brighter(Color c)
Returns a brighter version of this color.
 o darker
  public Color darker(Color c)
Returns a darker version of this color.
 o draw3DRect
  public void draw3DRect(Graphics g,
                         int x,
                         int y,
                         int w,
                         int h,
                         int relief,
                         int bd)
Draw a 3D rectable with the given relief and border width.
 o getWorkaroundImage
  public Image getWorkaroundImage(URL url,
                                  Component comp)
Get an image given a url. If we are on Windows 95, then we need to use a filter to get around the transparency bugs.
 o getWorkaroundImage
  public Image getWorkaroundImage(Image image,
                                  Component comp)
Get an image given another. If we are on Windows 95, then we need to use a filter to get around the transparency bugs. Otherwise, just return the image directly.
 o pathToURL
  public URL pathToURL(String path,
                       Applet applet)
Returns a URL based on a relative path to a file or directory. If we are running under a browser, then a URL is created based off of the code base. Otherwise, a file URL will be created by searching the CLASSPATH for the file.
 o readURLToString
  public String readURLToString(URL url) throws IOException
Creates a string from reading a URL. Returns null when an error occurs.
 o fileToString
  public String fileToString(String filename) throws FileNotFoundException, IOException, SecurityException
Creates a string from the contents of a file. Returns null when an error occurs, or the filename turns out to be a directory.
 o stringToFile
  public void stringToFile(String saveString,
                           String filename) throws FileNotFoundException, IOException, SecurityException
Puts a string out to a file. Returns true on success.
 o isEqual
  public boolean isEqual(Object o1,
                         Object o2)
Compares two objects and returns if they are equal. Will work with null objects
 o qsort
  public void qsort(String list[])
Quicksort for strings. Could not get James Gosling's example working properly, or the "fixed" example, so wrote my own using algorithms book.
 o pack
  public static void pack(Window c)
A workaround routine for the Windows95 pack bug in 1.0.2
Parameters:
c - The component to pack

All Packages  Class Hierarchy  This Package  Previous  Next  Index