Goovi
Class AmosNode

Goovi.AmosNode
Direct Known Subclasses:
AmosTree

public class AmosNode

Class for the AmosNode which is a graphical object corresponding to an Amos II object. AmosNode class extends the JCOutlinerFolderNode class, which means that AmosNode objects can be put in a JCOutliner-tree both as a parent node and as a leaf node. (Really a foldernode without any shortcut button.) The AmosNode inherits an icon from the JCOutlinerFolderNode, which in Goovi is used to determine the type. This is the same approach used for files in most windowing operating systems. Another attribute inherited from the JCOutlinerFolderNode is the label, which in it simplest form is a textstring displayed immediately to the right of the icon. In windowing operating systems this is used for the filename of the specific file. In Goovi it is used for the result of the name function applied to the object or if the name function is not defined the string #[OID nn] where nn is the oid number. This is the same approach as in Jasmine [CF96]. The setting of a correct icon of an AmosNode is done by calling the static method getIcon in the class IconHandler, which takes a type-name as a string and returns an object of type java.awt.Image which can be set to the JCOutlinerNodeStyle-attribute with the methods setItemIcon, setFolderOpenIcon an setFolderClosedIcon.

Attributes



AmosNode objects have three important attributes: The oid-reference is only set if this AmosNode visualizes a surrogate Amos II object. The node-style holds the style of this nodes appearance, specialized compared to the base-class and types-name is cashed after either being supplied in the constructor or fetched from the AMOS II-kernel.


Constructor Summary
AmosNode()
          Empty contructor for dummy nodes.
AmosNode(callin.Oid theOid)
          Constructor that creates an AmosNode object from an Amos oid.
AmosNode(callin.Oid theOid, boolean isFolder)
          Constructor that creates an AmosNode object from an Amos oid and a string to be put in the first column on the right side of the node.
AmosNode(callin.Oid theOid, java.lang.Object column)
          Constructor that creates an AmosNode object from an Amos oid and a string to be put in the first column on the right side of the node.
AmosNode(java.lang.String name, java.lang.String typename)
          Constructor that creates an AmosNode object from two strings.
AmosNode(java.lang.String name, java.lang.String typename, boolean isFolder)
          Constructor that creates an AmosNode object from two strings and a boolean flag to make it a folder or not.
 
Method Summary
 void addColumn(java.lang.Object obj)
          Method to add a column to this node.
 java.lang.String getLabelString()
          Method to retrieve the label of this AmosNode.
 callin.Oid getOid()
          Method to retrieve the oid of the corresponding Amos object.
 java.lang.String getType()
          Method to retrieve the name of the type of this AmosNode as a string.
 boolean isFolder()
          Method to see if this node has children or not.
 void makeMultInher()
          Method to make the node a main node.
 void makeStub()
          Method to make the node a stub node.
 void setToFolder(boolean isFolder)
          Method to set the shortcut of this node.
 java.lang.String toString()
          Method to retrieve the label of this AmosNode.
 

Constructor Detail

AmosNode

public AmosNode()
Empty contructor for dummy nodes. Useful for invisible roots. *

AmosNode

public AmosNode(java.lang.String name,
                java.lang.String typename)
Constructor that creates an AmosNode object from two strings. This is used for special Goovi nodes which has no correspondance to any Amos object. For example collection-nodes nil-nodes etc.
Parameters:
name - The name of the node stated next to the icon.
typename - The name of the type of the icon.

AmosNode

public AmosNode(java.lang.String name,
                java.lang.String typename,
                boolean isFolder)
Constructor that creates an AmosNode object from two strings and a boolean flag to make it a folder or not. This is used for special Goovi nodes which has no correspondance to any Amos object. For example collection-nodes nil-nodes etc.
Parameters:
name - The name of the node stated next to the icon.
typename - The name of the type of the icon.
isFolder - boolean to determine if this node is a folder or a leaf.

AmosNode

public AmosNode(callin.Oid theOid,
                java.lang.Object column)
         throws callin.AmosException
Constructor that creates an AmosNode object from an Amos oid and a string to be put in the first column on the right side of the node.
Parameters:
oid - The name of the node stated next to the icon.
column - The object to be put in the first column.

AmosNode

public AmosNode(callin.Oid theOid)
         throws callin.AmosException
Constructor that creates an AmosNode object from an Amos oid.
Parameters:
oid - The name of the node stated next to the icon.

AmosNode

public AmosNode(callin.Oid theOid,
                boolean isFolder)
         throws callin.AmosException
Constructor that creates an AmosNode object from an Amos oid and a string to be put in the first column on the right side of the node.
Parameters:
theOid - The name of the node stated next to the icon.
typename - The name of the type of the icon.
Method Detail

setToFolder

public void setToFolder(boolean isFolder)
Method to set the shortcut of this node. True means that it represents a folder node and false means it is a leaf node.

isFolder

public boolean isFolder()
Method to see if this node has children or not.

makeStub

public void makeStub()
Method to make the node a stub node. Used in display of multiple inheritance. The stub nodes are all parents after the first one which is the main node.

makeMultInher

public void makeMultInher()
Method to make the node a main node. Used in display of multiple inheritance. The main node is the first parent node.

getOid

public final callin.Oid getOid()
Method to retrieve the oid of the corresponding Amos object.

getType

public final java.lang.String getType()
Method to retrieve the name of the type of this AmosNode as a string. Either an Amos type or a Goovi AmosNode type such as collection, nil etc.

getLabelString

public final java.lang.String getLabelString()
Method to retrieve the label of this AmosNode. The string stated next to the icon.

toString

public final java.lang.String toString()
Method to retrieve the label of this AmosNode. The string stated next to the icon.

addColumn

public final void addColumn(java.lang.Object obj)
Method to add a column to this node.
Parameters:
obj - The object to be put in the new column.