jfits
Class ShapeListener

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

public abstract class ShapeListener
extends PropertyBundles
implements PropertyChangeListener

A listener that is notified when a ShapeDraw object is added to a FitsCanvas. It prepares the original FitsShape underlying the modified ShapeDraw object to reflect a proper size and position in CCD pixel space. Depending on the nature of the property change, one of the addFitsShape(jfits.FitsShape, java.awt.geom.AffineTransform), selectFitsShape(jfits.FitsShape, java.awt.geom.AffineTransform), or deleteFitsShape(jfits.FitsShape, java.awt.geom.AffineTransform) methods is called, which are all empty methods in the default implementation. Subclasses should override the method(s) they are interested in and, e.g., display an ADU graph.

Note that all formerly mentioned methods are called from within the event queue, so start a new thread, if the method takes too long.


Nested Class Summary
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
 
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
protected ShapeListener(Map<String,String> p)
          Constructor chaining.
 
Method Summary
protected  void addFitsShape(FitsShape f, AffineTransform adu)
          Empty, override if you are interested in receiving add events.
private  void applyFitsShape(JFitsCanvas fcan, String what, FitsShape apert, AffineTransform b)
          Applies the fits canvas to the finally restored fits shape, under the desired transformation.
protected  void deleteFitsShape(FitsShape f, AffineTransform adu)
          Empty, override if you are interested in receiving delete events.
 void propertyChange(PropertyChangeEvent pce)
          The fits canvas calls that method, if a shape cursor adds, selects, or deletes a shapedraw object.
protected  void selectFitsShape(FitsShape f, AffineTransform adu)
          Empty, override if you are interested in receiving select events.
 
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, init, 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
 
Methods inherited from interface util.Initializable
init
 

Constructor Detail

ShapeListener

protected ShapeListener(Map<String,String> p)
Constructor chaining.

Method Detail

propertyChange

public void propertyChange(PropertyChangeEvent pce)
The fits canvas calls that method, if a shape cursor adds, selects, or deletes a shapedraw object. In particular interest are events on fits canvas, where we can grab the underlying ADUs to process them further in either of addFitsShape(jfits.FitsShape, java.awt.geom.AffineTransform), selectFitsShape(jfits.FitsShape, java.awt.geom.AffineTransform), or the deleteFitsShape(jfits.FitsShape, java.awt.geom.AffineTransform) methods.

Specified by:
propertyChange in interface PropertyChangeListener

applyFitsShape

private void applyFitsShape(JFitsCanvas fcan,
                            String what,
                            FitsShape apert,
                            AffineTransform b)
Applies the fits canvas to the finally restored fits shape, under the desired transformation. Null ought to be a valid transform.


addFitsShape

protected void addFitsShape(FitsShape f,
                            AffineTransform adu)
Empty, override if you are interested in receiving add events. The correct HDU has already been registered, continue by querying the ADUs with the provided transform


selectFitsShape

protected void selectFitsShape(FitsShape f,
                               AffineTransform adu)
Empty, override if you are interested in receiving select events. The correct HDU has already been registered, continue by querying the ADUs with the provided transform


deleteFitsShape

protected void deleteFitsShape(FitsShape f,
                               AffineTransform adu)
Empty, override if you are interested in receiving delete events. The correct HDU has already been registered, continue by querying the ADUs with the provided transform