001/* A controller that provides binding of an attribute and a refinement model.
002 *
003 * Copyright (c) 2009-2016 The Regents of the University of California. All
004 * rights reserved. Permission is hereby granted, without written agreement and
005 * without license or royalty fees, to use, copy, modify, and distribute this
006 * software and its documentation for any purpose, provided that the above
007 * copyright notice and the following two paragraphs appear in all copies of
008 * this software.
009 *
010 * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
011 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
012 * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
013 * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
014 *
015 * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
016 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
017 * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN
018 * "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO PROVIDE
019 * MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
020 *
021 * PT_COPYRIGHT_VERSION_2 COPYRIGHTENDKEY
022 *
023 */
024
025package ptolemy.vergil.toolbox;
026
027import diva.graph.GraphController;
028import ptolemy.kernel.util.IllegalActionException;
029import ptolemy.kernel.util.NameDuplicationException;
030import ptolemy.kernel.util.NamedObj;
031import ptolemy.vergil.basic.MoMLModelAttributeController;
032import ptolemy.vergil.basic.NamedObjController;
033import ptolemy.vergil.basic.NodeControllerFactory;
034
035/**
036 * A factory attribute that creates MoMLModelAttributeControllers.
037 * @author Dai Bui.  Based on code by Man-Kit Leung
038 * @version $Id$
039 * @since Ptolemy II 8.0
040 * @Pt.ProposedRating Red (cxh)
041 * @Pt.AcceptedRating Red (cxh)
042 */
043public class MoMLModelAttributeControllerFactory extends NodeControllerFactory {
044
045    /**
046     * Create a new factory with the specified name and container.
047     * @param container The specified container.
048     * @param name The specified name.
049     * @exception IllegalActionException If the attribute cannot be
050     * contained by the proposed container.
051     * @exception NameDuplicationException If the container already has an
052     * attribute with this name.
053     */
054    public MoMLModelAttributeControllerFactory(NamedObj container, String name)
055            throws NameDuplicationException, IllegalActionException {
056        super(container, name);
057    }
058
059    /**
060     * Create a new ModelAttributeController with the specified graph
061     * controller.
062     * @param controller The specified graph controller.
063     * @return A new ModelAttributeController.
064     */
065    @Override
066    public NamedObjController create(GraphController controller) {
067        return new MoMLModelAttributeController(controller);
068    }
069}