001/* 002 * Copyright (c) 2010-2011 The Regents of the University of California. 003 * All rights reserved. 004 * 005 * 006 * Permission is hereby granted, without written agreement and without 007 * license or royalty fees, to use, copy, modify, and distribute this 008 * software and its documentation for any purpose, provided that the above 009 * copyright notice and the following two paragraphs appear in all copies 010 * of this software. 011 * 012 * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY 013 * FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 014 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF 015 * THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF 016 * SUCH DAMAGE. 017 * 018 * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, 019 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 020 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE 021 * PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF 022 * CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, 023 * ENHANCEMENTS, OR MODIFICATIONS. 024 * 025 */ 026 027package org.kepler.moml; 028 029import org.kepler.kar.karxml.KarXml; 030 031import ptolemy.kernel.CompositeEntity; 032import ptolemy.kernel.util.IllegalActionException; 033import ptolemy.kernel.util.NameDuplicationException; 034import ptolemy.kernel.util.Workspace; 035 036/** 037 * Created by IntelliJ IDEA. 038 * User: sean 039 * Date: Mar 23, 2010 040 * Time: 4:53:01 PM 041 */ 042 043 044// TODO: Actually use this class instead of plain EntityLibraries. Then test 045// if right clicking one of these seems to work. 046 047public class DownloadableKAREntityLibrary extends RemoteKAREntityLibrary { 048 049 public DownloadableKAREntityLibrary() {} 050 051 public DownloadableKAREntityLibrary(Workspace workspace) { 052 super(workspace); 053 } 054 055 public DownloadableKAREntityLibrary(CompositeEntity container, String name, KarXml karXml) throws NameDuplicationException, IllegalActionException { 056 super(container, name); 057 this.karXml = karXml; 058 } 059 060 // Create a copy of an existing DownloadableKAREntityLibrary (same name, 061 // KAR XML file) in a different container 062 public DownloadableKAREntityLibrary(CompositeEntity container, DownloadableKAREntityLibrary entityLibrary) throws IllegalActionException, NameDuplicationException { 063 this(container, entityLibrary.getName(), entityLibrary.getKarXml()); 064 } 065 066 067 068 069}