examples.syn3d.plugin.java3d
Class XYZResultNode

java.lang.Object
  extended by syn3d.base.ActiveNode
      extended by examples.syn3d.plugin.java3d.XYZResultNode
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
XYZResultNodeJava3D

public class XYZResultNode
extends ActiveNode

This is an example node to handle files in X-Y-Z-Result format. This is a simple format, which can be loaded by programs like TecPlot. The format is plain text. The first 2 lines are information on the data (see load method). These include the number of points and number of triangles. Then, the values are given line by line : The X, Y, Z coordinates of a point, plus values associated to this point (ex: temperature, voltage...) An empty line then separates the definition of the triangles. The index of the previously defined points (starting from one) are given line by line, to from the 3 summits of the triangle.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class syn3d.base.ActiveNode
children, name, parent
 
Constructor Summary
XYZResultNode(ActiveNode parent)
          This node needs a parent node to attach to
 
Method Summary
 void doAction(java.lang.Object action)
          Do a previously declared action
 java.util.List getActions()
          Let's declare an action to load a file
protected  void load(java.io.File file)
          Called from doAction => Load a file with the correct file format This Method should overriden by subclasses, so as to create 3D objects according to the data in the file.
 void showResult(int num)
          Shows the given result from the data file.
 
Methods inherited from class syn3d.base.ActiveNode
addChild, findDescendantOfType, findDescendantOfType, get3DObject, getChildren, getIcon, getName, getParent, highlight, notifyInternalChange, notifyStructuralChange, propagateAddChildEvent, propagateChangeNameEvent, propagateHighlightEvent, propagateInternalChangeEvent, propagateRemoveChildEvent, propagateStructuralChangeEvent, remove, removeChild, removeNodeTree, removeNodeTreeFrom, restoreReferences, saveChildren, setName, setParent, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XYZResultNode

public XYZResultNode(ActiveNode parent)
This node needs a parent node to attach to

Method Detail

getActions

public java.util.List getActions()
Let's declare an action to load a file

Overrides:
getActions in class ActiveNode
Returns:
an array of possible actions, or a null or empty array if this node doesn't handle any action

doAction

public void doAction(java.lang.Object action)
Do a previously declared action

Overrides:
doAction in class ActiveNode
Parameters:
action - An action previously declared by the getActions method.

load

protected void load(java.io.File file)
             throws java.io.IOException
Called from doAction => Load a file with the correct file format This Method should overriden by subclasses, so as to create 3D objects according to the data in the file.

Throws:
java.io.IOException

showResult

public void showResult(int num)
Shows the given result from the data file. variables are given in the file as X, Y, Z and a variable number of results to display for each point By default, the first variable is displayed. This function changes the variable to display