|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ptolemy.moml.filter.GRColorChanges
public class GRColorChanges
This class filters MoML files for backward compatibility between GR models constructed in version 4.0 or earlier. In particular, it handles the switch to using ColorAttribute for all colors, plus some parameter renaming. It also handles some conversions from matrix parameters to arrays.
Red (cxh) |
Yellow (eal) |
Field Summary | |
---|---|
private static java.util.HashSet |
_actorsWithRGBColor
Set of actors with parameter named "RGB color" |
private boolean |
_foundOne
Flag indicating that we found one whose name needed changing. |
Constructor Summary | |
---|---|
GRColorChanges()
|
Method Summary | |
---|---|
java.lang.String |
filterAttributeValue(NamedObj container,
java.lang.String element,
java.lang.String attributeName,
java.lang.String attributeValue,
java.lang.String xmlFile)
Handle parameter name changes. |
void |
filterEndElement(NamedObj container,
java.lang.String elementName,
java.lang.StringBuffer currentCharData,
java.lang.String xmlFile)
If the container is a property named "diffuseColor" contained by one of the GR actors, then check the format of its parameter to change it, if necessary, from matrix format to array format. |
java.lang.String |
toString()
Return a string that describes what the filter does. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static java.util.HashSet _actorsWithRGBColor
private boolean _foundOne
Constructor Detail |
---|
public GRColorChanges()
Method Detail |
---|
public java.lang.String filterAttributeValue(NamedObj container, java.lang.String element, java.lang.String attributeName, java.lang.String attributeValue, java.lang.String xmlFile)
filterAttributeValue
in interface MoMLFilter
container
- The container for XML element.element
- The XML element name.attributeName
- The name of the attribute.attributeValue
- The value of the attribute.xmlFile
- The file currently being parsed.
public void filterEndElement(NamedObj container, java.lang.String elementName, java.lang.StringBuffer currentCharData, java.lang.String xmlFile) throws java.lang.Exception
filterEndElement
in interface MoMLFilter
container
- The object defined by the element that this
is the end of.elementName
- The element name.currentCharData
- The character data, which appears
only in the doc and configure elementsxmlFile
- The file currently being parsed.
java.lang.Exception
- if there is a problem substituting
in the new value.public java.lang.String toString()
toString
in interface MoMLFilter
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |