11.9: Subviews
- Page ID
- 45940
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)
A node is a view in itself. This allows for a graph to be embedded in any node. The embedded view is physically bounded by the encapsulating node. The embedding is realized via the keywords nodes:forEach:
and node:forIt:
.
The following example approximates the dependencies between methods by linking methods that may call each other. A method m1
is connected to a method m2
if m1
contains a reference to the selector #m2
. This is a simple but effective way to see the dependencies between methods. Consider:
view nodes: ROShape withAllSubclasses forEach: [:cls | view nodes: cls methods. view edges: cls methods from: #yourself toAll: [ :cm | cls methods select: [ :rcm | cm messages anySatisfy: [:s | rcm selector == s ] ] ]. view treeLayout ]. view interaction action: #browse. view edgesFrom: #superclass. view treeLayout.
A subview contains its own layout. Interactions and shapes defined in a subview are not accessible from a nesting node (Figure \(\PageIndex{1}\)).