ilog.views.appframe.settings
Class IlvSettingsElement

java.lang.Object
  extended by ilog.views.appframe.settings.IlvSettingsNode
      extended by ilog.views.appframe.settings.IlvSettingsElement
All Implemented Interfaces:
Element, Node

public class IlvSettingsElement
extends IlvSettingsNode
implements Element

Settings elements are associated with objects of settings models.

See Also:
IlvSettings

Field Summary
 
Fields inherited from class ilog.views.appframe.settings.IlvSettingsNode
ATTRIBUTE_NODE, ELEMENT_NODE, ROOT_ELEMENT_NODE
 
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
Constructor Summary
IlvSettingsElement(IlvSettings settings)
          Creates a settings element for the specified settings.
 
Method Summary
 void add(IlvSettingsElement newChild)
          Makes newChild a new child of this settings element by adding it to the child array of the element.
static IlvSettingsElement[] AddElement(IlvSettingsElement[] elements, IlvSettingsElement element, int index)
          Adds a settings element to the specified array of settings elements at the specified index.
 Node appendChild(Node newChild)
          Adds the node newChild to the end of the list of children of this node.
 Node cloneNode(boolean deep)
          Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes.
 short compareDocumentPosition(Node other)
          
 IlvSettingsElement ensureChildElement(IlvSettingsQuery query)
          Ensures a descendant of this element accessible with the specified relative query exists.
 IlvSettingsElement ensureChildElement(String type)
          Ensures a child element of this element with the specified type exists.
 IlvSettingsElement ensureChildElement(String type, String attributeName, Object value)
          Ensures a child element of this element exists with the specified type and with the value of the attribute attributeName equal to value.
 boolean equals(Object obj)
          Returns whether this element is equal to the specified object.
 String getAttribute(String name)
          Retrieves an attribute value by name.
 String[] getAttributeNames()
          Returns the name of the attributes of this settings element.
 Attr getAttributeNode(String name)
          Retrieves an Attr node by name.
 Attr getAttributeNodeNS(String namespaceURI, String localName)
          Retrieves an Attr node by local name and namespace URI.
 IlvSettingsAttribute[] getAttributeNodes()
          Returns the settings attributes of this settings element.
 String getAttributeNS(String namespaceURI, String localName)
          Retrieves an attribute value by local name and namespace URI.
 NamedNodeMap getAttributes()
          A NamedNodeMap containing the attributes of this element.
 Object getAttributeValue(String attributeName)
          Gets an attribute value.
 String getBaseURI()
          
 boolean getBoolean(String attributeName)
          Returns the value of the attribute with the specified name as a boolean.
 boolean getBoolean(String attributeName, boolean defaultValue)
          Returns the value of the attribute with the specified name as a boolean.
 Object getCascadedElement(IlvSettings settings)
          Returns the element of the specified settings that has been cascaded in this settings element
 Object getCascadedElement(int level)
          Returns the level cascaded element that this settings element refers to.
 int getCascadedElementCount()
          Returns the number of elements of settings models that this element refers to.
 IlvSettings getCascadedSettings(int level)
          Returns the settings that own the level cascaded element that this settings element refers to.
 IlvSettingsElement getChild(String type, String attributeName, Object attributeValue)
          Returns the child element of this element with the specified type and attribute value.
 NodeList getChildNodes()
          A NodeList that contains all children of this node.
 IlvSettingsElement[] getChildren()
          Returns the child elements of this element.
 IlvSettingsElement[] getChildren(IlvSettingsQuery query)
          Returns the descendent elements that are selected by the specified query, starting the selection from this settings element.
 IlvSettingsElement[] getChildren(String type)
          Returns the child elements of this element with the specified type.
 Color getColor(String attributeName)
          Returns the value of the attribute with the specified name as a color.
 Color getColor(String attributeName, Color defaultValue)
          Returns the value of the attribute with the specified name as a color.
 Color[] getColorArray(String type, String attributeName)
          Returns an array of colors.
 Date getDate(String attributeName)
          Returns the value of the attribute with the specified name as a date.
 Date getDate(String attributeName, Date defaultValue)
          Returns the value of the attribute with the specified name as a double.
 Object getDefaultAttributeValue(String attributeName)
          Returns an attribute value that does not take into account the value defined in the user settings.
 Element getDOMElement()
          Returns the DOM element this settings element is associated with.
 double getDouble(String attributeName)
          Returns the value of the attribute with the specified name as a double.
 double getDouble(String attributeName, double defaultValue)
          Returns the value of the attribute with the specified name as a double.
 IlvSettingsElement getElement(String type, String attributeName, Object value)
          Returns the first child element of this element with the specified type and the attributeName attribute with the specified value.
 NodeList getElementsByTagName(String name)
          Returns a NodeList of all descendant elements with a given tag name, in the order in which they would be encountered in a preorder traversal of the Element tree.
 NodeList getElementsByTagNameNS(String namespaceURI, String localName)
          Returns a NodeList of all the descendant Elements with a given local name and namespace URI in the order in which they are encountered in a preorder traversal of this Element tree.
 Object getFeature(String feature, String version)
          
 Node getFirstChild()
          The first child of this node.
 IlvSettingsElement getFirstChild(String type)
          Returns the first settings element that is child of this settings element and that has the specified type.
 float getFloat(String attributeName)
          Returns the value of the attribute with the specified name as a float.
 float getFloat(String attributeName, float defaultValue)
          Returns the value of the attribute with the specified name as a float.
 Font getFont(String attributeName)
          Returns the value of the attribute with the specified name as a font.
 Font getFont(String attributeName, Font defaultValue)
          Returns the value of the attribute with the specified name as a font.
 Object getID()
          Returns the ID value of this settings element.
 int getInt(String attributeName)
          Returns the value of the attribute with the specified name as an integer.
 int getInt(String attributeName, int defaultValue)
          Returns the value of the attribute with the specified name as an integer.
 Node getLastChild()
          The last child of this node.
 String getLocalName()
          Returns the local part of the qualified name of this node.
 String getNamespaceURI()
          The namespace URI of this node, or null if it is unspecified.
 Node getNextSibling()
          The node immediately following this node.
 String getNodeName()
          Returns the name of this node.
 short getNodeType()
          Returns IlvSettingsNode.ELEMENT_NODE to specify this node is an element node.
 String getNodeValue()
          The value of this node.
 Document getOwnerDocument()
          The Document object associated with this node.
 String getPrefix()
          The namespace prefix of this node, or null if it is unspecified.
 Node getPreviousSibling()
          The node immediately preceding this node.
 Rectangle getRectangle()
          Returns a rectangle from this settings element.
 Rectangle getRectangle(Rectangle defaultRect)
          Returns a rectangle from this settings element.
 TypeInfo getSchemaTypeInfo()
          
 String getString(String attributeName)
          Returns the value of the attribute with the specified name as a string.
 String getString(String attributeName, String defaultValue)
          Returns the value of the attribute with the specified name as a string.
 String[] getStringArray(String type, String attributeName)
          Returns an array of string attribute values.
 String getTagName()
          The name of the element.
 String getText()
          Returns the text value of this settings element.
 String getTextContent()
          
 String getType()
          Returns the type of this settings element.
 Object getUserData(String key)
          
 boolean hasAttribute(String name)
          Returns true when an attribute with a given name is specified on this element or has a default value, false otherwise.
 boolean hasAttributeNS(String namespaceURI, String localName)
          Returns true when an attribute with a given local name and namespace URI is specified on this element or has a default value, false otherwise.
 boolean hasAttributes()
          Returns whether this element has any attributes.
 boolean hasChildNodes()
          This is a convenience method to allow easy determination of whether a node has any children.
 void insert(IlvSettingsElement newChild, int index)
          Makes newChild a new child of this settings element by adding it to the child array of the element at the specified insertion index.
 Node insertBefore(Node newChild, Node refChild)
          Inserts the node newChild before the existing child node refChild.
 boolean isDefaultNamespace(String namespaceURI)
          
 boolean isDOMElement()
          Determines whether this settings element is associated with a unique Element, without any cascading applied on this element.
 boolean isEqualNode(Node arg)
          
 boolean isSameNode(Node other)
          
 boolean isSupported(String feature, String version)
          Tests whether the DOM implementation implements a specific feature and that feature is supported by this node.
 String lookupNamespaceURI(String prefix)
          
 String lookupPrefix(String namespaceURI)
          
 boolean matchType(String type)
          Determines whether this element matches the specified type.
 void normalize()
          Puts all Text nodes in the full depth of the sub-tree underneath this Element into a "normal" form where only markup (e.g., tags, comments, processing instructions, CDATA sections, and entity references) separates Text nodes, i.e., there are no adjacent Text nodes.
 boolean remove(IlvSettingsElement aChild)
          Removes the specified child element from the child array of the element.
 void removeAll(String type)
          Removes all the child elements of this element with the specified type.
 void removeAttribute(String name)
          Removes an attribute by name.
 Attr removeAttributeNode(Attr oldAttr)
          Removes the specified attribute.
 void removeAttributeNS(String namespaceURI, String localName)
          Removes an attribute by local name and namespace URI.
 boolean removeCascadedElement(Object element)
          Removes the specified cascaded element from the list of cascaded elements stored within this settings element.
 Node removeChild(Node oldChild)
          Removes the child node indicated by oldChild from the list of children, and returns it.
static IlvSettingsElement[] RemoveElement(IlvSettingsElement[] elements, IlvSettingsElement element)
          Removes the settings element from the specified array of settings elements.
 void removeFromParent()
          Removes this settings element from its parent.
 Node replaceChild(Node newChild, Node oldChild)
          Replaces the child node oldChild with newChild in the list of children, and returns the oldChild node.
 void resetModifications()
          Resets the modifications brought to this element and its child elements.
 void setAttribute(String name, String value)
          Adds a new attribute.
 Attr setAttributeNode(Attr newAttr)
          Adds a new attribute.
 Attr setAttributeNodeNS(Attr newAttr)
          Adds a new attribute.
 void setAttributeNS(String namespaceURI, String qualifiedName, String value)
          Adds a new attribute.
 void setAttributeValue(String attributeName, Object value)
          Sets a new value to the attribute of this element with the specified name.
 void setBoolean(String attributeName, boolean value)
          Sets a boolean value to the attribute with the specified name.
 void setColor(String attributeName, Color color)
          Sets a color value to the attribute with the specified name.
 void setColorArray(String type, String attributeName, Color[] colors)
          Sets an array of color values.
 void setDate(String attributeName, Date date)
          Sets a date value to the attribute with the specified name.
 void setDouble(String attributeName, double value)
          Sets a double value to the attribute with the specified name.
 void setFloat(String attributeName, float value)
          Sets a float value to the attribute with the specified name.
 void setFont(String attributeName, Font font)
          Sets a font value to the attribute with the specified name.
 boolean setID(Object id)
          Sets an ID value to this settings element.
 void setIdAttribute(String name, boolean isId)
          
 void setIdAttributeNode(Attr idAttr, boolean isId)
          
 void setIdAttributeNS(String namespaceURI, String localName, boolean isId)
          
 void setInt(String attributeName, int value)
          Sets an integer value to the attribute with the specified name.
 void setNodeValue(String nodeValue)
          Changes the value of this node.
 void setPrefix(String prefix)
          Sets the prefix of this element.
 void setRectangle(Rectangle rect)
          Sets the x, y, width, and height attribute values of this settings element respectively to the value of the fields x, y, width, and height of the specified rectangle.
 void setString(String attributeName, String value)
          Sets a string value to the attribute with the specified name.
 void setStringArray(String type, String attributeName, String[] strings)
          Sets an array of string values.
 void setText(String value)
          Sets a new text value.
 void setTextContent(String textContent)
          
 Object setUserData(String key, Object data, UserDataHandler handler)
          
 String toString()
          Returns a string representation of the settings element.
 
Methods inherited from class ilog.views.appframe.settings.IlvSettingsNode
getParent, getParentNode, getSettings
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.w3c.dom.Node
getParentNode
 

Constructor Detail

IlvSettingsElement

public IlvSettingsElement(IlvSettings settings)
Creates a settings element for the specified settings.

Parameters:
settings - The settings of this element.
Method Detail

getBaseURI

public String getBaseURI()

Specified by:
getBaseURI in interface Node
Overrides:
getBaseURI in class IlvSettingsNode

compareDocumentPosition

public short compareDocumentPosition(Node other)
                              throws DOMException

Specified by:
compareDocumentPosition in interface Node
Overrides:
compareDocumentPosition in class IlvSettingsNode
Throws:
DOMException

getTextContent

public String getTextContent()
                      throws DOMException

Specified by:
getTextContent in interface Node
Overrides:
getTextContent in class IlvSettingsNode
Throws:
DOMException

setTextContent

public void setTextContent(String textContent)
                    throws DOMException

Specified by:
setTextContent in interface Node
Overrides:
setTextContent in class IlvSettingsNode
Throws:
DOMException

isSameNode

public boolean isSameNode(Node other)

Specified by:
isSameNode in interface Node
Overrides:
isSameNode in class IlvSettingsNode

lookupPrefix

public String lookupPrefix(String namespaceURI)

Specified by:
lookupPrefix in interface Node
Overrides:
lookupPrefix in class IlvSettingsNode

isDefaultNamespace

public boolean isDefaultNamespace(String namespaceURI)

Specified by:
isDefaultNamespace in interface Node
Overrides:
isDefaultNamespace in class IlvSettingsNode

lookupNamespaceURI

public String lookupNamespaceURI(String prefix)

Specified by:
lookupNamespaceURI in interface Node
Overrides:
lookupNamespaceURI in class IlvSettingsNode

isEqualNode

public boolean isEqualNode(Node arg)

Specified by:
isEqualNode in interface Node
Overrides:
isEqualNode in class IlvSettingsNode

getFeature

public Object getFeature(String feature,
                         String version)

Specified by:
getFeature in interface Node
Overrides:
getFeature in class IlvSettingsNode

setUserData

public Object setUserData(String key,
                          Object data,
                          UserDataHandler handler)

Specified by:
setUserData in interface Node
Overrides:
setUserData in class IlvSettingsNode

getUserData

public Object getUserData(String key)

Specified by:
getUserData in interface Node
Overrides:
getUserData in class IlvSettingsNode

getSchemaTypeInfo

public TypeInfo getSchemaTypeInfo()

Specified by:
getSchemaTypeInfo in interface Element

setIdAttribute

public void setIdAttribute(String name,
                           boolean isId)
                    throws DOMException

Specified by:
setIdAttribute in interface Element
Throws:
DOMException

setIdAttributeNS

public void setIdAttributeNS(String namespaceURI,
                             String localName,
                             boolean isId)
                      throws DOMException

Specified by:
setIdAttributeNS in interface Element
Throws:
DOMException

setIdAttributeNode

public void setIdAttributeNode(Attr idAttr,
                               boolean isId)
                        throws DOMException

Specified by:
setIdAttributeNode in interface Element
Throws:
DOMException

getNodeType

public short getNodeType()
Returns IlvSettingsNode.ELEMENT_NODE to specify this node is an element node.

Specified by:
getNodeType in interface Node
Specified by:
getNodeType in class IlvSettingsNode
Returns:
The type of this node.

getInt

public int getInt(String attributeName)
Returns the value of the attribute with the specified name as an integer.

Parameters:
attributeName - The name of the attribute to retrieve the value from.
Returns:
The integer value of the attribute. If no attribute is found with the specified name, Integer.MIN_VALUE will be returned.
See Also:
getInt(String, int), setInt(java.lang.String, int)

getInt

public int getInt(String attributeName,
                  int defaultValue)
Returns the value of the attribute with the specified name as an integer.

Parameters:
attributeName - The name of the attribute to retrieve the value from.
defaultValue - The default value that is returned if the attribute with the specified name is not found.
Returns:
The integer value of the attribute. If no attribute is found with the specified name, defaultValue will be returned.
See Also:
getInt(String), setInt(java.lang.String, int)

setInt

public void setInt(String attributeName,
                   int value)
Sets an integer value to the attribute with the specified name.

Parameters:
attributeName - The name of the attribute to set a value to.
value - The new value of the attribute.
See Also:
getInt(String), getInt(String, int)

getString

public String getString(String attributeName)
Returns the value of the attribute with the specified name as a string.

Parameters:
attributeName - The name of the attribute to retrieve the value from.
Returns:
The string value of the attribute or nul if no attribute is found with the specified name.
See Also:
getString(String, String), setString(java.lang.String, java.lang.String)

getString

public String getString(String attributeName,
                        String defaultValue)
Returns the value of the attribute with the specified name as a string.

Parameters:
attributeName - The name of the attribute to retrieve the value from.
defaultValue - The default value that is returned if the attribute with the specified name is not found.
Returns:
The string value of the attribute. If no attribute is found with the specified name, defaultValue will be returned.
See Also:
getString(String), setString(java.lang.String, java.lang.String)

setString

public void setString(String attributeName,
                      String value)
Sets a string value to the attribute with the specified name.

Parameters:
attributeName - The name of the attribute to set a value to.
value - The new value of the attribute.
See Also:
getString(String), getString(String, String)

getText

public String getText()
Returns the text value of this settings element.

Returns:
The text value.
See Also:
IlvXMLSettings.DEFAULT_TAG_TEXT_ATTRIBUTE

setText

public void setText(String value)
Sets a new text value.

Parameters:
value - The new text value of the element.
See Also:
getText()

getBoolean

public boolean getBoolean(String attributeName)
Returns the value of the attribute with the specified name as a boolean.

Parameters:
attributeName - The name of the attribute to retrieve the value from.
Returns:
The boolean value of the attribute or false if no attribute is found with the specified name.
See Also:
getBoolean(String, boolean), setBoolean(java.lang.String, boolean)

getBoolean

public boolean getBoolean(String attributeName,
                          boolean defaultValue)
Returns the value of the attribute with the specified name as a boolean.

Parameters:
attributeName - The name of the attribute to retrieve the value from.
defaultValue - The default value that is returned if the attribute with the specified name is not found.
Returns:
The boolean value of the attribute; if no attribute is found with the specified name, defaultValue will be returned.
See Also:
getBoolean(String), setBoolean(java.lang.String, boolean)

setBoolean

public void setBoolean(String attributeName,
                       boolean value)
Sets a boolean value to the attribute with the specified name.

Parameters:
attributeName - The name of the attribute to set a value to.
value - The new value of the attribute.
See Also:
getBoolean(String), getBoolean(String, boolean)

getFloat

public float getFloat(String attributeName)
Returns the value of the attribute with the specified name as a float.

Parameters:
attributeName - The name of the attribute to retrieve the value from.
Returns:
The boolean value of the attribute; if no attribute is found with the specified name, Float.MIN_VALUE will be returned.
See Also:
getFloat(String, float), setFloat(java.lang.String, float)

getFloat

public float getFloat(String attributeName,
                      float defaultValue)
Returns the value of the attribute with the specified name as a float.

Parameters:
attributeName - The name of the attribute to retrieve the value from.
defaultValue - The default value that is returned if the attribute with the specified name is not found.
Returns:
The float value of the attribute; if no attribute is found with the specified name, defaultValue will be returned.
See Also:
ge