ptolemy.actor.parameters
Class LocationParameter

java.lang.Object
  extended byptolemy.kernel.util.NamedObj
      extended byptolemy.kernel.util.Attribute
          extended byptolemy.kernel.util.AbstractSettableAttribute
              extended byptolemy.data.expr.Variable
                  extended byptolemy.data.expr.Parameter
                      extended byptolemy.actor.parameters.LocationParameter
All Implemented Interfaces:
ptolemy.kernel.util.Changeable, java.lang.Cloneable, ptolemy.kernel.util.Debuggable, ptolemy.kernel.util.DebugListener, ptolemy.kernel.util.Derivable, ptolemy.data.type.HasTypeConstraints, ptolemy.kernel.util.Locatable, ptolemy.kernel.util.ModelErrorHandler, ptolemy.kernel.util.MoMLExportable, ptolemy.kernel.util.Nameable, java.io.Serializable, ptolemy.kernel.util.Settable, ptolemy.data.type.Typeable, ptolemy.kernel.util.ValueListener

public class LocationParameter
extends ptolemy.data.expr.Parameter
implements ptolemy.kernel.util.Locatable

A parameter that specifies the location of its container. This location is used when rendering the container in a Vergil diagram. The parameter value is a double matrix with one row and two columns. The default value is [0.0, 0.0].

Since:
Ptolemy II 3.0
Version:
$Id: LocationParameter.java,v 1.11.2.1 2004/06/18 00:48:58 cxh Exp $
Author:
Edward A. Lee
See Also:
Serialized Form
Accepted Rating:
Red (cxh)
Proposed Rating:
Red (eal)

Nested Class Summary
 
Nested classes inherited from class ptolemy.data.expr.Variable
ptolemy.data.expr.Variable.VariableScope
 
Nested classes inherited from class ptolemy.kernel.util.NamedObj
ptolemy.kernel.util.NamedObj.ContainedObjectsIterator
 
Nested classes inherited from class ptolemy.kernel.util.Settable
ptolemy.kernel.util.Settable.Visibility
 
Field Summary
 
Fields inherited from class ptolemy.data.expr.Variable
_currentExpression, _needsEvaluation, _parserScope, _parseTreeValid, _valueListeners
 
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
 
Fields inherited from interface ptolemy.kernel.util.Settable
EXPERT, FULL, NONE, NOT_EDITABLE
 
Constructor Summary
LocationParameter(ptolemy.kernel.util.NamedObj container, java.lang.String name)
          Construct a parameter with the given name contained by the specified entity.
 
Method Summary
 double[] getLocation()
          Get the location in some Cartesian coordinate system.
 void setLocation(double[] location)
          Set the location in some Cartesian coordinate system, and notify the container and any value listeners of the new location.
 
Methods inherited from class ptolemy.data.expr.Parameter
addChoice, exportMoML, getChoices, removeAllChoices, removeChoice
 
Methods inherited from class ptolemy.data.expr.Variable
_description, _evaluate, _notifyValueListeners, _parseIfNecessary, _propagate, _propagateToValueListeners, _propagateValue, _setToken, _setTokenAndNotify, addValueListener, clone, getDeclaredType, getExpression, getFreeIdentifiers, getScope, getToken, getType, getTypeTerm, getVisibility, invalidate, isKnown, isLazy, isStringMode, isTypeAcceptable, removeValueListener, reset, setContainer, setExpression, setLazy, setParseTreeEvaluator, setStringMode, setToken, setToken, setTypeAtLeast, setTypeAtLeast, setTypeAtMost, setTypeEquals, setTypeSameAs, setUnknown, setVisibility, stringRepresentation, toString, typeConstraintList, validate, valueChanged
 
Methods inherited from class ptolemy.kernel.util.AbstractSettableAttribute
getDefaultExpression
 
Methods inherited from class ptolemy.kernel.util.Attribute
_getContainedObject, _propagateExistence, getContainer, setName
 
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _exportMoMLContents, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, attributeChanged, attributeList, attributeList, attributeTypeChanged, clone, containedObjectsIterator, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, getAttribute, getAttribute, getAttributes, getChangeListeners, getClassName, getDerivedLevel, getDerivedList, getElementName, getFullName, getModelErrorHandler, getName, getName, getPrototypeList, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, message, propagateExistence, propagateValue, propagateValues, removeChangeListener, removeDebugListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setModelErrorHandler, setPersistent, setSource, toplevel, uniqueName, 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.Settable
addValueListener, getDefaultExpression, getExpression, getVisibility, removeValueListener, setExpression, setVisibility, validate
 
Methods inherited from interface ptolemy.kernel.util.Nameable
description, getContainer, getFullName, getName, getName, setName
 

Constructor Detail

LocationParameter

public LocationParameter(ptolemy.kernel.util.NamedObj container,
                         java.lang.String name)
                  throws ptolemy.kernel.util.IllegalActionException,
                         ptolemy.kernel.util.NameDuplicationException
Construct a parameter with the given name contained by the specified entity. The container argument must not be null, or a NullPointerException will be thrown. This parameter will use the workspace of the container for synchronization and version counts. If the name argument is null, then the name is set to the empty string. The object is not added to the list of objects in the workspace unless the container is null. Increment the version of the workspace.

Parameters:
container - The container.
name - The name of the parameter.
Throws:
ptolemy.kernel.util.IllegalActionException - If the parameter is not of an acceptable class for the container.
ptolemy.kernel.util.NameDuplicationException - If the name coincides with a parameter already in the container.
Method Detail

getLocation

public double[] getLocation()
Get the location in some Cartesian coordinate system.

Specified by:
getLocation in interface ptolemy.kernel.util.Locatable
Returns:
The location.

setLocation

public void setLocation(double[] location)
                 throws ptolemy.kernel.util.IllegalActionException
Set the location in some Cartesian coordinate system, and notify the container and any value listeners of the new location. This also propagates the value to derived objects.

Specified by:
setLocation in interface ptolemy.kernel.util.Locatable
Parameters:
location - The location.
Throws:
ptolemy.kernel.util.IllegalActionException - If the location is rejected.