Click here to Skip to main content
15,884,472 members
Articles / Desktop Programming / WPF

PlantUML Editor: A Fast and Simple UML Editor using WPF

Rate me:
Please Sign up or sign in to vote.
4.98/5 (65 votes)
11 Jun 2011CPOL16 min read 234.4K   6.4K   233  
A WPF smart client to generate UML diagrams from plain text using plantuml tool
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PlantUmlEditor.Model;
using System.Collections.ObjectModel;
using System.IO;

namespace PlantUmlEditor.DesignTimeData
{
    public class DiagramFiles : ObservableCollection<DiagramFile>
    {
        public DiagramFiles()
        {
            this.Add(new DiagramFile()
            {
                Content = 
@"@startuml cpe.png
actor EndUser
participant SaaS
participant CPE

EndUser -> SaaS : Click Download
activate SaaS
	SaaS -> CPE: Generate Unique URL
	CPE -> SaaS: Unique URL
	SaaS -> EndUser: Unique URL
deactivate SaaS

EndUser -> CPE : Hit Unique URL
activate CPE
	CPE -> SaaS : Validate Unique URL
	activate SaaS
		SaaS -> SaaS : Mark Unique URL as disposed
		SaaS -> CPE : Actual App Url
	deactivate SaaS
	CPE -> CPE : Read the file from actual URL
	CPE -> EndUser : Transmit actual app binary
deactivate CPE
@enduml",
                DiagramFilePath = "test.txt",
                ImageFilePath = "http://plantuml.sourceforge.net/img/sequence_img009.png"
            });

            this.Add(new DiagramFile()
            {
                Content = 
@"@startuml btconnectjourney.png
actor User
participant AOOJ
participant SaaS
participant DnP
participant C2B
participant HE

User -> AOOJ: Enters userID 
activate AOOJ
	AOOJ -> DnP: Check for uniqueness
	DnP -> AOOJ: Unique, no problem	
deactivate AOOJ

User -> AOOJ: Submit order
activate AOOJ
	AOOJ -> SaaS: Queue Order
	AOOJ --> User: Show order in progress
deactivate AOOJ

SaaS -> SaaS: Process order
activate SaaS
	SaaS -> DnP: Create user account
	SaaS -> C2B: Create customer account
	SaaS -> HE: Create mailbox
	SaaS -> User: Send welcome email
deactivate SaaS

@enduml",
                DiagramFilePath = "test2.txt",
                ImageFilePath = "http://plantuml.sourceforge.net/img/activity_img06.png"
            });
        }
    }
}

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 The Code Project Open License (CPOL)


Written By
Architect BT, UK (ex British Telecom)
United Kingdom United Kingdom

Comments and Discussions