jni.gui
Class JNICodeGenerator

java.lang.Object
  extended by ptolemy.kernel.util.NamedObj
      extended by ptolemy.kernel.util.Attribute
          extended by jni.gui.JNICodeGenerator
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Changeable, Debuggable, DebugListener, Derivable, ModelErrorHandler, MoMLExportable, Moveable, Nameable

Deprecated. This code is old, hard to use and unmaintained. See EmbeddedCActor for a more recent implementation.

public class JNICodeGenerator
extends Attribute

Generate Java Native Interface (JNI) support code and create ports that correspond with the native method arguments.

Since:
Ptolemy II 6.0
Version:
$Id: JNICodeGenerator.java 53042 2009-04-10 20:31:21Z cxh $
Author:
Christopher Brooks
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
 
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
JNICodeGenerator(NamedObj container, java.lang.String name)
          Deprecated. Create a new instance of JNI Generator.
 
Method Summary
 int generateCode(java.lang.StringBuffer code)
          Deprecated. Generate code and append it to the given string buffer.
static ExecuteCommands getExecuteCommands()
          Deprecated. Get the command executor, which can be either non-graphical or graphical.
 void setContainer(NamedObj container)
          Deprecated. Set the container of this object to be the given container.
static void setExecuteCommands(ExecuteCommands executeCommands)
          Deprecated. Set the command executor, which can be either non-graphical or graphical.
 
Methods inherited from class ptolemy.kernel.util.Attribute
_checkContainer, _getContainedObject, _propagateExistence, clone, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setName, updateContent
 
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, 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
 

Constructor Detail

JNICodeGenerator

public JNICodeGenerator(NamedObj container,
                        java.lang.String name)
                 throws IllegalActionException,
                        NameDuplicationException
Deprecated. 
Create a new instance of JNI Generator.

Parameters:
container - The container.
name - The name of the JNI generator.
Throws:
IllegalActionException - If the super class throws the exception or error occurs when setting the file path.
NameDuplicationException - If the super class throws the exception or an error occurs when setting the file path.
Method Detail

generateCode

public int generateCode(java.lang.StringBuffer code)
                 throws java.lang.Exception
Deprecated. 
Generate code and append it to the given string buffer. Write the code to the directory specified by the codeDirectory parameter. The file name is a sanitized version of the model name with a suffix that is based on last package name of the generatorPackage parameter. Thus if the codeDirectory is $HOME, the name of the model is Foo and the generatorPackage is ptolemy.codegen.c, then the file that is written will be $HOME/Foo.c This method is the main entry point.

Parameters:
code - The given string buffer.
Returns:
The return value of the last subprocess that was executed. or -1 if no commands were executed.
Throws:
java.lang.Exception - If there was a problem creating the JNI files.

getExecuteCommands

public static ExecuteCommands getExecuteCommands()
Deprecated. 
Get the command executor, which can be either non-graphical or graphical. The initial default is non-graphical, which means that stderr and stdout from subcommands is written to the console.

Returns:
executeCommands The subprocess command executor.
See Also:
setExecuteCommands(ExecuteCommands)

setExecuteCommands

public static void setExecuteCommands(ExecuteCommands executeCommands)
Deprecated. 
Set the command executor, which can be either non-graphical or graphical. The initial default is non-graphical, which means that stderr and stdout from subcommands is written to the console.

Parameters:
executeCommands - The subprocess command executor.
See Also:
getExecuteCommands()

setContainer

public void setContainer(NamedObj container)
                  throws IllegalActionException,
                         NameDuplicationException
Deprecated. 
Set the container of this object to be the given container.

Overrides:
setContainer in class Attribute
Parameters:
container - The given container.
Throws:
IllegalActionException - If the given container is not null and not an instance of CompositeEntity.
NameDuplicationException - If there already exists a container with the same name.
See Also:
Attribute.getContainer()