org.primordion.xholon.base
Class Control

java.lang.Object
  extended byorg.primordion.xholon.base.Xholon
      extended byorg.primordion.xholon.base.Control
All Implemented Interfaces:
IXholon

public class Control
extends Xholon

Control for a Xholon application.

Since:
0.3 (Created on December 17, 2005)
Author:
Ken Webb

Field Summary
static int CS_INITIALIZED
           
static int CS_LOADED
           
static int CS_NO_MODEL_LOADED
           
static int CS_PAUSED
           
static int CS_RESETTING
           
static int CS_RUNNING
           
static int CS_STEPPING
           
static int CS_STOPPED
           
 java.lang.String roleName
          Name of a Control object.
static int state
          Current state of the application.
static java.lang.String[] stateName
           
 
Fields inherited from class org.primordion.xholon.base.Xholon
DEFAULT_LEVEL, interaction, interactionsEnabled
 
Fields inherited from interface org.primordion.xholon.base.IXholon
DEFAULT_SIZE_MSG_Q, NINCLUDE_PSC, NINCLUDE_PSx, NINCLUDE_PxC, NINCLUDE_Pxx, NINCLUDE_xSC, NINCLUDE_xSx, NINCLUDE_xxC, NINCLUDE_xxx
 
Constructor Summary
Control()
           
 
Method Summary
 java.lang.String getName()
          Get name, unique within this application, of this Xholon instance.
 java.lang.String getRoleName()
          Get name of the role played by this Xholon within a specific context.
static int getState()
          Get the control state.
 java.lang.String getStateName()
          Get displayable name of the state.
static Control getView()
           
 java.lang.String handleNodeSelection()
          Handle selection of a tree node by a user, as when a person clicks on a JTree node in the default viewer.
 void initialize()
          Initialize the tree node.
static Control setControlTree(XholonClass cntrlClass)
          Set the control tree, and return its root node.
static void setModel(XholonClass ih, IXholon csh)
          Set the model.
 void setRoleName(java.lang.String roleName)
          Set name of the role played by this Xholon within a specific context.
static void setState(int stateArg)
          Set the control state.
 java.lang.String toString()
           
 
Methods inherited from class org.primordion.xholon.base.Xholon
act, appendChild, appendChild, appendChild, cleanup, configure, configure, createStructure, decVal, decVal, depth, draw, getChildNodes, getFirstChild, getFirstSibling, getId, getLastChild, getLastSibling, getNeighbors, getNextId, getNextSibling, getNthChild, getNthSibling, getNumChildren, getNumSiblings, getParentNode, getPort, getPreviousSibling, getRootNode, getSiblings, getSizeMessageQ, getUid, getVal_boolean, getVal_byte, getVal_char, getVal_double, getVal_float, getVal_int, getVal_long, getVal_Object, getVal_short, getVal_String, getVal, getXhc, getXhcId, getXhcName, getXhType, hasAncestor, hasChildNodes, hasChildOrSiblingNodes, hasNextSibling, hasParentNode, height, incVal, incVal, initStatics, inOrderPrint, insertAfter, insertBefore, insertFirstChild, isActiveObject, isBound, isContainer, isExternal, isInternal, isLeaf, isPassiveObject, isRootNode, performActivity, performActivity, performBooleanActivity, performBooleanActivity, performDoubleActivity, performGuard, performVoidActivity, postAct, postConfigure, postOrderPrint, postReconfigure, preAct, preConfigure, preOrderPrint, preReconfigure, print, println, processMessageQ, processReceivedMessage, reconfigure, remove, removeChild, resetNextId, sendMessage, sendMessage, sendMessage, setAttributeVal, setFactory, setFirstChild, setId, setNextSibling, setParentChildLinks, setParentNode, setParentSiblingLinks, setPorts, setSizeMessageQ, setUid, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVariableValue, setXhc, swapNode, terminate, treeSize, writeXml
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CS_NO_MODEL_LOADED

public static final int CS_NO_MODEL_LOADED
See Also:
Constant Field Values

CS_LOADED

public static final int CS_LOADED
See Also:
Constant Field Values

CS_INITIALIZED

public static final int CS_INITIALIZED
See Also:
Constant Field Values

CS_RUNNING

public static final int CS_RUNNING
See Also:
Constant Field Values

CS_PAUSED

public static final int CS_PAUSED
See Also:
Constant Field Values

CS_STEPPING

public static final int CS_STEPPING
See Also:
Constant Field Values

CS_STOPPED

public static final int CS_STOPPED
See Also:
Constant Field Values

CS_RESETTING

public static final int CS_RESETTING
See Also:
Constant Field Values

stateName

public static final java.lang.String[] stateName

state

public static int state
Current state of the application. Since there can only be one Application object in a Xholon system, and an Application only has one root Control object, and only this root Control object has a state, it is OK to make the state static.


roleName

public java.lang.String roleName
Name of a Control object.

Constructor Detail

Control

public Control()
Method Detail

initialize

public void initialize()
Description copied from interface: IXholon
Initialize the tree node. Typically this is only used to re-initialize a node, such as when it is reused through the TreeNodeFactoryStatic.

Specified by:
initialize in interface IXholon
Overrides:
initialize in class Xholon

getName

public java.lang.String getName()
Description copied from interface: IXholon
Get name, unique within this application, of this Xholon instance. The name is a concatenation of the IXholonClass name and the Xholon unique ID. The first letter is converted to lowercase, and a "_" is used to separate the name and ID. ex: "helloWorld_123"

Specified by:
getName in interface IXholon
Overrides:
getName in class Xholon

setControlTree

public static Control setControlTree(XholonClass cntrlClass)
Set the control tree, and return its root node.

Parameters:
cntrlClass - The Control xholon class.
Returns:
The Application xholon class.

setModel

public static void setModel(XholonClass ih,
                            IXholon csh)
Set the model.

Parameters:
ih - The root of the InheritanceHierarchy xholon tree.
csh - The root of the CompositeStructureHierarchy xholon tree.

getView

public static Control getView()

setRoleName

public void setRoleName(java.lang.String roleName)
Description copied from interface: IXholon
Set name of the role played by this Xholon within a specific context.

Specified by:
setRoleName in interface IXholon
Overrides:
setRoleName in class Xholon

getRoleName

public java.lang.String getRoleName()
Description copied from interface: IXholon
Get name of the role played by this Xholon within a specific context.

Specified by:
getRoleName in interface IXholon
Overrides:
getRoleName in class Xholon

setState

public static void setState(int stateArg)
Set the control state. State is used by "Controller".

Parameters:
stateArg - The new state.

getState

public static int getState()
Get the control state.

Returns:
The current state.

getStateName

public java.lang.String getStateName()
Get displayable name of the state.

Returns:
A displayable name.

handleNodeSelection

public java.lang.String handleNodeSelection()
Description copied from interface: IXholon
Handle selection of a tree node by a user, as when a person clicks on a JTree node in the default viewer. Any action performed here should be minimal. Ideally there should be no side effects. WARNING: There may be thread issues.

Specified by:
handleNodeSelection in interface IXholon
Overrides:
handleNodeSelection in class Xholon

toString

public java.lang.String toString()
Overrides:
toString in class Xholon