class symbols in an UML diagram

Jul 16, 2012 at 4:07 AM

I want to make class symbols in an UML diagram
class symblos have to property textbox and method textbox
I'm wonddering if it is possible and how to make it.

Jul 17, 2012 at 3:37 PM

Hello ejbang,

I'm not sure about your exact intention:

  • Do you want to add entries to an instance of a "Entity"- or "Class" shape ("SoftwareArchitectureShapes" library) via code?
  • Do you want to create your own shape that supports the NShape text editing feature?
  • Do you want to create a shape that hosts WinForms components like a textbox?
  • Or something else?
Jul 19, 2012 at 3:24 AM

Hello KurtHolzinger,

There is "Class" Shape in the SoftwareArchitectureShapes library.
Currently, Class Shape has only one Text Layout.
I'd like to create my own shape that has two Text Layouts.
I want to use one Text Layout to input Property and the other to input Method.

Jul 19, 2012 at 7:33 AM

Ok, you have to do the following:

  • Implement interface "ICaptionedShape" that is used for adding/editing/removing texts
  • Implement interface "IEntity" that is used for saving the shape to a repository/store
  • Implement all methods responsible for calculating/drawing the texts (see implementation of class "EntitySymbol")
  • Implement CopyFrom() method that creates a deep copy of the shape (used for copying/cloning the shape and creating preview shapes)
  • Implement GetMenuItemDefs() method for creating context menu items for adding/removing texts
  • Write an initializer for your shape library (see documentation: "Concepts / Shapes / Understanding Shape Creation")
  • See documentation: "Programmer Tasks / Developing a New Shape Class" for a brief summary

This is only a short summary. Please have a closer look at the source code of class "EntitySymbol" to get an idea on the implementation details.