-
G2;c       s    d  Z    h  d d <d d <d d <d d <d	 d
 <d d <d d <Z - y . e d i d  d Z Wn / 0 d Z n X5 d k Z 6 d k Z 7 d k Z < d k Z = d k Z > d k	 Z D d   Z
 M d e i i i f d     YZ e d j o n d S(   s%   Formatter which produces dia files.

s   $RCSfile: formatter_Dia.py,v $s   module_names!   Joerg Henrichs <jhenrichs@gmx.de>s   creators   HappyDocs   projects   Sat, 03-Jun-2000 17:58:48 EDTs   createds   $Author: doughellmann $s   authors   $Revision: 1.1 $s   versions   $Date: 2001/10/24 21:27:35 $s   dates    i   s   0.0Nc      s#   D E F h  d d <t  d <Sd S(   s;   Return information about this module to the dynamic loader.s   Dias   names   factoryN(   s   DiaFormatter(    (    (    sa   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/formatter/formatter_Dia.pys
   entryPointD s   s   DiaFormatterc      s   M d  Z  ] _ e d d d  Z  d d  Z  d e d  Z  d   Z  d   Z  d	   Z d
   Z 
d   Z	 d   Z
 d   Z {d   Z d   Z d   Z RS(   sD  Formatter which produces dia files.

      Parameters

        filenamePrefix -- A prefix to preprend to the base names of
                          files and directories being created.  This
                          is useful for situations where the names
                          which would be automatically generated might
                          cause a name clash or conflict.

        dateStampFiles -- Boolean indicating whether or not to include
                          a date/time stamp in files.

        debug -- Enable debugging comments in output.
      
    i   i    c    s   _ n s t  i i |  |  _ v | |  _ { d |  _ | d |  _ } |  i |  _	 ~ |  i	 |  _
  |  i |  _  d |  _  d |  _  d |  _  d |  _  d |  _  h  |  _  h  |  _  t t  i i i i  |  | | f  |   d Sd S(   s  Initialize the DiaFormatter.

        Parameters

            'docSet' -- the DocSet instance containing global cross-reference
                      information
            
            '**configuration' -- additional, optional, configuration values

        f0.050000000000000003i
   ii    i   N(   s   happydoclibs   optiontoolss   getBooleanArgumentValues   dateStampFiless   selfs   _date_stamp_filess   debugs   _dxs   _dys   _xmins   _nextxs   _nextys   _connectlengths   _ymaxs	   _lastymaxs   _paperWidths	   _objectIds   _ObjName2Ids   _ObjId2Positions   applys	   formatters   fileformatterbases   FileBasedFormatters   __init__s   docSets   docsetTitles   configuration(   s   selfs   docSets   docsetTitles   dateStampFiless   debugs   configuration(    (    sa   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/formatter/formatter_Dia.pys   __init___ s&   
s   &nbsp;c    sZ      d G| GH t i i i i |   |  |  }  |  i	 | | |   | Sd S(   sK   Open output destination using 'name' with the title from 'title1'.
        s   OPEN OUTPUT: N(   s   names   happydoclibs	   formatters   fileformatterbases   FileBasedFormatters
   openOutputs   selfs   title1s   fs
   fileHeaders   title2(   s   selfs   names   title1s   title2s   f(    (    sa   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/formatter/formatter_Dia.pys
   openOutput s   c    s+      |  i d t   |   d Sd S(   s8   Write the formatting for a file header to the open file.s  <?xml version="1.0"?>
<diagram xmlns:dia="http://www.lysator.liu.se/~alla/dia/">
  <diagramdata>
    <attribute name="background">
      <color val="#ffffff"/>
    </attribute>
    <attribute name="paper">
      <composite type="paper">
        <attribute name="name">
          <string>#A4#</string>
        </attribute>
        <attribute name="tmargin">
          <real val="2.82"/>
        </attribute>
        <attribute name="bmargin">
          <real val="2.82"/>
        </attribute>
        <attribute name="lmargin">
          <real val="2.82"/>
        </attribute>
        <attribute name="rmargin">
          <real val="2.82"/>
        </attribute>
        <attribute name="is_portrait">
          <boolean val="true"/>
        </attribute>
        <attribute name="scaling">
          <real val="1"/>
        </attribute>
        <attribute name="fitto">
          <boolean val="false"/>
        </attribute>
      </composite>
    </attribute>
  </diagramdata>
    N(   s   selfs   writeRaws   localss   output(   s   selfs   title1s   title2s   output(    (    sa   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/formatter/formatter_Dia.pys
   fileHeader s   %c    s.      |  i |   | i    d Sd S(   s   Close the 'output' handle.N(   s   selfs
   fileFooters   outputs   close(   s   selfs   output(    (    sa   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/formatter/formatter_Dia.pys   closeOutput s   c    s$      |  i d |   d Sd S(   s8   Write the formatting for a file footer to the open file.s
   </diagram>N(   s   selfs   writeRaws   output(   s   selfs   output(    (    sa   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/formatter/formatter_Dia.pys
   fileFooter s   c    s3      |  i i }  |  i d t   |  d S(   s:   Write the beginning of the object section in the dia file.s  <layer name="Background" visible="true">
    <object type="Standard - Text" version="0" id="O11">
        <attribute name="obj_pos">
            <point val="6.0271,-4.71823"/>
        </attribute>
        <attribute name="text">
            <composite type="text">
                <attribute name="string">
                    <string>#%(title)s#</string>
                </attribute>
                <attribute name="font">
                    <font name="Helvetica-Bold"/>
                </attribute>
                <attribute name="height">
                    <real val="1"/>
                </attribute>
                <attribute name="pos">
                    <point val="6.0271,-4.71823"/>
                </attribute>
                <attribute name="color">
                    <color val="#000000"/>
                </attribute>
                <attribute name="alignment">
                    <enum val="1"/>
                </attribute>
            </composite>
        </attribute>
    </object>
N(   s   selfs   _docsets   _titles   titles   writeRaws   localss   output(   s   selfs   outputs   title(    (    sa   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/formatter/formatter_Dia.pys   BeginObjectSection s   c    s   |  i d |  d S(   s4   Write the end of the object section in the dia file.s	   </layer>
N(   s   selfs   writeRaws   output(   s   selfs   output(    (    sa   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/formatter/formatter_Dia.pys   EndObjectSections   c    s   
| o. t |  } t t d   |   } n d | GHd } d } | d d } | d d } | | f Sd	 S(
   sK   Return a tuple consisting of the width and the height of
        an object.c    s   t  |  d  S(   Ni    (   s   lens   x(   s   x(    (    sa   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/formatter/formatter_Dia.pys   <lambda>s    sF   WARNING: Using default size values for %s because there are no methodsi   i   f0.80000000000000004i   f0.48480000000000001f2.2544N(	   s   methodss   lens   num_methodss   maxs   maps   maxlens
   objectNames   heights   width(   s   selfs
   objectNames   methodss   num_methodss   maxlens   widths   height(    (    sa   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/formatter/formatter_Dia.pys   _ComputeSize
s   
		c    s,   |  i |  _ |  i |  i |  _ d  S(   N(   s   selfs   _xmins   _nextxs   _ymaxs   _dys   _nexty(   s   self(    (    sa   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/formatter/formatter_Dia.pys   NewLines   c    s  '(|  i | |  \ } } -|  i | |  i j o |  i |  i j o .|  i	   n 0d |  i
 } 1|  i
 d |  _
 3h  |  i d <|  i d <| d <| d <d |  i |  i |  i |  i |  i | |  i |  i | |  i f d <| d	 <| d
 <} =| |  i | <>|  i |  i |  i | |  i | f |  i | <D|  i | d |  i |  _ E|  i | |  i j o" F|  i | d |  i |  _ n H|  i d | |  r|  i | |  t|  i d | |  d S(   sD  Writes an object to the dia file.
        Parameters:

        objectName: Name of the class (string)
        methods:    list containing the information about the methods.
                    Each entry in the list is a tuple consisting of
                    (methodName, methodType, methodParameters)
                    s   O%di   s   xs   ys   widths   heights   %f,%f;%f,%fs   bbs   names   idi   s  <object type="UML - Class" version="0" id="%(id)s">
        <attribute name="obj_pos">
        <point val="%(x)f,%(y)f"/>
        </attribute>
        <attribute name="obj_bb">
        <rectangle val="%(bb)s"/>
        </attribute>
        <attribute name="elem_corner">
        <point val="%(x)f,%(y)f"/>
        </attribute>
        <attribute name="elem_width">
        <real val="%(width)f"/>
        </attribute>
        <attribute name="elem_height">
        <real val="%(height)f"/>
        </attribute>
        <attribute name="name">
        <string>#%(name)s#</string>
        </attribute>
        <attribute name="stereotype">
        <string/>
        </attribute>
        <attribute name="abstract">
        <boolean val="false"/>
        </attribute>
        <attribute name="suppress_attributes">
        <boolean val="false"/>
        </attribute>
        <attribute name="suppress_operations">
        <boolean val="false"/>
        </attribute>
        <attribute name="visible_attributes">
        <boolean val="true"/>
        </attribute>
        <attribute name="visible_operations">
        <boolean val="true"/>
        </attribute>
        <attribute name="attributes"/>
        s   <attribute name="template">
        <boolean val="false"/>
      </attribute>
      <attribute name="templates"/>
    </object>N(   s   selfs   _ComputeSizes
   objectNames   methodss   widths   heights   _nextxs   _paperWidths   _xmins   NewLines	   _objectIds   objIds   _nextys   _dxs   _dys   paras   _ObjName2Ids   _ObjId2Positions   _ymaxs   writeRaws   outputs   _writeMethods(   s   selfs
   objectNames   methodss   outputs   widths   paras   objIds   height(    (    sa   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/formatter/formatter_Dia.pys   WriteObjects   -
0"*c 	   s   {| o |  i d |  d Sn |  i d |  x | D] \ } } } | o d | } n
 d } | o d } n
 d } h  | d <| d <| d	 <} |  i d
 | |  qL W|  i d |  d Sd S(   s  Writes the methods of a class.
        Parameter:
        
        methods:    list containing the information about the methods.
                    Each entry in the list is a tuple consisting of
                    (methodName, methodType, methodParameters)s   <attribute name="operations"/>
Ns   <attribute name="operations">
s8   <attribute name="type"><string>#%s#</string></attribute>s,   <attribute name="type"><string/></attribute>s   <attribute name="parameters"/>s   names   types
   parameterss              <composite type="umloperation">
              <attribute name="name"><string>#%(name)s#</string></attribute>
              %(type)s
              <attribute name="visibility"><enum val="0"/></attribute>
              <attribute name="abstract"><boolean val="false"/></attribute>
              <attribute name="class_scope"><boolean val="false"/></attribute>
              %(parameters)s
            </composite>
s   </attribute>
(
   s   methodss   selfs   writeRaws   outputs   methods   types
   parameterss   sTypes   sParameterss   para(	   s   selfs   methodss   outputs   paras   sParameterss
   parameterss   types   methods   sType(    (    sa   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/formatter/formatter_Dia.pys   _writeMethods{s"   
 
	
	$c    s  t  i | d  d } |  i i | t  } | oJ d | GH|  i | d t t f g |  |  i i | t  } n t  i | d  d } |  i i | t  }	 |	 oJ d | GH|  i | d t t f g |  |  i i | t  }	 n |  i | } |  i |	 } | d | d d } | d | d d } | | j  o | } | } n | } | } | d | d j  o+ | d } | d } | d } n( | d } | d } | d } | d | d	 d }
 d
 |  i } |  i d	 |  _ h  d | d | d | d | d |  i f d <d | | d f d <d | | d f d <d | |
 f d <d | |
 f d <d | | d	 f d <| d <|	 d <| d <} |  i d | |  d S(   sJ   Write a generalization relation between class_name and
        base_class.s   .is   class_name '%s' not found.s   __init__s   base_class '%s' not found.i    i   i   i   s   O%ds   %f,%f;%f,%ff0.84999999999999998s   bbs   %f,%fs   origins   p1s   p2s   p3s   p4s   objIds   handle0s   handle1s8      <object type="UML - Generalization" version="0" id="$(ObjId)s">
        <attribute name="obj_pos"><point val="%(origin)s"/></attribute>
      <attribute name="obj_bb">
        <rectangle val="%(bb)s"/>
      </attribute>
        <attribute name="orth_points">
        <point val="%(p1)s"/>
        <point val="%(p2)s"/>
        <point val="%(p3)s"/>
        <point val="%(p4)s"/>
      </attribute>
      <attribute name="orth_orient">
        <enum val="1"/>
        <enum val="0"/>
        <enum val="1"/>
      </attribute>
      <attribute name="name"><string/></attribute>
      <attribute name="stereotype"><string/></attribute>
      <connections>
        <connection handle="0" to="%(handle0)s" connection="6"/>
        <connection handle="1" to="%(handle1)s" connection="1"/>
      </connections>
    </object>
N(   s   strings   splits
   class_names   selfs   _ObjName2Ids   gets   Nones
   classObjIds   WriteObjects   outputs
   base_classs	   baseObjIds   _ObjId2Positions   classLocations   baseLocations   xclasss   xbases   x1s   x2s   ymaxs   y1s   y2s   ymiddles	   _objectIds   objIds   _connectlengths   paras   writeRaw(   s   selfs
   class_names
   base_classs   outputs
   classObjIds   y2s   y1s   classLocations   paras	   baseObjIds   ymiddles   xclasss   x2s   objIds   x1s   xbases   baseLocations   ymax(    (    sa   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/formatter/formatter_Dia.pys   writeGeneralizationsD   ""			c    s   d Sd S(   sA   Returns the name of the root node for documentation of this type.s   dia.diaN(    (   s   self(    (    sa   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/formatter/formatter_Dia.pys   getRootNodeNames   (   s   __doc__s   Nones   __init__s
   openOutputs
   fileHeaders   closeOutputs
   fileFooters   BeginObjectSections   EndObjectSections   _ComputeSizes   NewLines   WriteObjects   _writeMethodss   writeGeneralizations   getRootNodeName(    (    (    sa   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/formatter/formatter_Dia.pys   DiaFormatterM s   	@*"\1Ps   __main__(   s   __doc__s   __rcs_info__s   splits   __version__s   oss   strings   typess   happydoclibs   happydoclib.indentstrings'   happydoclib.formatter.fileformatterbases
   entryPoints	   formatters   fileformatterbases   FileBasedFormatters   DiaFormatters   __name__(   s   DiaFormatters
   entryPoints   strings   typess   __version__s   oss   happydoclibs   __rcs_info__(    (    sa   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/formatter/formatter_Dia.pys   ? s    H	" 