ptolemy.vergil.basic
Class KeplerDocumentationAttribute

java.lang.Object
  extended by ptolemy.kernel.util.NamedObj
      extended by ptolemy.kernel.util.Attribute
          extended by ptolemy.vergil.basic.KeplerDocumentationAttribute
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Changeable, Configurable, Debuggable, DebugListener, Derivable, ModelErrorHandler, MoMLExportable, Moveable, Nameable

public class KeplerDocumentationAttribute
extends Attribute
implements Configurable

A Documentation attribute for actors. This class is used by Kepler so that the DocViewer can access kepler specfic actor metadata based documentation.

Since:
Ptolemy II 6.1
Version:
$Id: KeplerDocumentationAttribute.java,v 1.9.4.1 2008/03/25 22:26:52 cxh Exp $
Author:
Chad Berkley
See Also:
Serialized Form
Accepted Rating:
Red (johnr)
Proposed Rating:
Red (eal)

Nested Class Summary
 
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
 
Field Summary
 
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
KeplerDocumentationAttribute()
          Construct a Kepler documentation attribute.
KeplerDocumentationAttribute(NamedObj container, java.lang.String name)
          Construct a Kepler documentation attribute.
KeplerDocumentationAttribute(Workspace workspace)
          Construct a Kepler documentation attribute.
 
Method Summary
 void addPort(java.lang.String name, java.lang.String value)
          Add port to the port hashtable.
 void addProperty(java.lang.String name, java.lang.String value)
          Add a property to the property hashtable.
 void configure(java.net.URL base, java.lang.String source, java.lang.String text)
          Configure this documentation attribute.
 void createEmptyFields(NamedObj target)
          Create empty fields for the main attribute as well as any params or ports that exist in the target
 void createInstanceFromExisting(KeplerDocumentationAttribute da)
          Populates the members of KeplerDocumentationAttribute from another given KeplerDccumentationAtttribute.
 void exportMoML(java.io.Writer output, int depth, java.lang.String name)
          Write a MoML description of this object with the specified indentation depth and with the specified name substituting for the name of this object.
 java.lang.String getAuthor()
          return the author
 java.lang.String getConfigureSource()
          Get the configuration source.
 java.lang.String getConfigureText()
          Get the configuration text.
 java.lang.String getDescription()
          return the description
 DocAttribute getDocAttribute(NamedObj target)
          Return a docAttribute with the available kepler documentation.
 java.lang.String getDocClass()
          return the document class
 java.lang.String getDocName()
          return the document name
 java.lang.String getPort(java.lang.String name)
          return the port docs
 java.util.Hashtable getPortHash()
          return the port hash
 java.lang.String getProperty(java.lang.String name)
          return the property docs
 java.util.Hashtable getPropertyHash()
          return the property hash
 java.lang.String getUserLevelDocumentation()
          return the user level documentation
 java.lang.String getVersion()
          return the version
 void setAuthor(java.lang.String author)
          Set the author.
 void setDescription(java.lang.String description)
          Set the description.
 void setDocClass(java.lang.String className)
          Set the name of this docClass.
 void setDocName(java.lang.String name)
          Set the name of this document.
 void setPortHash(java.util.Hashtable portHash)
          Set the port hash.
 void setPropertyHash(java.util.Hashtable propertyHash)
          Set the property hashtable.
 void setUserLevelDocumentation(java.lang.String userLevelDocumentation)
          Set the user level documentation.
 void setVersion(java.lang.String version)
          Set the version.
 java.lang.String toDocML()
          Exports this documentation attribute as docML.
 void updateContent()
          Method for configurable.
 
Methods inherited from class ptolemy.kernel.util.Attribute
_getContainedObject, _propagateExistence, clone, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setContainer, setName
 
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _description, _exportMoMLContents, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, addDebugListener, attributeChanged, attributeList, attributeList, attributeTypeChanged, clone, containedObjectsIterator, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttribute, getAttributes, getChangeListeners, getClassName, getDerivedLevel, getDerivedList, getDisplayName, getElementName, getFullName, getModelErrorHandler, getName, getName, getPrototypeList, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, message, propagateExistence, propagateValue, propagateValues, removeChangeListener, removeDebugListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, uniqueName, validateSettables, workspace
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

KeplerDocumentationAttribute

public KeplerDocumentationAttribute()
Construct a Kepler documentation attribute.


KeplerDocumentationAttribute

public KeplerDocumentationAttribute(NamedObj container,
                                    java.lang.String name)
                             throws IllegalActionException,
                                    NameDuplicationException
Construct a Kepler documentation attribute.

Parameters:
container - The container.
name - The name of the Kepler documentation attribute.
Throws:
IllegalActionException - If thrown by the superclass.
NameDuplicationException - If thrown by the superclass.

KeplerDocumentationAttribute

public KeplerDocumentationAttribute(Workspace workspace)
Construct a Kepler documentation attribute.

Parameters:
workspace - The workspace in which the object is created.
Method Detail

createInstanceFromExisting

public void createInstanceFromExisting(KeplerDocumentationAttribute da)
Populates the members of KeplerDocumentationAttribute from another given KeplerDccumentationAtttribute.

Parameters:
da - The DocumentationAttribute from which to copy attributes.

createEmptyFields

public void createEmptyFields(NamedObj target)
Create empty fields for the main attribute as well as any params or ports that exist in the target

Parameters:
target - the namedobj to create the empty attributes for

exportMoML

public void exportMoML(java.io.Writer output,
                       int depth,
                       java.lang.String name)
                throws java.io.IOException
Write a MoML description of this object with the specified indentation depth and with the specified name substituting for the name of this object.

Specified by:
exportMoML in interface MoMLExportable
Overrides:
exportMoML in class NamedObj
Parameters:
output - The output stream to write to.
depth - The depth in the hierarchy, to determine indenting.
name - The name to use in the exported MoML.
Throws:
java.io.IOException - If an I/O error occurs.
See Also:
MoMLExportable, NamedObj.clone(Workspace), NamedObj.isPersistent(), NamedObj.getDerivedLevel()

toDocML

public java.lang.String toDocML()
Exports this documentation attribute as docML.

Returns:
The docML

getDocAttribute

public DocAttribute getDocAttribute(NamedObj target)
Return a docAttribute with the available kepler documentation. Returns null if an error prevents the doc attribute from being created.

Parameters:
target - The container for the DocAttribute
Returns:
The DocAttribute.

updateContent

public void updateContent()
                   throws InternalErrorException
Method for configurable. In this class, we do nothing.

Overrides:
updateContent in class Attribute
Throws:
InternalErrorException - Not thrown in this base class.

setDocName

public void setDocName(java.lang.String name)
Set the name of this document.

Parameters:
name - The name of this document.

getDocName

public java.lang.String getDocName()
return the document name

Returns:
the document name

setDocClass

public void setDocClass(java.lang.String className)
Set the name of this docClass.

Parameters:
className - The name of this docClass.

getDocClass

public java.lang.String getDocClass()
return the document class

Returns:
the document class

setDescription

public void setDescription(java.lang.String description)
Set the description.

Parameters:
description - The description.

getDescription

public java.lang.String getDescription()
return the description

Returns:
the description

setAuthor

public void setAuthor(java.lang.String author)
Set the author.

Parameters:
author - The author.

getAuthor

public java.lang.String getAuthor()
return the author

Returns:
the author

setVersion

public void setVersion(java.lang.String version)
Set the version.

Parameters:
version - The version.

getVersion

public java.lang.String getVersion()
return the version

Returns:
the version

setUserLevelDocumentation

public void setUserLevelDocumentation(java.lang.String userLevelDocumentation)
Set the user level documentation.

Parameters:
userLevelDocumentation - The user level documentation.

getUserLevelDocumentation

public java.lang.String getUserLevelDocumentation()
return the user level documentation

Returns:
the user level documentation

setPortHash

public void setPortHash(java.util.Hashtable portHash)
Set the port hash.

Parameters:
portHash - The port hash.

getPortHash

public java.util.Hashtable getPortHash()
return the port hash

Returns:
the port has

addPort

public void addPort(java.lang.String name,
                    java.lang.String value)
             throws IllegalActionException,
                    NameDuplicationException
Add port to the port hashtable.

Parameters:
name - The name of the port.
value - A String representing the port.
Throws:
IllegalActionException
NameDuplicationException

getPort

public java.lang.String getPort(java.lang.String name)
return the port docs

Returns:
the port docs

setPropertyHash

public void setPropertyHash(java.util.Hashtable propertyHash)
Set the property hashtable.

Parameters:
propertyHash - The property hashtable.

getPropertyHash

public java.util.Hashtable getPropertyHash()
return the property hash

Returns:
the property hash

addProperty

public void addProperty(java.lang.String name,
                        java.lang.String value)
                 throws NameDuplicationException,
                        IllegalActionException
Add a property to the property hashtable.

Parameters:
name - The name of the property.
value - A string representing the propety.
Throws:
NameDuplicationException
IllegalActionException

getProperty

public java.lang.String getProperty(java.lang.String name)
return the property docs

Returns:
the property docs

configure

public void configure(java.net.URL base,
                      java.lang.String source,
                      java.lang.String text)
Configure this documentation attribute.

Specified by:
configure in interface Configurable
Parameters:
base - Currently ignored.
source - The source of this configuration.
text - The configuration text.

getConfigureSource

public java.lang.String getConfigureSource()
Get the configuration source.

Specified by:
getConfigureSource in interface Configurable
Returns:
The configuration source.

getConfigureText

public java.lang.String getConfigureText()
Get the configuration text.

Specified by:
getConfigureText in interface Configurable
Returns:
The configuration text