public class ReadoutProbe extends SharableImpl implements PropertyChangeListener
Modifier and Type | Field and Description |
---|---|
private Color |
currentColor |
private double |
currentLatitude |
private double |
currentLongitude |
private String |
currentValue |
private static Color |
DEFAULT_COLOR |
private FlatField |
field |
private CopyOnWriteArrayList<ProbeListener> |
listeners |
private DisplayMaster |
master |
private static DecimalFormat |
numFmt |
private float |
pointSize |
private RealTuple |
prevPos |
private LineProbe |
probe |
static String |
SHARE_POSITION |
static String |
SHARE_PROFILE |
private static TupleType |
TUPTYPE |
private TextDisplayable |
valueDisplay
Displays the value of the data at the current position.
|
Constructor and Description |
---|
ReadoutProbe(DisplayMaster master,
FlatField field,
Color color,
boolean visible) |
Modifier and Type | Method and Description |
---|---|
void |
addProbeListener(ProbeListener listener)
Adds a
ProbeListener to the listener list so that it can be
notified when the probe is changed. |
private static TextDisplayable |
createValueDisplay(Color color) |
protected void |
fireProbeColorChanged(Color previous,
Color current)
Notifies the registered
ProbeListener s that this probe's color
has changed. |
protected void |
fireProbePositionChanged(RealTuple previous,
RealTuple current)
Notifies the registered
ProbeListener s that this probe's
position has changed. |
protected void |
fireProbeVisibilityChanged(boolean previous)
Notifies registered
ProbeListener s that this probe's visibility
has changed. |
Color |
getColor() |
float |
getDisplayScale()
Get the scaling factor for probes and such.
|
EarthLocationTuple |
getEarthPosition() |
private static RealTuple |
getInitialLinePosition() |
double |
getLatitude() |
double |
getLongitude() |
String |
getValue() |
RealTuple |
getXYPosition() |
void |
handleProbeRemoval() |
void |
handleProbeUpdate() |
boolean |
hasListener(ProbeListener listener) |
private static TupleType |
makeTupleType() |
void |
propertyChange(PropertyChangeEvent e)
Called whenever the probe fires off a
PropertyChangeEvent . |
void |
quietlySetColor(Color newColor) |
void |
quietlySetVisible(boolean visibility) |
void |
removeProbeListener(ProbeListener listener)
Removes a
ProbeListener from the notification list. |
void |
setColor(Color color) |
private void |
setColor(Color color,
boolean quietly) |
void |
setField(FlatField field) |
void |
setLatLon(Double latitude,
Double longitude) |
void |
setXYPosition(RealTuple position) |
String |
toString()
Returns a brief summary of a ReadoutProbe.
|
private Tuple |
valueAtPosition(RealTuple position,
FlatField imageData) |
applySharableProperties, doShare, doShare, doShareExternal, doShareInternal, getReceiveShareTime, getSharablePropertiesComponent, getShareGroup, getSharing, getUniqueId, initSharable, receiveShareData, removeSharable, setReceiveShareTime, setShareGroup, setSharing, setUniqueId, showSharableDialog
public static final String SHARE_PROFILE
public static final String SHARE_POSITION
private static final Color DEFAULT_COLOR
private final CopyOnWriteArrayList<ProbeListener> listeners
private final TextDisplayable valueDisplay
private final DisplayMaster master
private Color currentColor
private String currentValue
private double currentLatitude
private double currentLongitude
private float pointSize
private static final DecimalFormat numFmt
public ReadoutProbe(DisplayMaster master, FlatField field, Color color, boolean visible) throws VisADException, RemoteException
VisADException
RemoteException
public void propertyChange(PropertyChangeEvent e)
PropertyChangeEvent
. Only
handles position changes right now, all other events are discarded.propertyChange
in interface PropertyChangeListener
e
- Object that describes the property change.NullPointerException
- if passed a null
PropertyChangeEvent
.public void addProbeListener(ProbeListener listener)
ProbeListener
to the listener list so that it can be
notified when the probe is changed.listener
- ProbeListener
to register. null
listeners are not allowed.NullPointerException
- if listener
is null.public void removeProbeListener(ProbeListener listener)
ProbeListener
from the notification list.listener
- ProbeListener
to remove. null
values
are permitted, but since they are not allowed to be added...public boolean hasListener(ProbeListener listener)
protected void fireProbePositionChanged(RealTuple previous, RealTuple current)
ProbeListener
s that this probe's
position has changed.previous
- Previous position.current
- Current position.protected void fireProbeColorChanged(Color previous, Color current)
ProbeListener
s that this probe's color
has changed.previous
- Previous color.current
- Current color.protected void fireProbeVisibilityChanged(boolean previous)
ProbeListener
s that this probe's visibility
has changed. Only takes a "previous" value, which is negated
to form the "current" value.previous
- Visibility before change.public double getLatitude()
public double getLongitude()
public void quietlySetVisible(boolean visibility)
public void quietlySetColor(Color newColor)
public void handleProbeUpdate()
public void handleProbeRemoval()
public float getDisplayScale()
public void setXYPosition(RealTuple position)
public RealTuple getXYPosition()
public EarthLocationTuple getEarthPosition()
private Tuple valueAtPosition(RealTuple position, FlatField imageData)
private static RealTuple getInitialLinePosition()
private static TextDisplayable createValueDisplay(Color color)
private static TupleType makeTupleType()