net.sf.freecol.common.resources
Class ColorResource

java.lang.Object
  extended by net.sf.freecol.common.resources.Resource
      extended by net.sf.freecol.common.resources.ColorResource

public class ColorResource
extends Resource

A Resource wrapping a Color.

See Also:
Resource, Color

Field Summary
private  java.awt.Color color
           
private static java.util.logging.Logger logger
           
static java.lang.String SCHEME
           
 
Constructor Summary
ColorResource(java.awt.Color color)
           
ColorResource(java.net.URI resourceLocator)
          Do not use directly.
 
Method Summary
 java.awt.Color getColor()
          Gets the Color represented by this resource.
static java.awt.Color getColor(java.lang.String colorName)
          Returns the Color identified by the given string.
 void preload()
          Preloading is a noop for this resource type.
 
Methods inherited from class net.sf.freecol.common.resources.Resource
getResourceLocator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static final java.util.logging.Logger logger

SCHEME

public static final java.lang.String SCHEME
See Also:
Constant Field Values

color

private java.awt.Color color
Constructor Detail

ColorResource

public ColorResource(java.awt.Color color)

ColorResource

ColorResource(java.net.URI resourceLocator)
        throws java.lang.Exception
Do not use directly.

Parameters:
resourceLocator - The URI used when loading this resource.
Throws:
java.lang.Exception
See Also:
ResourceFactory.createResource(URI)
Method Detail

preload

public void preload()
Preloading is a noop for this resource type.

Specified by:
preload in class Resource

getColor

public static java.awt.Color getColor(java.lang.String colorName)
Returns the Color identified by the given string. This is either a hexadecimal integer prefixed with "0x", or the name of a field of the Color class.

Parameters:
colorName - a String value
Returns:
a Color value

getColor

public java.awt.Color getColor()
Gets the Color represented by this resource.

Returns:
The Color in it's original size.