Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NClass.build
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<nant buildfile="src/Core/Core.build" target="compile" />
<nant buildfile="src/CSharp/CSharp.build" target="compile" />
<nant buildfile="src/Java/Java.build" target="compile" />
<nant buildfile="src/Dart/Dart.build" target="compile" />
<nant buildfile="src/CodeGenerator/CodeGenerator.build" target="compile" />
<nant buildfile="src/DiagramEditor/DiagramEditor.build" target="compile" />
<nant buildfile="src/GUI/GUI.build" target="compile" />
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ The feature branch currently worked on is undo/redo

## About

NClass is a free tool to easily create UML class diagrams with C# and Java language support. The user interface is designed to be simple and user-friendly for easy and fast development. Initially the project was developed by the great Balasz Tihanyi on [sourceforge](http://nclass.sourceforge.net/), but the project has gone inactive due the lack of time.
NClass is a free tool to easily create UML class diagrams with C#, Java and Dart language support. The user interface is designed to be simple and user-friendly for easy and fast development. Initially the project was developed by the great Balasz Tihanyi on [sourceforge](http://nclass.sourceforge.net/), but the project has gone inactive due the lack of time.

Still, NClass is a great tool, although it is missing some important features. The goal of this project is to restart the development of NClass, adding the missing features.

## :computer: Existing features

- C# and Java support with many language specific elements
- C#, Java and Dart support with many language specific elements
- Simple and easy to use user interface
- Inline class editors with syntactic parsers for easy and fast editing
- Source code generation
Expand Down
1 change: 1 addition & 0 deletions src/AssemblyImport/Extensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using NClass.Core;
using NClass.Core.Entities;
using NReflect;
using NReflect.NRCode;

Expand Down
1 change: 1 addition & 0 deletions src/AssemblyImport/NETImport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using NClass.Core.Entities;

namespace NClass.AssemblyImport
{
Expand Down
9 changes: 8 additions & 1 deletion src/CSharp/CSharpLanguage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
using System.Text;
using System.Text.RegularExpressions;
using NClass.Core;
using NClass.Core.Entities;
using NClass.Translations;

namespace NClass.CSharp
Expand Down Expand Up @@ -252,7 +253,12 @@ public override bool IsValidModifier(FieldModifier modifier)

public override bool IsValidModifier(OperationModifier modifier)
{
return true;
if (modifier != OperationModifier.Factory)
{
return true;
}

return false;
}

/// <exception cref="BadSyntaxException">
Expand Down Expand Up @@ -613,5 +619,6 @@ protected override ArgumentList CreateParameterCollection()
{
return new CSharpArgumentList();
}

}
}
1 change: 1 addition & 0 deletions src/CSharp/Members/CSharpClass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using System.Text;
using System.Collections.Generic;
using NClass.Core;
using NClass.Core.Entities;
using NClass.Translations;

namespace NClass.CSharp
Expand Down
1 change: 1 addition & 0 deletions src/CSharp/Members/CSharpProperty.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using NClass.Translations;
using System;
using System.Text;
using NClass.Core.Entities;

namespace NClass.CSharp
{
Expand Down
1 change: 1 addition & 0 deletions src/CSharp/Members/CSharpStructure.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
using System;
using System.Text;
using NClass.Core;
using NClass.Core.Entities;
using NClass.Translations;

namespace NClass.CSharp
Expand Down
10 changes: 10 additions & 0 deletions src/CodeGenerator/CodeGenerator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,12 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="DartProjectGenerator.cs" />
<Compile Include="DartSourceFileGenerator.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="GenerationResult.cs" />
<Compile Include="ToolStripSimplifiedRenderer.cs" />
<Compile Include="DartSolutionGenerator.cs" />
<Compile Include="VSSolutionGenerator.cs" />
<Compile Include="SolutionType.cs" />
<Compile Include="SolutionGenerator.cs" />
Expand Down Expand Up @@ -110,6 +113,10 @@
<Project>{755B2714-62DB-419C-9097-49C08439E7E3}</Project>
<Name>CSharp</Name>
</ProjectReference>
<ProjectReference Include="..\Dart\Dart.csproj">
<Project>{2af0f529-333a-4ef2-aa17-2e353133fe78}</Project>
<Name>Dart</Name>
</ProjectReference>
<ProjectReference Include="..\Java\Java.csproj">
<Project>{255565B1-3246-4184-9F71-19178FE0BA65}</Project>
<Name>Java</Name>
Expand Down Expand Up @@ -139,6 +146,9 @@
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<None Include="Templates\pubspec.yaml.template">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="Templates\sln.template">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
Expand Down
88 changes: 88 additions & 0 deletions src/CodeGenerator/DartProjectGenerator.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
// NClass - Free class diagram editor
// Copyright (C) 2006-2009 Balazs Tihanyi
// Copyright (C) 2016-2018 Georgi Baychev
//
// This program is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation; either version 3 of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with
// this program; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

using System;
using System.IO;
using System.Windows.Forms;
using NClass.Core;
using NClass.Core.Models;

namespace NClass.CodeGenerator
{
internal sealed class DartProjectGenerator : ProjectGenerator
{
readonly SolutionType solutionType;

/// <exception cref="ArgumentNullException">
/// <paramref name="model"/> is null.
/// </exception>
public DartProjectGenerator(ClassModel model, SolutionType solutionType) : base(model)
{
this.solutionType = solutionType;
}

public override string RelativeProjectFileName
{
get
{
string fileName = "pubspec.yaml";
string directoryName = ProjectName;

return Path.Combine(directoryName, fileName);
}
}

protected override SourceFileGenerator CreateSourceFileGenerator(TypeBase type)
{
return new DartSourceFileGenerator(type, RootNamespace);
}

protected override bool GenerateProjectFiles(string location)
{
if (solutionType != SolutionType.Dart)
{
throw new ArgumentException("The solution type is not a Dart solution.");
}

try
{
string templateDir = Path.Combine(Application.StartupPath, "Templates");
string templateFile = Path.Combine(templateDir, "pubspec.yaml.template");
string projectFile = Path.Combine(location, RelativeProjectFileName);

using (StreamReader reader = new StreamReader(templateFile))
using (StreamWriter writer = new StreamWriter(projectFile, false, reader.CurrentEncoding))
{
while (!reader.EndOfStream)
{
string line = reader.ReadLine();
if (line != null)
{
line = line.Replace("${ProjectName}", ProjectName);
writer.WriteLine(line);
}
}
}

return true;
}
catch
{
return false;
}
}
}
}
71 changes: 71 additions & 0 deletions src/CodeGenerator/DartSolutionGenerator.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// NClass - Free class diagram editor
// Copyright (C) 2006-2009 Balazs Tihanyi
// Copyright (C) 2016-2018 Georgi Baychev
//
// This program is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation; either version 3 of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with
// this program; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

using System;
using NClass.Core;
using NClass.Dart;
using NClass.Core.Models;

namespace NClass.CodeGenerator
{
internal sealed class DartSolutionGenerator : SolutionGenerator
{
SolutionType version = SolutionType.Dart;

/// <exception cref="ArgumentNullException">
/// <paramref name="project"/> is null.
/// </exception>
public DartSolutionGenerator(Project project, SolutionType version) : base(project)
{
Version = version;
}

public SolutionType Version
{
get
{
return version;
}
set
{
if (value == SolutionType.Dart)
{
version = value;
}
}
}

/// <exception cref="ArgumentException">
/// The <paramref name="model"/> has invalid language.
/// </exception>
protected override ProjectGenerator CreateProjectGenerator(ClassModel model)
{
Language language = model.Language;

if (language == DartLanguage.Instance)
return new DartProjectGenerator(model, Version);

throw new ArgumentException("The model is not a Dart language model.");
}

// No solution file for Dart
protected override bool GenerateSolutionFile(string location)
{
return true;
}

}
}
Loading