%%
%% This is file `umldoc.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% umldoc.dtx  (with options: `package')
%% 
%% - Uses LaTeX
%%
%%    $Id: umldoc.dtx,v 0.7 2000/09/06 21:46:06 elements Exp $
%%
%%
\def\filedate{1999/10/01}
\def\fileversion{1.0}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{umldoc}[\filedate\ UML Documentation Environments \fileversion]
\typeout{Package 'umldoc' \fileversion}
\RequirePackage{ifthen}
\RequirePackage{graphicx}
\RequirePackage{verbatim}
\RequirePackage{amssymb}
\RequirePackage{longtable}
\RequirePackage{xspace}
\newcommand{\UML@Error}[1]{\@latex@error{umldoc: #1}}
\newboolean{UML@index@option}
\setboolean{UML@index@option}{true}
\newboolean{UML@sectionmark@option}
\setboolean{UML@sectionmark@option}{true}
\newboolean{UML@margin@option}
\setboolean{UML@margin@option}{true}
\DeclareOption{noindex}{\setboolean{UML@index@option}{false}}
\DeclareOption{nosectionmarks}{\setboolean{UML@sectionmark@option}{false}}
\DeclareOption{nomarginnotes}{\setboolean{UML@margin@option}{false}}
\DeclareOption*{\UML@Error{Unknown option \CurrentOption}}
\ProcessOptions
\newlength{\UML@diagramwidth}
\newlength{\UML@diagramheight}
\setlength{\UML@diagramwidth}{\textwidth}
\addtolength{\UML@diagramwidth}{-4em}
\setlength{\UML@diagramheight}{\textheight}
\addtolength{\UML@diagramheight}{-4.5cm}
\newenvironment{umldocumentation}[1][generic]{%
    \ifthenelse{\equal{#1}{category}}{%
        \ifthenelse{\isundefined{\chapter} \and \not \boolean{UML@category@extension}}{%
            \section*{\umlcategorydocumentationheader}
        }{}
    }{}
    \par%
}{%
    \hfill%
}
\newenvironment{umlexternalreferences}{%
    \begin{list}{\ensuremath{\circ}}{%
        \setlength{\itemsep}{0pt}
        \setlength{\parsep}{0pt}
    }
}{%
    \end{list}
}
\newcommand{\umlexternalurl}[2][]{%
    \item[\umlurlicon]
    \ifthenelse{\equal{#1}{}}{%
        \def\UML@ref@title{\texttt{#2}}
        \def\UML@ref@foot{}
    }{%
        \def\UML@ref@title{#1}
        \def\UML@ref@foot{\footnote{\texttt{#2}}}
    }
    \ifthenelse{\isundefined{\href}}{%
        \UML@ref@title\UML@ref@foot
    }{%
        \href{#2}{\UML@ref@title}
    }
}
\newcommand{\umlexternalfile}[2][]{%
    \item[\umlfileicon]
    \ifthenelse{\equal{#1}{}}{%
        \texttt{#2}
    }{%
        #1\footnote{\texttt{#2}}
    }
}
\newcommand{\defterm}[2][]{%
    \ifthenelse{\boolean{UML@index@option}}{%
        \ifthenelse{\equal{#1}{}}{%
            \index{\umltermsname!#2}%
            \index{#2}%
        }{%
            \index{\umltermsname!#1}%
            \index{#1}%
        }%
    }{}%
    \emph{#2}\xspace}
\newcommand{\compliance}[2][]{%
    \ifthenelse{\boolean{UML@index@option}}{%
        \ifthenelse{\equal{#1}{}}{%
            \index{\umlcompliancename!#2}%
            \index{#2}%
        }{%
            \index{\umlcompliancename!#1}%
            \index{#1}%
        }%
    }{}%
    \textbf{#2}\xspace}
\newenvironment{umlconstraints}{%
    \par
    \umlconstraintsname
    \par
}{%
}
\newenvironment{ocl}{%
    \par
    \umloclname
    \par
    \verbatim
}{%
    \endverbatim
}
\newcommand{\umlurlicon}{\ensuremath{\triangleright}}
\newcommand{\umlfileicon}{\ensuremath{\triangle}}
\newcommand{\umltermsname}{Terms}
\newcommand{\umlcompliancename}{Compliance}
\newcommand{\umlconstraintsname}{\textbf{Constraints}}
\newcommand{\umloclname}{\textbf{OCL}}
\newcommand{\umlnotesname}{Notes}
\newcommand{\umldescriptionname}{Description}
\newboolean{UML@inside@category}
\setboolean{UML@inside@category}{false}
\newboolean{UML@category@extension}
\setboolean{UML@category@extension}{false}
\gdef\UML@category@index@start{\relax}
\gdef\UML@category@index@end{\relax}
\def\UML@category@name{}
\def\UML@category@major{}
\ifthenelse{\isundefined{\chapter}}{%
    \def\UML@category@header{%
        \gdef\UML@category@index@start{\relax}
        \gdef\UML@category@index@end{\relax}
    }%
    \def\UML@category@extension@header{%
        \section{\umlcategoryextensionprefix\ \UML@category@name\ \umlcategoryextensionpostfix}
        \gdef\UML@category@index@start{\index{\UML@category@name!extensions}}
        \gdef\UML@category@index@end{}
    }
}{%
    \def\UML@category@header{%
        \chapter{\UML@category@name}
        \gdef\UML@category@index@start{\index{\UML@category@name}}
        \gdef\UML@category@index@end{}
    }%
    \def\UML@category@extension@header{%
        \section{\umlcategoryextensionprefix\ \UML@category@name\ \umlcategoryextensionpostfix}
        \gdef\UML@category@index@start{\index{\UML@category@name!extensions}}
        \gdef\UML@category@index@end{}
    }%
}
\newenvironment{umlcategory}[2][major]{%
    \ifthenelse{\boolean{UML@inside@category}}{%
        UML@error{Can't nest categories}
    }{}%
    \gdef\UML@category@name{#2}
    \ifthenelse{\equal{#1}{extension}}{%
        \setboolean{UML@category@extension}{true}
        \UML@category@extension@header
        \label{UML:Category:\UML@category@major:\UML@category@name}
    }{%
        \setboolean{UML@category@extension}{false}
        \UML@category@header
        \let\UML@category@major=\UML@category@name
        \label{UML:Category:\UML@category@name}
    }
    \UML@category@index@start
    \setboolean{UML@inside@category}{true}
}{%
    \setboolean{UML@category@extension}{false}
    \setboolean{UML@inside@category}{false}
    \UML@category@index@end
}
\newcommand{\umlcategoryref}[1]{\ref{UML:Category:#1}}
\newcommand{\umlcategorydocumentationheader}{Package Description}
\newcommand{\umlcategoryextensionprefix}{Extensions to the}
\newcommand{\umlcategoryextensionpostfix}{Package}
\gdef\UML@classgroup@name{}
\newenvironment{umlclassgroup}[1]{%
    \ifthenelse{\boolean{UML@inside@category}}
    {}{
        \UML@Error{Class groups can only occur inside categories.}
    }
    \gdef\UML@classgroup@name{#1}
    \ifthenelse{\boolean{UML@category@extension}}{}{%
        \section{\UML@classgroup@name}
        \label{UML:ClassGroup:\UML@category@name:\UML@classgroup@name}
    }
    \ifthenelse{\boolean{UML@index@option}}{%
        \index{\UML@category@name!\UML@classgroup@name}
        \index{\UML@classgroup@name}
    }{}
}{%
}
\newcommand{\umlclassgroupref}[1]{\ref{UML:ClassGroup:\UML@category@name:#1}}
\newenvironment{umlusecases}{%
    \begin{umlclassgroup}{\umlusecasesname}
}{%
    \end{umlclassgroup}
}
\newcommand{\umlusecasesname}{Use Cases}
\gdef\UML@class@name{}
\newboolean{UML@inside@class}
\setboolean{UML@inside@class}{false}
\newenvironment{UML@class}[2]{%
    \ifthenelse{\boolean{UML@inside@category}}
    {}{
        \UML@Error{Class-like things can only occur inside categories.}
    }
    \ifthenelse{\boolean{UML@inside@class}}{
        \UML@Error{Class-like things cannot be nested.}
    }{}
    \setboolean{UML@inside@class}{true}
    \gdef\UML@class@name{#2}
    \subsection{\UML@class@name}
    \ifthenelse{\boolean{UML@category@extension}}{%
        \label{UML:Class:\UML@category@major:\UML@class@name}
    }{%
        \label{UML:Class:\UML@class@name}
    }
    \ifthenelse{\boolean{UML@index@option}}{%
        \ifthenelse{\boolean{UML@category@extension}}{%
            \index{\UML@class@name}
        }{%
            \index{\UML@class@name}
        }
    }{}
}{%
    \setboolean{UML@inside@class}{false}
}
\newenvironment{umlclass}[2][class]{%
    \ifthenelse{\equal{#1}{interface}}{%
        \def\UML@class@type{\umlinterfacename}
    }{%
        \def\UML@class@type{\umlclassname}
    }%
    \begin{UML@class}{\UML@class@type}{#2}
}{%
    \end{UML@class}
}
\newenvironment{umlusecase}[1]{%
    \begin{UML@class}{\umlusecasename}{#1}
}{%
    \end{UML@class}
}
\newboolean{UML@inside@preamble}
\setboolean{UML@inside@preamble}{false}
\newenvironment{umlpreamble}{%
    \setboolean{UML@inside@preamble}{true}%
    \begin{list}{}{
        \setlength{\topsep}{0cm}
        \setlength{\parsep}{0cm}
        \setlength{\itemsep}{0cm}
        \setlength{\leftmargin}{0cm}
        \setlength{\rightmargin}{1cm}
    }
}{%
    \end{list}
    \setboolean{UML@inside@preamble}{false}%
}
\newcommand{\umlparameter}[3]{%
    \ifthenelse{\boolean{UML@inside@preamble}}{}{%
        \UML@Error{Parameters must be within a umlpreamble environment.}%
    }%
    \item
    \textbf{#1\ifthenelse{\equal{#2}{}}{}{: #2}} #3
}
\newcommand{\umlclassref}[1]{%
    \@ifundefined{r@UML:Class:#1}{%
        \typeout{Class #1 not in document - ignoring cross-reference}%
    }{%
        \ifthenelse{\boolean{UML@sectionmark@option}}{\S}{}\ref{UML:Class:#1}%
    }%
}
\newcommand{\umlclassnamed}[1]{%
    \@ifundefined{r@UML:Class:#1}{%
        #1\typeout{Class #1 not in document - ignoring cross-reference}%
    }{%
        #1~\ifthenelse{\boolean{UML@sectionmark@option}}{\S}{}\ref{UML:Class:#1}%
    }%
}
\newcommand{\umlclassname}{Class}
\newcommand{\umlinterfacename}{Interface}
\newcommand{\umlusecasename}{Use Case}
\newenvironment{umlattributes}{%
    \ifthenelse{\boolean{UML@inside@class}}{}{
        \UML@Error{Attributes must be inside a umlclass.}
    }
    \subsubsection{\umlattributesname}
    \ifthenelse{\boolean{UML@category@extension}}{%
        \label{UML:\UML@category@major:\UML@class@name:Attributes}
    }{
        \label{UML:\UML@class@name:Attributes}
    }
    \ifthenelse{\boolean{UML@index@option}}{%
        \index{\UML@class@name!\umlattributesname}
    }{}
    \begin{description}
}{%
    \end{description}
}
\newcommand{\umlattribute}[5][]{%
    \def\UML@staticoption{}
    \def\UML@derivedoption{}
    \@for\UML@option:=#1\do{%
        \ifthenelse{\equal{\UML@option}{static}}{%
            \def\UML@staticoption{\umlstaticattributename~}
        }{}
        \ifthenelse{\equal{\UML@option}{derived}}{%
            \def\UML@derivedoption{\umlderivedattributename~}
        }{}
    }
    \item[#2: #3 \ifthenelse{\equal{#4}{}}{}{ = #4}]
    \UML@staticoption \UML@derivedoption #5
}
\newcommand{\umlattributesname}{Attributes}
\newcommand{\umlstaticattributename}{\emph{static}}
\newcommand{\umlderivedattributename}{\emph{derived}}
\newenvironment{umloperations}{%
    \ifthenelse{\boolean{UML@inside@class}}{}{
        \UML@Error{Operations must be inside a umlclass.}
    }
    \subsubsection{\umloperationsname}
\pagebreak[0]
    \ifthenelse{\boolean{UML@category@extension}}{%
        \label{UML:\UML@category@major:\UML@class@name:Operations}
    }{
        \label{UML:\UML@class@name:Operations}
    }
    \ifthenelse{\boolean{UML@index@option}}{%
        \index{\UML@class@name!\umloperationsname}
    }{}
}{%
}
\newboolean{UML@inside@operation}
\setboolean{UML@inside@operation}{false}
\gdef\UML@operation@name{}
\newenvironment{umloperation}[2][1]{%
    \ifthenelse{\boolean{UML@inside@class}}{}{%
        \UML@Error{Operations must be inside a class.}%
    }%
    \ifthenelse{\boolean{UML@inside@operation}}{%
        \UML@Error{Operations cannot be nested.}%
    }{}%
    \setboolean{UML@inside@operation}{true}%
    \gdef\UML@operation@name{#2}%
    \gdef\UML@operation@id{#2-#1}%
    \ifthenelse{\boolean{UML@index@option}}{%
        \index{\UML@operation@name @\texttt{\UML@operation@name}}
    }{}%
}{%
    \setboolean{UML@inside@operation}{false}%
    \noindent \hspace{0cm} \\[0.1ex]%
}
\newcommand{\umlsignature}[1]{%
    \ifthenelse{\boolean{UML@category@extension}}{%
        \label{UML:Operation:\UML@category@major:\UML@class@name:\UML@operation@id}%
    }{%
        \label{UML:Operation:\UML@class@name:\UML@operation@id}%
    }%
    \ifthenelse{\boolean{UML@inside@preamble}}{%
        \item
        \textbf{#1}
        \ifthenelse{\boolean{UML@margin@option}}{%
            \marginpar{\hspace{0cm}\footnotesize\UML@operation@name}%
        }{}
    }{%
        \textbf{#1}
    }%
}
\newcommand{\umlexceptions}[1]{%
    \ifthenelse{\boolean{UML@inside@preamble}}{}{%
        \UML@Error{Exceptions must be within a umlpreamble environment.}%
    }%
    \item
    \textbf{\umlraisesname:} #1
}
\newcommand{\umloperationref}[2][1]{%
    \ifthenelse{\boolean{UML@inside@class}}{}{
        \UML@Error{Operation references must be inside a class.}
    }
    \ifthenelse{\boolean{UML@category@extension}}{%
        \ref{UML:Operation:\UML@category@major:\UML@class@name:#2-#1}
    }{%
        \ref{UML:Operation:\UML@class@name:#2-#1}
    }
}
\newcommand{\umloperationpageref}[2][1]{%
    \ifthenelse{\boolean{UML@inside@class}}{}{
        \UML@Error{Operation references must be inside a class.}
    }
    \ifthenelse{\boolean{UML@category@extension}}{%
        \pageref{UML:Operation:\UML@category@major:\UML@class@name:#2-#1}
    }{%
        \pageref{UML:Operation:\UML@class@name:#2-#1}
    }
}
\newcommand{\umlraisesname}{Raises}
\newcommand{\umloperationsname}{Operations}
\newboolean{UML@inside@relationships}
\setboolean{UML@inside@relationships}{false}
\newlength{\UML@summary@class@width}
\setlength{\UML@summary@class@width}{6cm}
\newlength{\UML@summary@doc@width}
\setlength{\UML@summary@doc@width}{\textwidth}
\addtolength{\UML@summary@doc@width}{-\UML@summary@class@width}
\addtolength{\UML@summary@doc@width}{-4cm}
\newenvironment{umlrelationships}{%
    \ifthenelse{\boolean{UML@inside@class}}%
    {}{%
        \UML@Error{Relationships can only occur inside classes.}%
    }%
    \ifthenelse{\boolean{UML@inside@relationships}}{%
        \UML@Error{Relationships cannot be nested.}%
    }{}%
    \setboolean{UML@inside@relationships}{true}%
    \ifthenelse{\boolean{UML@index@option}}{%
        \index{\UML@class@name!\umlrelationshipsname}%
    }{}%
    \subsubsection{\umlrelationshipsname}
\gdef\UML@inherits@tablenote{}
    \gdef\UML@inheritedby@tablenote{}
\gdef\UML@realizes@tablenote{}
\gdef\UML@realizedby@tablenote{}
\gdef\UML@instantiates@tablenote{}
\gdef\UML@instantiatedby@tablenote{}
\gdef\UML@association@tablenote{}
\begin{center}
    \begin{tabular}{lp{\UML@summary@class@width}p{\UML@summary@doc@width}r}
    \hline
    & \umlclassname & \umldescriptionname  & \umlnotesname \\
    \hline
}{%
    \hline
\multicolumn{4}{l}{
     \footnotesize
\UML@inherits@tablenote\
     \UML@inheritedby@tablenote\
\UML@realizes@tablenote\
\UML@realizedby@tablenote\
\UML@instantiates@tablenote\
\UML@instantiatedby@tablenote\
\UML@association@tablenote\
} \\
    \end{tabular}
\end{center}
    \setboolean{UML@inside@relationships}{false}
}
\newcommand{\UML@relationship}[4]{%
    \ifthenelse{\boolean{UML@inside@relationships}}{}{%
        \UML@Error{Relationships can only occur inside the umlrelationships environment.}%
    }%
    \ifthenelse{\boolean{UML@index@option}}{%
        \index{#2!\umlrelationshipsname}%
    }{}%
    #1 & {\hspace{0cm}\umlclassnamed{#2}} & {\hspace{0cm}#3} & #4 \\
}
\newcommand{\umlinherits}[2]{
\gdef\UML@inherits@tablenote{\umlinheritsicon:\umlinheritsname}%
    \UML@relationship{\umlinheritsicon}{#1}{#2}{}
}
\newcommand{\umlrealizes}[2]{
    \gdef\UML@realizes@tablenote{\umlrealizesicon:\umlrealizesname}%
    \UML@relationship{\umlrealizesicon}{#1}{#2}{}
}
\newcommand{\umlinstantiates}[2]{
    \gdef\UML@instantiates@tablenote{\umlinstantiatesicon:\umlinstantiatesname}%
    \UML@relationship{\umlinstantiatesicon}{#1}{#2}{}
}
\newcommand{\umlinheritedby}[2]{
    \gdef\UML@inheritedby@tablenote{\umlinheritedbyicon:\umlinheritedbyname}%
    \UML@relationship{\umlinheritedbyicon}{#1}{#2}{}
}
\newcommand{\umlrealizedby}[2]{
    \gdef\UML@realizedby@tablenote{\umlrealizedbyicon:\umlrealizedbyname}%
    \UML@relationship{\umlrealizedbyicon}{#1}{#2}{}
}
\newcommand{\umlinstantiatedby}[2]{
    \gdef\UML@instantiatedby@tablenote{\umlinstantiatedbyicon:\umlinstantiatedbyname}
    \UML@relationship{\umlinstantiatedbyicon}{#1}{#2}{}
}
\newcommand{\umlassocrelationship}[4][]{%
    \gdef\UML@association@tablenote{
\umlassociationicon:\umlassociationname\
\hfill
        \umlnavigableicon:\umlnavigablename\
       \umlaggregateicon:\umlaggregatename\
        \umlcompositeicon:\umlcompositename\
}%
    \umlassociationicon &
    {\hspace{0cm}\umlclassnamed{#2}} &
    {\hspace{0cm}#3 #4} &
    \@for\UML@option:=#1\do{%
                \ifthenelse{\equal{\UML@option}{navigable}}{%
                \umlnavigableicon%
             }{}%
                \ifthenelse{\equal{\UML@option}{aggregate}}{%
                \umlaggregateicon%
             }{}%
                \ifthenelse{\equal{\UML@option}{composite}}{%
                \umlcompositeicon%
             }{}%
        }%
     \\
}
\newcommand{\umlrelationshipname}{Relationship}
\newcommand{\umlrelationshipsname}{Relationships}
\newcommand{\umlinheritsname}{Inherits}
\newcommand{\umlinheritedbyname}{Inherited by}
\newcommand{\umlrealizesname}{Realizes}
\newcommand{\umlrealizedbyname}{Realized by}
\newcommand{\umlinstantiatesname}{Instantiates}
\newcommand{\umlinstantiatedbyname}{Instantiated by}
\newcommand{\umlinheritsicon}{\ensuremath{\Uparrow}}
\newcommand{\umlinheritedbyicon}{\ensuremath{\Downarrow}}
\newcommand{\umlrealizesicon}{\ensuremath{\uparrow}}
\newcommand{\umlrealizedbyicon}{\ensuremath{\downarrow}}
\newcommand{\umlinstantiatesicon}{\ensuremath{\succ}}
\newcommand{\umlinstantiatedbyicon}{\ensuremath{\prec}}
\newboolean{UML@inside@associations}
\setboolean{UML@inside@associations}{false}
\newboolean{UML@inside@assocsummary}
\setboolean{UML@inside@assocsummary}{false}
\newboolean{UML@inside@assocfull}
\setboolean{UML@inside@assocfull}{false}
\def\UML@association@name{}
\newenvironment{umlassociations}{%
    \ifthenelse{\boolean{UML@inside@category}}{%
    }{%
        UML@Error{umlassociations must be inside a umlcategory.}
    }
    \ifthenelse{\boolean{UML@inside@associations}}{%
        UML@Error{umlassociations must not be nested.}
    }{}
    \ifthenelse{\boolean{UML@category@extension}}{%
        \subsection{\umlassociationsname}
        \label{UML:\UML@category@major:\UML@category@name:Associations}
        \ifthenelse{\boolean{UML@index@option}}{
            \index{\umlassociationsname!\UML@category@name}
            \index{\UML@category@name!\umlassociationsname}
        }{}
    }{
        \section{\umlassociationsname}
        \label{UML:\UML@category@name:Associations}
        \ifthenelse{\boolean{UML@index@option}}{
            \index{\umlassociationsname!\UML@category@name}
            \index{\UML@category@name!\umlassociationsname}
        }{}
    }
    \setboolean{UML@inside@associations}{true}
    \setboolean{UML@inside@assocfull}{true}
}{%
    \setboolean{UML@inside@associations}{false}
    \setboolean{UML@inside@assocfull}{false}
}
\newenvironment{umlassocsummary}{%
    \ifthenelse{\boolean{UML@inside@associations}}{%
    }{%
        UML@Error{umlassocsummary must be used inside umlassociations.}
    }
    \ifthenelse{\boolean{UML@inside@assocsummary}}{%
        UML@Error{umlassocsummary must not be nested.}
    }{}
    \setboolean{UML@inside@assocsummary}{true}
    \setboolean{UML@inside@assocfull}{false}
    \ifthenelse{\boolean{UML@category@extension}}{%
        \gdef\UML@tab@label{UML:\UML@category@major:\UML@category@name:Associations:Summary}
    }{%
        \gdef\UML@tab@label{UML:\UML@category@name:Associations:Summary}
    }
    \begin{longtable}{llp{\UML@summary@class@width}ll}
    \hline
    \caption{\UML@category@name --- \umlassociationsname \label{\UML@tab@label}}\\
    \hline
    \multicolumn{5}{l}{\umlassociationname} \\
    \hspace{1em} & \umlrolename & \umlclassname & \umlcardinalityname & \umlnotesname \\
    \hline
    \endfirsthead
    \hline
    \caption{\umlcontinuedname \label{\UML@tab@label}} \\
    \hline
    \multicolumn{5}{l}{\umlassociationname} \\
    \hspace{1em} & \umlrolename & \umlclassname & \umlcardinalityname & \umlnotesname \\
    \hline
    \endhead
    \hline
    \endfoot
    \hline
    \multicolumn{5}{r}{\footnotesize
        \umlnavigableicon:\umlnavigablename\
        \umlaggregateicon:\umlaggregatename\
        \umlcompositeicon:\umlcompositename\
    } \\
    \endlastfoot
}{%
    \hline
    \end{longtable}
    \setboolean{UML@inside@assocsummary}{false}
    \setboolean{UML@inside@assocfull}{true}
}
\newcommand{\umlassociation}[1]{%
    \ifUML@inside@assocsummary%
        \multicolumn{5}{l}{#1} \\
    \else%
        \ifthenelse{\boolean{UML@category@extension}}{%
               \subsubsection{#1}
               \label{UML:\UML@category@major:\UML@category@name:Association:#1}
        }{%
               \subsection{#1}
               \label{UML:\UML@category@name:Association:#1}
        }
        \ifthenelse{\boolean{UML@index@option}}{%
               \index{\umlassociationsname!#1}%
               \index{#1}%
        }{}%
    \fi%
    \gdef\UML@association@name{#1}%
}
\newcommand{\umlrole}[4][]{%
    \ifthenelse{\boolean{UML@inside@associations}}{%
    }{%
        UML@Error{umlrole must be used inside umlassociations.}
    }

    \ifUML@inside@assocsummary%
        \hspace{1em} & #2 & {\hspace{0cm}\umlclassnamed{#3}} & #4 &
        \@for\UML@option:=#1\do{%
                \ifthenelse{\equal{\UML@option}{navigable}}{%
                \umlnavigableicon%
             }{}%
                \ifthenelse{\equal{\UML@option}{aggregate}}{%
                \umlaggregateicon%
             }{}%
                \ifthenelse{\equal{\UML@option}{composite}}{%
                \umlcompositeicon%
             }{}%
        }%
        \\
    \else\fi%
    \ifUML@inside@assocfull%
        \par \noindent
           \textbf{\umlrolename: #2}
        \@for\UML@option:=#1\do{%
                \ifthenelse{\equal{\UML@option}{navigable}}{%
                \emph{ \umlnavigablename }%
             }{}%
                \ifthenelse{\equal{\UML@option}{aggregate}}{%
                \emph{ \umlaggregatename }%
             }{}%
                \ifthenelse{\equal{\UML@option}{composite}}{%
                \emph{ \umlcompositeicon }%
             }{}%
        }%
        \ifthenelse{\equal{#4}{}}{ #3.}{ #3, #4.}
        \ifthenelse{\boolean{UML@index@option}}{%
               \index{\umlrolesname!#2}
               \index{#2}
        }{}%
    \else\fi%
}
\newcommand{\umlassociationsname}{Associations}
\newcommand{\umlassociationname}{Association}
\newcommand{\umlassociationicon}{\ensuremath{\leftrightarrow}}
\newcommand{\umlrolesname}{Roles}
\newcommand{\umlrolename}{Role}
\newcommand{\umlcontinuedname}{\ldots continued}
\newcommand{\umlcardinalityname}{Card.}
\newcommand{\umlnavigablename}{Navigable}
\newcommand{\umlaggregatename}{Aggregate}
\newcommand{\umlcompositename}{Composite}
\newcommand{\umlnavigableicon}{\ensuremath{\rightarrow}}
\newcommand{\umlaggregateicon}{\ensuremath{\lozenge}}
\newcommand{\umlcompositeicon}{\ensuremath{\blacklozenge}}
\gdef\UML@diagram@caption{}
\gdef\UML@diagram@type{}
\newenvironment{UML@diagram}[4]{%
    \ifthenelse{\boolean{UML@inside@category}}
    {}{
        \UML@Error{Diagrams can only occur inside categories.}
    }
    \begin{figure}[p]
    \begin{center}
    \ifthenelse{\equal{#1}{wide}}{%
        \includegraphics*[
            angle=90,
            width=\UML@diagramwidth,
            height=\UML@diagramheight,
             keepaspectratio=true
        ]{#4}
    }{%
        \includegraphics*[
            width=\UML@diagramwidth,
            height=\UML@diagramheight,
             keepaspectratio=true
        ]{#4}
    }
    \gdef\UML@diagram@caption{#3}
    \gdef\UML@diagram@type{#2}
}{%
    \caption{\UML@diagram@type --- \UML@diagram@caption}
    \ifthenelse{\boolean{UML@category@extension}}{%
        \label{UML:Diagram:\UML@category@major:\UML@category@name:\UML@diagram@caption}
    }{
        \label{UML:Diagram:\UML@category@name:\UML@diagram@caption}
    }
    \ifthenelse{\boolean{UML@index@option}}{
        \index{\UML@diagram@type!\UML@diagram@caption}
        \index{\UML@diagram@caption!\UML@diagram@type}
        \index{\UML@category@major!\UML@diagram@type}
    }{}
    \end{center}
    \end{figure}
}
\newenvironment{umlclassdiagram}[3][tall]{%
    \begin{UML@diagram}{#1}{\umlclassdiagramname}{#2}{#3}
}{%
    \end{UML@diagram}
}
\newcommand{\umlclassdiagramname}{Class Diagram}
\newcommand{\umldiagramref}[1]{%
    \@ifundefined{r@UML:Diagram:\UML@category@major:\UML@category@name:#1}{%
        \ref{UML:Diagram:\UML@category@name:#1}
    }{%
        \ref{UML:Diagram:\UML@category@major:\UML@category@name:#1}
    }
}
\endinput
%%
%% End of file `umldoc.sty'.
