optics
Class PrintMonitor

java.lang.Object
  extended by optics.Optics
      extended by optics.PrintMonitor
All Implemented Interfaces:
RayMonitor

public class PrintMonitor
extends Optics
implements RayMonitor

Simple RayMonitor implementtaion to print out Ray information to a PrintStream which may be connected to a file, or a TextPanel or Frame.

The default information written is controlled but the toString() method of the Rays.


Field Summary
 
Fields inherited from class optics.Optics
DEFAULT_WAVELENGTH, errorStream, fmt, MICRONS
 
Constructor Summary
PrintMonitor()
          Default PrintMonitor to print to System.out.
PrintMonitor(java.io.File file)
          Form a PrintMonitor to output to a specified File.
PrintMonitor(java.io.PrintStream out)
          Form a PrintMonitor to output to s specified PrintStream.
PrintMonitor(java.lang.String fileName)
          Form a PrintMonitor to output to a file specified by name.
PrintMonitor(TextFrame frame)
          Form a PrintMonitor that prints to a TextFrame containing a TextPanel.
PrintMonitor(TextPanel panel)
          Form a PrintMonitor with output to a TextPanel
 
Method Summary
 void update(Ray r)
          Method specified in interface to update a Ray by printing the default toString() method to the specified output PrintStream.
 
Methods inherited from class optics.Optics
getDefaultWaveLength, getErrorStream, getFormatString, getName, getStaticName, getVersion, printError, setDefaultWaveLength, setErrorStream, setFormatString, setMicrons
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrintMonitor

public PrintMonitor()
Default PrintMonitor to print to System.out.


PrintMonitor

public PrintMonitor(java.io.PrintStream out)
Form a PrintMonitor to output to s specified PrintStream.

Parameters:
out - the output PrintStream

PrintMonitor

public PrintMonitor(java.io.File file)
Form a PrintMonitor to output to a specified File. If the File open fails it will default to System.out

Parameters:
file - the output File

PrintMonitor

public PrintMonitor(java.lang.String fileName)
Form a PrintMonitor to output to a file specified by name.

Parameters:
fileName - the output file name.

PrintMonitor

public PrintMonitor(TextPanel panel)
Form a PrintMonitor with output to a TextPanel

Parameters:
panel - the TextPanel

PrintMonitor

public PrintMonitor(TextFrame frame)
Form a PrintMonitor that prints to a TextFrame containing a TextPanel.

Parameters:
frame - the TextFrame
Method Detail

update

public void update(Ray r)
Method specified in interface to update a Ray by printing the default toString() method to the specified output PrintStream.

Specified by:
update in interface RayMonitor
Parameters:
r - the Ray