Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement UML Packages ( C # namespaces & Java packages ) #6

Closed
4 of 5 tasks
mrpetro opened this issue Jan 4, 2018 · 22 comments
Closed
4 of 5 tasks

Implement UML Packages ( C # namespaces & Java packages ) #6

mrpetro opened this issue Jan 4, 2018 · 22 comments
Assignees

Comments

@mrpetro
Copy link
Contributor

mrpetro commented Jan 4, 2018

Feature request:
UML standard allows to create Packages in diagrams.
One package element can have member elements with various types (classes, interfaces and even other packages). Package can also have nested types and other packages
C # stereotype in UML is namespace
Java stereotype in UML is package

Few things have to be done here in order to implement this feature:

  • Create/add new package icon for "package" shape creation functionality in "DiagramsEditor" project resources
  • Implement Package shape with it's behavior in DiagramsEditor project. Package can have other packages and types nested. Package cannot be nested inside a type.
  • (Secondary) Implement Package shape behavior of putting type shapes (or other packages) inside a package shapes. This is just another way of representing nesting. In case of type or package shape being inside of package shape any movement and resizing parent package shape will affect the global diagram position of nested shapes. Basically coordinate system of nested shapes will be the parent shape coordinate system.
  • Implement "namespaces" code generation for "Packages" in C#
  • Implement "packages" code generation for "Packages" in Java

BTW: you can assign it to me because this work is near finished.
I've tried to use Project and issues creation on my Fork but turns out that the issue numbers are counted from hash1 which creates problems with history of issues. So I've decided to create an issue in main branch. Also I've read about different levels of access to branch features, So I could do more, like start projects on main branch instead of my fork. This is something to consider. And I'm sorry about writing this in an issue but I couldn't find any other way to contact repository owner.

mrpetro added a commit to mrpetro/NClass that referenced this issue Jan 4, 2018
@gbaychev gbaychev assigned gbaychev and mrpetro and unassigned gbaychev Jan 6, 2018
@gbaychev
Copy link
Owner

gbaychev commented Jan 6, 2018

Hi,
yes, I've assigned the issue to you. I have the feeling that you want to check out the github task lists for your issues. Sorry, if this is not anything new to you.

I'm not sure that I understand the second part, but opening an issue here and working on your fork is the way to go. What exactly did you read, can you drop me a link?

@mrpetro
Copy link
Contributor Author

mrpetro commented Jan 6, 2018

I actually didn't know about github task lists, thanks for the info :)
And sorry I think I've over complicated my sentence. I was thinking that you could promote me as collaborator.
https://help.github.com/articles/inviting-collaborators-to-a-personal-repository/

@gbaychev
Copy link
Owner

gbaychev commented Jan 10, 2018

I think I'm gonna setup a slack workspace, where we can discuss such things.

@gbaychev
Copy link
Owner

So, I've setup a slack workspace, if you drop me an email, I will invite you.

@mrpetro
Copy link
Contributor Author

mrpetro commented Jan 10, 2018

"Slack channel", never used it, we may try it.

Regarding current issue:
All mandatory TODOs from the list are completed, but the one left is more complicated in implementation, especially due to bloated Diagram super class.
So I'm tempted to create pull request from what I have right now (because it's still functional as intended), before I'll make some more changes that will be more difficult to track/review.
How's that sounds?

@mrpetro
Copy link
Contributor Author

mrpetro commented Jan 10, 2018

Due to email hunters i'm making it a bit harder to read:
[email redacted]

@gbaychev
Copy link
Owner

Thank you, I've sent you invite and removed your email.

@fedeali90
Copy link

Hello,
I would need this feature to show packages within the class diagram. Is it still under development?
Thank you in advance for your answer and keep up the good work! :)

@gbaychev
Copy link
Owner

gbaychev commented Jan 5, 2019

Hi,
TBH I haven't heard from @mrpetro for a long time, so I don't know. As you've seen, most of the stuff is done, so if he doesn't respond in a week or two, I'm gonna try to pull his code and integrate it

Best regards :)

@mrpetro
Copy link
Contributor Author

mrpetro commented Jan 8, 2019

Hello, I'm terribly sorry about not giving any sign of life.
Long time ago I've tried few times to implement final functionality from this feature, which is placing UML shapes inside packages but I've gave up each time due to too many side effects. The biggest problem with nesting of shapes is that NClass was never designed to render shapes inside of other shapes.
So eventualy I've gave up. Sorry for not letting anyone know.

It may require some major refactoring before implementing package graphical nesting.
On the other side, rest of this features functionality was complete.
What we can do right now is to merge what I already have to main and try to implement missing thing later.

Cheers!
Piotr

@gbaychev
Copy link
Owner

gbaychev commented Jan 9, 2019

Hello @mrpetro ,
good to know that you are alive and well. Drop me a pull request, please, I will see what I can do with it. The next three weeks, maybe even february are going to be quite stressful to me, so I'm not sure when I'll have the time to do some work on the code, but I'll do my best.

Regards
Georgi

@mrpetro
Copy link
Contributor Author

mrpetro commented Jan 11, 2019

Hi @gbaychev ,
No worries. To make your life easier, I've restarted my fork to your master branch, and I'll be applying the changes for this feature to my fork.
I wish you good luck with your stressful time.

@mrpetro
Copy link
Contributor Author

mrpetro commented Jan 12, 2019

Hi @gbaychev

As you may noticed, i've created a pull request.

Here are same notes from pull request for tracking:

  • Graphical nesting of diagram shapes in package shapes is still not implemented. This could be added as separate feature.
  • Sourcecode files for C# are being generated with correct namespaces (based on Package nesting relationships). An enchancement could be created that each namespace would be separarate folder structure in generated project file system.

@gbaychev
Copy link
Owner

gbaychev commented Feb 7, 2019

So, @mrpetro , I've downloaded the PR, that you submitted and did some work on it. Currently it looks like this:

nclass_packages

It is more or less functioning, but it is kinda difficult to get the element drawing/selection order correct, so sometimes dragging shapes gets kinda funky.

What also needs to be done is:

  • creating shapes directly into other shapes
  • the hover rectangle should be moved to styles
  • recalculating of the min size of a package shape when a child shape leaves a parent shape
  • code generation.
  • draw and selection order of the elements once more (including the diagram preview in the lower right corner)
  • icon replacement
  • color replacement and moving color between styles
  • see how copy and paste behaves

I also intend to replace the package icon with something more passing to the other icons. The project uses the visual studio 2013 image library, which I find more aesthetically pleasing then the flat madness of vs2015+, but it is screwing me over, because it is difficult to find icons/images.

There will also be some color adjustments of the package shape.

All in all - great work, @mrpetro, thank you very much for this PR! I'm going to need this functionality for other types of diagrams.

Currently I have about 4 hours per week to work on the project, so maybe this feature is going to be ready next week.

@mrpetro
Copy link
Contributor Author

mrpetro commented Feb 7, 2019

Hi @gbaychev,
This is Cool!, the animation you've presented shows exactly what I've wanted to achieve, but I got stuck at some point with too many glitches. Mentioned drawing order was one of glitches. Maybe I wanted to much at once.
I don't mind changing the package icon to something more fitting :)

Fingers crossed for finishing bringing this feature to full complete.

In this month I'll try to focus on issue #7 .It's causing lots of problems.

@gbaychev
Copy link
Owner

Hi @mrpetro,
thank you, mate! :) I'm glad that what is implemented currently corresponds to your ideas as well.

I've updated my post above with the list of the work left.

See ya around.

@gbaychev
Copy link
Owner

gbaychev commented Mar 4, 2019

So, guys and gals, this is done and if you want to check it out, you can download the v2.6.0-pre release.

Currently, if you use the Visual Studio (ClearType) style, it looks like this:
2019-03-04 1

@gbaychev gbaychev closed this as completed Mar 4, 2019
@gbaychev
Copy link
Owner

gbaychev commented Mar 4, 2019

Oh, and by the way, the copy and paste was completely broken, it is fixed now.

@vishwas-trivedi
Copy link

Hey @gbaychev ,
Hope you are doing well.
Great tool and loved the namespace feature.
I just thought that it would be great if I could generate a folder for each namespace when I generate code for C# from [Diagram → Generate Code] menu. For example, when I create a class in a folder using Visual Studio, it automatically assumes folder name as namespace.

@gbaychev
Copy link
Owner

Hello @vishwas-trivedi ,
thank you for the words and the suggestion. I'm going to create a new issue and implement it sometimes later.

Regards

@vishwas-trivedi
Copy link

vishwas-trivedi commented Apr 3, 2019

Hi @gbaychev,

Thank you for accepting my suggestion earlier!
I just noticed following after using pre-release version:

1). I'm unable to open old projects on the pre-release version. Following error is displayed :
"Error: The save file is corrupt and could not be loaded."

2). NClass icon in taskbar is not visible, white/empty icon is displayed.

Regards

@gbaychev
Copy link
Owner

Hello @vishwas-trivedi ,

  1. Which prerelease exactly do you mean?
  2. Could you perhaps attach a file, which you have a problem with.
  3. Do you use the msi or the zip files?

And maybe open a new issue with you problem, so other users can see it too, if they have a problem

Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants