edu.wisc.ssec.mcidasv.control
Class MultiSpectralControl.Spectrum

java.lang.Object
  extended by edu.wisc.ssec.mcidasv.control.MultiSpectralControl.Spectrum
All Implemented Interfaces:
ProbeListener, EventListener
Enclosing class:
MultiSpectralControl

private static class MultiSpectralControl.Spectrum
extends Object
implements ProbeListener


Field Summary
private  MultiSpectralControl control
           
private  MultiSpectralDisplay display
          Display that is displaying the spectrum associated with probe's location.
private  boolean isVisible
          Whether or not probe is visible.
private  String myId
          Human-friendly ID for this spectrum and probe.
private  ReadoutProbe probe
          Probe that appears in the "image display" associated with the current display control.
private  DataReference spectrumRef
          VisAD's reference to this spectrum.
 
Constructor Summary
MultiSpectralControl.Spectrum(MultiSpectralControl control, Color color, String myId)
          Initializes a new Spectrum that is "bound" to control and whose color is color.
 
Method Summary
 Color getColor()
           
 String getId()
           
 double getLatitude()
           
 double getLongitude()
           
protected  ReadoutProbe getProbe()
           
 Hashtable<String,Object> getProperties()
           
 DataReference getSpectrumRef()
           
 String getSpectrumRefName()
           
 String getValue()
           
 boolean isVisible()
           
 void pokeValueDisplay()
           
 void probeColorChanged(ProbeEvent<Color> e)
          Invoked when a probe's color has changed.
 void probePositionChanged(ProbeEvent<RealTuple> e)
          Invoked when a probe's position is changed.
 void probeVisibilityChanged(ProbeEvent<Boolean> e)
          Invoked when a probe's visibility has changed.
 void removeValueDisplay()
           
 void setColor(Color color)
           
 void setProperties(Hashtable<String,Object> table)
           
 void setVisible(boolean visible)
          Shows and hides this spectrum/probe.
 void updatePosition(RealTuple position)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

control

private final MultiSpectralControl control

display

private final MultiSpectralDisplay display
Display that is displaying the spectrum associated with probe's location.


spectrumRef

private final DataReference spectrumRef
VisAD's reference to this spectrum.


probe

private ReadoutProbe probe
Probe that appears in the "image display" associated with the current display control.


isVisible

private boolean isVisible
Whether or not probe is visible.


myId

private final String myId
Human-friendly ID for this spectrum and probe. Used in MultiSpectralControl.probeTable.

Constructor Detail

MultiSpectralControl.Spectrum

public MultiSpectralControl.Spectrum(MultiSpectralControl control,
                                     Color color,
                                     String myId)
                              throws VisADException,
                                     RemoteException
Initializes a new Spectrum that is "bound" to control and whose color is color.

Parameters:
control - Display control that contains this spectrum and the associated ReadoutProbe. Cannot be null.
color - Color of probe. Cannot be null.
myId - Human-friendly ID used a reference for this spectrum/probe. Cannot be null.
Throws:
NullPointerException - if control, color, or myId is null.
VisADException - if VisAD-land had some problems.
RemoteException - if VisAD's RMI stuff had problems.
Method Detail

probePositionChanged

public void probePositionChanged(ProbeEvent<RealTuple> e)
Description copied from interface: ProbeListener
Invoked when a probe's position is changed.

Specified by:
probePositionChanged in interface ProbeListener
Parameters:
e - Describes the probe that moved, its old position, and its new position.

updatePosition

public void updatePosition(RealTuple position)

getValue

public String getValue()

getLatitude

public double getLatitude()

getLongitude

public double getLongitude()

getColor

public Color getColor()

getId

public String getId()

getSpectrumRef

public DataReference getSpectrumRef()

getSpectrumRefName

public String getSpectrumRefName()

setColor

public void setColor(Color color)

setVisible

public void setVisible(boolean visible)
Shows and hides this spectrum/probe. Note that an "hidden" spectrum merely uses an alpha value of zero for the spectrum's color--nothing is actually removed!

Also note that if our MultiSpectralControl has its visibility toggled "off", the probe itself will not be shown. It will otherwise behave as if it is visible!

Parameters:
visible - true for "visible", false otherwise.

isVisible

public boolean isVisible()

getProbe

protected ReadoutProbe getProbe()

probeColorChanged

public void probeColorChanged(ProbeEvent<Color> e)
Description copied from interface: ProbeListener
Invoked when a probe's color has changed.

Specified by:
probeColorChanged in interface ProbeListener
Parameters:
e - Describes the probe that changed, its old color, and its new color.

probeVisibilityChanged

public void probeVisibilityChanged(ProbeEvent<Boolean> e)
Description copied from interface: ProbeListener
Invoked when a probe's visibility has changed.

Specified by:
probeVisibilityChanged in interface ProbeListener
Parameters:
e - Describes the probe that changed, its old visibility, and the new visibility. The previous and current values will always be the opposites of each other.

getProperties

public Hashtable<String,Object> getProperties()

setProperties

public void setProperties(Hashtable<String,Object> table)

pokeValueDisplay

public void pokeValueDisplay()

removeValueDisplay

public void removeValueDisplay()
                        throws VisADException,
                               RemoteException
Throws:
VisADException
RemoteException