artisynth.core.modelbase
Class ReferenceComponent

java.lang.Object
  extended by artisynth.core.modelbase.ModelComponentBase
      extended by artisynth.core.modelbase.ReferenceComponent
All Implemented Interfaces:
ModelComponent, java.lang.Cloneable, HasProperties, HierarchyNode, Scannable

public class ReferenceComponent
extends ModelComponentBase

A simple component that provides a reference to another component. Used as the building block for ReferenceLists.


Nested Class Summary
 
Nested classes/interfaces inherited from interface artisynth.core.modelbase.ModelComponent
ModelComponent.NavpanelVisibility
 
Field Summary
 
Fields inherited from class artisynth.core.modelbase.ModelComponentBase
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, myProps, NULL_OBJ, useCompactPathNames
 
Constructor Summary
ReferenceComponent()
           
ReferenceComponent(ModelComponent ref)
           
 
Method Summary
 void getHardReferences(java.util.List<ModelComponent> refs)
          Appends all hard references for this component to a list.
 ModelComponent getReference()
           
 boolean scanItem(ReaderTokenizer rtok, java.util.Deque<ScanToken> tokens)
           
 void setReference(ModelComponent ref)
           
 void writeItems(java.io.PrintWriter pw, NumberFormat fmt, CompositeComponent ancestor)
           
 
Methods inherited from class artisynth.core.modelbase.ModelComponentBase
checkFlag, checkName, checkNameUniqueness, clearFlag, clone, connectToHierarchy, copy, createTempFlag, disconnectFromHierarchy, getAllPropertyInfo, getChildren, getGrandParent, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, getSoftReferences, hasChildren, hasState, isFixed, isMarked, isSelected, isWritable, makeValidName, makeValidName, notifyParentOfChange, postscan, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, scan, setFixed, setFlag, setMarked, setName, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setSelected, updateReferences, write
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReferenceComponent

public ReferenceComponent(ModelComponent ref)

ReferenceComponent

public ReferenceComponent()
Method Detail

getReference

public ModelComponent getReference()

setReference

public void setReference(ModelComponent ref)

getHardReferences

public void getHardReferences(java.util.List<ModelComponent> refs)
Appends all hard references for this component to a list. References are other components, outside of this component's immediate ancestry, on which this component depends. For example, an AxialSpring refers to two Point components as for it's end points. A hard reference is one which the referring component must have, and which if deleted, implies that the referring component should be deleted too.

Specified by:
getHardReferences in interface ModelComponent
Overrides:
getHardReferences in class ModelComponentBase
Parameters:
refs - list to which hard references are appended

scanItem

public boolean scanItem(ReaderTokenizer rtok,
                        java.util.Deque<ScanToken> tokens)
                 throws java.io.IOException
Throws:
java.io.IOException

writeItems

public void writeItems(java.io.PrintWriter pw,
                       NumberFormat fmt,
                       CompositeComponent ancestor)
                throws java.io.IOException
Throws:
java.io.IOException