PCE version 4C man_modulenamespaceid_tablemodified current_idOIxN class/nodeN referenceC hash_tablerefersizeOIxNbothI sNM.node.S.sort_sonsCman_method_card identifiermodule last_modifiednamesummary descriptionsee_alsoinherit diagnosticsdefaultsbugsOIxNM.node.S.sort_sonsRICdateOIx7ü"N sort_sonsnCstringOIx_Sort the chain of <-nodes, just like `chain->sort', and update the hierarchy layout afterwards.nnnnnsNM.node.G.containsOIxNM.node.G.containsRIOIx*´~‰NcontainsnnCchainsizeOIxIeN$class/tree$M.tree.G.containsENM.node.G.contained_inXnnnnsN M.node.S.moveOI xN M.node.S.moveRIOI x*´Œ9NmovenOI xIMake the argument node a direct son of this node. Succeeds without doing anything if the argument is already a son. Fails silently if one of the following is the case: 1) The argument node is in another tree 2) This node is not part of a tree 3) The argument node is this node 4) The argument node is a parent of this nodeOI xIEN M.node.S.sonXnnnnsNM.node.S.delete_treeOI xNM.node.S.delete_treeRIOIx:ŻrN delete_treenOIxÓDeletes the entire subtree starting at this node. Node that if any subnode of this node is still connected to the root through another chain of parents it will *not* be deleted from the tree. See also ->unlinkOIxIENM.node.S.deleteXnnnnsN M.node.G.findOIxN M.node.G.findRIOIx66ňĄNfindnOIxŽTraverses the tree in a depth-first fashion until code can be executed successfully on a node and then returns this node. See also ->for_all.OIxIeNM.node.G.find_nodeeNM.node.S.for_allEN $examples$7XnOIx"Fails if code fails for all nodes.nnsN V.node.imageCman_variable_card identifiermodule last_modifiednamesummary descriptionsee_alsoinheritdefaultsOIxN V.node.imageRIOIx?ÁűNimagenOIxěGraphical object that represents the node. This may be any graphical object. Note that class graphical defines some methods that take care of the fact that they are part of a tree. See `graphical<-node' and `graphical<-contained_in'.OIxIeN&$class/graphical$M.graphical.G.converteN#$class/graphical$M.graphical.G.nodeXnnsNM.node.S.is_parentOIxNM.node.S.is_parentRIOIx*´†ąN is_parentnOIxYSucceeds if the argument is an (indirect) parent of this node. Fails silently otherwise.OIxIENM.node.S.is_sonXnnnnsNM.node.G.find_nodeOIxNM.node.G.find_nodeRIOIx*´{SN find_nodenOI x‹Find node (either myself or a node in the subtree of which this node is the root) that has `node <-image' equal to the specified graphical.OI!xIeN#$class/graphical$M.graphical.G.nodeEN M.node.G.findXnnnnsN M.node.S.sonOI"xN M.node.S.sonRIOI#x>c9NsonnOI$xîMakes the argument node a son of this node. This is the most common way to build a hierarchy. If before is @nil or @default, the child is added at the end of the <-sons chain. Otherwise it is added just in front of the before argument.OI%xIeN V.node.sonsEN M.node.S.moveXnOI&x‰# already in a tree Argument node is member of another tree. # should be in a tree The receiver node is not in a tree.nnsNM.node.G.convertOI'xNM.node.G.convertRIOI(x0´‘ĂNconvertnOI)x=Create node for graphical object. This method may be used to expand the tree by adding graphical objects rather than nodes. Note however that the actually stored object will be the node: ?- new(@t, tree(text(animal))), ?- get(@t, root, Root) Root = @345263 ?- get(@345263, class_name, Class) Class = node.OI*xIENM.node.S.initialiseXnnnnsN M.node.S.swapOI+xN M.node.S.swapRIOI,x*´oNswapnOI-x'Swap the images of the specified nodes.OI.xIENM.node.S.swap_treeXnnnOI/x‡This method manipulates the images rather than the nodes as done by most of the other methods manipulating the layout of the hierarchy.sNM.node.S.swap_treeOI0xNM.node.S.swap_treeRIOI1x*´‘„N swap_treenOI2xSwap the subtrees formed by both nodes. It performs the following steps: 1) Identify common parents and swap the positions in the parent <-sons chain. 2) Swaps the <-parents chain between both nodes 3) Destroy and recreate the necessary connections.OI3xIEN M.node.S.swapXnOI4xyFails silently if: 1) The nodes are not in the same tree or not in a tree at all 2) One node is a parent of the othernnsN V.node.sonsOI5xN V.node.sonsRIOI6x*´NsonsnOI7xťChain holding all immediate sub-nodes. The nodes are displayed left-to-right or top-to-bottom in the order they appear in this chain. This order may be changed using `node ->move_after'.OI8xIEN M.node.S.sonXnnsNM.node.S.for_someOI9xNM.node.S.for_someRIOI:x0ľŸüNfor_somenOI;xcEquivalent to `node ->for_all', but ignores the exit-status of the executed code. Succeeds always.OIx:Żr NunlinknOI?x—Equivalent to `node->delete': removes node from the tree binding all sons to all parents of this node. To remove an entire subtree, see ->delete_tree.OI@xIENM.node.S.deleteXnnnnsNM.node.S.for_allOIAxNM.node.S.for_allRIOIBx9ů; Nfor_allnOICx Invokes itself recursively on all `node<-sons' of this node and finally runs `code' on the receiving node. Note that multiple-inheritance will cause some nodes to be visited more than once. Argument binding: @arg1: Node object. See also <-find. NOTE: Upto version 5.0.9, the execution order was different: code was first executed on the node and then on the <-sons. The current order allows for deleting nodes.OIDxIeN M.node.G.findeNM.node.S.for_someEN$class/tree$M.tree.S.for_allXnOIExOTerminates immediately with failure if code could not be executed fro some nodenOIFx\`Node ->for_all' is not safe when the executed code manipulates the subtree below this node.sNM.node.S.initialiseOIGxNM.node.S.initialiseRIOIHx0ľN initialisenOIIx8Create a node from an arbitrary graphical object. Nodes may be created from any graphical object, including devices, dialog_items and even trees. A typical way to build a tree is the following: ?- new(T, tree(new(Root, node(text(anything))))), send(Root, son, new(S0, node(text(living_thing)))), ...OIJxIENM.node.G.convertXnnnnsNM.node.S.deleteOIKxNM.node.S.deleteRIOILx*´„>NdeletenOIMx‹Deletes node from the tree. Each of the sons of this node will be connected to each of the parents of this node. The root of the tree may be deleted with this method. If this node has no sons, `tree <-root' will be set to @nil. Otherwise the first son of this node will be made the new root of the tree. When the `tree <-display_root' is deleted, it is set to the first parent of this node.OINxIeNM.node.S.unlinkENM.node.S.delete_treeXnnnOIOxGDeleting the root of a tree that has multiple sons is not well defined.sNM.node.G.contained_inOIPxNM.node.G.contained_inRIOIQx?Áä÷N contained_innOIRxˆReturn <-tree. Fails if the node is not attached to a tee object. See `visual<-contained_in' for a general description of this method.OISxIeN$class/tree$M.tree.G.containsENM.node.G.containsXnnnnsNV.node.displayedOITxNV.node.displayedRIOIUx*´…N displayednOIVxƒWhen @off, the node is invisible either because it is above `tree <-display_root' or below a node that has `node <-collapsed: @on'.OIWxIeN$class/tree$M.tree.S.zoomENV.node.collapsedXnnsNM.node.S.is_sonOIXxNM.node.S.is_sonRIOIYx*´‰ŸNis_sonnOIZxWSucceeds if argument node is an (indirect) son of this node. Fails silently otherwise.OI[xIENM.node.S.is_parentXnnnnsNC.nodeCman_class_card identifiermodule last_modifiednamesummary descriptionsee_alsoinherituser_interfacebugsOI\xNC.nodeRIOI]x0ľ§šNnodenOI^x A `node' represents a node in a tree object. A node is a kind of `wrapper' around an arbitrary graphical representing the image of the node. A node maintains it's relations to the tree, it's parent node(s) and it's child nodes. Class node defines the methods to make a tree editable. See ->delete, ->son, ->delete_tree, etc. The HierarchyEditor demo may be used as a starting point for manipulating hierarchies.OI_xIeN#$class/graphical$M.graphical.G.nodeeN$class/tree$C.treeXnnnsNM.node.S.eventOI`xNM.node.S.eventRIOIax<ĹFëNeventnOIbx/`Node->event' is a little different from the other refinements of `graphical->event' as class node is not a subclass of graphical. It is invoked from `tree->event' and allows for adding behaviour to nodes regardless of the underlying graphicals. The default method uses `central' handler objects from the associated <-tree: a) If it is collapsed, run <-collapsed_handlers b) If it is a leaf, run <-leaf_handlers c) If it is the display_root, run <-root_handlers d) else, run <-node_handlers In each of the cases a) to d), `run' means invoke the following message for each of the members of the handler-chain: `event ->post: graphical, recogniser' If you wish to refine this method, please be aware that the normal schema described with `graphical->event' does not work for nodes. Here is a skeleton implementation: :- pce_global(@my_node_recogniser, make_my_node_recogniser). make_my_node_recogniser(G) :- ... event(Node, Ev:event) :-> ( send_super(Node, event, Ev) -> true ; send(Ev, post, Node?image, @my_node_recogniser) ).nnnnnsNV.node.collapsedOIcxNV.node.collapsedRIOIdx4`uîN collapsednOIex‘When @on, the image related to this node is displayed, but all subnodes will be made invisible. `Node ->collapsed' and `tree ->zoom' make it possible to visualise only a small part of a large tree. A tree might contain multiple `collapsed' nodes. If the tree is displayed using `tree ->direction: list', an image is displayed at the left-hand of the line connecting the node to its parent. This image depends on the value of <-collapsed: # @on Show a [+] sign (Pce.Tree.collapsedImage). If the user lef-clicks on this sign, a message ->collapsed: @off is sent to the node. # @off Show a [-] sign (Pce.Tree.expandedImage). If the user lef-clicks on this sign, a message ->collapsed: @on is sent to the node. # @nil Shows nothing, no events are handled for collapse/expand. See library(pce_toc) for an example and a starting point the visualisation of a hierarchy. See also `tree ->direction'.OIfxIeN$class/tree$M.tree.S.zoomeNV.node.displayedEN&$class/tree$M.tree.S.collapsed_handlerXnnsN V.node.levelOIgxN V.node.levelRIOIhx*´ŠäNlevelnOIixÁInteger representing the distance from the `tree<-display_root' node. The node `tree<-display_root' has level 0. This variable is updated by `tree ->compute', which scans the tree depth-first.nnnsNM.node.S.move_afterOIjxNM.node.S.move_afterRIOIkx5up^N move_afternOIlxEIf node and the argument are immediate sons of the same parent, the receiver is placed immediately after the argument node. If the argument is @default, the receiver is placed at the end chain of sons (making it the lowest or rightmost node). If the argument is @nil, the receiver is places at the start of the chain of sons.OImxIEN!$class/chain$M.chain.S.move_afterXnnnOInx=Not well defined when the receiver node has multiple parents.sNM.node.S.unzoomOIoxNM.node.S.unzoomRIOIpx*´“NunzoomnOIqx8Invokes `tree ->unzoom', unzooming the tree to its root.OIrxIeN M.node.S.zoomEN$class/tree$M.tree.S.unzoomXnnnnsNV.node.parentsOIsxNV.node.parentsRIOItx*´ŽtNparentsnOIuxÇChain of parent nodes of this node. For the `tree <-root' node this is the empty chain. Nodes may have multiple parents, but many methods of the classes tree and node are ill-defined for this case.nnnsNM.node.S.unrelateOIvxNM.node.S.unrelateRIOIwx*´’ŚNunrelatenOIxxˆDelete the direct relation between this node and the argument. Removes all nodes that have no relation to the root of the tree anymore.nnOIyxzoom', giving this node as the argument. This will make node the root of the visible part of the hierarchy.OI}xIeNM.node.S.unzoomEN$class/tree$M.tree.S.zoomXnnnnsNV.node.sons_sizeOI~xNV.node.sons_sizeRIOIx*´ÎN sons_sizenOI€xlCombined height (width) of the entire subtree starting at this node. Part of the automatic layout mechanism.OIxIENV.node.my_sizeXnnsNV.node.my_sizeOI‚xNV.node.my_sizeRIOIƒx*´ŽNmy_sizenOI„xwHeight (or width if `tree <-direction' equals vertical) or the graphical image represented. Part of the layout system.OI…xIENV.node.sons_sizeXnnXaCnumber O I†xx