Package xj3d.filter.filters
Class AppearanceReplacerFilter
java.lang.Object
xj3d.filter.AbstractFilter
xj3d.filter.NewAbstractFilter
xj3d.filter.node.EncodedFilter
xj3d.filter.filters.AppearanceReplacerFilter
- All Implemented Interfaces:
BinaryContentHandler
,ContentHandler
,ProtoHandler
,RouteHandler
,ScriptHandler
,StringContentHandler
Replaces all appearances with the specified one. Nodes without an appearance
will get one.
Params supported:
defFilter only apply the filter to a node with this DEF and its children
appearanceFile The X3D file containing the appearance to use.
The X3D files must be a complete valid X3D file. Only the first
appearance found will be used.
- Version:
- $Revision: 1.4 $
- Author:
- Alan Hudson
-
Field Summary
Fields inherited from class xj3d.filter.node.EncodedFilter
encMap, encodeNodes, encStack, factory
Fields inherited from class xj3d.filter.NewAbstractFilter
fieldHasEndedImplicitly, parentTypeStack, suppressCalls
Fields inherited from class xj3d.filter.AbstractFilter
contentHandler, documentLocator, errorHandler, fieldHandler, fieldReader, fieldStack, lastErrorCode, majorVersion, minorVersion, nodeStack, parsingType, protoHandler, routeHandler, scriptHandler
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
endNode()
Notification of the end of a node declaration.void
setArguments
(String[] args) Set the argument parameters to control the filter operation.void
Notification of the start of a node.void
The field value is a USE for the given node name.Methods inherited from class xj3d.filter.node.EncodedFilter
encode, endDocument, endField, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, setDebug, startDocument
Methods inherited from class xj3d.filter.NewAbstractFilter
componentDecl, endExternProtoDecl, endProtoBody, endProtoDecl, endScriptDecl, exportDecl, externProtoURI, getContentHandler, getErrorReporter, getLastErrorCode, getProtoHandler, getRouteHandler, getScriptHandler, importDecl, metaDecl, profileDecl, protoFieldDecl, protoIsDecl, routeDecl, scriptFieldDecl, setContentHandler, setDocumentLocator, setErrorReporter, setProtoHandler, setRouteHandler, setScriptHandler, startExternProtoDecl, startField, startProtoBody, startProtoDecl, startScriptDecl, suppressCalls
Methods inherited from class xj3d.filter.AbstractFilter
setParsingType
-
Constructor Details
-
AppearanceReplacerFilter
public AppearanceReplacerFilter()Basic constructor.
-
-
Method Details
-
startNode
Notification of the start of a node. This is the opening statement of a node and it's DEF name. USE declarations are handled in a separate method.- Specified by:
startNode
in interfaceContentHandler
- Overrides:
startNode
in classEncodedFilter
- Parameters:
name
- The name of the node that we are about to parsedefName
- The string associated with the DEF name. Null if not given for this node.- Throws:
SAVException
- This call is taken at the wrong time in the structure of the document.VRMLException
- This call is taken at the wrong time in the structure of the document.
-
useDecl
The field value is a USE for the given node name. This is a terminating call for startField as well. The next call will either be anotherstartField()
orendNode()
.- Specified by:
useDecl
in interfaceContentHandler
- Overrides:
useDecl
in classEncodedFilter
- Parameters:
defName
- The name of the DEF string to use- Throws:
SAVException
- This call is taken at the wrong time in the structure of the document.VRMLException
- This call is taken at the wrong time in the structure of the document.
-
endNode
Notification of the end of a node declaration. If boolean addMaterial is set to TRUE, then when a Shape node ends we reset materialAdded, so that future Shapes can also have Material nodes added if necessary.- Specified by:
endNode
in interfaceContentHandler
- Overrides:
endNode
in classEncodedFilter
- Throws:
SAVException
- This call is taken at the wrong time in the structure of the document.VRMLException
- This call is taken at the wrong time in the structure of the document.
-
setArguments
Set the argument parameters to control the filter operation.- Overrides:
setArguments
in classNewAbstractFilter
- Parameters:
args
- The array of argument parameters.
-