jfits
Class ShapeStatistic

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by jfits.ShapeListener
                  extended by jfits.ShapeStatistic
All Implemented Interfaces:
PropertyChangeListener, Cloneable, EventListener, Displayable, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying

public class ShapeStatistic
extends ShapeListener
implements Displayable

This shape listener presents a button that displays the average plus standard deviation of the last adu delivered to it. It is inactive as long as select or delete events have been issued lately. Only on add events, the button gets active. If pressed, a dialog pops up giving more statistical information.


Nested Class Summary
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
private  Statistic adu
          The last ADU statistics delivered to this listener.
private  JButton av
          The button with the av+/-std label.
private static DecimalFormat DEFFORMAT
          Default formatter for text on button.
static String KEY_AVERAGEFORMAT
          The format string for the average of the first index.
 
Fields inherited from class util.PropertyBundles
KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_RESOURCEBUNDLES
 
Fields inherited from class util.PropertyResources
KEY_NOINITONCREATE, localurl, locate, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_URL, urlset
 
Fields inherited from class util.PropertyContainer
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR
 
Fields inherited from interface util.ResourceSupplying
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME
 
Fields inherited from interface util.PropertySupplying
CONFIG, KEY_CLASS
 
Constructor Summary
ShapeStatistic(Map<String,String> prop)
          Constructs a new shape statistic.
 
Method Summary
protected  void addFitsShape(FitsShape f, AffineTransform a)
          We update our statistic with the ADU-statistic delivered along with the fits shape and enable the details button.
protected  void deleteFitsShape(FitsShape f, AffineTransform adu)
          Disables the detail button until a new selection has been added.
 Icon getIcon()
          No icon.
 Component getRepresentation()
          Our representation is a button, which displays the average and the sigma of the first index given in indices on its label.
 void init()
          Initializes the button of this listener, which is then readily delivered with #getComponent.
protected  void selectFitsShape(FitsShape f, AffineTransform adu)
          Disables the detail button until a new selection has been added.
private  void updateText(double aver)
          Updates the text displayed on the button.
 
Methods inherited from class jfits.ShapeListener
propertyChange
 
Methods inherited from class util.PropertyBundles
clone, getLocalized, getLocalized, getLocalizedString, getLocalizedString, loadResource
 
Methods inherited from class util.PropertyResources
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, keyCreate, keyCreate, reload, setApplet
 
Methods inherited from class util.PropertyContainer
augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, reload, removeProperty, rescanned, setObject, setProperties, setProperty, stringProperties, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface util.ResourceSupplying
getResource, getResourceAsStream, getResources
 
Methods inherited from interface util.PropertySupplying
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringProperties
 

Field Detail

KEY_AVERAGEFORMAT

public static final String KEY_AVERAGEFORMAT
The format string for the average of the first index.

See Also:
Constant Field Values

DEFFORMAT

private static final DecimalFormat DEFFORMAT
Default formatter for text on button.


av

private JButton av
The button with the av+/-std label.


adu

private Statistic adu
The last ADU statistics delivered to this listener.

Constructor Detail

ShapeStatistic

public ShapeStatistic(Map<String,String> prop)
Constructs a new shape statistic.

Method Detail

init

public void init()
Initializes the button of this listener, which is then readily delivered with #getComponent.

Specified by:
init in interface Initializable
Overrides:
init in class PropertyResources

getRepresentation

public Component getRepresentation()
Our representation is a button, which displays the average and the sigma of the first index given in indices on its label.

Specified by:
getRepresentation in interface Displayable

getIcon

public Icon getIcon()
No icon.

Specified by:
getIcon in interface Displayable

addFitsShape

protected void addFitsShape(FitsShape f,
                            AffineTransform a)
We update our statistic with the ADU-statistic delivered along with the fits shape and enable the details button.

Overrides:
addFitsShape in class ShapeListener

selectFitsShape

protected void selectFitsShape(FitsShape f,
                               AffineTransform adu)
Disables the detail button until a new selection has been added.

Overrides:
selectFitsShape in class ShapeListener

deleteFitsShape

protected void deleteFitsShape(FitsShape f,
                               AffineTransform adu)
Disables the detail button until a new selection has been added.

Overrides:
deleteFitsShape in class ShapeListener

updateText

private void updateText(double aver)
Updates the text displayed on the button.