|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||
com.sas.models.ColorList
public class ColorList
A base class that creates an empty ordered collection. A java.awt.color objects can be added to this collection. This Collection has an association list which maintains a key value pair. The keys are java.awt.SystemColor or com.sas.awt.Color objects and values are its name.
Creating a ColorList Component
ColorList = new ColorList();
Usage
The ColorList is an empty list which can be dropped on any visual component that supports OrderedCollection Interface like ListBox, ComboBox
ColorNameList,
Serialized Form| Field Summary | |
|---|---|
protected static java.lang.String |
COLORNOTFOUNDERROR
|
protected java.lang.String |
NodeName
|
protected java.lang.String |
NodeType
|
| Fields inherited from class com.sas.collection.BaseCollection |
|---|
allContentsChangedListeners, mappingObject |
| Constructor Summary | |
|---|---|
ColorList()
The default constructor which creates an empty list. |
|
ColorList(ColorNameList cnl)
A constructor that takes the ColorNameList and initializes this list with it. |
|
ColorList(java.util.Enumeration e)
A constructor that takes enumeration of java.awt.SystemColor or com.sas.awt.Color objects and creates a list. |
|
| Method Summary | |
|---|---|
void |
add(java.lang.Object c,
int index)
Overridden to call convertObject(Object) first on the item to add to the ColorList. |
void |
addItems(java.util.Enumeration items,
int index)
Overridden to call convertObject(Object) first on all items in the Enumeration. |
void |
append(int index,
java.lang.Object item)
Overridden to call convertObject(Object) first on the item to append to the ColorList. |
java.lang.Object |
clone()
Create a copy of the current model |
protected java.lang.Object |
convertObject(java.lang.Object c)
Convert the specified object to a valid object to add to the ColorList. |
int |
countNodeChildren(int maximumChildCount)
Counts the children of the current node. countNodeChildren differs from getNodeChildCount when the number of children is not readily known. |
java.awt.Color |
getColor(int rgb)
Return the Color corresponding to the rgb value provided. |
java.awt.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 or java.awt.SystemColor objects. |
static com.sas.beans.ExtendedBeanInfo |
getExtendedBeanInfo()
|
SimpleNodeInterface |
getNodeChild(int index)
Returns the child node at the specified index. |
int |
getNodeChildCount()
Returns the number of children available. |
SimpleNodeInterface[] |
getNodeChildren(int startIndex,
int count)
Returns the specified range of children for the current node. |
java.lang.String |
getNodeExpandedText()
Returns the value of the nodeExpandedText property. |
java.lang.String |
getNodeText()
Returns the value of the nodeText property. |
java.lang.String |
getNodeType()
Returns the value of the nodeType property. |
NodeInterface |
getRoot()
Gets the root for the tree implementation of the list |
boolean |
isLeafNode()
Indicates whether the current node is a leaf. |
void |
set(int index,
java.lang.Object item)
Overridden to call convertObject(Object) first on the item to set on the ColorList. |
protected void |
setList(ColorNameList cnl)
Gets the color objects from the colorNameList(associationlist with keys as com.sas.awt.Color or java.awt.SystemColor objects and names as values) and adds it to the collection |
| Methods inherited from class com.sas.collection.OrderedCollection |
|---|
add, addItems, apply, clone, computeNewCapacity, contains, count, dumpComponent, equals, equals, get, getIndex, getItems, getItems, getLastIndex, moveHole, moveHoleEnsureCapacity, remove, removeAll, removeAll, removeAt, setSize, sort, sort, sort, sort, toArray, toArray, toString |
| Methods inherited from class com.sas.collection.BaseCollection |
|---|
addContentsChangedListener, anyContentsChangedListeners, disableEvents, enableEvents, enableEvents, fireContentsChanged, map, removeContentsChangedListener, unmap |
| Methods inherited from interface com.sas.collection.ContentsChangedSource |
|---|
addContentsChangedListener, removeContentsChangedListener |
| Methods inherited from interface com.sas.beans.PropertyChangeSource |
|---|
addPropertyChangeListener, removePropertyChangeListener |
| Field Detail |
|---|
protected java.lang.String NodeName
protected java.lang.String NodeType
protected static java.lang.String COLORNOTFOUNDERROR
| Constructor Detail |
|---|
public ColorList(ColorNameList cnl)
cnl - an associationlist with com.sas.awt.Color and
java.awt.SystemColor objects as keys and names as valuespublic ColorList()
public ColorList(java.util.Enumeration e)
Enumeration - of java.awt.Color objects| Method Detail |
|---|
public static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()
protected void setList(ColorNameList cnl)
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in interface CollectionInterfaceclone in interface OrderedCollectionInterfaceclone in interface StaticCollectionInterfaceclone in interface StaticOrderedCollectionInterfaceclone in interface com.sas.PublicClonableclone in class OrderedCollectionjava.lang.CloneNotSupportedException - if the clone fails.public NodeInterface getRoot()
getRoot in interface TreeInterfacepublic java.awt.Color getColor(java.lang.String colorName)
colorName - a String corresponding to a key in the hashtable.
The String must be one of the keys in this list.
java.util.NoSuchElementException - when there is no matching name in this
list.public java.awt.Color getColor(int rgb)
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.
java.util.NoSuchElementException - when there is no matching color object in this
list.public java.util.Enumeration getColors()
protected java.lang.Object convertObject(java.lang.Object c)
c - the object to convert to a com.sas.awt.Color
public void add(java.lang.Object c,
int index)
add in interface OrderedCollectionInterfaceadd in class OrderedCollectionc - the item to add to this collection.
The item may exist multiple times in this collection.index - insert the object before the indexed item. The
newly inserted item can be accessed by get(index) afterwards.convertObject(java.lang.Object)
public void addItems(java.util.Enumeration items,
int index)
addItems in interface OrderedCollectionInterfaceaddItems in class OrderedCollectionitems - an Enumeration of items to add to this collectionindex - insert the objects starting before the indexed item. The
first of the newly inserted item can be accessed by get(index)
afterwards.convertObject(java.lang.Object)
public void set(int index,
java.lang.Object item)
set in interface OrderedCollectionInterfaceset in interface IndexedSetInterfaceset in class OrderedCollectionindex - The position where the Object will be placed.item - The Object to be added to this ordered collection.convertObject(java.lang.Object)
public void append(int index,
java.lang.Object item)
append in class OrderedCollectionindex - The position where the object will be placed.
If necessary, this collection is extended to
accommodate the item.item - the object to be added to this ordered collection.convertObject(java.lang.Object)public java.lang.String getNodeExpandedText()
getNodeExpandedText in interface NodeInterfacepublic java.lang.String getNodeText()
getNodeText in interface NodeInterfacepublic java.lang.String getNodeType()
getNodeType in interface NodeInterfacepublic int countNodeChildren(int maximumChildCount)
countNodeChildren in interface SimpleNodeInterfacemaximumChildCount - the maximum number of children to read, or 0 to read indefinitely
public int getNodeChildCount()
getNodeChildCount in interface SimpleNodeInterfacepublic boolean isLeafNode()
isLeafNode in interface SimpleNodeInterfacepublic SimpleNodeInterface getNodeChild(int index)
getNodeChild in interface SimpleNodeInterfaceindex - the 0-based index of the child node to retrieve
true.
public SimpleNodeInterface[] getNodeChildren(int startIndex,
int count)
getNodeChildren in interface SimpleNodeInterfacestartIndex - 0-based index which identifies the start of the rangecount - the amount of children to get
true.
|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||