thales.actor.gui
Class SingleWindowConfiguration

java.lang.Object
  extended by ptolemy.kernel.util.NamedObj
      extended by ptolemy.kernel.InstantiableNamedObj
          extended by ptolemy.kernel.Entity
              extended by ptolemy.kernel.ComponentEntity
                  extended by ptolemy.kernel.CompositeEntity
                      extended by ptolemy.actor.gui.Configuration
                          extended by thales.actor.gui.SingleWindowConfiguration
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, ApplicationConfigurer, Changeable, Debuggable, DebugListener, Derivable, Instantiable, ModelErrorHandler, MoMLExportable, Moveable, Nameable

public class SingleWindowConfiguration
extends Configuration

A Configuration that intercept created Tableau, and the content of its Frame into a TabbedPane.

Since:
Ptolemy II 4.0
Version:
$Id: SingleWindowConfiguration.java 54721 2009-06-26 22:32:23Z cxh $
Author:
Jérôme Blanc & Benoit Masson, Thales Research and technology, 01 sept. 2003
See Also:
Serialized Form
Accepted Rating:
Red (cxh)
Proposed Rating:
Yellow (jerome.blanc)

Nested Class Summary
 
Nested classes/interfaces inherited from class ptolemy.kernel.CompositeEntity
CompositeEntity.ContainedObjectsIterator
 
Field Summary
 
Fields inherited from class ptolemy.actor.gui.Configuration
_DIRECTORY_NAME, classesToRemove, removeGraphicalClasses
 
Fields inherited from class ptolemy.kernel.CompositeEntity
_levelCrossingLinks
 
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
 
Constructor Summary
SingleWindowConfiguration(Workspace workspace)
          Construct an instance in the specified workspace with an empty string as a name.
 
Method Summary
private  void catchTableau(Tableau tableau)
          Catches the tableau, gets the corresponding JFrame and builds a new JTabbedPane into the SingleWindowHTMLViewer.
protected  PtolemyEffigy createEffigy(PtolemyEffigy container)
           
 Tableau createPrimaryTableau(Effigy effigy)
          Create the first tableau for the given effigy, using the tableau factory.
 Tableau openModel(NamedObj entity)
          Open the specified Ptolemy II model.
 Tableau openModel(java.net.URL base, java.net.URL in, java.lang.String identifier, EffigyFactory factory)
          Open the specified URL using the specified effigy factory.
 
Methods inherited from class ptolemy.actor.gui.Configuration
_removeEntity, attributeChanged, check, closeAllTableaux, configurations, findEffigy, getDirectory, getEffigy, openInstance, openInstance, openModel, openModel, setContainer, showAll
 
Methods inherited from class ptolemy.kernel.CompositeEntity
_addEntity, _addRelation, _adjustDeferrals, _deepOpaqueEntityList, _description, _exportMoMLContents, _finishedAddEntity, _recordDecoratedAttributes, _removeRelation, _validateSettables, allAtomicEntityList, allCompositeEntityList, allowLevelCrossingConnect, classDefinitionList, clone, connect, connect, containedObjectsIterator, deepEntityList, deepGetEntities, deepOpaqueEntityList, deepRelationSet, entityList, entityList, exportLinks, exportMoML, getAttribute, getEntities, getEntity, getPort, getRelation, getRelations, isAtomic, isOpaque, lazyAllAtomicEntityList, lazyAllCompositeEntityList, lazyClassDefinitionList, lazyDeepEntityList, lazyEntityList, lazyRelationList, newRelation, numberOfEntities, numberOfRelations, numEntities, numRelations, relationList, removeAllEntities, removeAllRelations, setClassDefinition, statistics, uniqueName
 
Methods inherited from class ptolemy.kernel.ComponentEntity
_addPort, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, newPort, propagateExistence, setName
 
Methods inherited from class ptolemy.kernel.Entity
_removePort, connectedPortList, connectedPorts, connectionsChanged, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts
 
Methods inherited from class ptolemy.kernel.InstantiableNamedObj
_setParent, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition
 
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, attributeList, attributeList, attributeTypeChanged, clone, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getFullName, getModelErrorHandler, getName, getName, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, propagateValue, propagateValues, removeChangeListener, removeDebugListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, validateSettables, workspace
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ptolemy.kernel.util.Derivable
getDerivedLevel, getDerivedList, propagateValue
 
Methods inherited from interface ptolemy.kernel.util.Nameable
description, getDisplayName, getFullName, getName, getName
 

Constructor Detail

SingleWindowConfiguration

public SingleWindowConfiguration(Workspace workspace)
                          throws IllegalActionException,
                                 NameDuplicationException
Construct an instance in the specified workspace with an empty string as a name. You can then change the name with setName(). If the workspace argument is null, then use the default workspace. Add the instance to the workspace directory. Increment the version number of the workspace. Note that there is no constructor that takes a container as an argument; a Configuration is always a top-level entity (this is enforced by the setContainer() method).

Parameters:
workspace -
Throws:
IllegalActionException - If the container is incompatible with this entity.
NameDuplicationException - If the name coincides with an entity already in the container.
Method Detail

createPrimaryTableau

public Tableau createPrimaryTableau(Effigy effigy)
Create the first tableau for the given effigy, using the tableau factory. This is called after an effigy is first opened, or when a new effigy is created. If the method fails to create a tableau, then it removes the effigy from the directory. This prevents us from having lingering effigies that have no user interface.

Overrides:
createPrimaryTableau in class Configuration
Parameters:
effigy - The effigy for which to create a tableau.
Returns:
A tableau for the specified effigy, or null if none can be opened.

catchTableau

private void catchTableau(Tableau tableau)
Catches the tableau, gets the corresponding JFrame and builds a new JTabbedPane into the SingleWindowHTMLViewer.

Parameters:
tableau - tableau to catch

openModel

public Tableau openModel(NamedObj entity)
                  throws IllegalActionException,
                         NameDuplicationException
Open the specified Ptolemy II model. If a model already has open tableaux, then put those in the foreground and return the first one. Otherwise, create a new tableau.

Overrides:
openModel in class Configuration
Parameters:
entity - The model.
Returns:
The tableau that is created, or the first one found, or null if none is created or found.
Throws:
IllegalActionException - If constructing an effigy or tableau fails.
NameDuplicationException - If a name conflict occurs (this should not be thrown).

createEffigy

protected PtolemyEffigy createEffigy(PtolemyEffigy container)

openModel

public Tableau openModel(java.net.URL base,
                         java.net.URL in,
                         java.lang.String identifier,
                         EffigyFactory factory)
                  throws java.lang.Exception
Description copied from class: Configuration
Open the specified URL using the specified effigy factory. If a model with the specified identifier is present in the directory, then find all the tableaux of that model and make them visible; otherwise, read a model from the specified URL in and create a default tableau for the model and add the tableau to this directory.

Overrides:
openModel in class Configuration
Parameters:
base - The base for relative file references, or null if there are no relative file references.
in - The input URL.
identifier - The identifier that uniquely identifies the model.
factory - The effigy factory to use.
Returns:
The tableau that is created, or null if none.
Throws:
java.lang.Exception - If the URL cannot be read.