/* Attributes for the GiottoDirector decorator. Copyright (c) 2000-2013 The Regents of the University of California. All rights reserved. Permission is hereby granted, without written agreement and without license or royalty fees, to use, copy, modify, and distribute this software and its documentation for any purpose, provided that the above copyright notice and the following two paragraphs appear in all copies of this software. IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. PT_COPYRIGHT_VERSION_2 COPYRIGHTENDKEY // NOTE: Downgraded to red due to extensive changes. EAL */ package ptolemy.domains.giotto.kernel; import ptolemy.data.expr.Parameter; import ptolemy.data.type.BaseType; import ptolemy.kernel.util.DecoratorAttributes; import ptolemy.kernel.util.IllegalActionException; import ptolemy.kernel.util.InternalErrorException; import ptolemy.kernel.util.KernelException; import ptolemy.kernel.util.NameDuplicationException; import ptolemy.kernel.util.NamedObj; /** Container for decorator attributes that are provided to actors by the GiottoDirector. @author Edward A. Lee @version $Id: GiottoAttributes.java 67774 2013-10-26 01:18:05Z cxh $ @since Ptolemy II 10.0 @Pt.ProposedRating Yellow (eal) @Pt.AcceptedRating Red (eal) @see GiottoScheduler @see GiottoReceiver */ public class GiottoAttributes extends DecoratorAttributes { /** Constructor to use when editing a model. * @param target The object being decorated. * @param director The director. * @exception IllegalActionException If the superclass throws it. * @exception NameDuplicationException If the superclass throws it. */ public GiottoAttributes(NamedObj target, GiottoDirector director) throws IllegalActionException, NameDuplicationException { super(target, director); _init(); } /** Constructor to use when parsing a MoML file. * @param target The object being decorated. * @param name The name of this attribute. * @exception IllegalActionException If the superclass throws it. * @exception NameDuplicationException If the superclass throws it. */ public GiottoAttributes(NamedObj target, String name) throws IllegalActionException, NameDuplicationException { super(target, name); _init(); } /////////////////////////////////////////////////////////////////// //// parameters //// /** The frequency parameter specifies the frequency of an actor. */ public Parameter frequency; /////////////////////////////////////////////////////////////////// //// private methods //// /** Create the parameters. */ private void _init() { try { frequency = new Parameter(this, "frequency"); frequency.setExpression("1"); frequency.setTypeEquals(BaseType.INT); } catch (KernelException ex) { // This should not occur. throw new InternalErrorException(ex); } } }