PCE version 4C man_modulenamespaceid_tablemodified current_idOIxN class/treeN referenceC hash_tablerefersizeOIxNbothI sN M.tree.S.zoomCman_method_card identifiermodule last_modifiednamesummary descriptionsee_alsoinherit diagnosticsdefaultsbugsOIxN M.tree.S.zoomRICdateOIx*wuNzoomnCstringOIx`Zoom' in for a particular subtree. The visualisation of the tree will behave as if the argument-node of this method is the root. Sets the variable `tree <-display_root'.CchainsizeOIxIeN$class/node$M.node.S.zoomeN$class/node$V.node.displayedeN$class/node$V.node.collapsedeNM.tree.S.unzoomENV.tree.display_rootXnnnnsNM.tree.S.root_handlerOIxNM.tree.S.root_handlerRIOIx*jN root_handlernOI xcAttach a recogniser for the `tree <-display_root' node. See `tree ->event' for the interpretation.OI xIENM.tree.S.eventXnnnnsNV.tree.directionCman_variable_card identifiermodule last_modifiednamesummary descriptionsee_alsoinheritdefaultsOI xNV.tree.directionRIOI x4`vN directionnOI xDefines the layout: # horizontal Root at the left, the sons are displayed left-to-right. # vertical The tree is displayed `top-to-bottom'. # list The tree is displayed as an indented list. The line properties of the <-link are used to determine the thickness, texture and colour of the lines. Each node will, if it has sons, draw a line from (x + <-level_gap/2, bottom side) down to halfway the last son. If to node is not the root, it will draw a line from halfway its height towards the line from its parent. See also `node <->collapsed'. Note: the default tree is displayed left-to-right rather than top-to-bottom as the nodes are often much wider than high. Using left-to-right layout allows for displaying much larger hierarchies. When a large number of items is to be displayed as an indented list, also consider class list_browser. The indentation may be realised using `list_browser ->tab_stops'.nnnsNM.tree.S.eventOIxNM.tree.S.eventRIOIxevent' allows for centralised event-processing for all nodes displayed on the tree. It performs the following steps. 1) Invoke `device ->event'. When successful, succeed. 2) Invoke `node->event' on the node below the pointer. ** Finding the Context Arguments The most reliable way to find the various context objects are: @event?receiver Graphical receiving the event @event?receiver?node Node object for this graphical @event?receiver?device The tree objectOIxI eNM.tree.S.root_handlereNM.tree.S.node_handlereNM.tree.S.leaf_handlereNM.tree.S.collapsed_handlereN#$class/graphical$M.graphical.G.nodeeNV.tree.root_handlerseNV.tree.node_handlerseNV.tree.leaf_handlersENV.tree.collapsed_handlersXnnnnsNM.tree.S.directionOIxNM.tree.S.directionRIOIx*mN directionnnOIxIENV.tree.parent_handleXnnnnsNV.tree.root_handlersOIxNV.tree.root_handlersRIOIx*gN root_handlersnnOIxIENM.tree.S.eventXnnsNM.tree.S.unzoomOIxNM.tree.S.unzoomRIOIx*xNunzoomnOIxEquivalent to: send(Tree, zoom, Tree?root). To unzoom only one level, use send(Tree, zoom, Tree?display_root?parents?head). Note that this method is ambiguous when the display_root has multiple parents.OIxIeN$class/node$M.node.S.unzoomEN M.tree.S.zoomXnnnnsNM.tree.S.node_handlerOIxNM.tree.S.node_handlerRIOIx*jN node_handlernOIxMAttach a recogniser for all nodes. See `tree ->event' for the interpretation.OIxIENM.tree.S.eventXnnnnsNM.tree.S.layoutOI xNM.tree.S.layoutRIOI!x,FNlayoutnOI"x$Recompute the layout of the tree. This method is normally called from ->compute and sends the following three messages to <-display_root: `node ->compute_level' Update the `node<-level' slots `node ->compute_size' Compute the sizes of all nodes `node ->compute_layout' Place the nodesnnnnnsNV.tree.parent_handleOI#xNV.tree.parent_handleRIOI$x*mN parent_handlenOI%xThis handle object is attached to each graphical representing a node. It is the connection-point for a line linking this graphical to its parent. This handle is automatically updated by `tree ->direction'..OI&xIeNV.tree.link_gapeN V.tree.linkeNM.tree.S.directioneNV.tree.son_handleEN$class/handle$C.handleXnnsN V.tree.rootOI'xN V.tree.rootRIOI(x:>NrootnOI)x6Root node of the tree. Note that the root of the visual part of the tree is represented by <-display_root. Class tree delegates messages not understood to its <-root node when present. If the argument is *nil, all nodes are removed from the tree. If the argument is a new root object the behaviour depends on the `relink' argument. With `relink' = @off (default), the tree is first cleared using ->root: @nil, after which the new root is attached. With `relink' = @on the old root is added as the only `node->son' of the new root. See also ->zoom and ->unzoom.OI*xIENV.tree.display_rootXnnsNV.tree.node_handlersOI+xNV.tree.node_handlersRIOI,x*gN node_handlersnnOI-xIENM.tree.S.eventXnnsNC.treeCman_class_card identifiermodule last_modifiednamesummary descriptionsee_alsoinherituser_interfacebugsOI.xNC.treeRIOI/x,}ENtreenOI0xClass `tree' is a subclass of class `device' which displays its graphical objects formatted as a hierarchy. Class `tree' fits well in PCE's target domain: graphical interfaces for structured representations (models). The nodes of a PCE tree may be arbitrary graphical objects (yes, even trees, editors, etc.). Trees allow for multiple inheritance, but the automatically generated layout is often not optimal when multiple inheritance is used intensively. The automatically generated layouts for hierarchies are top-to-bottom, left-to-right (default) or `indented list'. Class tree itself is responsible for displaying and formatting the nodes of the hierarchy. The hierarchy is defined by `node' objects. A node object refers to a graphical (using `node <->image'), its parent node(s) and its son nodes. Event-handling for trees may be done in two ways. The first is to define event-handling for each of the individual graphicals representing the nodes. The second is to associate recognisers with the tree object itself. Class `tree' defines various different recognisers, activation of which depends on the status of the node. See `tree ->event'.OI1xIeN%$class/graphical$M.graphical.S.layouteN $examples$16EN$class/node$C.nodeXnnnsNM.tree.S.leaf_handlerOI2xNM.tree.S.leaf_handlerRIOI3x*jN leaf_handlernOI4xqAttach a recogniser for all nodes that have no sons (i.e. are leaves). See `tree ->event' for the interpretation.OI5xIENM.tree.S.eventXnnnnsNM.tree.S.neighbour_gapOI6xNM.tree.S.neighbour_gapRIOI7x*kN neighbour_gapnnOI8xIENV.tree.neighbour_gapXnnnnsN V.tree.linkOI9xN V.tree.linkRIOI:x,KNlinknOI;x(Link used to create connections between parent- and son-nodes. Its attributes may be changed to attach arrows or modify one of the line attributes. For example, send(Tree?link, arrows, first). will attach an arrow pointing to the root to every relation created after this call has been made.OIx5}TTN neighbour_gapnOI?xDistance between two nodes that are at the same level (= distance from the root). The default (0) satisfies when the nodes are represented by text object. For other graphicals a small positive value gives better results.OI@xIeNM.tree.S.level_gapENM.tree.S.neighbour_gapXnnsNV.tree.son_handleOIAxNV.tree.son_handleRIOIBx0N son_handlenOICxdSimilar to `tree <-parent_handle', but is the connection-point for the connection towards son-nodes.OIDxIeNV.tree.link_gapeN V.tree.linkENV.tree.parent_handleXnnsNV.tree.link_gapOIExNV.tree.link_gapRIOIFx*nNlink_gapnOIGxxDistance between the image and the line. Used to define the X- and Y-positions of the <-son_handle and <-parent_handle.OIHxIeNV.tree.parent_handleeNV.tree.son_handleEN V.tree.linkXnnsNM.tree.S.for_someOIIxNM.tree.S.for_someRIOIJx*x5Nfor_somennOIKxIENM.tree.S.for_allXOILxIENM.tree.S.for_allXnnnsNV.tree.leaf_handlersOIMxNV.tree.leaf_handlersRIOINx*gN leaf_handlersnnOIOxIENM.tree.S.eventXnnsNV.tree.display_rootOIPxNV.tree.display_rootRIOIQx,K#N display_rootnOIRxZRoot of the visible part of the tree. This variable is managed using ->zoom and ->unzoom.OISxIEN V.tree.rooteN M.tree.S.zoomXnnsNM.tree.S.level_gapOITxNM.tree.S.level_gapRIOIUx*XN level_gapnnOIVxIENV.tree.neighbour_gapXnnnnsNV.tree.level_gapOIWxNV.tree.level_gapRIOIXx*XN level_gapnOIYx0Distance between a node and its parents or sons.nnnsN M.tree.S.rootOIZxN M.tree.S.rootRIOI[x*{NrootnnOI\xIeN$errors$!.already_has_rootENM.tree.S.initialiseXnnnnsNM.tree.S.for_allOI]xNM.tree.S.for_allRIOI^x,KvNfor_allnOI_xInvokes the message to the <-root of the tree, iterating over all nodes of the tree. See also `node ->for_all', `node ->for_some' and <-contains.OI`xIeN$class/node$M.node.S.for_allENM.tree.S.for_someXnnnnsNM.tree.G.containsOIaxNM.tree.G.containsRIOIbx*CNcontainsnOIcxSNew chain holding all node objects in the tree. Its device functionality would be to return the chain of graphicals, holding only the graphicals for the displayed nodes and connections. The contains-hierarchy for trees is defined as follows: tree | node | | image Image (being a graphical) may contain any number of sub-visuals.OIdxIeN+$class/graphical$M.graphical.G.contained_ineN$class/node$M.node.G.containsEN!$class/node$M.node.G.contained_inXnnnnsNM.tree.S.collapsed_handlerOIexNM.tree.S.collapsed_handlerRIOIfx*jNcollapsed_handlernOIgxpAttach a recogniser for all nodes that have `node <->collapsed: @on'. See `tree ->event' for the interpretation.OIhxIeN$class/node$V.node.collapsedENM.tree.S.eventXnnnnsNM.tree.S.computeOIixNM.tree.S.computeRIOIjx,FNcomputenOIkxWhenever something changes to the tree that might affect its layout, this is notified using `graphical ->request_compute'. `tree ->compute' recomputes the layout of the tree by invoking ->layout.nnnnnsNV.tree.collapsed_handlersOIlxNV.tree.collapsed_handlersRIOImx*gxNcollapsed_handlersnnOInxIENM.tree.S.eventXnnsNV.tree.auto_layoutOIoxNV.tree.auto_layoutRIOIpx,FN auto_layoutnOIqxWhen @on (default), the tree will recompute its layout on any change to any of its nodes or change to the tree itself. When @off the tree won't automatically recompute the layout. Sometimes, it is desirable to allow the user to move the nodes of a tree by hand. With <-auto_layout: @on this is not possible as the tree will immediately move the node back to the original position. See also ->compute and ->layout.nnnsNM.tree.S.initialiseOIrxNM.tree.S.initialiseRIOIsx0kN initialisenOItx+Create a tree object and assign it a root. When the root is @nil (default), the tree must be assigned a root using `tree ->root' before any other nodes may be attached. Note that class node defines a convert method for graphicals that creates a node with the specified graphical as `node <-image'.OIuxIEN M.tree.S.rootXnnnnXaCnumber O Ivxx