Class FileSurfaceRefXML_J3D
- java.lang.Object
-
- gov.nih.mipav.model.file.FileBase
-
- gov.nih.mipav.model.file.FileXML
-
- gov.nih.mipav.model.file.FileSurfaceRefXML
-
- gov.nih.mipav.view.renderer.J3D.model.file.FileSurfaceRefXML_J3D
-
public class FileSurfaceRefXML_J3D extends FileSurfaceRefXML
Inherits from FileXML, reads SurfaceRef.XML files based on the "surfaceref.xsd" file. Defines specific variables for reading and writing surfaceref.xml files:
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classFileSurfaceRefXML_J3D.SurfaceRefXMLHandlerUsed by the XML Parser to parse the Surface.XML header.-
Nested classes/interfaces inherited from class gov.nih.mipav.model.file.FileXML
FileXML.XMLAttributes
-
-
Field Summary
-
Fields inherited from class gov.nih.mipav.model.file.FileSurfaceRefXML
m_kMaterialStr, m_kSurfaceStr
-
Fields inherited from class gov.nih.mipav.model.file.FileXML
bw, fileDir, fileInfo, fileName, m_kHandler, MIPAV_HEADER, pInterface, TAB, tabLevel, W3C_XML_SCHEMA, XML_ENCODING, XML_HEADER
-
Fields inherited from class gov.nih.mipav.model.file.FileBase
BIG_ENDIAN, bitsPerPixel, fileNames, LITTLE_ENDIAN, pBarVisible, raFile, READ, READ_WRITE
-
-
Constructor Summary
Constructors Constructor Description FileSurfaceRefXML_J3D(java.lang.String fName, java.lang.String fDir)Constructs new file object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfinalize()Prepares class for cleanup.FileInfoSurfaceRefXML_J3DgetFileInfo()Returns the FileInfoSurfaceRefXML read from the file.FileInfoSurfaceRefXML_J3DreadSurfaceXML(java.lang.String headerFileName, java.lang.String headerDir)Reads and parses a SurfaceRef.XML header.booleanwriteHeader(java.lang.String headerName, java.lang.String headerDir, javax.media.j3d.Material kMaterial, float opacity, int levelDetail)Writes the XML header information, including the ModelTriangleMesh surface out to the given filename and path:booleanwriteXMLsurface(java.lang.String fileName, javax.media.j3d.Material kMaterial, float opacity, int levelDetail)Writes the XML file information, including the ModelTriangleMesh surface out to the given filename and path:-
Methods inherited from class gov.nih.mipav.model.file.FileXML
closedTag, closedTag, closedTag, openTag, readHeader, setPBar
-
Methods inherited from class gov.nih.mipav.model.file.FileBase
addProgressChangeListener, bytesToDouble, bytesToFloat, bytesToInt, bytesToShort, doubleToBytes, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, floatToBytes, getBufferDouble, getBufferFloat, getBufferInt, getBufferLong, getBufferShort, getBufferUShort, getDataType, getDouble, getFloat, getInt, getLong, getProgressChangeListeners, getRaFile, getSignedShort, getString, getUInt, getUnsignedByte, getUnsignedShort, intToBytes, isBigEndian, isProgressBarVisible, linkProgress, longToBytes, readDouble, readFloat, readInt, readLong, readShort, readString, readUnsignedShort, removeProgressChangeListener, setBigEndian, setBufferFloat, setBufferInt, setBufferLong, setBufferShort, setBufferString, setDataType, setEndianess, shortToBytes, writeBytes, writeDouble, writeFloat, writeInt, writeLong, writeShort
-
-
-
-
Method Detail
-
finalize
public void finalize()
Prepares class for cleanup.- Overrides:
finalizein classFileSurfaceRefXML
-
getFileInfo
public FileInfoSurfaceRefXML_J3D getFileInfo()
Returns the FileInfoSurfaceRefXML read from the file.- Returns:
- File info read from file, or null if it has not been read.
-
readSurfaceXML
public FileInfoSurfaceRefXML_J3D readSurfaceXML(java.lang.String headerFileName, java.lang.String headerDir) throws java.io.IOException
Reads and parses a SurfaceRef.XML header.- Parameters:
headerFileName- file name of xml headerheaderDir- directory- Returns:
- FileInfoSurfaceRefXML
- Throws:
java.io.IOException- file exception
-
writeHeader
public boolean writeHeader(java.lang.String headerName, java.lang.String headerDir, javax.media.j3d.Material kMaterial, float opacity, int levelDetail) throws java.io.IOExceptionWrites the XML header information, including the ModelTriangleMesh surface out to the given filename and path:- Parameters:
headerName- file name to write toheaderDir- name of directory to write tokMaterial- surface materialopacity- surface opacitylevelDetail- surface level of detail- Returns:
- if header write was successful
- Throws:
java.io.IOException- if a file I/O problem is encoutered while writing the header
-
writeXMLsurface
public boolean writeXMLsurface(java.lang.String fileName, javax.media.j3d.Material kMaterial, float opacity, int levelDetail) throws java.io.IOExceptionWrites the XML file information, including the ModelTriangleMesh surface out to the given filename and path:- Parameters:
fileName- file name to write tokMaterial- surface materialopacity- surface opacitylevelDetail- surface level of detail- Returns:
- if header write was successful
- Throws:
java.io.IOException- if a file I/O problem is encoutered while writing the header
-
-