Changeset 1047

Show
Ignore:
Timestamp:
10/28/06 07:25:18 (2 years ago)
Author:
wrobell
Message:

- added name align sketch
- specification of named items styles related to name align finished

- document structure improvements

  • defined pylst environment
  • defined code float environment

- clear up name align specification

- document structure improvements - use code extension for float code listings

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • gaphor/branches/new-canvas/doc/items.tex

    r1043 r1047  
    1 \documentclass[draft]{book} 
     1\documentclass{book} 
    22\usepackage[papername = a4paper, margin = 3cm]{geometry} 
    33\usepackage{graphicx} 
    44\usepackage{hyperref} 
     5\usepackage{listings} 
     6\usepackage{float} 
    57 
    68\title{Gaphor Diagram Item Model} 
    79\author{wrobell@pld-linux.org} 
     10 
     11\newfloat{code}{th}{code} 
     12 
     13\lstnewenvironment{pylst}{\lstset{language=Python}}{} 
    814 
    915\newcommand{\rmodule}[1]{\texttt{#1}} 
     
    149155applies for tail. 
    150156 
    151 \subsection{Item Styles} 
     157\subsection{Item Styles}\label{itemstyles} 
    152158All the items are going to contain different parts. 
    153159Many of such parts can be shared by other items, for example 
     
    184190\iattr{\_\_stereotype\_\_}{item static stereotype} 
    185191\iattr{\_\_style\_\_}{item styles information} 
     192\iattr{style}{item style information} 
    186193\end{attrs} 
    187194\begin{entitydesc} 
     
    313320changed, i.e. initial node item. 
    314321 
     322It should be possible to align name of named element with styles 
     323(see~\ref{itemstyles}) as depending on an element, the name can be 
     324displayed in different places related to an item, i.e. 
     325\begin{itemize} 
     326\item class               --- top center 
     327\item use case            --- middle center 
     328\item object node         --- middle center 
     329\item actor               --- bottom center, outside item bounduaries 
     330\item initial action node --- top left, outside item bounduaries 
     331\item decision node       --- bottom center, outside item bounduaries 
     332\end{itemize} 
     333 
    315334%fixme: there can be items with initial name and without initial name 
     335 
     336\section{Styles} 
     337Kind of information we need to align the name 
     338\begin{itemize} 
     339\item horizontal align information (left, center or right) 
     340\item vertical align information (top, middle or bottom) 
     341\item padding specified as in CSS (top right bottom left) 
     342\item is name outside an item? 
     343\end{itemize} 
     344 
     345Styles for name align are defined in table~\ref{nameditems:styles:spec} 
     346(see diagram~\ref{nameditems:styles:example} for example). 
     347 
     348\begin{table} 
     349\begin{center} 
     350\begin{tabular}{|l|l|l|} 
     351\hline 
     352Name           & Default value     & Description \\ 
     353\hline 
     354name--align    & ('center', 'top') & align information \\ 
     355name--padding  & (5, 5, 5, 5)      & name padding \\ 
     356name--outside  & False             & name outside/inside item bounduaries \\ 
     357\hline 
     358\end{tabular} 
     359\caption{Specification of name align styles}\label{nameditems:styles:spec} 
     360\end{center} 
     361\end{table} 
     362 
     363%\item vertical align information (top, middle or bottom) 
     364%\item padding specified as in CSS (top right bottom left) 
     365%\item is name outside an item? 
     366 
     367\begin{code} 
     368\lstset{language={Python}} 
     369\begin{pylst} 
     370class NamedItem(DiagramItem): 
     371    __style__ = { 
     372        'name-align' : ('center', 'top'), 
     373        'name-padding': (5, 5, 5, 5), 
     374        'name-outside': False, 
     375    } 
     376\end{pylst} 
     377\caption{Named items style example}\label{nameditems:styles:example} 
     378\end{code} 
    316379 
    317380\section{Classes} 
     
    320383\begin{class}{NamedItem} 
    321384\begin{entitydesc} 
    322 Calculates minimal size based on name size. Draws UML object's name. 
     385Calculates minimal size based on name size. Draws UML object's name using 
     386style information. 
    323387\end{entitydesc} 
    324388\end{class}