com.dat.cx
Class CxWire

java.lang.Object
  |
  +--com.dat.cx.CxComponent
        |
        +--com.dat.cx.CxWire
All Implemented Interfaces:
CxExtendsListener, java.util.EventListener, com.d_a_t.expeval.ExpressionContext

public class CxWire
extends CxComponent

CxWire provides semantics for a wire component which connects two port components.


Fields inherited from class com.dat.cx.CxComponent
compactDisplay, noHatDisplay, standardDisplay
 
Constructor Summary
CxWire()
          Default Constructor
CxWire(CxPort fromPort, CxPort toPort)
          Constructor
 
Method Summary
 void activate()
          Activate the wire.
 boolean connectsTo(CxComponent component)
          Determines if a component is either the from or to port.
 boolean connectsToPort(CxComponent component)
          Determines if a component is either the from or to port.
 void deactivate()
          Deactivate the wire.
 XSet export(XSet doc, CxProject project)
          Export the definition of this wire.
 void exportInfo(com.dat.cx.exec.CxExecComponentInfo info)
          Export the definition of the component into a java serializable object.
 com.dat.cx.studio.CxCompDisplay getDisplay()
          Get the display peer for this wire.
 com.dat.cx.studio.CxInternalFrame getEditFrame(com.dat.cx.studio.CxStudio studio)
          Get at edit frame for editing this component.
 CxComponent getFrom()
          Get the from port
 java.lang.String getIcon()
          Get the icon file name for this component
 CxComponent getTo()
          Get the to port
 void importInfo(com.dat.cx.exec.CxExecComponentInfo info)
          Import the definition of the component from a java serializable object.
 java.util.Vector importSpec(XSet spec)
          Import specification from an XML element
 void importTemplate(CxComponent fromComp, boolean copy, boolean inherit, boolean inverse)
          Import the definition of a wire from another wire.
 boolean isWire()
          Determines if the component is a wire
 com.dat.cx.exec.CxExecComponentInfo makeInfo()
          Make an empty serializable object to hold the components definition.
 void setFrom(CxComponent from)
          Set the from port
 void setTo(CxComponent to)
          Set the to port
 
Methods inherited from class com.dat.cx.CxComponent
addChild, addChildAt, addChildAtNoUndo, addChildNoUndo, addChildNoUndoAssign, addComponentChangeListener, addComponentChildrenListener, addExtendsListener, addSortedChild, canAddComponent, canExtendsAdd, componentAdded, componentLocationChanged, componentNameChanged, componentNodeChanged, componentPropertyChanged, componentRemoved, componentWirePortChanged, constructNode, contains, decrUnresolved, exportContent, findPath, findPath, getBaseType, getChild, getChild, getChildren, getClassClause, getConfig, getConfigValue, getConfigValue, getDataPath, getDataPort, getDisplayStyle, getExtendsFrom, getExtendsListeners, getImageIcon, getIndexOfChild, getInfo, getName, getNameInAncestor, getNameInContext, getNextChildTo, getNoChildren, getOwnerProject, getPackage, getPackage, getParent, getPort, getPropertyNames, getPropertyValues, getRoot, getRzChildren, getRzSortedChildren, getSortedChild, getSortedChildren, getSortedIndexOfChild, getViewFrame, getX, getXmlType, getY, handleException, hasChild, hasChild, hasChildren, hasDisplay, hasOverride, hasProperties, importContent, incrUnresolved, init, instantiateChildComponent, instantiateChildComponentAt, isActive, isAttribute, isAttributeInstance, isBaseProperty, isCompositeComponent, isConfiguration, isContentComponent, isDataMgr, isDataPort, isErrorCatchPort, isExtendable, isExtended, isInherited, isInterface, isLibraryComponent, isMiniPort, isName, isNative, isPackage, isPalette, isPin, isPort, isPortMgr, isProperty, isRoot, isSubPortOf, isTextInstance, isTypePackage, isVar, isVarInstance, isVarSet, isXmlPort, isXmlPrimative, isXmlString, omitExport, removeChild, removeChild, removeChildNoUndo, removeComponentChangeListener, removeComponentChildrenListener, removeExtendsListener, renameSortedChild, resolveClass, resolveConstructor, resolveField, resolveMethod, setClassClause, setComponentDefinitionServer, setDisplayStyle, setDisplayStyleFromInfo, setExtendsFrom, setInherited, setLocation, setLocationNoUndo, setName, setNameNoTrigger, setNameNoUndo, setNative, setOwnerProject, setParent, setPropertyValues, setX, setY, toString, triggerExtendsNodeChanged
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CxWire

public CxWire()
Default Constructor

CxWire

public CxWire(CxPort fromPort,
              CxPort toPort)
Constructor
Parameters:
fromPort - the from port
toPort - the to port
Method Detail

isWire

public boolean isWire()
Determines if the component is a wire
Overrides:
isWire in class CxComponent
Returns:
true if the component is a wire, otherwise false

getEditFrame

public com.dat.cx.studio.CxInternalFrame getEditFrame(com.dat.cx.studio.CxStudio studio)
Get at edit frame for editing this component.
Overrides:
getEditFrame in class CxComponent
Returns:
the edit frame

getDisplay

public com.dat.cx.studio.CxCompDisplay getDisplay()
Get the display peer for this wire. The display peer handles the rendering of the wire within the studio.
Overrides:
getDisplay in class CxComponent
Returns:
the display peer

importTemplate

public void importTemplate(CxComponent fromComp,
                           boolean copy,
                           boolean inherit,
                           boolean inverse)
Import the definition of a wire from another wire.
Overrides:
importTemplate in class CxComponent
Parameters:
from - the wire from which to import a definition
copy - indicate that this is a copy 'vs' extends
inherit - indicate that the definition is inherited as part of an extends
inverse - (not used)

importSpec

public java.util.Vector importSpec(XSet spec)
Import specification from an XML element
Overrides:
importSpec in class CxComponent
Parameters:
spec - the xml element containing the specification

export

public XSet export(XSet doc,
                   CxProject project)
Export the definition of this wire.
Overrides:
export in class CxComponent
Parameters:
doc - the XSet docuement being constructed. The definition is added to this document.
Returns:
the XSet document relative to the new definition

activate

public void activate()
Activate the wire. Effectively sets the to port to listen for events from the from port. Activate will wire nested ports if the to and from are interfaces.
Overrides:
activate in class CxComponent

deactivate

public void deactivate()
Deactivate the wire. Effectively remove the any port listeners set by activate.
Overrides:
deactivate in class CxComponent

connectsTo

public boolean connectsTo(CxComponent component)
Determines if a component is either the from or to port.
Parameters:
component - component to use in the test
Returns:
true if the component is either the from or to port.

connectsToPort

public boolean connectsToPort(CxComponent component)
Determines if a component is either the from or to port.
Parameters:
component - component to use in the test
Returns:
true if the component is either the from or to port.

getFrom

public CxComponent getFrom()
Get the from port
Returns:
the from port;

setFrom

public void setFrom(CxComponent from)
Set the from port
Parameters:
from - the new from port

getTo

public CxComponent getTo()
Get the to port
Returns:
the to port

setTo

public void setTo(CxComponent to)
Set the to port
Parameters:
from - the new from port

getIcon

public java.lang.String getIcon()
Get the icon file name for this component
Overrides:
getIcon in class CxComponent
Returns:
the file name for the icon

makeInfo

public com.dat.cx.exec.CxExecComponentInfo makeInfo()
Description copied from class: CxComponent
Make an empty serializable object to hold the components definition. This method should be overridden in any sub class of CxComponent where the definition of such component contains additional information not defined in CxComponent.
Overrides:
makeInfo in class CxComponent
Following copied from class: com.dat.cx.CxComponent
Returns:
an empty serializable object which will hold the defintion of a component.

exportInfo

public void exportInfo(com.dat.cx.exec.CxExecComponentInfo info)
Description copied from class: CxComponent
Export the definition of the component into a java serializable object. This method should be overridden in any sub class of CxComponent where the definition of such component contains additional information not defined in CxComponent. The overridden method should call the superclass exportInfo method and then add in the additional information.
Overrides:
exportInfo in class CxComponent
Following copied from class: com.dat.cx.CxComponent
Parameters:
info - the serializable object in which the definition of this component is to be stored.

importInfo

public void importInfo(com.dat.cx.exec.CxExecComponentInfo info)
Description copied from class: CxComponent
Import the definition of the component from a java serializable object. This method should be overridden in any sub class of CxComponent where the definition of such component contains additional information not defined in CxComponent. The overridden method should call the superclass importInfo method and then import the additional information.
Overrides:
importInfo in class CxComponent
Following copied from class: com.dat.cx.CxComponent
Parameters:
info - the serializable object in which the definition of this component is stored.