gov.nist.microanalysis.NISTMonte
Class TrajectoryImage

java.lang.Object
  extended by java.awt.Image
      extended by java.awt.image.BufferedImage
          extended by gov.nist.microanalysis.NISTMonte.TrajectoryImage
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.image.RenderedImage, java.awt.image.WritableRenderedImage, java.awt.Transparency, java.util.EventListener

public class TrajectoryImage
extends java.awt.image.BufferedImage
implements java.awt.event.ActionListener

Creates a bitmap image showing the generation of detected x-rays as a function of position. The thermal color scale shows white where the most x-rays are generated and black where almost no or no x-rays are generated. The left and bottom edge show accumulated transmitted phi-rho-z and phi-rho-x (projected) curves.

Copyright: Pursuant to title 17 Section 105 of the United States Code this software is not subject to copyright protection and is in the public domain

Company: National Institute of Standards and Technology

Version:
1.0
Author:
Nicholas W. M. Ritchie

Field Summary
 
Fields inherited from class java.awt.image.BufferedImage
TYPE_3BYTE_BGR, TYPE_4BYTE_ABGR, TYPE_4BYTE_ABGR_PRE, TYPE_BYTE_BINARY, TYPE_BYTE_GRAY, TYPE_BYTE_INDEXED, TYPE_CUSTOM, TYPE_INT_ARGB, TYPE_INT_ARGB_PRE, TYPE_INT_BGR, TYPE_INT_RGB, TYPE_USHORT_555_RGB, TYPE_USHORT_565_RGB, TYPE_USHORT_GRAY
 
Fields inherited from class java.awt.Image
accelerationPriority, SCALE_AREA_AVERAGING, SCALE_DEFAULT, SCALE_FAST, SCALE_REPLICATE, SCALE_SMOOTH, UndefinedProperty
 
Fields inherited from interface java.awt.Transparency
BITMASK, OPAQUE, TRANSLUCENT
 
Constructor Summary
TrajectoryImage(int width, int height)
          MCSS_TrajectoryImage - Creates a MCSS_TrajectoryImage instance with the standard grey-scale palette of the specified size (width and height).
TrajectoryImage(int width, int height, double scale)
          MCSS_TrajectoryImage - Creates a MCSS_TrajectoryImage instance with the standard grey-scale palette of the specified size (width and height).
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          actionPerformed - Implements actionPerformed for the ActionListener interface.
 java.awt.Color assignColor(Material mat)
          assignColor - Assigns a color to a Material.
 void dumpToFile(java.lang.String dest)
          dumpToFile - Dump this MCSS_TrajectoryImage to a file in the specified directory.
 void setMaxTrajectories(int max)
          setMaxTrajectories - Sets the maximum number of trajectories to add to this image.
 void setXRange(double min, double max)
          setXRange - Sets the range of x values that will display on the image.
 void setYRange(double min, double max)
          setYRange - Sets the range of y-values that will display on the image.
 
Methods inherited from class java.awt.image.BufferedImage
addTileObserver, coerceData, copyData, createGraphics, flush, getAlphaRaster, getCapabilities, getColorModel, getData, getData, getGraphics, getHeight, getHeight, getMinTileX, getMinTileY, getMinX, getMinY, getNumXTiles, getNumYTiles, getProperty, getProperty, getPropertyNames, getRaster, getRGB, getRGB, getSampleModel, getSource, getSources, getSubimage, getTile, getTileGridXOffset, getTileGridYOffset, getTileHeight, getTileWidth, getTransparency, getType, getWidth, getWidth, getWritableTile, getWritableTileIndices, hasTileWriters, isAlphaPremultiplied, isTileWritable, releaseWritableTile, removeTileObserver, setData, setRGB, setRGB, toString
 
Methods inherited from class java.awt.Image
getAccelerationPriority, getScaledInstance, setAccelerationPriority
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TrajectoryImage

public TrajectoryImage(int width,
                       int height)
MCSS_TrajectoryImage - Creates a MCSS_TrajectoryImage instance with the standard grey-scale palette of the specified size (width and height).

Parameters:
width - int
height - int

TrajectoryImage

public TrajectoryImage(int width,
                       int height,
                       double scale)
MCSS_TrajectoryImage - Creates a MCSS_TrajectoryImage instance with the standard grey-scale palette of the specified size (width and height). The scale determines the size of the volume represented by the image.

Parameters:
width - int
height - int
scale - double - a typical scale might be 4.0e-6 meters
Method Detail

assignColor

public java.awt.Color assignColor(Material mat)
assignColor - Assigns a color to a Material. If you require consistent coloration of materials between instances of MCSS_TrajectoryImage you can preregister all the relevant Material instances using this function. Otherwise colors will be assigned on a first imact basis and are likely to change between simulations.

Parameters:
mat - Material
Returns:
Color

setXRange

public void setXRange(double min,
                      double max)
setXRange - Sets the range of x values that will display on the image. min is left and max is right.

Parameters:
min - double
max - double

setYRange

public void setYRange(double min,
                      double max)
setYRange - Sets the range of y-values that will display on the image. min is top and max is bottom.

Parameters:
min - double
max - double

setMaxTrajectories

public void setMaxTrajectories(int max)
setMaxTrajectories - Sets the maximum number of trajectories to add to this image.

Parameters:
max - int

dumpToFile

public void dumpToFile(java.lang.String dest)
                throws java.io.FileNotFoundException,
                       java.io.IOException
dumpToFile - Dump this MCSS_TrajectoryImage to a file in the specified directory.

Parameters:
dest - String - The destination directory
Throws:
java.io.FileNotFoundException
java.io.IOException

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed - Implements actionPerformed for the ActionListener interface.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - ActionEvent