|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
|
+--javax.swing.tree.DefaultMutableTreeNode
|
+--jade.tools.sniffer.TreeData
Class TreeData represents Agents, Containers and Agent-platforms in the Gui. The Object "TreeData" is a local representation of all the knowledge we have about an agent TreeData are FSM with only two states (RUNNING and SUSPENDED) and with four different levels (SUPER_NODE, AGENT_PLATFORM, CONTAINER, AGENT). The graphic representation of the state is given only for Agents, but Platforms and containers have their own state, too. The method loadChildren() must be rewritten to work properly
| Field Summary | |
protected java.lang.String[] |
addresses
|
static java.lang.String |
AddSeparator
|
static int |
AGENT
|
static int |
AGENT_PLATFORM
|
static int |
CONTAINER
|
protected static java.lang.String |
ContainerToolTip
|
protected int |
currentState
|
protected boolean |
hasLoaded
|
protected static javax.swing.Icon[] |
icons
|
protected int |
Level
|
protected static java.lang.String[] |
LevelsNames
|
protected java.lang.String |
name
|
static int |
RUNNING
|
protected static java.lang.String[] |
statesNames
|
static int |
SUPER_NODE
|
protected static java.lang.String |
SuperNodeToolTip
|
static int |
SUSPENDED
|
protected java.lang.String |
type
|
| Fields inherited from class javax.swing.tree.DefaultMutableTreeNode |
allowsChildren,
children,
EMPTY_ENUMERATION,
parent,
userObject |
| Constructor Summary | |
TreeData(java.lang.String t)
Defines a Agent with specific name |
|
TreeData(java.lang.String t,
int LevelP)
Defines a Node with specific name, addresses, type and Level |
|
TreeData(java.lang.String nameP,
java.lang.String[] addressesP,
java.lang.String typeP)
Defines a Node with specific name, addresses, type and Level |
|
TreeData(java.lang.String nameP,
java.lang.String[] addressesP,
java.lang.String typeP,
int LevelP)
Defines a Node with specific name, addresses, type and Level |
|
| Method Summary | |
void |
addAddress(java.lang.String newAdd)
Adds an address to a node |
java.lang.String |
getAddressesAsString()
Returns the addresses of a node as a string |
int |
getChildCount()
If the children have not yet been loaded, loadChildren is messaged and super is messaged for the return value. |
javax.swing.Icon |
getIcon()
Returns an icon represententing the Level or the state if this is an Agent |
int |
getLevel()
Returns the level of a node |
java.lang.String |
getName()
Returns the name of the agent |
java.lang.String |
getStateName()
Returns the state name of a node |
java.lang.String |
getToolTipText()
Returns the ToolTipText of a node |
java.lang.String |
getType()
Returns the type of a node of a node |
boolean |
isLeaf()
A node is a Leaf only if it is an agent |
protected void |
loadChildren()
Messaged the first time getChildCount is messaged. |
void |
setAddresses(java.lang.String[] aP)
Sets the address of a node |
boolean |
setLevel(int LevelP)
Sets the level of a node |
void |
setName(java.lang.String nameP)
Sets a name of a node |
boolean |
setState(int state)
Sets the state of an agent in a node |
void |
setType(java.lang.String r)
Sets the type of a node |
java.lang.String |
toString()
|
void |
transState()
forces the Agent to go from current state to the other state |
| Methods inherited from class javax.swing.tree.DefaultMutableTreeNode |
add,
breadthFirstEnumeration,
children,
clone,
depthFirstEnumeration,
getAllowsChildren,
getChildAfter,
getChildAt,
getChildBefore,
getDepth,
getFirstChild,
getFirstLeaf,
getIndex,
getLastChild,
getLastLeaf,
getLeafCount,
getNextLeaf,
getNextNode,
getNextSibling,
getParent,
getPath,
getPathToRoot,
getPreviousLeaf,
getPreviousNode,
getPreviousSibling,
getRoot,
getSharedAncestor,
getSiblingCount,
getUserObject,
getUserObjectPath,
insert,
isNodeAncestor,
isNodeChild,
isNodeDescendant,
isNodeRelated,
isNodeSibling,
isRoot,
pathFromAncestorEnumeration,
postorderEnumeration,
preorderEnumeration,
remove,
remove,
removeAllChildren,
removeFromParent,
setAllowsChildren,
setParent,
setUserObject |
| Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Field Detail |
public static final int SUSPENDED
public static final int RUNNING
public static final java.lang.String AddSeparator
public static final int SUPER_NODE
public static final int AGENT_PLATFORM
public static final int CONTAINER
public static final int AGENT
protected static java.lang.String ContainerToolTip
protected static java.lang.String SuperNodeToolTip
protected static java.lang.String[] statesNames
protected static java.lang.String[] LevelsNames
protected static javax.swing.Icon[] icons
protected java.lang.String name
protected java.lang.String type
protected int currentState
protected int Level
protected java.lang.String[] addresses
protected boolean hasLoaded
| Constructor Detail |
public TreeData(java.lang.String nameP,
java.lang.String[] addressesP,
java.lang.String typeP,
int LevelP)
nameP - name of the nodeaddressesP - array of addressestypeP - type of the nodeLevelP - level of the node
public TreeData(java.lang.String nameP,
java.lang.String[] addressesP,
java.lang.String typeP)
nameP - name of the nodeaddressesP - array of addressestypeP - type of the node
public TreeData(java.lang.String t,
int LevelP)
t - name of the nodeLevelP - level of the nodepublic TreeData(java.lang.String t)
t - name of the node| Method Detail |
public javax.swing.Icon getIcon()
public java.lang.String getName()
public void setName(java.lang.String nameP)
nameP - name of the nodepublic void setAddresses(java.lang.String[] aP)
aP - array of addresses for the nodepublic java.lang.String getAddressesAsString()
public java.lang.String getType()
public void setType(java.lang.String r)
r - type of the nodepublic boolean setState(int state)
state - state of the agentpublic void transState()
public java.lang.String getStateName()
public int getLevel()
public boolean setLevel(int LevelP)
levelP - level of the nodepublic java.lang.String toString()
public java.lang.String getToolTipText()
public void addAddress(java.lang.String newAdd)
newAdd - new address to add to a nodepublic boolean isLeaf()
public int getChildCount()
protected void loadChildren()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||