/** * Specify whether this object is a class definition. This method is write synchronized on the * workspace. * * @param isClass True to make this object a class definition, false to make it an instance. * @exception IllegalActionException If there are subclasses and/or instances and the argument is * false. * @see #isClassDefinition() * @see ptolemy.kernel.util.Instantiable */ public void setClassDefinition(boolean isClass) throws IllegalActionException { try { // Get write access in case things change and // because super.setClassDefinition() gets write access. workspace().getWriteAccess(); if (isClass) { setClassName("ptolemy.actor.TypedCompositeActor"); populate(); } super.setClassDefinition(isClass); } finally { workspace().doneWriting(); } }
/** * Remove the specified relation. This method should not be used directly. Call the setContainer() * method of the relation instead with a null argument. The relation is assumed to be contained by * this composite (otherwise, nothing happens). This does not alter the relation in any way. This * method is <i>not</i> synchronized on the workspace, so the caller should be. This overrides the * base class to first populate the actor, if necessary, by calling populate(). This ensures that * the relation being removed now actually exists. * * @param relation The relation to remove. */ protected void _removeRelation(ComponentRelation relation) { populate(); super._removeRelation(relation); }
/** * Remove the specified entity. This method should not be used directly. Call the setContainer() * method of the entity instead with a null argument. The entity is assumed to be contained by * this composite (otherwise, nothing happens). This does not alter the entity in any way. This * method is <i>not</i> synchronized on the workspace, so the caller should be. This overrides the * base class to first populate the actor, if necessary, by calling populate(). This ensures that * the entity being removed now actually exists. * * @param entity The entity to remove. */ protected void _removeEntity(ComponentEntity entity) { populate(); super._removeEntity(entity); }
/** * Add a relation to this container. This method should not be used directly. Call the * setContainer() method of the relation instead. This method does not set the container of the * relation to refer to this container. This method is <i>not</i> synchronized on the workspace, * so the caller should be. This overrides the base class to first populate the actor, if * necessary, by calling populate(). This ensures that the relation being added now appears in * order after the ones previously specified and lazily instantiated. * * @param relation Relation to contain. * @exception IllegalActionException If the relation has no name. * @exception NameDuplicationException If the name collides with a name already on the contained * relations list. */ protected void _addRelation(ComponentRelation relation) throws IllegalActionException, NameDuplicationException { populate(); super._addRelation(relation); }
/** * Add an entity or class definition to this container. This method should not be used directly. * Call the setContainer() method of the entity instead. This method does not set the container of * the entity to point to this composite entity. It assumes that the entity is in the same * workspace as this container, but does not check. The caller should check. Derived classes may * override this method to constrain the the entity to a subclass of ComponentEntity. This method * is <i>not</i> synchronized on the workspace, so the caller should be. This overrides the base * class to first populate the actor, if necessary, by calling populate(). This ensures that the * entity being added now appears in order after the ones previously specified and lazily * instantiated. * * @param entity Entity to contain. * @exception IllegalActionException If the entity has no name, or the action would result in a * recursive containment structure. * @exception NameDuplicationException If the name collides with a name already in the entity. */ protected void _addEntity(ComponentEntity entity) throws IllegalActionException, NameDuplicationException { populate(); super._addEntity(entity); }
/** * Write a MoML description of this object with the specified indentation depth and with the * specified name substituting for the name of this object. * * @param output The output stream to write to. * @param depth The depth in the hierarchy, to determine indenting. * @param name The name to use in the exported MoML. * @exception IOException If an I/O error occurs. */ public void exportMoML(Writer output, int depth, String name) throws IOException { populate(); super.exportMoML(output, depth, name); }