edu.wisc.ssec.mcidasv.display.hydra
Class MultiSpectralDisplay

java.lang.Object
  extended by edu.wisc.ssec.mcidasv.display.hydra.MultiSpectralDisplay
All Implemented Interfaces:
EventListener, DisplayListener

public class MultiSpectralDisplay
extends Object
implements DisplayListener


Nested Class Summary
static class MultiSpectralDisplay.DragLine
           
private static class MultiSpectralDisplay.RubberBandBox
           
 
Field Summary
private  JComboBox bandSelectComboBox
           
private  String channelSelector
          ID of the selector that controls the displayed channel.
private static int cnt
           
private  HashMap<DataReference,ConstantMap[]> colorMaps
           
private  MultiSpectralData data
           
private  DirectDataChoice dataChoice
           
private static String DISP_NAME
           
private  LocalDisplay display
           
private  HydraControl displayControl
           
private  List<DataReference> displayedThings
           
private  Gridded1DSet domainSet
           
private  RealType domainType
           
private  HashMap<String,DataReference> idToRef
           
private  FlatField image
           
private  DisplayableData imageDisplay
           
private  boolean imageExpired
           
private  float[] initialRangeX
           
private  float[] initialRangeY
           
private static org.slf4j.Logger logger
           
private  XYDisplay master
           
private  RealType rangeType
           
private  Map<String,MultiSpectralDisplay.DragLine> selectors
          The map of selector IDs to selectors.
private  FlatField spectrum
           
private  RealType uniqueRangeType
           
private  ViewManager viewManager
           
private  float waveNumber
           
private  ScalarMap xmap
           
private  ScalarMap ymap
           
 
Constructor Summary
MultiSpectralDisplay(DirectDataChoice dataChoice)
           
MultiSpectralDisplay(HydraControl control)
           
 
Method Summary
 void addRef(DataReference thing, Color color)
           
private  FlatField changeRangeType(FlatField image, RealType newRangeType)
           
 MultiSpectralDisplay.DragLine createSelector(String id, Color color)
           
 MultiSpectralDisplay.DragLine createSelector(String id, ConstantMap[] color)
           
 void displayChanged(DisplayEvent e)
           
 boolean displayingChannel()
           
 JComboBox getBandSelectComboBox()
           
 int getChannelIndex()
           
 LocalDisplay getDisplay()
           
 Component getDisplayComponent()
           
 Gridded1DSet getDomainSet()
           
 RealType getDomainType()
           
private static RealType getDomainType(FlatField spectrum)
           
 FlatField getImageData()
           
 FlatField getImageDataFrom(float channel)
           
 DisplayableData getImageDisplay()
           
 MultiSpectralData getMultiSpectralData()
           
 RealType getRangeType()
           
static RealType getRangeType(FlatField spectrum)
           
 MultiSpectralDisplay.DragLine getSelector(String id)
           
 List<MultiSpectralDisplay.DragLine> getSelectors()
           
 float getSelectorValue(String id)
           
 ViewManager getViewManager()
           
 float getWaveNumber()
           
private static float[] getXRange(Gridded1DSet domain)
           
 boolean hasNullData()
           
 void hideChannelSelector()
           
private  void init()
           
static ConstantMap[] makeColorMap(Color color)
           
 void refreshDisplay()
           
 void removeRef(DataReference thing)
           
 MultiSpectralDisplay.DragLine removeSelector(String id)
           
 void reorderDataRefsById(List<String> dataRefIds)
           
 void setDisplayControl(HydraControl control)
           
private static void setDisplayMasterAttributes(XYDisplay master)
          Provides master some sensible default attributes.
 void setSelectorValue(String id, float value)
           
 boolean setWaveNumber(float val)
           
 void showChannelSelector()
           
 void updateControlSelector(String id, float value)
           
 void updateRef(DataReference thing, Color color)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static final org.slf4j.Logger logger

DISP_NAME

private static final String DISP_NAME
See Also:
Constant Field Values

cnt

private static int cnt

dataChoice

private DirectDataChoice dataChoice

viewManager

private ViewManager viewManager

initialRangeX

private float[] initialRangeX

initialRangeY

private float[] initialRangeY

domainType

private RealType domainType

rangeType

private RealType rangeType

uniqueRangeType

private RealType uniqueRangeType

xmap

private ScalarMap xmap

ymap

private ScalarMap ymap

display

private LocalDisplay display

image

private FlatField image

spectrum

private FlatField spectrum

imageExpired

private boolean imageExpired

data

private MultiSpectralData data

waveNumber

private float waveNumber

displayedThings

private List<DataReference> displayedThings

idToRef

private HashMap<String,DataReference> idToRef

colorMaps

private HashMap<DataReference,ConstantMap[]> colorMaps

displayControl

private HydraControl displayControl

imageDisplay

private DisplayableData imageDisplay

master

private XYDisplay master

domainSet

private Gridded1DSet domainSet

bandSelectComboBox

private JComboBox bandSelectComboBox

channelSelector

private final String channelSelector
ID of the selector that controls the displayed channel.


selectors

private final Map<String,MultiSpectralDisplay.DragLine> selectors
The map of selector IDs to selectors.

Constructor Detail

MultiSpectralDisplay

public MultiSpectralDisplay(HydraControl control)
                     throws VisADException,
                            RemoteException
Throws:
VisADException
RemoteException

MultiSpectralDisplay

public MultiSpectralDisplay(DirectDataChoice dataChoice)
                     throws VisADException,
                            RemoteException
Throws:
VisADException
RemoteException
Method Detail

getImageData

public FlatField getImageData()

getImageDataFrom

public FlatField getImageDataFrom(float channel)

changeRangeType

private FlatField changeRangeType(FlatField image,
                                  RealType newRangeType)
                           throws VisADException,
                                  RemoteException
Throws:
VisADException
RemoteException

getDisplay

public LocalDisplay getDisplay()

getDisplayComponent

public Component getDisplayComponent()

getDomainType

public RealType getDomainType()

getRangeType

public RealType getRangeType()

getViewManager

public ViewManager getViewManager()

getMultiSpectralData

public MultiSpectralData getMultiSpectralData()

getDomainSet

public Gridded1DSet getDomainSet()

init

private void init()
           throws VisADException,
                  RemoteException
Throws:
VisADException
RemoteException

getBandSelectComboBox

public JComboBox getBandSelectComboBox()

setDisplayControl

public void setDisplayControl(HydraControl control)

displayChanged

public void displayChanged(DisplayEvent e)
                    throws VisADException,
                           RemoteException
Specified by:
displayChanged in interface DisplayListener
Throws:
VisADException
RemoteException

getImageDisplay

public DisplayableData getImageDisplay()

getWaveNumber

public float getWaveNumber()

getChannelIndex

public int getChannelIndex()
                    throws Exception
Throws:
Exception

refreshDisplay

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

hasNullData

public boolean hasNullData()

showChannelSelector

public void showChannelSelector()

hideChannelSelector

public void hideChannelSelector()

createSelector

public MultiSpectralDisplay.DragLine createSelector(String id,
                                                    Color color)
                                             throws Exception
Throws:
Exception

createSelector

public MultiSpectralDisplay.DragLine createSelector(String id,
                                                    ConstantMap[] color)
                                             throws Exception
Throws:
Exception

getSelector

public MultiSpectralDisplay.DragLine getSelector(String id)

getSelectorValue

public float getSelectorValue(String id)

setSelectorValue

public void setSelectorValue(String id,
                             float value)
                      throws VisADException,
                             RemoteException
Throws:
VisADException
RemoteException

updateControlSelector

public void updateControlSelector(String id,
                                  float value)

removeSelector

public MultiSpectralDisplay.DragLine removeSelector(String id)

getSelectors

public List<MultiSpectralDisplay.DragLine> getSelectors()

displayingChannel

public boolean displayingChannel()
Returns:
Whether or not the channel selector is being displayed.

removeRef

public void removeRef(DataReference thing)
               throws VisADException,
                      RemoteException
Throws:
VisADException
RemoteException

addRef

public void addRef(DataReference thing,
                   Color color)
            throws VisADException,
                   RemoteException
Throws:
VisADException
RemoteException

updateRef

public void updateRef(DataReference thing,
                      Color color)
               throws VisADException,
                      RemoteException
Throws:
VisADException
RemoteException

reorderDataRefsById

public void reorderDataRefsById(List<String> dataRefIds)

setWaveNumber

public boolean setWaveNumber(float val)

makeColorMap

public static ConstantMap[] makeColorMap(Color color)
                                  throws VisADException,
                                         RemoteException
Returns:
The ConstantMap representation of color.
Throws:
VisADException
RemoteException

setDisplayMasterAttributes

private static void setDisplayMasterAttributes(XYDisplay master)
                                        throws VisADException,
                                               RemoteException
Provides master some sensible default attributes.

Throws:
VisADException
RemoteException

getXRange

private static float[] getXRange(Gridded1DSet domain)
Returns:
The minimum and maximum values found on the x-axis.

getRangeType

public static RealType getRangeType(FlatField spectrum)

getDomainType

private static RealType getDomainType(FlatField spectrum)