Click here to Skip to main content
15,896,154 members
Articles / Desktop Programming / MFC

UMLEditor - revisiting the vector editor

Rate me:
Please Sign up or sign in to vote.
4.99/5 (156 votes)
5 Jul 2006Public Domain8 min read 378.1K   37.1K   326  
An UML editor with code-generation capabilities derived from CDiagramEditor.
<html>
<head>
<style>
body{font-size: 10pt;color: black;font-family: Verdana, Helvetica, Arial, sans-serif;background-color: #ffffff}
p{font-size: 10pt;color: black;font-family: Verdana, Helvetica, Arial, sans-serif;}
h2{font-size: 13pt;color: #ff9900;font-family: Verdana, Helvetica, Arial, sans-serif;font-weight: bold;}
h3{color: #ff9900;font-weight: bold;font-size: 11pt;font-family: Arial, sans-serif;}
table{background-color:#f0f0ff;}
td{font-size: 10pt;color: black;font-family: Verdana, Helvetica, Arial, sans-serif;padding:4px;}
pre{padding-right: 7pt;padding-left: 7pt;padding-bottom: 7pt;font: 9pt 'Courier New', Courier, mono;width: 100%;padding-top: 7pt;white-space: pre;background-color: #fbedbb}
code{color: #990000;font-family: 'Courier New', Courier, mono;}
A:link{text-decoration: none}
A:visited{text-decoration: none}
A:active{text-decoration: underline}
A:hover{text-decoration: underline}
A.top:link{font-size:8pt;color:red;font-family:Verdana,Helvetica,Arial,sans-serif;}
A.top:visited{font-size:8pt;color:red;font-family:Verdana,Helvetica,Arial,sans-serif;}
A.top:active{font-size:8pt;color:red;font-family:Verdana,Helvetica,Arial,sans-serif;}
A.top:hoover{font-size:8pt;color:red;font-family:Verdana,Helvetica,Arial,sans-serif;}
</style>
</head>
<body>
<h2>CUMLEntityClassTemplate</h2><h3>Overview</h3>
<blockquote>
<b>Purpose</b><br>
<code>CUMLEntityClassTemplate</code> is a specialization of <code>CUMLEntityClass</code> and represents a template class.<br>
<p><b>Description</b><br>
The class derives from <code>CUMLEntityClass</code> and adds functionality to handle the template parameter as well as specialized export-functionality.<br>
<p><b>Usage</b><br>
Use as a <code>CUMLEntityClass</code>.
<p><a class='top' href='index.html'>[back to the index page]</a>
</blockquote>
<a name='contents'></a><h3>Contents</h3>
<b>- C -</b><br>
<a href='#CUMLEntityClassTemplate'>CUMLEntityClassTemplate()</a><br>
<a href='#Clone'>Clone()</a><br>
<a href='#CopyCDiagramEntityobj'>Copy( CDiagramEntity* obj )</a><br>
<a href='#CreateFromStringconstCStringstr'>CreateFromString( const CString& str )</a><br>
<p>
<b>- D -</b><br>
<a href='#DrawCDCdcCRectrect'>Draw( CDC* dc, CRect rect )</a><br>
<p>
<b>- E -</b><br>
<a href='#ExportUINTformatconst'>Export( UINT format ) const</a><br>
<a href='#ExportHconst'>ExportH() const</a><br>
<a href='#ExportHTMLconst'>ExportHTML() const</a><br>
<p>
<b>- F -</b><br>
<a href='#FromStringconstCStringstr'>FromString( const CString& str )</a><br>
<p>
<b>- G -</b><br>
<a href='#GetHeaderTemplateFilenameconst'>GetHeaderTemplateFilename() const</a><br>
<a href='#GetOperationListintformatconst'>GetOperationList( int format ) const</a><br>
<a href='#GetParameterTypeconst'>GetParameterType() const</a><br>
<a href='#GetStringconst'>GetString() const</a><br>
<p>
<b>- S -</b><br>
<a href='#SetParameterTypeconstCStringparameterType'>SetParameterType( const CString& parameterType )</a><br>
<p>
<b>- ~ -</b><br>
<a href='#~CUMLEntityClassTemplate'>~CUMLEntityClassTemplate()</a><br>
<p><h3>Functions</h3><hr>
<code><b><a name='CUMLEntityClassTemplate'></a>CUMLEntityClassTemplate()</b></code>
<blockquote>
<b>Description</b><br>
Constructor
<br><b>Access</b><br>
Public
<br><br><b>Parameters</b><br>
none<br>
<b>Returns</b><br>
void
<br><br><b>Usage</b><br>
-<p>
<a class='top' href='#contents'>[back to the contents]</a>&nbsp;<a class='top' href='index.html'>[back to the index page]</a></p>
</blockquote>
<hr>
<code><b><a name='Clone'></a>CDiagramEntity* Clone()</b></code>
<blockquote>
<b>Description</b><br>
Clone this object to a new object.
<br><b>Access</b><br>
Public
<br><br><b>Parameters</b><br>
none<br>
<b>Returns</b><br>
<code>CDiagramEntity* </code> -  The new object.
<br><br><b>Usage</b><br>
Call to create a clone of the object. The caller will have to delete the object.<p>
<a class='top' href='#contents'>[back to the contents]</a>&nbsp;<a class='top' href='index.html'>[back to the index page]</a></p>
</blockquote>
<hr>
<code><b><a name='CopyCDiagramEntityobj'></a>void Copy( CDiagramEntity* obj )</b></code>
<blockquote>
<b>Description</b><br>
Copies the information in <code>obj</code> to this object.
<br><b>Access</b><br>

<br><br><b>Parameters</b><br>
<code>CDiagramEntity* obj </code> -  Object to copy from.<br>
<b>Returns</b><br>
void
<br><br><b>Usage</b><br>
Call to copy the information from <code>obj</code> to this object.<p>
<a class='top' href='#contents'>[back to the contents]</a>&nbsp;<a class='top' href='index.html'>[back to the index page]</a></p>
</blockquote>
<hr>
<code><b><a name='CreateFromStringconstCStringstr'></a>CDiagramEntity* CreateFromString( const CString& str )</b></code>
<blockquote>
<b>Description</b><br>
Static factory function that creates and returns an instance of this class if <code>str</code> is a valid representation.
<br><b>Access</b><br>
Public
<br><br><b>Parameters</b><br>
<code>const CString& str </code> -  The string to create from.<br>
<b>Returns</b><br>
<code>CDiagramEntity*  </code> -  The object, or <code>NULL</code> if <code>str</code> is not a representation of this type.
<br><br><b>Usage</b><br>
Can be used as a factory for text file loads.<p>
<a class='top' href='#contents'>[back to the contents]</a>&nbsp;<a class='top' href='index.html'>[back to the index page]</a></p>
</blockquote>
<hr>
<code><b><a name='DrawCDCdcCRectrect'></a>void Draw( CDC* dc, CRect rect )</b></code>
<blockquote>
<b>Description</b><br>
Draws the template.
<br><b>Access</b><br>

<br><br><b>Parameters</b><br>
<code>CDC* dc  </code> -  <code>CDC</code> to draw to<br><code>CRect rect </code> -  Rectangle to draw to.<br>
<b>Returns</b><br>
void
<br><br><b>Usage</b><br>
Called by the editor. Draws the underlying class object and adds the template parameter type box if the parameter type is not empty.<p>
<a class='top' href='#contents'>[back to the contents]</a>&nbsp;<a class='top' href='index.html'>[back to the index page]</a></p>
</blockquote>
<hr>
<code><b><a name='ExportUINTformatconst'></a>CString Export( UINT format ) const</b></code>
<blockquote>
<b>Description</b><br>
Exports this object to the desired format.
<br><b>Access</b><br>
Public
<br><br><b>Parameters</b><br>
<code>UINT format </code> -  Format to export to<br>
<b>Returns</b><br>
<code>CString  </code> -  Result
<br><br><b>Usage</b><br>
<code>format</code> can be one of the following: <p><table width='100%'><tr><td><code>EXPORT_CPP</code></td><td>Export to cpp-files </td></tr><tr><td><code>EXPORT_H</code></td><td>Export to header files </td></tr><tr><td><code>EXPORT_HTML</code></td><td>Export to HTML-files</td></tr></table><p>
<a class='top' href='#contents'>[back to the contents]</a>&nbsp;<a class='top' href='index.html'>[back to the index page]</a></p>
</blockquote>
<hr>
<code><b><a name='ExportHconst'></a>CString ExportH() const</b></code>
<blockquote>
<b>Description</b><br>
Exports the class to a c++-header file.
<br><b>Access</b><br>
Private
<br><br><b>Parameters</b><br>
none<br>
<b>Returns</b><br>
<code>CString </code> -  Generated contents of header file.
<br><br><b>Usage</b><br>
Called by the export-mechanism<p>
<a class='top' href='#contents'>[back to the contents]</a>&nbsp;<a class='top' href='index.html'>[back to the index page]</a></p>
</blockquote>
<hr>
<code><b><a name='ExportHTMLconst'></a>CString ExportHTML() const</b></code>
<blockquote>
<b>Description</b><br>
Exports the class to DHTML
<br><b>Access</b><br>
Private
<br><br><b>Parameters</b><br>
none<br>
<b>Returns</b><br>
<code>CString </code> -  Generated HTML
<br><br><b>Usage</b><br>
Called by the export-mechanism<p>
<a class='top' href='#contents'>[back to the contents]</a>&nbsp;<a class='top' href='index.html'>[back to the index page]</a></p>
</blockquote>
<hr>
<code><b><a name='FromStringconstCStringstr'></a>BOOL FromString( const CString& str )</b></code>
<blockquote>
<b>Description</b><br>
Sets the data for this object from <code>str</code>
<br><b>Access</b><br>
Public
<br><br><b>Parameters</b><br>
<code>const CString& str </code> -  String representation<br>
<b>Returns</b><br>
<code>BOOL    </code> -  <code>TRUE</code> if <code>str</code> was a valid representation of this type.
<br><br><b>Usage</b><br>
Use when loading from file.<p>
<a class='top' href='#contents'>[back to the contents]</a>&nbsp;<a class='top' href='index.html'>[back to the index page]</a></p>
</blockquote>
<hr>
<code><b><a name='GetHeaderTemplateFilenameconst'></a>CString GetHeaderTemplateFilename() const</b></code>
<blockquote>
<b>Description</b><br>
Returns the name of the prefered header file template.
<br><b>Access</b><br>

<br><br><b>Parameters</b><br>
none<br>
<b>Returns</b><br>
<code>CString </code> -  Name of header file template
<br><br><b>Usage</b><br>
Call to get the name of the prefered header file template during generation to c++.<p>
<a class='top' href='#contents'>[back to the contents]</a>&nbsp;<a class='top' href='index.html'>[back to the index page]</a></p>
</blockquote>
<hr>
<code><b><a name='GetOperationListintformatconst'></a>CString GetOperationList( int format ) const</b></code>
<blockquote>
<b>Description</b><br>
Returns a string with the operations of this object in the format <code>format</code>.
<br><b>Access</b><br>
Protected
<br><br><b>Parameters</b><br>
<code>int format </code> -  Format to use.<br>
<b>Returns</b><br>
<code>CString  </code> -  Result
<br><br><b>Usage</b><br>
Call as a part of an export, for example. <code>format</code> can be one of the following: <p><table width='100%'><tr><td><code>EXPORT_CPP</code></td><td>Export to cpp-files </td></tr><tr><td><code>EXPORT_H</code></td><td>Export to header files </td></tr><tr><td><code>EXPORT_HTML</code></td><td>Export to HTML-files</td></tr></table><p>
<a class='top' href='#contents'>[back to the contents]</a>&nbsp;<a class='top' href='index.html'>[back to the index page]</a></p>
</blockquote>
<hr>
<code><b><a name='GetParameterTypeconst'></a>CString GetParameterType() const</b></code>
<blockquote>
<b>Description</b><br>
Gets the template class parameter type.
<br><b>Access</b><br>

<br><br><b>Parameters</b><br>
none<br>
<b>Returns</b><br>
<code>CString </code> -  Parameter type, empty if none.
<br><br><b>Usage</b><br>
Call to get the parameter type of the template.<p>
<a class='top' href='#contents'>[back to the contents]</a>&nbsp;<a class='top' href='index.html'>[back to the index page]</a></p>
</blockquote>
<hr>
<code><b><a name='GetStringconst'></a>CString GetString() const</b></code>
<blockquote>
<b>Description</b><br>
Gets a string representation of this object.
<br><b>Access</b><br>
Public
<br><br><b>Parameters</b><br>
none<br>
<b>Returns</b><br>
<code>CString </code> -  Resulting string
<br><br><b>Usage</b><br>
Call to get a string representation for saving.<p>
<a class='top' href='#contents'>[back to the contents]</a>&nbsp;<a class='top' href='index.html'>[back to the index page]</a></p>
</blockquote>
<hr>
<code><b><a name='SetParameterTypeconstCStringparameterType'></a>void SetParameterType( const CString& parameterType )</b></code>
<blockquote>
<b>Description</b><br>
Sets the template class parameter type.
<br><b>Access</b><br>

<br><br><b>Parameters</b><br>
<code>const CString& parameterType </code> -  New parameter type<br>
<b>Returns</b><br>
void
<br><br><b>Usage</b><br>
Call to set the parameter type of the template.<p>
<a class='top' href='#contents'>[back to the contents]</a>&nbsp;<a class='top' href='index.html'>[back to the index page]</a></p>
</blockquote>
<hr>
<code><b><a name='~CUMLEntityClassTemplate'></a>~CUMLEntityClassTemplate()</b></code>
<blockquote>
<b>Description</b><br>
Destructor
<br><b>Access</b><br>
Public
<br><br><b>Parameters</b><br>
none<br>
<b>Returns</b><br>
void
<br><br><b>Usage</b><br>
-<p>
<a class='top' href='#contents'>[back to the contents]</a>&nbsp;<a class='top' href='index.html'>[back to the index page]</a></p>
</blockquote>
<hr>
<b><small>Copyright 2004 Johan Rosengren Abstrakt Mekanik AB</small></b>
</body>
</html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under A Public Domain dedication


Written By
Software Developer (Senior) Abstrakt Mekanik AB
Sweden Sweden
45 years old, married, three kids.

Started with computers more than 20 years ago on a CBM-64.

Read Theoretical Philosophy at the University of Lund.

Working as a C++ consultant developer.

Science-fiction freak. Enjoy vintage punkrock.

Comments and Discussions