edu.wisc.ssec.mcidasv.probes
Class ProbeEvent<T>

java.lang.Object
  extended by java.util.EventObject
      extended by edu.wisc.ssec.mcidasv.probes.ProbeEvent<T>
All Implemented Interfaces:
Serializable

public class ProbeEvent<T>
extends EventObject

This class captures a change to a probe and stores both the previous and current (as of the event's creation) changed values.

See Also:
Serialized Form

Field Summary
private  T newValue
          Current value of the probe.
private  T oldValue
          Previous value of the probe.
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
ProbeEvent(ReadoutProbe source, T oldValue, T newValue)
          Generated when a ReadoutProbe changes either its position, color, or visibility.
 
Method Summary
 T getNewValue()
          Returns the current (as of this event) value of the probe.
 T getOldValue()
          Returns the value of the probe before this event was generated.
 ReadoutProbe getProbe()
           
 String toString()
          Returns a brief summary of this event.
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

oldValue

private final T oldValue
Previous value of the probe.


newValue

private final T newValue
Current value of the probe.

Constructor Detail

ProbeEvent

public ProbeEvent(ReadoutProbe source,
                  T oldValue,
                  T newValue)
Generated when a ReadoutProbe changes either its position, color, or visibility. Currently stores either position, color, or visibility both before and after the change.

Parameters:
source - Probe that generated this event.
oldValue - Old value of the probe.
newValue - New value of the probe.
Throws:
NullPointerException - if any parameters are null.
Method Detail

getProbe

public ReadoutProbe getProbe()

getOldValue

public T getOldValue()
Returns the value of the probe before this event was generated.

Returns:
Previous probe value.

getNewValue

public T getNewValue()
Returns the current (as of this event) value of the probe.

Returns:
Current probe value.

toString

public String toString()
Returns a brief summary of this event. Please note that this format is subject to change.

Overrides:
toString in class EventObject
Returns:
String that looks like [ProbeEvent@HASHCODE: source=..., oldValue=..., newValue=...].