From 57631eb7000c6edbaef160d73d027dd59d2a118e Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 27 Mar 2014 23:35:09 +0000 Subject: pgf-umlcd (27mar14) git-svn-id: svn://tug.org/texlive/trunk@33307 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/pgf-umlcd/COPYING | 14 + Master/texmf-dist/doc/latex/pgf-umlcd/README | 3 + .../doc/latex/pgf-umlcd/demo/abstract-class.tex | 9 + .../doc/latex/pgf-umlcd/demo/abstract-factory.svg | 791 +++++++++++++++++++++ .../doc/latex/pgf-umlcd/demo/abstract-factory.tex | 69 ++ .../doc/latex/pgf-umlcd/demo/aggregation.tex | 10 + .../doc/latex/pgf-umlcd/demo/association.tex | 22 + .../texmf-dist/doc/latex/pgf-umlcd/demo/class.tex | 10 + .../doc/latex/pgf-umlcd/demo/composition.tex | 10 + .../latex/pgf-umlcd/demo/implement-interface.tex | 16 + .../doc/latex/pgf-umlcd/demo/inheritance.tex | 26 + .../doc/latex/pgf-umlcd/demo/interface.tex | 6 + .../texmf-dist/doc/latex/pgf-umlcd/demo/note.tex | 3 + .../pgf-umlcd/demo/object-include-methods.tex | 10 + .../texmf-dist/doc/latex/pgf-umlcd/demo/object.tex | 6 + .../doc/latex/pgf-umlcd/demo/package.tex | 28 + .../pgf-umlcd/demo/unidirectional-association.tex | 20 + .../doc/latex/pgf-umlcd/demo/visibility.tex | 17 + Master/texmf-dist/doc/latex/pgf-umlcd/logo.png | Bin 0 -> 38004 bytes .../doc/latex/pgf-umlcd/pgf-umlcd-manual.pdf | Bin 0 -> 269669 bytes .../doc/latex/pgf-umlcd/pgf-umlcd-manual.tex | 149 ++++ .../texmf-dist/tex/latex/pgf-umlcd/pgf-umlcd.sty | 353 +++++++++ Master/tlpkg/bin/tlpkg-ctan-check | 2 +- Master/tlpkg/tlpsrc/collection-pictures.tlpsrc | 1 + Master/tlpkg/tlpsrc/pgf-umlcd.tlpsrc | 0 25 files changed, 1574 insertions(+), 1 deletion(-) create mode 100644 Master/texmf-dist/doc/latex/pgf-umlcd/COPYING create mode 100644 Master/texmf-dist/doc/latex/pgf-umlcd/README create mode 100644 Master/texmf-dist/doc/latex/pgf-umlcd/demo/abstract-class.tex create mode 100644 Master/texmf-dist/doc/latex/pgf-umlcd/demo/abstract-factory.svg create mode 100644 Master/texmf-dist/doc/latex/pgf-umlcd/demo/abstract-factory.tex create mode 100644 Master/texmf-dist/doc/latex/pgf-umlcd/demo/aggregation.tex create mode 100644 Master/texmf-dist/doc/latex/pgf-umlcd/demo/association.tex create mode 100644 Master/texmf-dist/doc/latex/pgf-umlcd/demo/class.tex create mode 100644 Master/texmf-dist/doc/latex/pgf-umlcd/demo/composition.tex create mode 100644 Master/texmf-dist/doc/latex/pgf-umlcd/demo/implement-interface.tex create mode 100644 Master/texmf-dist/doc/latex/pgf-umlcd/demo/inheritance.tex create mode 100644 Master/texmf-dist/doc/latex/pgf-umlcd/demo/interface.tex create mode 100644 Master/texmf-dist/doc/latex/pgf-umlcd/demo/note.tex create mode 100644 Master/texmf-dist/doc/latex/pgf-umlcd/demo/object-include-methods.tex create mode 100644 Master/texmf-dist/doc/latex/pgf-umlcd/demo/object.tex create mode 100644 Master/texmf-dist/doc/latex/pgf-umlcd/demo/package.tex create mode 100644 Master/texmf-dist/doc/latex/pgf-umlcd/demo/unidirectional-association.tex create mode 100644 Master/texmf-dist/doc/latex/pgf-umlcd/demo/visibility.tex create mode 100644 Master/texmf-dist/doc/latex/pgf-umlcd/logo.png create mode 100644 Master/texmf-dist/doc/latex/pgf-umlcd/pgf-umlcd-manual.pdf create mode 100644 Master/texmf-dist/doc/latex/pgf-umlcd/pgf-umlcd-manual.tex create mode 100644 Master/texmf-dist/tex/latex/pgf-umlcd/pgf-umlcd.sty create mode 100644 Master/tlpkg/tlpsrc/pgf-umlcd.tlpsrc diff --git a/Master/texmf-dist/doc/latex/pgf-umlcd/COPYING b/Master/texmf-dist/doc/latex/pgf-umlcd/COPYING new file mode 100644 index 00000000000..71917be32ee --- /dev/null +++ b/Master/texmf-dist/doc/latex/pgf-umlcd/COPYING @@ -0,0 +1,14 @@ +This file is part of pgf-umlcd. + +pgf-umlcd is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +pgf-umlcd is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Foobar. If not, see . \ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/pgf-umlcd/README b/Master/texmf-dist/doc/latex/pgf-umlcd/README new file mode 100644 index 00000000000..5cc6fbf3a01 --- /dev/null +++ b/Master/texmf-dist/doc/latex/pgf-umlcd/README @@ -0,0 +1,3 @@ +Some LaTeX macros for UML Class Diagrams. +Home page of project: http://pgf-umlcd.googlecode.com/ +Please read pgf-umlcd-manual.pdf for more information. diff --git a/Master/texmf-dist/doc/latex/pgf-umlcd/demo/abstract-class.tex b/Master/texmf-dist/doc/latex/pgf-umlcd/demo/abstract-class.tex new file mode 100644 index 00000000000..cdaa3e5a45a --- /dev/null +++ b/Master/texmf-dist/doc/latex/pgf-umlcd/demo/abstract-class.tex @@ -0,0 +1,9 @@ +\begin{tikzpicture} + \begin{abstractclass}[text width=5cm]{BankAccount}{0,0} + \attribute{owner : String} + \attribute{balance : Dollars = 0} + + \operation{deposit(amount : Dollars)} + \operation[0]{withdrawl(amount : Dollars)} + \end{abstractclass} +\end{tikzpicture} \ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/pgf-umlcd/demo/abstract-factory.svg b/Master/texmf-dist/doc/latex/pgf-umlcd/demo/abstract-factory.svg new file mode 100644 index 00000000000..90b90ca48cf --- /dev/null +++ b/Master/texmf-dist/doc/latex/pgf-umlcd/demo/abstract-factory.svg @@ -0,0 +1,791 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Master/texmf-dist/doc/latex/pgf-umlcd/demo/abstract-factory.tex b/Master/texmf-dist/doc/latex/pgf-umlcd/demo/abstract-factory.tex new file mode 100644 index 00000000000..e1018da4c03 --- /dev/null +++ b/Master/texmf-dist/doc/latex/pgf-umlcd/demo/abstract-factory.tex @@ -0,0 +1,69 @@ + +\begin{tikzpicture}[show background grid] + \begin{interface}{AbstractFactory}{0,0} + \operation[0]{+ CreateProductA()} + \operation[0]{+ CreateProductB()} + \end{interface} + + \begin{class}{ConcreteFactory2}{-3,-4} + \implement{AbstractFactory} + \operation{+ CreateProductA()} + \operation{+ CreateProductB()} + \end{class} + + \begin{class}{ConcreteFactory1}{3,-4} + \implement{AbstractFactory} + \operation{+ CreateProductA()} + \operation{+ CreateProductB()} + \end{class} + + \begin{interface}{AbstractProductA}{15,-2} + \end{interface} + + \begin{class}{ProductA1}{12,-5} + \implement{AbstractProductA} + \end{class} + + \begin{class}{ProductA2}{18,-5} + \implement{AbstractProductA} + \end{class} + + \draw[umlcd style dashed line,->] (ConcreteFactory1) --node[above, + sloped, black]{$<<$instantiate$>>$} (ProductA1); + + \draw[umlcd style dashed line,->] (ConcreteFactory2.south) ++ + (1,0) -- ++(0,-1) -- node[above, sloped, + black]{$<<$instantiate$>>$} ++(20,0) -| (ProductA2); + + \begin{interface}{AbstractProductB}{15,-8} + \end{interface} + + \begin{class}{ProductB1}{12,-11} + \implement{AbstractProductB} + \end{class} + + \begin{class}{ProductB2}{18,-11} + \implement{AbstractProductB} + \end{class} + + \draw[umlcd style dashed line,->] (ConcreteFactory1) |-node[above, + sloped, black]{$<<$instantiate$>>$} (ProductB1); + + \draw[umlcd style dashed line,->] (ConcreteFactory2.south) ++ + (-1,0) -- ++(0,-7) -- node[above, sloped, + black]{$<<$instantiate$>>$} ++(20,0) -| (ProductB2); + + \begin{class}{Client}{22,-0.5} + \end{class} + + \draw[umlcd style dashed line,->] (Client) --node[above, sloped, + black]{$<<$import$>>$} (AbstractFactory); + + \draw[umlcd style dashed line,->] (Client) |-node[above, sloped, + black]{$<<$import$>>$} (AbstractProductA); + + \draw[umlcd style dashed line,->] (Client) |-node[above, sloped, + black]{$<<$import$>>$} (AbstractProductB); +\end{tikzpicture} + + diff --git a/Master/texmf-dist/doc/latex/pgf-umlcd/demo/aggregation.tex b/Master/texmf-dist/doc/latex/pgf-umlcd/demo/aggregation.tex new file mode 100644 index 00000000000..5de8da63f27 --- /dev/null +++ b/Master/texmf-dist/doc/latex/pgf-umlcd/demo/aggregation.tex @@ -0,0 +1,10 @@ +\begin{tikzpicture}[show background grid] + \begin{class}{Car}{0,0} + \end{class} + + \begin{class}{Wheel}{7.5,0} + \end{class} + + \aggregation{Car}{wheels}{4}{Wheel} + +\end{tikzpicture} \ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/pgf-umlcd/demo/association.tex b/Master/texmf-dist/doc/latex/pgf-umlcd/demo/association.tex new file mode 100644 index 00000000000..0582e54f6e7 --- /dev/null +++ b/Master/texmf-dist/doc/latex/pgf-umlcd/demo/association.tex @@ -0,0 +1,22 @@ +\begin{tikzpicture} + \begin{class}[text width=7cm]{Flight}{0,0} + \attribute{flightNumber : Integer} + \attribute{departureTime : Date} + \attribute{flightDuration : Minutes} + \attribute{departingAirport : String} + \attribute{arrivingAirport : String} + + \operation{delayFlight ( numberOfMinutes : Minutes )} + \operation{getArrivalTime ( ) : Date} + \end{class} + + \begin{class}{Plane}{11,0} + \attribute{airPlaneType : String} + \attribute{maximumSpeed : MPH} + \attribute{maximumDistance : Miles} + \attribute{tailID : String} + \end{class} + + \association{Plane}{assignedPlane}{0..1}{Flight}{0..*}{assignedFlights} + +\end{tikzpicture} diff --git a/Master/texmf-dist/doc/latex/pgf-umlcd/demo/class.tex b/Master/texmf-dist/doc/latex/pgf-umlcd/demo/class.tex new file mode 100644 index 00000000000..4ba13254a42 --- /dev/null +++ b/Master/texmf-dist/doc/latex/pgf-umlcd/demo/class.tex @@ -0,0 +1,10 @@ +\begin{tikzpicture} + \begin{class}[text width=8cm]{ClassName}{0,0} + \attribute{name : attribute type} + \attribute{name : attribute type = default value} + + \operation{name(parameter list) : type of value returned} + % virtual operation + \operation[0]{name(parameters list) : type of value returned} + \end{class} +\end{tikzpicture} \ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/pgf-umlcd/demo/composition.tex b/Master/texmf-dist/doc/latex/pgf-umlcd/demo/composition.tex new file mode 100644 index 00000000000..6c584c254dd --- /dev/null +++ b/Master/texmf-dist/doc/latex/pgf-umlcd/demo/composition.tex @@ -0,0 +1,10 @@ +\begin{tikzpicture}[show background grid] + \begin{class}{Company}{0,0} + \end{class} + + \begin{class}{Department}{10,0} + \end{class} + + \composition{Company}{theDepartment}{1..*}{Department} + +\end{tikzpicture} \ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/pgf-umlcd/demo/implement-interface.tex b/Master/texmf-dist/doc/latex/pgf-umlcd/demo/implement-interface.tex new file mode 100644 index 00000000000..b8b36a502aa --- /dev/null +++ b/Master/texmf-dist/doc/latex/pgf-umlcd/demo/implement-interface.tex @@ -0,0 +1,16 @@ +\begin{tikzpicture}%[show background grid] + \begin{interface}{Person}{0,0} + \attribute{firstName : String} + \attribute{lastName : String} + \end{interface} + + \begin{class}{Professor}{-5,-5} + \implement{Person} + \attribute{salary : Dollars} + \end{class} + + \begin{class}{Student}{5,-5} + \implement{Person} + \attribute{major : String} + \end{class} +\end{tikzpicture} \ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/pgf-umlcd/demo/inheritance.tex b/Master/texmf-dist/doc/latex/pgf-umlcd/demo/inheritance.tex new file mode 100644 index 00000000000..3399f606a41 --- /dev/null +++ b/Master/texmf-dist/doc/latex/pgf-umlcd/demo/inheritance.tex @@ -0,0 +1,26 @@ +\begin{tikzpicture} + \begin{class}[text width=5cm]{BankAccount}{0,0} + \attribute{owner : String} + \attribute{balance : Dollars = 0} + + \operation{deposit(amount : Dollars)} + \operation[0]{withdrawl(amount : Dollars)} + \end{class} + + \begin{class}[text width=7cm]{CheckingAccount}{-5,-5} + \inherit{BankAccount} + \attribute{insufficientFundsFee : Dollars} + + \operation{processCheck ( checkToProcess : Check )} + \operation{withdrawal ( amount : Dollars )} + \end{class} + + \begin{class}[text width=7cm]{SavingsAccount}{5,-5} + \inherit{BankAccount} + \attribute{annualInteresRate : Percentage} + + \operation{depositMonthlyInterest ( )} + \operation{withdrawal ( amount : Dollars )} + \end{class} + +\end{tikzpicture} diff --git a/Master/texmf-dist/doc/latex/pgf-umlcd/demo/interface.tex b/Master/texmf-dist/doc/latex/pgf-umlcd/demo/interface.tex new file mode 100644 index 00000000000..28bee28f289 --- /dev/null +++ b/Master/texmf-dist/doc/latex/pgf-umlcd/demo/interface.tex @@ -0,0 +1,6 @@ +\begin{tikzpicture}%[show background grid] + \begin{interface}{Person}{0,0} + \attribute{firstName : String} + \attribute{lastName : String} + \end{interface} +\end{tikzpicture} \ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/pgf-umlcd/demo/note.tex b/Master/texmf-dist/doc/latex/pgf-umlcd/demo/note.tex new file mode 100644 index 00000000000..eb7f7d7d19f --- /dev/null +++ b/Master/texmf-dist/doc/latex/pgf-umlcd/demo/note.tex @@ -0,0 +1,3 @@ +\begin{tikzpicture} + \umlnote (note) {This is a note.}; +\end{tikzpicture} \ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/pgf-umlcd/demo/object-include-methods.tex b/Master/texmf-dist/doc/latex/pgf-umlcd/demo/object-include-methods.tex new file mode 100644 index 00000000000..69d66da97f9 --- /dev/null +++ b/Master/texmf-dist/doc/latex/pgf-umlcd/demo/object-include-methods.tex @@ -0,0 +1,10 @@ +\begin{tikzpicture} + \begin{object}[text width=6cm]{Thomas' account}{0,0} + \instanceOf{BankAccount} + \attribute{owner = Thomas} + \attribute{balance = 100} + + \operation{deposit(amount : Dollars)} + \operation[0]{withdrawl(amount : Dollars)} + \end{object} +\end{tikzpicture} \ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/pgf-umlcd/demo/object.tex b/Master/texmf-dist/doc/latex/pgf-umlcd/demo/object.tex new file mode 100644 index 00000000000..198f845ad89 --- /dev/null +++ b/Master/texmf-dist/doc/latex/pgf-umlcd/demo/object.tex @@ -0,0 +1,6 @@ +\begin{tikzpicture} + \begin{object}[text width=6cm]{Instance Name}{0,0} + \instanceOf{Class Name} + \attribute{attribute name = value} + \end{object} +\end{tikzpicture} \ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/pgf-umlcd/demo/package.tex b/Master/texmf-dist/doc/latex/pgf-umlcd/demo/package.tex new file mode 100644 index 00000000000..a3196d7dd36 --- /dev/null +++ b/Master/texmf-dist/doc/latex/pgf-umlcd/demo/package.tex @@ -0,0 +1,28 @@ +\begin{tikzpicture} + \begin{package}{Accounts} + \begin{class}[text width=5cm]{BankAccount}{0,0} + \attribute{owner : String} + \attribute{balance : Dollars = 0} + + \operation{deposit(amount : Dollars)} + \operation[0]{withdrawl(amount : Dollars)} + \end{class} + + \begin{class}[text width=7cm]{CheckingAccount}{-5,-5} + \inherit{BankAccount} + \attribute{insufficientFundsFee : Dollars} + + \operation{processCheck ( checkToProcess : Check )} + \operation{withdrawal ( amount : Dollars )} + \end{class} + + \begin{class}[text width=7cm]{SavingsAccount}{5,-5} + \inherit{BankAccount} + \attribute{annualInteresRate : Percentage} + + \operation{depositMonthlyInterest ( )} + \operation{withdrawal ( amount : Dollars )} + \end{class} + \end{package} + +\end{tikzpicture} \ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/pgf-umlcd/demo/unidirectional-association.tex b/Master/texmf-dist/doc/latex/pgf-umlcd/demo/unidirectional-association.tex new file mode 100644 index 00000000000..9ea07805b04 --- /dev/null +++ b/Master/texmf-dist/doc/latex/pgf-umlcd/demo/unidirectional-association.tex @@ -0,0 +1,20 @@ +\begin{tikzpicture} + % \draw[help lines] (-7,-6) grid (6,0); + + \begin{class}[text width=6cm]{OverdrawnAccountsReport}{0,0} + \attribute{generatedOn : Date} + + \operation{refresh ( )} + \end{class} + + \begin{class}{BankAccount}{12,0} + \attribute{owner : String} + \attribute{balance : Dollars} + + \operation{deposit(amount : Dollars)} + \operation[0]{withdrawl(amount : Dollars)} + \end{class} + + \unidirectionalAssociation{OverdrawnAccountsReport}{overdrawnAccounts}{0..*}{BankAccount} + +\end{tikzpicture} \ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/pgf-umlcd/demo/visibility.tex b/Master/texmf-dist/doc/latex/pgf-umlcd/demo/visibility.tex new file mode 100644 index 00000000000..e5bd6e13186 --- /dev/null +++ b/Master/texmf-dist/doc/latex/pgf-umlcd/demo/visibility.tex @@ -0,0 +1,17 @@ +\begin{tikzpicture}%[show background grid] + \begin{class}[text width=7cm]{Class}{0,0} + \attribute{+ Public} + \attribute{\# Protected} + \attribute{- Private} + \attribute{$\sim$ Package} + \end{class} + + \begin{class}[text width=7cm]{BankAccount}{0,-3} + \attribute{+ owner : String} + \attribute{+ balance : Dollars} + + \operation{+ deposit( amount : Dollars )} + \operation{+ withdrawal( amount : Dollars )} + \operation{\# updateBalance( newBalance : Dollars )} + \end{class} +\end{tikzpicture} \ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/pgf-umlcd/logo.png b/Master/texmf-dist/doc/latex/pgf-umlcd/logo.png new file mode 100644 index 00000000000..4d04053166b Binary files /dev/null and b/Master/texmf-dist/doc/latex/pgf-umlcd/logo.png differ diff --git a/Master/texmf-dist/doc/latex/pgf-umlcd/pgf-umlcd-manual.pdf b/Master/texmf-dist/doc/latex/pgf-umlcd/pgf-umlcd-manual.pdf new file mode 100644 index 00000000000..7e6fea67e19 Binary files /dev/null and b/Master/texmf-dist/doc/latex/pgf-umlcd/pgf-umlcd-manual.pdf differ diff --git a/Master/texmf-dist/doc/latex/pgf-umlcd/pgf-umlcd-manual.tex b/Master/texmf-dist/doc/latex/pgf-umlcd/pgf-umlcd-manual.tex new file mode 100644 index 00000000000..17a6edc6fdf --- /dev/null +++ b/Master/texmf-dist/doc/latex/pgf-umlcd/pgf-umlcd-manual.tex @@ -0,0 +1,149 @@ +% Manual of pgf-umlcd.sty, a convenient set of macros for drawing UML +% class diagrams. +% Written by Xu Yuan +% This file is part of pgf-umlcd +% you may get it at http://code.google.com/p/pgf-umlcd/ + +\documentclass{article} +\usepackage[margin=12mm]{geometry} +\usepackage{hyperref} + +\usepackage[ +% school, +% simplified +]{pgf-umlcd} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\usepackage{listings} +\usepackage{color} +\definecolor{listinggray}{gray}{0.92} +\lstset{ % +language=[LaTeX]TeX, +breaklines=true, +frame=single, +% frameround=tttt, +basicstyle=\footnotesize\ttfamily, +backgroundcolor=\color{listinggray}, +keywordstyle=\color{blue} +} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\hypersetup{ + colorlinks=true, + linkcolor=blue, + anchorcolor=black, + citecolor=olive, + filecolor=magenta, + menucolor=red, + urlcolor=blue +} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\newcommand{\demo}[2][1]{ +\begin{minipage}{.49\linewidth} +\centering +\resizebox{#1\linewidth}{!}{ +\input{demo/#2} +} +\end{minipage} +\hspace{0.01\linewidth} +\begin{minipage}{.5\linewidth} +\lstinputlisting{demo/#2} +\end{minipage} +} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\newcommand{\example}[1]{ +\resizebox{\linewidth}{!}{ +\input{demo/#1} +} +\lstinputlisting{demo/#1} +} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\begin{document} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\title{Drawing UML Class Diagram by using \texttt{pgf-umlcd}} +\author{\href{mailto:xuyuan.cn@gmail.com}{Yuan Xu}} +\date{\today{}~(v0.2.1)} +\maketitle +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\begin{abstract} + \texttt{pgf-umlcd} is a LaTeX package for drawing UML Class + Diagrams. As stated by its name, it is based on a very popular + graphic package \texttt{PGF/TikZ}. This document presents the usage + of \texttt{pgf-umlcd} and collects some UML class diagrams as + examples. \texttt{pgf-umlcd} can be downloaded from + \href{http://code.google.com/p/pgf-umlcd/}{http://code.google.com/p/pgf-umlcd/}. +\end{abstract} + +\tableofcontents + +\section{Basics} +\subsection{Class with attributes and operations} +Note: If you don't want to show empty parts in the diagrams, please +use \texttt{simplified} option, e.g. \lstinline|\usepackage[simplified]{pgf-umlcd}|.\\ +\demo{class} + +\subsubsection{Visibility of attributes and operations} +\demo[0.8]{visibility} + +\subsubsection{Abstract class and interface} +\demo[0.5]{abstract-class} +\demo[0.5]{interface} + +\subsubsection{Object} +\demo[0.7]{object} +Note: Object with rounded corners and methods are used in German school for didactic reasons. You get the rounded corners with \lstinline|\usepackage[school]{pgf-umlcd}|. If you need both in one document you can switch it with \lstinline|\switchUmlcdSchool| \\ +\switchUmlcdSchool +\demo[0.7]{object} +\demo[0.7]{object-include-methods} + +\subsubsection{Note} +The \lstinline|\umlnote| use the same syntax as tikz command +\lstinline|\node|, e.g. \lstinline|\umlnote[style] (name) at (coordinate) {text};| + +\demo[0.7]{note} + +\subsection{Inheritance and implement} +\subsubsection{Inheritance} +\demo{inheritance} + +\subsubsection{Implement an interface} +\demo{implement-interface} + +\subsection{Association, Aggregation and Composition} +\subsubsection{Association} +\demo{association} + +\subsubsection{Unidirectional association} +\demo{unidirectional-association} + +\subsubsection{Aggregation} +\demo{aggregation} + +\subsubsection{Composition} +\demo{composition} + +\subsection{Package} +\demo{package} + +\section{Examples} +\subsection{Abstract Factory} +\example{abstract-factory} + +\section{Acknowledgements} +Many people contributed to \texttt{pgf-umlcd} by reporting problems, +suggesting various improvements or submitting code. Here is a list of +these people: \href{mailto:martin.quinson@loria.fr}{Martin Quinson}, +and \href{mailto:johannes_pieper@yahoo.de}{Johannes Pieper}. + +\end{document} +%%% Local Variables: +%%% mode: Tex-PDF +%%% TeX-master: t +%%% End: diff --git a/Master/texmf-dist/tex/latex/pgf-umlcd/pgf-umlcd.sty b/Master/texmf-dist/tex/latex/pgf-umlcd/pgf-umlcd.sty new file mode 100644 index 00000000000..0062909b8d7 --- /dev/null +++ b/Master/texmf-dist/tex/latex/pgf-umlcd/pgf-umlcd.sty @@ -0,0 +1,353 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Start of pgf-umlcd.sty +% +% Some macros for UML Class Diagrams. +% Home page of project: http://pgf-umlcd.googlecode.com/ +% Author: Xu Yuan , Humboldt University, Berlin +% Style from: http://www.ibm.com/developerworks/cn/rational/r-uml/ +% + +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\ProvidesPackage{pgf-umlcd}[2011/10/01 v0.3dev Some LaTeX macros for +UML Class Diagrams.] + +\RequirePackage{tikz} + +\usetikzlibrary{arrows,shapes.multipart,backgrounds,fit} +\tikzstyle{help lines}+=[blue!50,very thin,dashed] + +\newcommand{\umltextcolor}{black} +\newcommand{\umldrawcolor}{purple} +\newcommand{\umlfillcolor}{yellow!20} +\tikzstyle{umlcolor}=[color=\umldrawcolor,fill=\umlfillcolor,text=\umltextcolor] +\tikzstyle{umlcd style}=[umlcolor, >=angle 90] + +\tikzstyle{package}=[matrix, column sep=1mm, row sep=1cm, node distance=2cm] +\tikzstyle{packagename}=[rectangle, minimum height=2em] + +\tikzstyle{umlcd style implement line}=[color=\umldrawcolor, open triangle 45-,dashed] +\tikzstyle{objectline}=[color=\umldrawcolor, diamond->] +\tikzstyle{umlcd style inherit line}=[color=\umldrawcolor, open triangle 45-] +\tikzstyle{splitline}=[color=\umldrawcolor, dotted,font=\itshape] + +\tikzstyle{umlcd style class}=[rectangle split, rectangle split parts=3, +every text node part/.style={text centered}, +draw, minimum height=2em, umlcolor, minimum width=2cm, text width=5cm, +minimum height=1cm, node distance=2cm] + + +\tikzstyle{umlcd style dashed line}=[color=\umldrawcolor, >=angle 90,dashed] + +\tikzstyle{umlcd style school}=[] +\newif\ifschool\schoolfalse +\DeclareOption{school}{\tikzstyle{umlcd style school}=[rounded corners] \schooltrue} +\newif\ifsimplified\simplifiedfalse +\DeclareOption{simplified}{\simplifiedtrue} +\ProcessOptions\relax + + +% declare layers +\pgfdeclarelayer{background} +\pgfdeclarelayer{connectionlayers} +\pgfsetlayers{background,connectionlayers,main} + +\newcounter{umlcdClassAttributesNum} +\newcounter{umlcdClassOperationsNum} +\newcounter{umlcdClassAbstractClassNum} +\newcounter{umlcdClassInterfaceNum} +\newcounter{umlcdClassSplitPartNum} + +\def\umlcdPackageFit{} + +\newenvironment{class}[3][]% +{ +\begin{classAndInterfaceCommon}{#1}{#2}{#3} +}% +{\calcuateNumberOfParts{} +\node[this umlcd style, anchor=north] (\umlcdClassName) at (\umlcdClassPos) + {\textbf{\umlcdClassName} +\insertAttributesAndOperations{} +}; + +\end{classAndInterfaceCommon} +} + +\newenvironment{interface}[3][]% +{ +\begin{classAndInterfaceCommon}{#1}{#2}{#3} +}% +{\calcuateNumberOfParts{} +\node[this umlcd style, anchor=north] (\umlcdClassName) at (\umlcdClassPos) + {$<<$interface$>>$ \\ \textbf{\umlcdClassName} +\insertAttributesAndOperations{} +}; + +\end{classAndInterfaceCommon} +} + +\newenvironment{abstractclass}[3][]% +{ +\begin{classAndInterfaceCommon}{#1}{#2}{#3} +}% +{\calcuateNumberOfParts{} +\node[this umlcd style, anchor=north] (\umlcdClassName) at (\umlcdClassPos) + {$<<$abstract$>>$ \\ \textbf{\umlcdClassName} +\insertAttributesAndOperations{} +}; + +\end{classAndInterfaceCommon} +} + +% TODO: here the name of \umlcdClassName and \umlObjectName should be +% switched, it is only for reusing \classAndInterfaceCommon at the +% moment. +\newenvironment{object}[3][]% +{ +\begin{classAndInterfaceCommon}{#1}{#2}{#3} +\def\@instanceOf{} +\def\@@instanceOf{} +}% +{ + % customized + \ifsimplified + \calcuateNumberOfParts{} + \else + \ifnum\c@umlcdClassOperationsNum>0 + \setcounter{umlcdClassSplitPartNum}{3} + \protected@xdef\umlcdSplitPart{3} + \else + \setcounter{umlcdClassSplitPartNum}{2} + \protected@xdef\umlcdSplitPart{2} + \fi + \fi + + \ifx\@instanceOf\@@instanceOf + \def\umldObjectName{\umlcdClassName} + \else + \def\umldObjectName{\umlcdClassName : \@instanceOf} + \fi + +\node[this umlcd style, anchor=north, umlcd style school] (\umlcdClassName) at (\umlcdClassPos) + { \ifschool + \textbf{\umldObjectName} + \else + \underline{\textbf{\umldObjectName}} + \fi + \insertAttributesAndOperations{} +}; + +\end{classAndInterfaceCommon} +} + +\newcommand*{\insertAttributesAndOperations} +{ + \ifnum\c@umlcdClassSplitPartNum>1 + \nodepart{second} + \fi + \umlcdClassAttributes + \ifnum\c@umlcdClassSplitPartNum>2 + \nodepart{third} + \fi + \umlcdClassOperations +} + +\newcommand*{\calcuateNumberOfParts} +{ + % calcuate the number of parts + \ifsimplified + \setcounter{umlcdClassSplitPartNum}{1} + \ifnum\c@umlcdClassAttributesNum>0 + \stepcounter{umlcdClassSplitPartNum} + \fi + \ifnum\c@umlcdClassOperationsNum>0 + \stepcounter{umlcdClassSplitPartNum} + \fi + \else + \setcounter{umlcdClassSplitPartNum}{3}% three parts by default + \fi + + \protected@xdef\umlcdSplitPart{3} + \ifnum\c@umlcdClassSplitPartNum=1 + \protected@xdef\umlcdSplitPart{1} + \fi + \ifnum\c@umlcdClassSplitPartNum=2 + \protected@xdef\umlcdSplitPart{2} + \fi +} + +\newenvironment*{classAndInterfaceCommon}[3] +{ +\def\umlcdClassName{#2}% +\def\umlcdClassPos{#3} +\def\umlcdClassAttributes{}% +\def\umlcdClassOperations{}% +\def\umlcdClassAbstractClass{}% +\def\umlcdClassInterface{}% +\setcounter{umlcdClassAttributesNum}{0}% +\setcounter{umlcdClassOperationsNum}{0}% +\setcounter{umlcdClassAbstractClassNum}{0}% +\setcounter{umlcdClassInterfaceNum}{0}% +\tikzstyle{this umlcd style}=[umlcd style class, rectangle split + parts=\umlcdSplitPart, #1] +}% +{ +%% connections +\begin{pgfonlayer}{connectionlayers} +\ifnum\c@umlcdClassAbstractClassNum>0 +\foreach \c in {\umlcdClassAbstractClass}{ + \draw [umlcd style inherit line] (\c) -- (\umlcdClassName); +} +\fi + +\ifnum\c@umlcdClassInterfaceNum>0 +\foreach \c in {\umlcdClassInterface}{ + \draw [umlcd style implement line] (\c) -- (\umlcdClassName); +} +\fi +\end{pgfonlayer} + +%% add to fit +\let\umlcdPackageFitOld\umlcdPackageFit +\protected@xdef\umlcdPackageFit{\umlcdPackageFitOld (\umlcdClassName)} +} + +\newcommand{\attribute}[1]{% +\ifnum\c@umlcdClassAttributesNum=0 +\protected@xdef\umlcdClassAttributes{#1} +\else +\let\umlcdClassAttributesOld\umlcdClassAttributes +\protected@xdef\umlcdClassAttributes{\umlcdClassAttributesOld \ \newline + #1} +\fi +\stepcounter{umlcdClassAttributesNum} +} + +\newcommand{\operation}[2][1]{% +\stepcounter{umlcdClassOperationsNum} + +\def\virtualoperation{#2} +\ifnum0=#1 +\def\virtualoperation{\textit{#2}} +\fi + +\ifnum\c@umlcdClassOperationsNum=1 +\protected@xdef\umlcdClassOperations{\virtualoperation} +\else +\let\umlcdClassOperationsOld\umlcdClassOperations +\protected@xdef\umlcdClassOperations{\umlcdClassOperationsOld \ \newline + \virtualoperation} +\fi +} + +\newcommand{\inherit}[1] +{ +\stepcounter{umlcdClassAbstractClassNum} +\ifnum\c@umlcdClassAbstractClassNum=1 +\protected@xdef\umlcdClassAbstractClass{#1} +\else +\let\umlcdClassAbstractClassOld\umlcdClassAbstractClass +\protected@xdef\umlcdClassAbstractClass{\umlcdClassAbstractClassOld, + #1} +\fi +} + +\newcommand{\implement}[1] +{ +\stepcounter{umlcdClassInterfaceNum} +\ifnum\c@umlcdClassInterfaceNum=1 +\protected@xdef\umlcdClassInterface{#1} +\else +\let\umlcdClassInterfaceOld\umlcdClassInterface +\protected@xdef\umlcdClassInterface{\umlcdClassInterfaceOld, + #1} +\fi +} + +\newcommand{\instanceOf}[1]{\def\@instanceOf{#1}} + +\newcommand{\association}[6]{ +\draw [umlcd style] (#1) -- (#4) +node[near start, above]{#2} +node[near start, below]{#3} +node[near end, above]{#5} +node[near end, below]{#6}; +} + +\newcommand{\unidirectionalAssociation}[4]{ +\draw [umlcd style, ->] (#1) -- (#4) +node[near end, above]{#2} +node[near end, below]{#3}; +} + +\newcommand{\aggregation}[4] +{ +\draw[umlcd style, open diamond->] (#1) -- (#4) +node[near end, above]{#2} +node[near end, below]{#3}; +} + +\newcommand{\composition}[4] +{ +\draw[umlcd style, fill=\umldrawcolor, diamond->] (#1) -- (#4) +node[near end, above]{#2} +node[near end, below]{#3}; +} + +\newenvironment{package}[1]{ +\def\umlcdPackageFit{} +\def\umlcdPackageName{#1} +}{ + \begin{pgfonlayer}{background} + \node[umlcd style, draw, inner sep=0.5cm, fit = \umlcdPackageFit] (\umlcdPackageName) {}; + \node[umlcd style, draw, outer ysep=-0.5, anchor=south west] (\umlcdPackageName caption) at + (\umlcdPackageName.north west) {\umlcdPackageName}; + \end{pgfonlayer} +} + +\newcommand{\switchUmlcdSchool}{ + \ifschool + \tikzstyle{umlcd style school}=[] + \schoolfalse + \else + \tikzstyle{umlcd style school}=[rounded corners] + \schooltrue + \fi +} + +\pgfdeclareshape{umlcdnote}{ +\inheritsavedanchors[from=rectangle] % this is nearly a rectangle +\inheritanchorborder[from=rectangle] +\inheritanchor[from=rectangle]{center} +\inheritanchor[from=rectangle]{north} +\inheritanchor[from=rectangle]{south} +\inheritanchor[from=rectangle]{west} +\inheritanchor[from=rectangle]{east} +% ... and possibly more +\backgroundpath{% this is new +% store lower right in xa/ya and upper right in xb/yb +\southwest \pgf@xa=\pgf@x \pgf@ya=\pgf@y +\northeast \pgf@xb=\pgf@x \pgf@yb=\pgf@y +% compute corner of flipped page +\pgf@xc=\pgf@xb \advance\pgf@xc by-10pt % this should be a parameter +\pgf@yc=\pgf@yb \advance\pgf@yc by-10pt +% construct main path +\pgfpathmoveto{\pgfpoint{\pgf@xa}{\pgf@ya}} +\pgfpathlineto{\pgfpoint{\pgf@xa}{\pgf@yb}} +\pgfpathlineto{\pgfpoint{\pgf@xc}{\pgf@yb}} +\pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@yc}} +\pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@ya}} +\pgfpathclose +% add little corner +\pgfpathmoveto{\pgfpoint{\pgf@xc}{\pgf@yb}} +\pgfpathlineto{\pgfpoint{\pgf@xc}{\pgf@yc}} +\pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@yc}} +\pgfpathlineto{\pgfpoint{\pgf@xc}{\pgf@yc}} +} +} + +\newcommand{\umlnote}[1][]{ + \node[umlcd style, anchor=north, draw,shape=umlcdnote, text width=4cm, #1] +} + +%%% End of pgf-umlcd.sty +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ No newline at end of file diff --git a/Master/tlpkg/bin/tlpkg-ctan-check b/Master/tlpkg/bin/tlpkg-ctan-check index b5f7b6ac6a6..20d243e3968 100755 --- a/Master/tlpkg/bin/tlpkg-ctan-check +++ b/Master/tlpkg/bin/tlpkg-ctan-check @@ -361,7 +361,7 @@ my @TLP_working = qw( pecha pedigree-perl perception perfectcut perltex permute persian-bib persian-modern petiteannonce petri-nets pfarrei - pgf pgf-blur pgf-soroban pgf-umlsd pgfgantt pgfkeyx pgfmolbio + pgf pgf-blur pgf-soroban pgf-umlcd pgf-umlsd pgfgantt pgfkeyx pgfmolbio pgfopts pgfplots phaistos philex philokalia philosophersimprint phonetic phonrule photo physics physymb piano picinpar pict2e diff --git a/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc b/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc index 74c07f48530..2d1f421b81a 100644 --- a/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc +++ b/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc @@ -62,6 +62,7 @@ depend petri-nets depend pgf depend pgf-blur depend pgf-soroban +depend pgf-umlcd depend pgf-umlsd depend pgfgantt depend pgfkeyx diff --git a/Master/tlpkg/tlpsrc/pgf-umlcd.tlpsrc b/Master/tlpkg/tlpsrc/pgf-umlcd.tlpsrc new file mode 100644 index 00000000000..e69de29bb2d -- cgit v1.2.3