uwcse.location.client
Class Utils

java.lang.Object
  |
  +--uwcse.location.client.Utils

public class Utils
extends Object

Location display utilities.

Author:
Matthai Philipose

Constructor Summary
Utils()
           
 
Method Summary
static double alphaToDouble(int alpha)
           
static int alphaToInt(double alpha)
           
static Color findContrastingColor(Color color)
          Return a color that contrasts with "color", so e.g. the latter color may be used as foreground color for text on a background of the former color.
static Color generateColorFromInt(int key)
          generates a color for the collectors...at most there can be 32 distinguishable collectors.
static Color generateColorFromString(String nm)
          Figure out a color for the display, using its name as the key.
static boolean isLightColor(Color color)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Utils

public Utils()
Method Detail

generateColorFromString

public static Color generateColorFromString(String nm)
Figure out a color for the display, using its name as the key. Code from Kelvin Lau. He credits the idea "in large part to Ken Fishkin"


generateColorFromInt

public static Color generateColorFromInt(int key)
generates a color for the collectors...at most there can be 32 distinguishable collectors. Code from Kelvin Lau. He credits the idea "in large part to Ken Fishkin"


findContrastingColor

public static Color findContrastingColor(Color color)
Return a color that contrasts with "color", so e.g. the latter color may be used as foreground color for text on a background of the former color.


isLightColor

public static boolean isLightColor(Color color)

alphaToInt

public static int alphaToInt(double alpha)

alphaToDouble

public static double alphaToDouble(int alpha)


This documentation is for the Location Stack v0.8. The latest distribution, the documentation, and the list of contributors to the Location Stack can always be found at http://portolano.cs.washington.edu/projects/location/

© Copyright 2004 University of Washington CSE