com.dat.cx
Class CxPort

java.lang.Object
  |
  +--com.dat.cx.CxComponent
        |
        +--com.dat.cx.CxPort
All Implemented Interfaces:
CxExtendsListener, CxListener, CxPortInterface, CxSource, java.util.EventListener, com.d_a_t.expeval.ExpressionContext
Direct Known Subclasses:
CxCatchPort, CxErrorPort, CxInterface, CxMiniPort, CxPin, CxXmlPort

public class CxPort
extends CxComponent
implements CxSource, CxListener, CxPortInterface

CxPort provides semantics for a port component. This include forwarding of all received events to all registered listeners.


Fields inherited from class com.dat.cx.CxComponent
compactDisplay, noHatDisplay, standardDisplay
 
Fields inherited from interface com.dat.cx.CxPortInterface
COMPOSITE, EVENT, INTERFACE, METHOD, PROVIDES, USES
 
Constructor Summary
CxPort()
          Default constructor
CxPort(java.lang.String name, boolean direction)
          Constructor
 
Method Summary
 void addCxListener(CxListener listener)
          Add a Cx listener to the list of listners that will recieved forwarded events.
 XSet export(XSet doc, CxProject project)
          Export the definition of this port (only this component)
 void exportInfo(com.dat.cx.exec.CxExecComponentInfo info)
          Export the definition of the component into a java serializable object.
 java.util.Iterator getCxListeners()
          Get the list of currently registered listeners
 com.dat.cx.studio.CxCompDisplay getDisplay()
          Get the display peer for this port.
 com.dat.cx.studio.CxInternalFrame getEditFrame(com.dat.cx.studio.CxStudio studio)
          Get at edit frame for editing this component.
 java.lang.String getIcon()
          Get the icon file name for this port
 boolean getPortDirection()
          Get the port direction
 boolean hasCxListeners()
          Determine if there are any listners currently registered.
 void importInfo(com.dat.cx.exec.CxExecComponentInfo info)
          Import the definition of the component from a java serializable object.
 void importTemplate(CxComponent from, boolean copy, boolean inherit, boolean inverse)
          Import the definition of a port from another port.
 void inversePortDirection()
          Inverse the port direction.
 boolean isPort()
          Determines if the component is a port
 com.dat.cx.exec.CxExecComponentInfo makeInfo()
          Make an empty serializable object to hold the components definition.
 void recieve(java.util.EventObject event)
          Recieve an event as required by the CxListener interface.
 void removeCxListener(CxListener listener)
          Remove a Cx listener from the list of listeners that will recieved forwarded events.
 void setPortDirection(boolean portDirection)
          Set the port direction.
 
Methods inherited from class com.dat.cx.CxComponent
activate, addChild, addChildAt, addChildAtNoUndo, addChildNoUndo, addChildNoUndoAssign, addComponentChangeListener, addComponentChildrenListener, addExtendsListener, addSortedChild, canAddComponent, canExtendsAdd, componentAdded, componentLocationChanged, componentNameChanged, componentNodeChanged, componentPropertyChanged, componentRemoved, componentWirePortChanged, constructNode, contains, deactivate, 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, importSpec, 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, isPortMgr, isProperty, isRoot, isSubPortOf, isTextInstance, isTypePackage, isVar, isVarInstance, isVarSet, isWire, 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

CxPort

public CxPort()
Default constructor

CxPort

public CxPort(java.lang.String name,
              boolean direction)
Constructor
Parameters:
name - the name of the port
direction - the direction of the port, true for PROVIDES, false for USES
Method Detail

isPort

public boolean isPort()
Determines if the component is a port
Overrides:
isPort in class CxComponent
Returns:
true if the component is a port, 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 port. The display peer handles the rendering of the port within the studio.
Overrides:
getDisplay in class CxComponent
Returns:
the display peer

importTemplate

public void importTemplate(CxComponent from,
                           boolean copy,
                           boolean inherit,
                           boolean inverse)
Import the definition of a port from another port.
Overrides:
importTemplate in class CxComponent
Parameters:
from - the port 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)

export

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

recieve

public void recieve(java.util.EventObject event)
Recieve an event as required by the CxListener interface. This may result in processing the event in some way defined by a subclass, and will then result in forwarding to event to all registered Cx listeners.
Specified by:
recieve in interface CxListener
Parameters:
event - the recieved event

addCxListener

public void addCxListener(CxListener listener)
Add a Cx listener to the list of listners that will recieved forwarded events.
Specified by:
addCxListener in interface CxSource
Parameters:
listener - the listener to add.

removeCxListener

public void removeCxListener(CxListener listener)
Remove a Cx listener from the list of listeners that will recieved forwarded events.
Specified by:
removeCxListener in interface CxSource
Parameters:
listener - the listener to remove from the list

hasCxListeners

public boolean hasCxListeners()
Determine if there are any listners currently registered.
Parameters:
listener - the listener to remove from the list
Returns:
true if the are listeners currently registered, otherwise false.

getCxListeners

public java.util.Iterator getCxListeners()
Get the list of currently registered listeners
Specified by:
getCxListeners in interface CxSource
Returns:
an interator for the list of currently registered listeners.

getPortDirection

public boolean getPortDirection()
Get the port direction
Specified by:
getPortDirection in interface CxPortInterface
Returns:
the port direction, true for PROVIDES, false for USES

setPortDirection

public void setPortDirection(boolean portDirection)
Set the port direction.
Parameters:
portDirection - the new port direction, use true for PROVIDES, false for USES.

inversePortDirection

public void inversePortDirection()
Inverse the port direction.

getIcon

public java.lang.String getIcon()
Get the icon file name for this port
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.