com.sas.models
Class RGBList

com.sas.models.RGBList
All Implemented Interfaces:
com.sas.beans.PropertyChangeSource, com.sas.beans.VetoableChangeSource, AssociationListInterface, CollectionInterface, com.sas.collection.ContentsChangedSource, DictionaryInterface, OrderedCollectionInterface, Sortable, StaticCollectionInterface, StaticDictionaryInterface, StaticOrderedCollectionInterface, ComponentInterface, com.sas.DeepClonable, LinkPropertiesInterface, ModelInterface, com.sas.PublicClonable, com.sas.util.Countable, com.sas.util.Enumerable, com.sas.util.EventGateInterface, IndexedGetInterface, IndexedSetInterface, ViewInterface, MultipleValueEventSourceInterface, java.beans.PropertyChangeListener, java.io.ObjectInputValidation, java.io.Serializable, java.lang.Cloneable, java.util.EventListener

public class RGBList
implements com.sas.PublicClonable

A class that has a list of color names associated with its RGB values(integer). This list is used by the com.sas.awt.Color class.

See Also:
Color, Serialized Form

Field Summary
 
Fields inherited from class com.sas.collection.AssociationList
items, keys, RB_KEY
 
Fields inherited from class com.sas.collection.BaseCollection
allContentsChangedListeners, mappingObject
 
Constructor Summary
RGBList()
          The default constructor which fills the list with java defined color names as keys and corresponding rgb value as values.
RGBList(java.util.Enumeration e)
          A constructor that takes enumeration of java.awt.Color or com.sas.awt.Color objects and creates a list based on that.
 
Method Summary
 void add(int hexValue)
          Add a RGB value to this list only if the name does not exist.
 void add(java.lang.Object c)
          Add a com.sas.awt.color object into this list only if the name is not in the list.
 void add(java.lang.String name, int hexValue)
          Add a color name and corresponding RGB value to this list only if the name is not in the list.
 java.lang.Object clone()
          Create a copy of the current model
 Color getColor(java.awt.Color jcolor)
          Return the java.awt.Color Object corresponding to the color object passed in.
 Color getColor(int rgb)
          Return the Color corresponding to the rgb value provided.
 Color getColor(java.lang.String colorName)
          Return the Color corresponding to the name provided.
 java.util.Enumeration getColors()
          Returns an enumeration of com.sas.awt.Color objects.
static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()
           
 java.util.Enumeration getItems()
          Return an enumeration of all the names in the list
 
Methods inherited from class com.sas.collection.AssociationList
add, add, addItems, addItems, apply, applyToPairs, clone, contains, containsKey, count, count, countKey, dumpComponent, equals, equals, equals, fireContentsChanged, get, get, get, getIndex, getItems, getKey, getKey, getKey, getKeys, getKeys, getLastIndex, getPairs, getPairs, remove, removeAll, removeAll, removeAllAt, removeAt, removeAt, removeAt, set, set, set, setKey, setSize, sort, sort, toString, toString
 
Methods inherited from class com.sas.collection.BaseCollection
addContentsChangedListener, anyContentsChangedListeners, disableEvents, enableEvents, enableEvents, fireContentsChanged, map, removeContentsChangedListener, unmap
 
Methods inherited from class com.sas.Component
addLink, addPropertyChangeListener, addVetoableChangeListener, anyPropertyChangeListeners, attachModel, attachView, beansIsDesignTime, beansSetDesignTime, clone, detachModel, detachView, firePropertyChange, firePropertyChange, fireVetoableChange, getComponentDescription, getComponentSupportInfo, getEventMethod, getEventValues, getLinkInfo, getModelInterface, getRequiredInterfaces, getResources, getStringResource, getViewInterfaceSupportInfo, initialize, initializeComponent, isDesignTime, isLinked, propertyChange, queryLinks, queryLinks, refresh, removeAllLinks, removeInterfaceTraps, removeLink, removePropertyChangeListener, removeVetoableChangeListener, setComponentDescription, setComponentSupportInfo, setDefaultValues, setLinkInfo, setModelInterface, setRequiredInterfaces, setViewInterfaceSupportInfo, supportsListenerInterface, supportsRequiredInterfaces, trapInterfaceEvents, validateObject
 
Methods inherited from interface com.sas.collection.ContentsChangedSource
addContentsChangedListener, removeContentsChangedListener
 
Methods inherited from interface com.sas.beans.PropertyChangeSource
addPropertyChangeListener, removePropertyChangeListener
 

Constructor Detail

RGBList

public RGBList()
The default constructor which fills the list with java defined color names as keys and corresponding rgb value as values.


RGBList

public RGBList(java.util.Enumeration e)
A constructor that takes enumeration of java.awt.Color or com.sas.awt.Color objects and creates a list based on that. If the enumeration is empty, an empty list is created. If the enumeration does not contain java.awt.Colors or com.sas.awt.Colors then creates an empty list.

Parameters:
Enumeration - of com.sas.awt.Color objects
Method Detail

getExtendedBeanInfo

public static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()

add

public void add(java.lang.String name,
                int hexValue)
Add a color name and corresponding RGB value to this list only if the name is not in the list.

Parameters:
name - Name of the color to be added.
hexValue - int referring to RGB value of the color

add

public void add(int hexValue)
Add a RGB value to this list only if the name does not exist. It puts the RGB value as a default name.

Parameters:
hexValue - RGB value of the color to be added.

add

public void add(java.lang.Object c)
Add a com.sas.awt.color object into this list only if the name is not in the list.

Specified by:
add in interface CollectionInterface
Overrides:
add in class AssociationList
Parameters:
com.sas.awt.Color - object to be added.

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Create a copy of the current model

Specified by:
clone in interface AssociationListInterface
Specified by:
clone in interface CollectionInterface
Specified by:
clone in interface DictionaryInterface
Specified by:
clone in interface OrderedCollectionInterface
Specified by:
clone in interface StaticCollectionInterface
Specified by:
clone in interface StaticDictionaryInterface
Specified by:
clone in interface StaticOrderedCollectionInterface
Specified by:
clone in interface com.sas.PublicClonable
Overrides:
clone in class AssociationList
Returns:
a clone of this association list.
Throws:
java.lang.CloneNotSupportedException - if the clone fails.

getColor

public Color getColor(java.lang.String colorName)
Return the Color corresponding to the name provided.

Parameters:
colorName - a String corresponding to a value in this list. The String must be one of the keys in this list. Otherwise, the color corresponding to "white" is returned as a default value.
Returns:
Color The com.sas.awt.Color associated with colorName.

getColor

public Color getColor(int rgb)
Return the Color corresponding to the rgb value provided.

Parameters:
rgb - an integer corresponding to an item in the hashtable. If more than one item exists, the first one is returned. The rgb value must be one of the items in the hashtable. Otherwise, the color corresponding to "white" is returned as a default value.
Returns:
Color The com.sas.awt.Color associated with colorName.

getColor

public Color getColor(java.awt.Color jcolor)
Return the java.awt.Color Object corresponding to the color object passed in.

Parameters:
colorobj - a java.awt.Color object.
Returns:
com.sas.awt.Color The Color associated with colorobj or black if not in the list.

getColors

public java.util.Enumeration getColors()
Returns an enumeration of com.sas.awt.Color objects.

Returns:
enumeration of com.sas.awt.Color objects.

getItems

public java.util.Enumeration getItems()
Return an enumeration of all the names in the list

Specified by:
getItems in interface com.sas.util.Enumerable
Overrides:
getItems in class AssociationList
Returns:
enumeration of the names (keys) stored in this List.
See Also:
Enumerable.getItems()



Copyright © 2009 SAS Institute Inc. All Rights Reserved.