public abstract class ModelComponentBase extends java.lang.Object implements ModelComponent, java.lang.Cloneable
ModelComponent.NavpanelVisibility| Modifier and Type | Field and Description | 
|---|---|
| static boolean | enforceUniqueCompositeNames | 
| static boolean | enforceUniqueNames | 
| int | myNumber | 
| static PropertyList | myProps | 
| static java.lang.Object | NULL_OBJ | 
| static boolean | useCompactPathNames | 
| Constructor and Description | 
|---|
| ModelComponentBase() | 
| ModelComponentBase(java.lang.String name) | 
| Modifier and Type | Method and Description | 
|---|---|
| boolean | checkFlag(int mask) | 
| static java.lang.String | checkName(java.lang.String name,
         ModelComponent comp)Check to see if a String represents a valid name for a model
 component. | 
| static void | checkNameUniqueness(ModelComponent comp,
                   CompositeComponent parent)Check name uniqueness restrictions of a component with respect
 to a specific parent, and throw an exception if these are violated. | 
| void | clearFlag(int mask) | 
| java.lang.Object | clone() | 
| void | connectToHierarchy()Called by the system after this component is added to the
 component hierarchy (i.e., when it is added as a child of another
 CompositeComponent). | 
| ModelComponent | copy(int flags,
    java.util.Map<ModelComponent,ModelComponent> copyMap) | 
| static int | createTempFlag() | 
| void | disconnectFromHierarchy()Called by the system after this component is removed from the component
 hierarchy (i.e., when it is removed as a child of its parent). | 
| PropertyList | getAllPropertyInfo()Returns a list giving static information about all properties exported by
 this object. | 
| java.util.Iterator<? extends HierarchyNode> | getChildren() | 
| CompositeComponent | getGrandParent() | 
| void | getHardReferences(java.util.List<ModelComponent> refs)Appends all hard references for this component to a list. | 
| java.lang.String | getName()Gets the name of this component. | 
| Range | getNameRange() | 
| ModelComponent.NavpanelVisibility | getNavpanelVisibility() | 
| static ModelComponent.NavpanelVisibility | getNavpanelVisibility(int flags) | 
| int | getNumber()Gets the number of this component. | 
| CompositeComponent | getParent()Returns the current parent of this ModelComponent, if any. | 
| Property | getProperty(java.lang.String path)Returns a property associated with a specified path name. | 
| void | getSoftReferences(java.util.List<ModelComponent> refs)Appends all soft references for this component to a list. | 
| boolean | hasChildren() | 
| boolean | hasState()Queries if this component has state. | 
| boolean | isConnectedToHierarchy()Queries if this component is currently connected to a component
 hierarchy. | 
| boolean | isFixed()Returns true if this model component is fixed. | 
| boolean | isMarked()Returns true if this model component is marked. | 
| boolean | isSelected()Returns true if this model component is selected. | 
| boolean | isWritable()Returns  trueif this component should in fact be written to
 secondary storage. | 
| static java.lang.String | makeValidName(java.lang.String name)Makes a valid component name from the string provided. | 
| static java.lang.String | makeValidName(java.lang.String name,
             ModelComponent comp,
             CompositeComponent parent)Makes a valid component name from the string provided. | 
| void | notifyParentOfChange(ComponentChangeEvent e)Notifies the parent of this component (if any) of changes within in its
 descendants. | 
| void | postscan(java.util.Deque<ScanToken> tokens,
        CompositeComponent ancestor)Performs any required post-scanning for this component. | 
| void | printReferences()Diagnostic method that prints the references associated with
 this component. | 
| static boolean | recursivelyContained(ModelComponent comp,
                    CompositeComponent ancestor,
                    java.util.Collection<? extends ModelComponent> collection) | 
| static boolean | recursivelyContains(ModelComponent ancestor,
                   ModelComponent comp)Queries whether if a component is a descendant of a specified
 ancestor. | 
| static void | removeTempFlag(int mask) | 
| void | scan(ReaderTokenizer rtok,
    java.lang.Object ref)Scans this element from a ReaderTokenizer. | 
| void | setFixed(boolean fixed)Fixes or unfixes this component. | 
| void | setFlag(int mask) | 
| void | setMarked(boolean marked)Marks or unmarks this component. | 
| void | setName(java.lang.String name)Sets the name of this component. | 
| void | setNavpanelVisibility(ModelComponent.NavpanelVisibility visibility) | 
| static int | setNavpanelVisibility(ModelComponent.NavpanelVisibility visibility,
                     int flags) | 
| void | setNumber(int num)Sets the number of this component. | 
| void | setParent(CompositeComponent parent)Sets the parent for this component. | 
| void | setSelected(boolean selected)Selects or deselects this component. | 
| void | updateReferences(boolean undo,
                java.util.Deque<java.lang.Object> undoInfo)May be called by the system if any of the soft references for
 this component are removed from the the component hierarchy. | 
| void | write(java.io.PrintWriter pw,
     NumberFormat fmt,
     java.lang.Object ref)Writes a text description of this element to a PrintWriter. | 
public int myNumber
public static final java.lang.Object NULL_OBJ
public static boolean enforceUniqueNames
public static boolean enforceUniqueCompositeNames
public static boolean useCompactPathNames
public static PropertyList myProps
public ModelComponentBase(java.lang.String name)
public ModelComponentBase()
public static int createTempFlag()
public static void removeTempFlag(int mask)
public PropertyList getAllPropertyInfo()
HasPropertiesgetAllPropertyInfo in interface HasPropertiespublic Property getProperty(java.lang.String path)
.' characters. A sub-property
 exists if the value of a property is itself an object which exports
 properties. It is only possible to obtain a sub-property handle if each of
 its ancestor properties exports their values by reference.getProperty in interface HasPropertiespath - name of the desired property or sub-propertypublic java.lang.String getName()
getName in interface ModelComponentpublic void setName(java.lang.String name)
notifyParentOfChange with a NameChangeEvent so that it's
 parent can update the name map entry and other ancestors can adjust for
 the new name.
 
 
 Component names can be specified as null. However, if not null, they
 should have non-zero length and should not begin with a digit or contain
 the characters '.' or '/'. Implementations can use ModelComponentBase.checkName() to determine if a proposed name is valid.
setName in interface ModelComponentname - new component namepublic Range getNameRange()
public void write(java.io.PrintWriter pw,
                  NumberFormat fmt,
                  java.lang.Object ref)
           throws java.io.IOException
scan and complete
 enough to allow full reconstruction of the element.public boolean isWritable()
true if this component should in fact be written to
 secondary storage. This gives subclasses control over whether or
 not they are actually written out.isWritable in interface Scannabletrue if this component should be written to
 secondary storage.public void scan(ReaderTokenizer rtok, java.lang.Object ref) throws java.io.IOException
write.scan in interface ModelComponentscan in interface Scannablertok - Tokenizer from which to scan the elementref - optional reference object which can be used for resolving references to
 other objectsjava.io.IOException - if an I/O or formatting error occuredpublic void postscan(java.util.Deque<ScanToken> tokens, CompositeComponent ancestor) throws java.io.IOException
ModelComponentscan() method and stored in the token queue.
 The most common use of this method is to resolve the paths
 of component references, which may not have been created
 at the time of the initial scan() call.postscan in interface ModelComponenttokens - token information that was stored during 
 scan().ancestor - ancestor component with respect to which
 reference component paths are defined.java.io.IOException - if an error is encountered (such as a reference to a
 non-existent component)public void connectToHierarchy()
 When this method is called, ModelComponent.getParent() will return
 the new parent component; the system will have set this beforehand.
connectToHierarchy in interface ModelComponentpublic void disconnectFromHierarchy()
 When this
 method is called, ModelComponent.getParent() will still return this original
 parent component; the system will set this to null after.
disconnectFromHierarchy in interface ModelComponentpublic boolean isConnectedToHierarchy()
true if this component is connected to a component
 hierarchypublic CompositeComponent getParent()
getParent in interface ModelComponentgetParent in interface HierarchyNodepublic void setParent(CompositeComponent parent)
null
 is specified when the component is being removed from the hierarchy.
 This method is intended for internal use by the system only.
setParent in interface ModelComponentparent - new parent component, or null.public CompositeComponent getGrandParent()
public boolean isSelected()
isSelected in interface ModelComponentpublic void setSelected(boolean selected)
setSelected in interface ModelComponentselected - if true, this component is selectedpublic boolean isMarked()
isMarked in interface ModelComponentpublic void setMarked(boolean marked)
setMarked in interface ModelComponentmarked - if true, this component is markedpublic boolean isFixed()
isFixed in interface ModelComponentpublic void setFixed(boolean fixed)
setFixed in interface ModelComponentfixed - if true, this component will be fixed to its parent.public static int setNavpanelVisibility(ModelComponent.NavpanelVisibility visibility, int flags)
public static ModelComponent.NavpanelVisibility getNavpanelVisibility(int flags)
public ModelComponent.NavpanelVisibility getNavpanelVisibility()
getNavpanelVisibility in interface ModelComponentpublic void setNavpanelVisibility(ModelComponent.NavpanelVisibility visibility)
public boolean checkFlag(int mask)
public void setFlag(int mask)
public void clearFlag(int mask)
public void getHardReferences(java.util.List<ModelComponent> refs)
getHardReferences in interface ModelComponentrefs - list to which hard references are appendedpublic void getSoftReferences(java.util.List<ModelComponent> refs)
updateReferences() method will
 be called to update its internal reference information.getSoftReferences in interface ModelComponentrefs - list to which soft references are appendedpublic static boolean recursivelyContains(ModelComponent ancestor, ModelComponent comp)
ancestor - ancestor component to checkcomp - component to check for descendence from ancestortrue if comp is a descendant of
 ancestorpublic static boolean recursivelyContained(ModelComponent comp, CompositeComponent ancestor, java.util.Collection<? extends ModelComponent> collection)
public int getNumber()
getNumber in interface ModelComponentpublic void setNumber(int num)
setNumber in interface ModelComponentnum - new component numberpublic void notifyParentOfChange(ComponentChangeEvent e)
componentChanged method.notifyParentOfChange in interface ModelComponente - optional argument giving specific information about the changepublic java.util.Iterator<? extends HierarchyNode> getChildren()
getChildren in interface HierarchyNodepublic boolean hasChildren()
hasChildren in interface HierarchyNodepublic java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
clone in class java.lang.Objectjava.lang.CloneNotSupportedExceptionpublic ModelComponent copy(int flags, java.util.Map<ModelComponent,ModelComponent> copyMap)
public void printReferences()
public static java.lang.String makeValidName(java.lang.String name,
                                             ModelComponent comp,
                                             CompositeComponent parent)
comp (and possibly parent) is
 also specified, then the method will also ensure that the
 name is unique to the component's parent.name - name to validatecomp - Component for which the name is intended. 
 If null, name uniqueness will not be checked.parent - Parent of the component. May be null, in
 which case the component's current parent will be used.public static java.lang.String makeValidName(java.lang.String name)
name - name to modifypublic static void checkNameUniqueness(ModelComponent comp, CompositeComponent parent)
comp - component whose name should be checkedparent - parent component in which name may have to be unique.public static java.lang.String checkName(java.lang.String name,
                                         ModelComponent comp)
null if it is, and 
 an error message otherwise.name - name to be validatedcomp - Component for which the name is intended.
 May be null, in which case duplicate sibling names
 will not be checked.null, or error message if the name is not valid.public boolean hasState()
ModelComponenthasState in interface ModelComponenttrue if this component has statepublic void updateReferences(boolean undo,
                             java.util.Deque<java.lang.Object> undoInfo)
undo equal to false,
 this component should then examine its soft references and
 use ComponentUtils.isConnected()
 to determine which of them have been disconnected from the hierarchy.
 Disconnected references should be removed, and sufficient information
 should be appended to undoInfo to allow this update
 to be undone if this method is called later with undo 
 equal to true. When undoing an update, the undo
 information should be removed from the front of undoInfo.updateReferences in interface ModelComponentundo - if true, indicates that the most
 recent reference update should be undone, using the supplied
 undo information.undoInfo - if undo is false, should be used
 to store information allowing the reference update to be undone.
 Otherwise, if undo is true, then this
 supplied information to undo the most recent update.