public class RelativeLocation extends Location
Red (cxh) |
Yellow (cxh) |
NamedObj.ContainedObjectsIterator
Settable.Visibility
Modifier and Type | Field and Description |
---|---|
static double |
BREAK_THRESHOLD
The maximal distance of the relative location.
|
static double |
INITIAL_OFFSET
The initial offset for new relative locatable objects.
|
StringAttribute |
relativeTo
The name of the object this location is relative to.
|
StringAttribute |
relativeToElementName
The element name of the object this location is relative to.
|
_attributes, _changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
EXPERT, FULL, NONE, NOT_EDITABLE
Constructor and Description |
---|
RelativeLocation(NamedObj container,
java.lang.String name)
Construct an instance.
|
Modifier and Type | Method and Description |
---|---|
double[] |
getLocation()
Get the location in some cartesian coordinate system.
|
double[] |
getRelativeLocation()
Get the relative location, relative to the relativeTo
object, if there is one, and otherwise return the absolute
location.
|
NamedObj |
getRelativeToNamedObj()
If the relativeTo object exists, return it.
|
void |
setLocation(double[] location)
Set the location in some cartesian coordinate system, and notify
the container and any value listeners of the new location.
|
_propagateValue, addValueListener, clone, exportMoML, getDefaultExpression, getDisplayName, getExpression, getValueAsString, getVisibility, removeValueListener, setExpression, setVisibility, toString, validate
setContainer
_checkContainer, _getContainedObject, _propagateExistence, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setName, updateContent
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _description, _executeChangeRequests, _exportMoMLContents, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, addDebugListener, addHierarchyListener, attributeChanged, attributeDeleted, attributeList, attributeList, attributeTypeChanged, clone, containedObjectsIterator, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getElementName, getFullName, getModelErrorHandler, getName, getName, getPrototypeList, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateExistence, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, uniqueName, validateSettables, workspace
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
description, getContainer, getFullName, getName, getName, setName
public StringAttribute relativeTo
public StringAttribute relativeToElementName
public static final double INITIAL_OFFSET
public static final double BREAK_THRESHOLD
LocatableNodeDragInteractor.mouseReleased(diva.canvas.event.LayerEvent)
).public RelativeLocation(NamedObj container, java.lang.String name) throws IllegalActionException, NameDuplicationException
container
- The container (the object to have a relative location).name
- The name of this instance.IllegalActionException
- If the superclass throws it.NameDuplicationException
- If the superclass throws it.public double[] getLocation()
relativeTo
property and that object
is gone, then the internally stored location is updated so it
contains the correct absolute location.getLocation
in interface Locatable
getLocation
in class Location
setLocation(double[])
public double[] getRelativeLocation()
setLocation(double[])
public NamedObj getRelativeToNamedObj()
public void setLocation(double[] location) throws IllegalActionException
relativeTo
property, then only the relative location is
stored internally.setLocation
in interface Locatable
setLocation
in class Location
location
- The location.IllegalActionException
- Thrown when attributeChanged() is called.getLocation()