summaryrefslogtreecommitdiff
path: root/info/examples/PSTricks_7_de/31-02-17.ltx
blob: b35f1af0f65aa9ad307d1962c67a0937c94d8b37 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
%% 
%%  Ein Beispiel der DANTE-Edition
%%  
%%  7. Auflage
%% 
%%  Beispiel 31-02-17 auf Seite 697.
%% 
%%  Copyright (C) 2016 Herbert Voss
%% 
%%  It may be distributed and/or modified under the conditions
%%  of the LaTeX Project Public License, either version 1.3
%%  of this license or (at your option) any later version.
%% 
%%  See http://www.latex-project.org/lppl.txt for details.
%% 
%% 
%% ==== 
% Show page(s) 1
%% 
%% 
\documentclass[]{exaarticle}
\pagestyle{empty}
\setlength\textwidth{352.81416pt}
\setlength\parindent{0pt}
%StartShownPreambleCommands
\usepackage{uml}
%StopShownPreambleCommands
\begin{document}
\umlDiagram[box=,sizeX=11cm,sizeY=14cm,ref=ADTdiagram,grayness=0.92]{}% End of diagram
\umlSchema[pos=\umlTopRight{ADTdiagram},posDelta={-.5,-.5},refpoint=tr]{ADT}{% Attributes
  \umlAttribute[visibility,type=String]{name}}{}{}{}{}
\umlSchema[pos=\umlTopLeft{ADTdiagram},posDelta={.5,-1},refpoint=lt,abstract,
  ref=ADTexample]{ADT-example}{%
  \umlAttribute[visibility=-,
    type=\emph{\umlColorsArgument\umlColorsAdjust type},default=null]{firstNode}
  }{%Methods
  }{%Arguments
    \umlArgument[type=Metaclass]{type}
  }{%Constraints
  }{%Structure
    \umlDiagram[box=,innerBorder=2mm,outerBorder]{%
      \umlClass[pos={.5,.5}, ref=adtNode,box=]{Node}{%
        \umlAttribute[visibility,
            type=\emph{\umlColorsArgument\umlColorsAdjust type}]{data}}{}%
      \umlAssociation[angleA=20, angleB=-20,arm=1em,arm=1em]{adtNode}{adtNode}%
    }\cr% End of Diagram
  }% End of ADT-example
\umlInstance{ADTexample}{ADT}%
\umlSchema[pos=\umlRight{ADTexample},posDelta={3,-1},refpoint=tl, ]{Graph}{% Attributes
  }{% Methods
    \umlMethod[visibility,]{insert}{\emph{\umlColorsArgument\umlColorsAdjust type} x}
    \umlMethod[visibility,type=\emph{\umlColorsArgument\umlColorsAdjust type}]{%
       dijkstra}{\emph{\umlColorsArgument\umlColorsAdjust type} x}
    \umlMethod[visibility, type=boolean]{%
      insertEdge}{\emph{\umlColorsArgument\umlColorsAdjust type} x}
    \umlMethod[visibility, ]{delete}{\emph{\umlColorsArgument\umlColorsAdjust type} x}
  }{% Arguments
  }{% Constraints
  }{% Structure
    \umlDiagram[box=,innerBorder=2mm,outerBorder,sizeX=11em,sizeY=3.5em,ref=GraphDiagram]{%
       \begin{umlColors}{\umlColorsSub}
    \umlClass[pos=\umlBottomLeft{GraphDiagram},
                  posDelta={1,1}, ref=graphNode]{Node}{}{}%
        \umlAssociation[angleA=20,angleB=-20,armA=1em,armB=1em]{graphNode}{graphNode}%
           \end{umlColors}
          \umlLabelA[height=0mm,offset=1ex]{graphNodegraphNode}{*}%
          \umlLabelB[height=0mm,offset=1ex,refpoint=t]{graphNodegraphNode}{*}%
        \umlSymbol[fraction=.5]{graphNodegraphNode}{\pnode{gngn}}
        \umlClass[pos=gngn,posDelta={2,0},ref=graphEdge, refpoint=l]{Edge}{%
        \umlAttribute[type=real]{cost}}{}%
      \umlAssociationClass[]{graphEdge}{gngn}%
      }\cr% End of diagram
    }% End of Graph
  \umlSubclass{Graph}{ADTexample}
  \umlSchema[posX=\umlLeft{ADTexample}, posDelta={3em,-1em},posY=\umlBottom{Graph},
             refpoint=tl, ref=searchTree]{Search Tree}{% Attributes
    }{% Methods
    \umlMethod[visibility,]{%
      insert}{\emph{\umlColorsArgument\umlColorsAdjust type} x}
    \umlMethod[visibility,
         type=\emph{\umlColorsArgument\umlColorsAdjust type}]{%
      search}{\emph{\umlColorsArgument\umlColorsAdjust type} x}
    \umlMethod[visibility, type=boolean]{%
      search}{\emph{\umlColorsArgument\umlColorsAdjust type} x}
    \umlMethod[visibility, ]{%
      delete}{\emph{\umlColorsArgument\umlColorsAdjust type} x}
    }{% Arguments
    \umlArgument[type=Integer, initialValue=2]{arity}
    \umlArgument[type={${\umlColorsArgument\umlColorsAdjust type}
      \times {\umlColorsArgument\umlColorsAdjust type}\rightarrow$
        boolean}, default=>]{sort}
    }{% Constraints
    }{% Structure
      \umlDiagram[box=,sizeX=14em,sizeY=4em,innerBorder=2mm,outerBorder]{%
        \begin{umlColors}{\umlColorsSub}
        \umlClass[pos={.5, .5}, ref=treeNode]{Node}{}{}%
        \umlAssociation[angleA=30,angleB=-30,armA=1em,armB=1em]{treeNode}{treeNode}%
         \end{umlColors}
          \umlLabelA[height=1mm,offset=4mm,refpoint=l]{treeNodetreeNode}{%
            \emph{\umlColorsArgument\umlColorsAdjust arity}}%
          \umlLabelB[refpoint=tl,height=-1mm,offset=4mm]{treeNodetreeNode}{1}%
        }\cr% End of diagram
    }%
  \umlSubclass{searchTree}{ADTexample}%
\end{document}