001    package edu.nrao.sss.model.source;
002    
003    import javax.xml.bind.annotation.XmlElement;
004    import javax.xml.bind.annotation.XmlRootElement;
005    
006    /**
007     * A source brightness of type {@link BrightnessDistribution#DISK}.
008     * This is a specialization of a diffuse brightness
009     * with the addition of a limb darkening property. 
010     * <p>
011     * <b>CVS Info:</b>
012     * <table style="margin-left:2em">
013     *   <tr><td>$Revision: 161 $</td></tr>
014     *   <tr><td>$Date: 2006-12-15 11:48:34 -0700 (Fri, 15 Dec 2006) $</td></tr>
015     *   <tr><td>$Author: btruitt $</td></tr>
016     * </table></p>
017     *  
018     * @author David M. Harland
019     * @since 2006-05-16
020     */
021    @XmlRootElement
022    public class DiskBrightness
023      extends AreaBrightness
024    {
025      /**
026       * Creates a new source brightness of type
027       * {@link BrightnessDistribution#DISK}.
028       */
029      DiskBrightness()
030      {
031        super();
032        distributionType = BrightnessDistribution.DISK;
033      }
034      
035      /**
036       * Sets the limb darkening of this source brightness.
037       * @param darkening a number that is a measure of shape.
038       * @throws IllegalArgumentException if {@code darkening} is not a number.
039       */
040      @XmlElement
041      public void setLimbDarkening(double darkening)
042      {
043        if (Double.isNaN(darkening))
044          throw new IllegalArgumentException(
045            "Darkening must be a non-negative number. Attempt to set to " +
046            darkening);
047        
048        this.limbDarkening = darkening;
049      }
050    
051      //This method is here only for JAXB purposes.  If it were not here, JAXB
052      //would complain that it found setLimbDarkening, but not getLimbDarkening,
053      //even though getBrightnessFile is present an ancestral class.
054      public double getLimbDarkening()
055      {
056        return super.getLimbDarkening();
057      }
058    }