001/* An interface that is used to open an instance of a NamedObj. 002 003 Copyright (c) 2013-2014 The Regents of the University of California. 004 All rights reserved. 005 Permission is hereby granted, without written agreement and without 006 license or royalty fees, to use, copy, modify, and distribute this 007 software and its documentation for any purpose, provided that the above 008 copyright notice and the following two paragraphs appear in all copies 009 of this software. 010 011 IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY 012 FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 013 ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF 014 THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF 015 SUCH DAMAGE. 016 017 THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, 018 INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 019 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE 020 PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF 021 CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, 022 ENHANCEMENTS, OR MODIFICATIONS. 023 024 PT_COPYRIGHT_VERSION_2 025 COPYRIGHTENDKEY 026 027 */ 028package ptolemy.actor; 029 030import ptolemy.kernel.util.IllegalActionException; 031import ptolemy.kernel.util.NameDuplicationException; 032import ptolemy.kernel.util.NamedObj; 033 034/////////////////////////////////////////////////////////////////// 035//// InstanceOpener 036/** An interface that is used to open an instance of a NamedObj. 037 038 <p>This interface exists so that ModalController and ModalRefinement 039 need not depend on Configuration. 040 041 @author Christopher Brooks 042 @version $Id$ 043 @since Ptolemy II 10.0 044 @Pt.ProposedRating Green (cxh) 045 @Pt.AcceptedRating Yellow (cxh) 046 047 */ 048public interface InstanceOpener { 049 050 /** Open the specified instance. 051 * A derived class looks for the instance, and if the instance already has 052 * open tableaux, then put those in the foreground 053 * Otherwise, create a new tableau and if 054 * necessary, a new effigy. Unless there is a more natural container 055 * for the effigy (e.g. it is a hierarchical model), then if a new 056 * effigy is created, it is put into the directory of the configuration. 057 * Any new tableau created will be contained by that effigy. 058 * 059 * @param entity The entity to open. 060 * @exception IllegalActionException If constructing an effigy or tableau 061 * fails. 062 * @exception NameDuplicationException If a name conflict occurs (this 063 * should not be thrown). 064 */ 065 public void openAnInstance(NamedObj entity) 066 throws IllegalActionException, NameDuplicationException; 067 068}