Class FileSurfaceGiftiXML_WM.SurfaceGifitXMLHandler
java.lang.Object
org.xml.sax.helpers.DefaultHandler
gov.nih.mipav.view.renderer.WildMagic.Interface.FileSurfaceGiftiXML_WM.SurfaceGifitXMLHandler
- All Implemented Interfaces:
ContentHandler,DTDHandler,EntityResolver,ErrorHandler
- Enclosing class:
FileSurfaceGiftiXML_WM
Used by the XML Parser to parse the Surface.XML header.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) StringCurrent XML keyword:.(package private) StringCurrent buffer:.(package private) FileInfoSurfaceGiftiXML_WMfileInfo data structure for reading the surface information into:. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new SurfaceXMLHandler object. -
Method Summary
Modifier and TypeMethodDescriptionvoidcharacters(char[] ch, int start, int length) Text data callback from parser.voidDo nothing.voidendElement(String namespaceURI, String localName, String qName) Called by parser when the end of an element is reached in the document.private WildMagic.LibFoundation.Mathematics.ColorRGBCalled when reading the input surface.xml file: Parses the input string into a Color3f variable:getColorString(WildMagic.LibFoundation.Mathematics.ColorRGB kColor) Called when writing the surface.xml file: Converts the input Color3f to a String for writing:getConnectivity(String elementBuffer) Parse the connectivity index from the section.Vector<WildMagic.LibFoundation.Mathematics.Vector3f> getCoordinate(String elementBuffer) Parse the coordinate point value from the section.voidskippedEntity(String name) Do nothing but show the entity we skipped.voidstartElement(String namespaceURI, String localName, String qName, Attributes atts) Parser calls this for the beginning of each element in the document.Methods inherited from class org.xml.sax.helpers.DefaultHandler
endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, startDocument, startPrefixMapping, unparsedEntityDecl, warningMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.xml.sax.ContentHandler
declaration
-
Field Details
-
currentKey
String currentKeyCurrent XML keyword:. -
elementBuffer
String elementBufferCurrent buffer:. -
fileInfo
FileInfoSurfaceGiftiXML_WM fileInfofileInfo data structure for reading the surface information into:.
-
-
Constructor Details
-
SurfaceGifitXMLHandler
Creates a new SurfaceXMLHandler object.- Parameters:
fInfo- FileInfo for storing the file data into.
-
-
Method Details
-
characters
public void characters(char[] ch, int start, int length) Text data callback from parser. If the parser is not validating, this method can report whitespace. We ignore strings that are entirely whitespace.- Specified by:
charactersin interfaceContentHandler- Overrides:
charactersin classDefaultHandler- Parameters:
ch- Character arraystart- Start of data in array.length- Length of data in array.
-
endDocument
Do nothing.- Specified by:
endDocumentin interfaceContentHandler- Overrides:
endDocumentin classDefaultHandler- Throws:
SAXException- never happens
-
endElement
Called by parser when the end of an element is reached in the document.- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin classDefaultHandler- Parameters:
namespaceURI- the namespace urilocalName- the element nameqName- the qualified name- Throws:
SAXException- if a problem is encountered during parsing
-
getCoordinate
Parse the coordinate point value from the section.- Parameters:
elementBuffer- buffer hold the whole coordinate data- Returns:
- coords coordinate vector that hold the 3D positions.
-
getConnectivity
Parse the connectivity index from the section.- Parameters:
elementBuffer-- Returns:
-
getColorString
Called when writing the surface.xml file: Converts the input Color3f to a String for writing:- Parameters:
kColor- color object- Returns:
- the color in string format
-
skippedEntity
Do nothing but show the entity we skipped.- Specified by:
skippedEntityin interfaceContentHandler- Overrides:
skippedEntityin classDefaultHandler- Parameters:
name- the skipped entity name
-
startElement
public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException Parser calls this for the beginning of each element in the document.- Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin classDefaultHandler- Parameters:
namespaceURI- the namespace urilocalName- the element nameqName- the qualified nameatts- the attached attributes- Throws:
SAXException- if a problem is encountered during parsing
-
getColor
Called when reading the input surface.xml file: Parses the input string into a Color3f variable:- Parameters:
kParseString- input string containing the material color- Returns:
- the material color in Color3f format
-