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 59203 2010-09-23 21:41:27Z cxh $
Author:
Chad Berkley
See Also:
Serialized Form
Accepted Rating:
Red (cxh)
Proposed Rating:
Red (cxh)

Nested Class Summary
 
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
 
Field Summary
private  java.lang.String _author
           
private  java.lang.String _description
           
private  java.lang.String _docClass
           
private  java.lang.String _docName
           
private  java.util.Hashtable _portHash
           
private  java.util.Hashtable _propertyHash
           
private  java.lang.String _userLevelDocumentation
           
private  java.lang.String _version
           
private  java.lang.String source
           
private  java.lang.String text
           
 
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 documentationAttribute)
          Populate 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 documentation.
 java.util.Hashtable getPortHash()
          Return the port hash.
 java.lang.String getProperty(java.lang.String name)
          Return the property documenation.
 java.util.Hashtable getPropertyHash()
          Return the property hash.
 java.lang.String getUserLevelDocumentation()
          Return the user level documentation.
 java.lang.String getVersion()
          Return the version.
 java.lang.String removeProperty(java.lang.String name)
          Remove a property from the property hashtable.
 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
_checkContainer, _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, _recordDecoratedAttributes, _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, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getElementName, getFullName, getModelErrorHandler, getName, getName, getPrototypeList, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, 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
 

Field Detail

source

private java.lang.String source

text

private java.lang.String text

_docName

private java.lang.String _docName

_docClass

private java.lang.String _docClass

_description

private java.lang.String _description

_author

private java.lang.String _author

_version

private java.lang.String _version

_userLevelDocumentation

private java.lang.String _userLevelDocumentation

_portHash

private java.util.Hashtable _portHash

_propertyHash

private java.util.Hashtable _propertyHash
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

addPort

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

Parameters:
name - The name of the port.
value - A String representing the port.
Throws:
NameDuplicationException - If thrown while creating the port.
java.lang.Exception - If thrown while configuring the port

addProperty

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

Parameters:
name - The name of the property.
value - A string representing the propety.
Throws:
NameDuplicationException - If thrown while creating the property
java.lang.Exception - If thrown while configuring the attribute
See Also:
getProperty(String)

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.

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

createInstanceFromExisting

public void createInstanceFromExisting(KeplerDocumentationAttribute documentationAttribute)
Populate the members of KeplerDocumentationAttribute from another given KeplerDccumentationAtttribute.

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

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()

getAuthor

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

Returns:
the author
See Also:
setAuthor(String)

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

getDescription

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

Returns:
the description
See Also:
setDescription(String)

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.

getDocClass

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

Returns:
the document class or the empty string.
See Also:
setDocClass(String)

getDocName

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

Returns:
the document name
See Also:
setDocName(String)

getPort

public java.lang.String getPort(java.lang.String name)
Return the port documentation.

Parameters:
name - The name of the port.
Returns:
the port documentation.

getPortHash

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

Returns:
the port hash
See Also:
setPortHash(Hashtable)

getProperty

public java.lang.String getProperty(java.lang.String name)
Return the property documenation.

Parameters:
name - The name of the property.
Returns:
the property docs
See Also:
addProperty(String, String)

getPropertyHash

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

Returns:
the property hash
See Also:
setPropertyHash(Hashtable)

getUserLevelDocumentation

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

Returns:
the user level documentation
See Also:
setUserLevelDocumentation(String)

getVersion

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

Returns:
the version
See Also:
setVersion(String)

removeProperty

public java.lang.String removeProperty(java.lang.String name)
                                throws IllegalActionException,
                                       NameDuplicationException
Remove a property from the property hashtable.

Parameters:
name - The name of the property.
Returns:
The value of the property.
Throws:
IllegalActionException - If an error occurs removing the ConfigurableAttribute.
NameDuplicationException - If an error occurs removing the ConfigurableAttribute.
See Also:
addProperty(String, String)

setAuthor

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

Parameters:
author - The author.
See Also:
getAuthor()

setDescription

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

Parameters:
description - The description.
See Also:
getDescription()

setDocClass

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

Parameters:
className - The name of this docClass.
See Also:
getDocClass()

setDocName

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

Parameters:
name - The name of this document.
See Also:
getDocName()

setPortHash

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

Parameters:
portHash - The port hash.
See Also:
getPortHash()

setPropertyHash

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

Parameters:
propertyHash - The property hashtable.
See Also:
FIXME: need to remove all existing ConfigurableAttributes for properties and add new ones for new hash table.

setUserLevelDocumentation

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

Parameters:
userLevelDocumentation - The user level documentation.
See Also:
getUserLevelDocumentation()

setVersion

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

Parameters:
version - The version.
See Also:
getVersion()

toDocML

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

Returns:
The docML

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.