|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent ui.recognizer.JSpectra
public class JSpectra
A JSpectra is a kind of JComponent which represents a spectra. The JSpectra contains an instance of Spectra which can be interpreted either as a continuous spectrum or a discrete series of spectral lines depending on the type of Spectra. Can be scaled and rotated. Can contain a movable cursor. Contains zero or more zones which can be highlighted. Cantains zero or more icons indicating interesting features and 'bookmarks' (as tooltips of the icons) Can be constructed by providing a file name for a spectra data text file.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected boolean |
continuous
|
static int |
DEFAULT_HEIGHT
|
static double |
DEFAULT_OFFSET
|
static double |
DEFAULT_SCALE
|
static int |
DEFAULT_WIDTH
|
protected double |
maxWavelength
|
protected double |
minWavelength
|
protected double |
offset
|
protected double |
scale
|
protected boolean |
showAxisLabels
|
protected boolean |
showTics
|
protected Spectra |
spectra
The spectra object containing the spectra data |
protected int |
spectraHeight
|
protected BufferedImage |
spectraImage
The spectra image with a one to one correspondence between spectra sample points and pixels. |
protected int |
spectraWidth
The width of the spectra in pixels (should this be a floating point number ?) |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
JSpectra(Spectra aSpectra)
|
|
JSpectra(Spectra aSpectra,
double aScale,
double anOffset,
boolean aShowTics,
boolean aShowAxisLabels,
double aMinWavelength,
double aMaxWavelength,
boolean aContinuous)
|
Method Summary | |
---|---|
BufferedImage |
createContinuousSpectraImage(Spectra aSpectra)
Create a continous spectra in which there is a one to one correspondence between spectra sample points and pixels. |
BufferedImage |
createDiscreteSpectraImage(Spectra aSpectra)
Create a discrete spectra which consists of a sum of overlapping gaussians representing the spectral lines. |
BufferedImage |
createSpectraImage(Spectra aSpectra)
Create a buffered image containing the spectra. |
double |
getMaxWavelength()
|
double |
getMinWavelength()
Get the minimum wavelength of this JSpectra label. |
double |
getOffset()
Get the intensity offset constant to add to the spectra intensity |
int |
getPoints()
Get points in the spectra |
double |
getScale()
Get the intensity scale factor to multiply the spectra intensity |
Spectra |
getSpectra()
Get the spectra object from this JSpectra. |
int |
getSpectraHeight()
|
BufferedImage |
getSpectraImage()
Get the spectra image representing a one to one correspondence between spectra sample points and pixels. |
int |
getSpectraWidth()
Get the width of the JSpectra label in pixels (image of spectra may be smaller) This should be the same as preferred size. |
boolean |
isContinuous()
Is the Spectra continuous or does it represent a discrete set of lines ? |
boolean |
isShowAxisLabels()
Are the axis labels plotted ? |
boolean |
isShowTics()
Are the tics shown ? |
int |
mapWavelengthToPixel(double aWavelength)
Convert or map a wavelength to the corresponding position in the JLabel. |
void |
paintComponent(Graphics g)
|
void |
setContinuous(boolean aContinuous)
|
void |
setMaxWavelength(double aWavelength)
|
void |
setMinWavelength(double aWavelength)
|
void |
setOffset(double anOffset)
|
void |
setScale(double aScale)
|
void |
setShowAxisLabels(boolean aShowAxisLabels)
|
void |
setShowTics(boolean aShowTics)
|
void |
setSpectra(Spectra aSpectra)
|
void |
setSpectraHeight(int aHeight)
|
void |
setSpectraImage(BufferedImage anImage)
Set the spectra image representing a one to one correspondence between spectra sample points and pixels. |
void |
setSpectraWidth(int aWidth)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_WIDTH
public static final int DEFAULT_HEIGHT
public static final double DEFAULT_SCALE
public static final double DEFAULT_OFFSET
protected Spectra spectra
protected int spectraWidth
protected int spectraHeight
protected double minWavelength
protected double maxWavelength
protected BufferedImage spectraImage
protected double scale
protected double offset
protected boolean showTics
protected boolean showAxisLabels
protected boolean continuous
Constructor Detail |
---|
public JSpectra(Spectra aSpectra)
public JSpectra(Spectra aSpectra, double aScale, double anOffset, boolean aShowTics, boolean aShowAxisLabels, double aMinWavelength, double aMaxWavelength, boolean aContinuous)
Method Detail |
---|
public BufferedImage createSpectraImage(Spectra aSpectra)
aSpectra
- the spectra datapublic BufferedImage createContinuousSpectraImage(Spectra aSpectra)
public BufferedImage createDiscreteSpectraImage(Spectra aSpectra)
public void paintComponent(Graphics g)
paintComponent
in class JComponent
public Spectra getSpectra()
public void setSpectra(Spectra aSpectra)
public boolean isContinuous()
public void setContinuous(boolean aContinuous)
public boolean isShowTics()
public void setShowTics(boolean aShowTics)
public boolean isShowAxisLabels()
public void setShowAxisLabels(boolean aShowAxisLabels)
public BufferedImage getSpectraImage()
public void setSpectraImage(BufferedImage anImage)
anImage
- a buffered image representing the spectrapublic double getScale()
public void setScale(double aScale)
public double getOffset()
public void setOffset(double anOffset)
public int getPoints()
public int getSpectraWidth()
public void setSpectraWidth(int aWidth)
public int getSpectraHeight()
public void setSpectraHeight(int aHeight)
public double getMinWavelength()
public void setMinWavelength(double aWavelength)
public double getMaxWavelength()
public void setMaxWavelength(double aWavelength)
public int mapWavelengthToPixel(double aWavelength)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |