GithubHelp home page GithubHelp logo

gaphor / gaphor Goto Github PK

View Code? Open in Web Editor NEW
1.7K 47.0 186.0 47.24 MB

Gaphor is the simple modeling tool

Home Page: https://gaphor.org

Python 99.01% Shell 0.02% NSIS 0.32% Makefile 0.21% CSS 0.41% Dockerfile 0.03%
python uml modeling gnome gtk diagram sysml mbse model-based-systems-engineering c4model

gaphor's Introduction

Gaphor - UML/SysML Modeling

Build Hypothesis Tests Docs build state PyPI PyPI - Downloads Matrix

Maintainability Test Coverage Translation Status Sourcery standard-readme compliant All Contributors.org

Gaphor is a UML and SysML modeling application written in Python. It is designed to be easy to use, while still being powerful. Gaphor implements a fully-compliant UML 2 data model, so it is much more than a picture drawing tool. You can use Gaphor to quickly visualize different aspects of a system as well as create complete, highly complex models.

Gaphor Demo

πŸ“‘ Table of Contents

πŸ“œ Background

Gaphor is a UML and SysML modeling application written in Python. We designed it to be easy to use, while still being powerful. Gaphor implements a fully-compliant UML 2 data model, so it is much more than a picture drawing tool. You can use Gaphor to quickly visualize different aspects of a system as well as create complete, highly complex models.

Gaphor is designed around the following principles:

  • Simplicity: The application should be easy to use. Only some basic knowledge of UML or SysML is required.
  • Consistency: UML is a graphical modeling language, so all modeling is done in a diagram.
  • Workability: The application should not bother the user every time they do something non-UML-ish.

Gaphor is a GUI application. It has a modern GTK-based interface and uses Cairo for consistent rendering.

Gaphor is a library. You can use it from scripts and Jupyter notebooks and interact with models programmatically.

Non-Goals:

  • Generating UML diagrams from source code. pynsource or pyreverse might be what you are looking for.
  • Generating source code from diagrams or creating other concrete executable artifacts including use of fUML or ALF.

Although it would be possible to incorporate these features, these aren't the goals of this project. However, if these are important capabilities for you, you may be able to extend Gaphor by creating a plugin.

πŸ’Ύ Install

Download on Flathub

You can find the latest version on the gaphor.org website. Gaphor ships installers for macOS and Windows. Those can be found there. The Python package is also available on PyPI.

All releases are available on GitHub.

If you want to start developing on Gaphor, have a look at the Installation section of our documentation.

πŸ”¦ Usage

If using Gaphor for the first time you will be presented with a greeter dialog at startup in which you can select one of 5 models available to you to work in:

  • Generic: (or blank) template
  • UML: Unified Modeling Language template
  • SysML: Systems Modeling Language template
  • RAAML: Risk Analysis and Assessment Modeling language template
  • C4 Model: a lean graphical notation technique for modelling the architecture of software systems template

After you select a template, the main Gaphor window will load, and you will be ready to start modeling. Gaphor will automatically select the correct profile based on the template that you selected, but you can also select other modeling profiles if needed by clicking on the button next to the Profile dropdown menu at the top of your window.

To select an element you want to place, for example a Class, click on the icon in the Toolbox and then again on the diagram. This will place a new Class item on the diagram and add a new Class to the model (it shows up in the Model Browser).

Portions of the toolbox may also be collapsed depending on the type of diagram you are modeling with. You can expand the collapsed portions of the toolbox if needed.

If you want to know more, please read our documentation on https://docs.gaphor.org.

β™₯ Contributing

Thanks goes to these wonderful people (emoji key):

2old4it
2old4it

πŸ›
2old4this
2old4this

πŸ›
3fla1416
3fla1416

πŸ›
Adam Bjurstrom
Adam Bjurstrom

πŸ›
Adam Boduch
Adam Boduch

πŸ’» ⚠️ πŸ›
Alen Ε iljak
Alen Ε iljak

πŸ›
Alexander Wilms
Alexander Wilms

πŸ›
Alexis Howells
Alexis Howells

πŸ“–
Amor Ali
Amor Ali

πŸ›
Amy Y
Amy Y

🌍
Andrei
Andrei

πŸ›
Andrew
Andrew

πŸ›
Antonio Mejia
Antonio Mejia

🌍
Arjan Molenaar
Arjan Molenaar

πŸ’» πŸ› πŸ“– πŸ‘€ πŸ’¬ πŸ› πŸ”Œ ⚠️
AurΓ©lien Joga
AurΓ©lien Joga

πŸ“–
Bill ZHANG
Bill ZHANG

🌍
BjΓΆrn StrΓΆmberg
BjΓΆrn StrΓΆmberg

πŸ›
Blippost
Blippost

πŸ€”
Brage Fuglseth
Brage Fuglseth

🎨
Brandan Glendenning
Brandan Glendenning

πŸ“–
Brock Tibert
Brock Tibert

πŸ›
Can Lehmann
Can Lehmann

πŸ’»
Christian Hoff
Christian Hoff

πŸ’»
DKX47
DKX47

πŸ›
Dan Yeaw
Dan Yeaw

πŸ’» ⚠️ πŸ“– πŸ“¦ πŸš‡ πŸ› πŸ’¬
Daniel BerglΓΈv
Daniel BerglΓΈv

πŸ€”
Daniel Nylander
Daniel Nylander

🌍
DimShadoWWW
DimShadoWWW

πŸ›
Douglas B
Douglas B

πŸ“–
Encolpe DEGOUTE
Encolpe DEGOUTE

🌍
Enno GrΓΆper
Enno GrΓΆper

πŸ’»
Enno Zickler
Enno Zickler

πŸ›
Ercalvez
Ercalvez

🌍
Erwan Bousse
Erwan Bousse

πŸ€” πŸ›
Eryk Michalak
Eryk Michalak

🌍
Felipe Nogueira
Felipe Nogueira

🌍
Fell-x27
Fell-x27

πŸ›
Fran DiΓ©guez
Fran DiΓ©guez

🌍
Francisco Gouveia
Francisco Gouveia

πŸ’»
Gabriel Gian
Gabriel Gian

🌍
Gleb Smirnov
Gleb Smirnov

πŸ›
Greg Stewart
Greg Stewart

πŸ›
Gytree
Gytree

πŸ›
GΓΌnther Wagner
GΓΌnther Wagner

πŸ›
Hamish Mcintyre-Bhatty
Hamish Mcintyre-Bhatty

πŸ›
HighKingofMelons
HighKingofMelons

πŸ›
Igor Lerinc
Igor Lerinc

πŸ›
Ikko Ashimine
Ikko Ashimine

πŸ’»
JACKADUX
JACKADUX

πŸ›
Jacob Crabill
Jacob Crabill

πŸ›
Jacobo Aragunde PΓ©rez
Jacobo Aragunde PΓ©rez

πŸ›
Jan
Jan

πŸ›
Jean-Luc Tibaux
Jean-Luc Tibaux

🌍
JensPfeifle
JensPfeifle

πŸ“–
Jonathan
Jonathan

πŸ€” πŸ› 🌍 πŸ’»
Jonathan E. Magen
Jonathan E. Magen

πŸ€”
JonnathanRiquelmo
JonnathanRiquelmo

🌍
Jordi Mallach
Jordi Mallach

🌍
Jorge DLG
Jorge DLG

πŸ›
JoΓ£o Correia
JoΓ£o Correia

πŸ’»
Juha-Matti Kokkonen
Juha-Matti Kokkonen

πŸ›
Julius RΓΌberg
Julius RΓΌberg

πŸ›
JuliusBrueggemann
JuliusBrueggemann

πŸ›
K.B.Dharun Krishna
K.B.Dharun Krishna

🌍
Kapil Thangavelu
Kapil Thangavelu

πŸ›
KhazAkar
KhazAkar

πŸ›
Kian-Meng Ang
Kian-Meng Ang

πŸ“–
Lazerbeak12345
Lazerbeak12345

πŸ›
Lordy
Lordy

πŸ›
Mark Kennedy
Mark Kennedy

πŸ€” πŸ’» πŸ›
Mark-Daniel LΓΌthje
Mark-Daniel LΓΌthje

🌍
Mat
Mat

πŸ’»
Matthew Maclaine
Matthew Maclaine

πŸ›
Maxim
Maxim

πŸ›
Mek101
Mek101

πŸ›
Michael J. Vinca
Michael J. Vinca

πŸ›
Michael Patrick Tkacik
Michael Patrick Tkacik

πŸ›
Mikhail Bessonov
Mikhail Bessonov

πŸ›
Mikkel Aunsbjerg Jakobsen
Mikkel Aunsbjerg Jakobsen

πŸ›
Nedko Arnaudov
Nedko Arnaudov

πŸ›
Patrik
Patrik

πŸ€”
Paul Menzel
Paul Menzel

πŸ“–
PaweΕ‚ PajΔ…k
PaweΕ‚ PajΔ…k

πŸ›
Petal
Petal

πŸ“– 🌍
Phil_Smurf
Phil_Smurf

πŸ€”
Philip Goto
Philip Goto

🌍
Rafael Fontenelle
Rafael Fontenelle

🌍 πŸ€”
Rafael MuΓ±oz CΓ‘rdenas
Rafael MuΓ±oz CΓ‘rdenas

πŸ›
RenStone83
RenStone83

πŸ›
Richard Bamford
Richard Bamford

πŸ›
Rui Maciel
Rui Maciel

πŸ€”
Sabri Ünal
Sabri Ünal

🌍 πŸ’»
Sascha Holzhauer
Sascha Holzhauer

πŸ› πŸ“–
SebCanet
SebCanet

πŸ€”
Sebi
Sebi

πŸ›
Seong-ho Cho
Seong-ho Cho

🌍
Sergej A.
Sergej A.

🌍
Sophie Herold
Sophie Herold

πŸ’» ️️️️♿️
Steve Kossouho
Steve Kossouho

πŸ› πŸ’»
Steven Liu
Steven Liu

πŸ›
Sycophantic-Witty
Sycophantic-Witty

πŸ›
Teun Hoevenaars
Teun Hoevenaars

πŸ“–
Thomas
Thomas

πŸ›
Thomas Firchau
Thomas Firchau

πŸ“–
Tiemen Schuijbroek
Tiemen Schuijbroek

πŸ› πŸ’»
Tobias Bernard
Tobias Bernard

🎨 πŸ€”
TomBous
TomBous

πŸ›
Tomasz DroΕΌdΕΌ
Tomasz DroΕΌdΕΌ

πŸ€”
Tony
Tony

🚧
Viicos
Viicos

πŸ›
Xander982
Xander982

πŸ–‹ πŸ›
YantaoZhao
YantaoZhao

πŸ› πŸ€”
Yauhen Kirylau
Yauhen Kirylau

πŸ“– πŸ“¦ πŸ€” πŸ›
Zsolt Sandor
Zsolt Sandor

πŸ€” πŸ› πŸ’» πŸ“–
\s\m
\s\m

πŸ“–
albanobattistella
albanobattistella

🌍
bayerl
bayerl

πŸ“–
cloud-erik
cloud-erik

πŸ€”
deifemu
deifemu

πŸ›
freddii
freddii

πŸ€” πŸ“–
freezed-or-frozen
freezed-or-frozen

πŸ›
fu7mu4
fu7mu4

🌍
gavr123456789
gavr123456789

πŸ€”
ghillebrand
ghillebrand

πŸ€”
greedyj4ck
greedyj4ck

πŸ›
johnvon
johnvon

🌍
jposada202020
jposada202020

🌍
kellenmoura
kellenmoura

πŸ›
lightonflux
lightonflux

πŸ›
lukman83
lukman83

πŸ›
madiharvey
madiharvey

πŸ€” πŸ›
mcdigregorio
mcdigregorio

πŸ›
melisdogan
melisdogan

πŸ“–
mikekidner
mikekidner

πŸ› πŸ’»
milotype
milotype

🌍 πŸ“–
mskorkowski
mskorkowski

πŸ›
noblevirk
noblevirk

πŸ€”
nomisge
nomisge

πŸ› πŸ€”
ovari
ovari

πŸ€” 🌍 πŸ›
perovsek
perovsek

🌍 πŸ›
peter88213
peter88213

πŸ›
qsodev
qsodev

πŸ›
samirodj
samirodj

πŸ›
seryafarma
seryafarma

πŸ“–
shobeira
shobeira

πŸ› πŸ€”
sib@c
sib@c

πŸ› πŸ€”
tompkins-ct
tompkins-ct

πŸ› πŸ€”
tronta
tronta

πŸ›
vikdevelop
vikdevelop

🌍
wrobell
wrobell

πŸ’» ⚠️ πŸ› 🎨
zhangxinqiang
zhangxinqiang

🌍
Γ“scar FernΓ‘ndez DΓ­az
Γ“scar FernΓ‘ndez DΓ­az

🌍 πŸ’»
Π•Π²Π³Π΅Π½ΠΈΠΉ Π›Π΅ΠΆΠ½ΠΈΠ½
Π•Π²Π³Π΅Π½ΠΈΠΉ Π›Π΅ΠΆΠ½ΠΈΠ½

🌍
ΠŸΡ‘Ρ‚Ρ€ Π‘Π°Π±Π°Π½ΠΎΠ²
ΠŸΡ‘Ρ‚Ρ€ Π‘Π°Π±Π°Π½ΠΎΠ²

🌍
品ι›ͺ
品ι›ͺ

πŸ›

This project follows the all-contributors specification. Contributions of any kind are welcome!

  1. Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug. There is a first-timers-only tag for issues that should be ideal for people who are not very familiar with the codebase yet.
  2. Fork the repository on GitHub to start making your changes to the main branch (or branch off of it).
  3. Write a test which shows that the bug was fixed or that the feature works as expected.
  4. Send a pull request and bug the maintainers until it gets merged and published. πŸ˜„

See the contributing guide!

🌍 Translations

Translation of Gaphor is mostly done using Weblate.

For the Linux Flatpak, the desktop entry comment string can be translated at our Flatpak repository.

Thank you so much for your effort in helping us keep it available in many languages!

Translation status

♿️ Code of Conduct

We value your participation and want everyone to have an enjoyable and fulfilling experience. As a GNOME Circle project, all participants are expected to follow the GNOME Code of Conduct and to show respect, understanding, and consideration to one another. Thank you for helping make this a welcoming, friendly community for everyone.

©️ License

Copyright Β© The Gaphor Development Team

Licensed under the Apache License v2.

Summary: You can do what you like with Gaphor, as long as you include the required notices. This permissive license contains a patent license from the contributors of the code.

gaphor's People

Contributors

0lione avatar adamboduch avatar albanobattistella avatar allcontributors[bot] avatar amolenaar avatar bugurtit avatar danyeaw avatar dependabot[bot] avatar flipflop97 avatar franciscotgouveia avatar frandieguez avatar jposada202020 avatar marek-piirikivi avatar mikekidner avatar milotype avatar mrmonkington avatar oscfdezdz avatar ovari avatar pre-commit-ci[bot] avatar pyguy2 avatar rffontenelle avatar ser82-png avatar sourcery-ai[bot] avatar sz332 avatar teunhoevenaars avatar tiemensch avatar vanillajonathan avatar vikdevelop avatar weblate avatar wrobell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gaphor's Issues

uml metamodel: nodes shall be connected with communication path

it is possible to connect two node items with an association line,
but association line shall represent communication path on uml
metamodel.

also, when connecting 2 nodes with association line, it would be
nice to have association ends navigability set to unknown by default.

Installation Errors

I'm submitting a...

  • Bug report
  • Feature request
  • Documentation issue or request

Current behavior

Failed installation when trying to create a new environment with conda

conda create -n gaphor python=2.7
source activate gaphor 
pip install gaphor

Expected behavior

Expect software to install.

Minimal reproduction of the problem with instructions

Get error for missing module six. After pip install six and then pip install gaphor, get the error below.

Failed to build pycairo PyGObject

System Information

OS:

  • Linux (Please put in notes the specific distro)
  • MacOS
  • Windows 10
  • Windows 7

Enhancement: Inline element editor dialog.

I'm not entirely sure if this is even possible with GTK, but the inline element name edit dialog displays in the task bar when opened. It would be nice if this didn't happen.

0.15b3: Operations in element editor disappear.

To reproduce:

  • Select a class and add an operation.
  • Press enter to save the operation.
  • Notice the canvas is updated but the new method has vanished from the element editor.
  • Deselect the class and reselect it. The newly added method is now displayed in the element editor.

ToolPalette Buttons Don't Click

I'm submitting a...

  • Bug report
  • Feature request
  • Documentation issue or request

Current behavior

Although drag and drop currently works from the ToolPalette, clicking on a button to drag and drop it, does not result in the button actually being clicked. The cause of this is because each button has Gtk.ToolButton.set_use_drag_window(True). This causes all events (even button clicks) to be intercepted as a drag event.

The docs say that the easiest way to use drag and drop with Gtk.ToolPalette is to call Gtk.ToolPalette.add_drag_dest() with the desired drag source palette and the desired drag target widget. This is kind of the opposite of the technique we are using, since we need to setup the toolbox and then add a callback to the drag source after the DiagramPage is created.

Expected behavior

You should be able to click and drag and see the button pressed. You should also be able to click on the button and then click on the diagram page. This is used for connecting lines between two items.

Re-opening editor window makes Gaphor crash

I'm submitting a...

  • Bug report
  • Feature request
  • Documentation issue or request

Current behavior

When the editor window is opened for a second time, after it's closed, it will crash the application.

Expected behavior

Minimal reproduction of the problem with instructions

  • Start Gaphor,
  • Open the editor (Command-e)
  • close the editor window
  • open it again
  • crash (SIGSEGV)

System Information

OS:

  • Linux (Please put in notes the specific distro)
  • MacOS
  • Windows 10
  • Windows 7

NOTES:

The Console window does not make Gaphor crash, instead the window will not show when opened for a second time.

error loading diagram with "Control/object flow" item

When I tried to load any diagram with a "Control/object flow" item in it, Gaphor crash with:

2009-12-20 18:31:24,771 DEBUG Loading from: ~/case1.gaphor
2009-12-20 18:31:24,885 INFO Loading file case1.gaphor
2009-12-20 18:31:25,241 INFO Read 10 elements from file
2009-12-20 18:31:25,241 DEBUG Cargando 10 elementos...
2009-12-20 18:31:25,282 INFO file ~/case1.gaphor could not be loaded
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/gaphor/storage/storage.py", line 357, in load_generator
for percentage in load_elements_generator(elements, factory, gaphor_version):
File "/usr/lib/python2.6/site-packages/gaphor/storage/storage.py", line 306, in load_elements_generator
elem.element.postload()
File "/usr/lib/python2.6/site-packages/gaphor/diagram/flow.py", line 45, in postload
super(FlowItem, self).postload()
File "/usr/lib/python2.6/site-packages/gaphor/diagram/diagramline.py", line 162, in postload
self._postload_connect(self.head, self._load_head_connection)
File "/usr/lib/python2.6/site-packages/gaphor/diagram/diagramline.py", line 143, in _postload_connect
connector = Connector(self, handle)
File "/usr/lib/python2.6/site-packages/simplegeneric.py", line 62, in dispatch
return f(_args, *_kw)
TypeError: init() takes exactly 4 arguments (3 given)
2009-12-20 18:31:25,284 ERROR Error while loading model from file ~/case1.gaphor: <type 'exceptions.TypeError'>

/usr/lib/python2.6/site-packages/simplegeneric.py(62)dispatch()
-> return f(_args, *_kw)
(Pdb) list
57 f = _gbo(id(args[0]), _sentinel)
58 if f is _sentinel:
59 for t in type(args[0]).mro:
60 f = _gbt(t, _sentinel)
61 if f is not _sentinel:
62 -> return f(_args, *_kw)
63 else:
64 return func(_args, *_kw)
65 else:
66 return f[1](*args, **kw)
67

I have simplegeneric-0.6 installed

Feature: Stuctured classifiers.

This is really more of a question, is there going to be any structured classifier support in the future? The main reason I am curious is because I'm allowed to create "Connector" elements but there is no obvious way for me to create a "StructuredClass" or a "Collaboration" element.

Shouldn't the "Connector" element only be allowed to connect parts within a structured classifier? Also, this may be somewhat unrelated, but since "Component" elements are structured classifiers, should there not be some notion of containment? For instance, shouldn't I be able to build sub-components?

What are your thoughts?

Undo deleted class error

Try this:

  • create 2 classes
  • connect by an association
  • delete one class
  • undo
  • now one end of the association still has a green handle. moving the class will move the association as well
  • try to disconnect the association green handle. Errors will occur and the diagram won't behave properly

Undo Tests Fail for Can_Undo Issue

Two tests are failing in the UndoRedoTestCase and the UndoTest for a similar issue for a failed assert:
self.assertTrue(undo_manager.can_undo())

I'm submitting a...

  • Bug report
  • Feature request
  • Documentation issue or request

Current behavior

tests/test_undo.py:11 (UndoTest.test_class_association_undo_redo)
self = <test_undo.UndoTest testMethod=test_class_association_undo_redo>
def test_class_association_undo_redo(self):
factory = self.element_factory
undo_manager = self.get_service("undo_manager")

self.assertEqual(0, len(self.diagram.canvas.solver.constraints))

ci1 = self.create(items.ClassItem, UML.Class)
self.assertEqual(2, len(self.diagram.canvas.solver.constraints))

ci2 = self.create(items.ClassItem, UML.Class)
self.assertEqual(4, len(self.diagram.canvas.solver.constraints))

a = self.create(items.AssociationItem)

self.connect(a, a.head, ci1)
self.connect(a, a.tail, ci2)

# Diagram, Association, 2x Class, Property, LiteralSpecification
self.assertEqual(6, len(factory.lselect()))
self.assertEqual(6, len(self.diagram.canvas.solver.constraints))

@transactional
def delete_class():
ci2.unlink()

undo_manager.clear_undo_stack()
self.assertFalse(undo_manager.can_undo())

delete_class()

>       self.assertTrue(undo_manager.can_undo())
E AssertionError: False is not true
tests/test_undo.py:42: AssertionError

Edit comment text

I'm submitting a...

  • Bug report
  • Feature request
  • Documentation issue or request

Current behavior

gaphor.transaction ERROR Transaction terminated due to an exception, performing a rollback
Traceback (most recent call last):
  File "/Users/arjan/Development/gaphor/gaphor/transaction.py", line 27, in _transactional
    r = func(*args, **kwargs)
  File "/Users/arjan/Development/gaphor/gaphor/adapters/propertypages.py", line 503, in _on_body_change
    buffer.get_start_iter(), buffer.get_end_iter()
TypeError: Gtk.TextBuffer.get_text() takes exactly 4 arguments (3 given)
Traceback (most recent call last):
  File "/Users/arjan/Development/gaphor/gaphor/transaction.py", line 27, in _transactional
    r = func(*args, **kwargs)
  File "/Users/arjan/Development/gaphor/gaphor/adapters/propertypages.py", line 503, in _on_body_change
    buffer.get_start_iter(), buffer.get_end_iter()
TypeError: Gtk.TextBuffer.get_text() takes exactly 4 arguments (3 given)

Minimal reproduction of the problem with instructions

Create a Class, add a comment to it (comment + comment line). Open the editor (Edit -> Editor) and start typing.

Spellcheck docs, docstrings, and comments

Currently there is quite a few spelling issues. This would be a great way for someone to make an awesome contribution and start to get involved in the project! ❀️

BUG: Model will not save once operations are removed.

This is fairly easy to reproduce:

  1. Create a class operation and then delete it.

  2. Attempt to save the save the model.

  3. A message about cleaning no longer maintained items appears. Click "yes". The model is now saved.

  4. Shutdown Gaphor and start it up again.

  5. Attempt to open the model file. Error about invalid item id appears.

Deal with non-diagram element dependencies

Some relationships are simple: e.g. an association connected to a class is simple, cause it is visible in a diagram.

Other relationships, like stereotypes to classes are harder to maintain, esp. since there are a few intermediate objects. The behaviour when for example a stereotype is removed is not clearly defined. It should be explicitly defined, since those are like the business rules for gaphor.

Think DCI

Flaky Test Tagged Value Upgrade Test

When running the StorageTestCase, the test_tagged_value_upgrade test is failing when running with the full test suite, but it passes when run by itself.

I'm submitting a...

  • Bug report
  • Feature request
  • Documentation issue or request

Current behavior

4 != 1
Expected :
1
Actual :
4

self = <gaphor.storage.tests.test_storage.FileUpgradeTestCase testMethod=test_tagged_values_upgrade>
first = 1, second = 4, msg = None
def _patched_equals(self, first, second, msg=None):
try:
>           old(self, first, second, msg)
../../pycharm-2018.3/helpers/pycharm/teamcity/diff_tools.py:32: 

Errors when loading diagram

I'm submitting a...

  • Bug report
  • Feature request
  • Documentation issue or request

Current behavior

I tried loading test-diagrams/diagram-#4.gaphor and the diagram only contained the interface "Room". On the terminal, there were a lot of error messages:

flatpak run --filesystem=home org.gaphor.Gaphor 
Application INFO initializing service service.component_registry
Application INFO initializing service service.main_window
gaphor.ui.stock INFO Icon dir: /app/lib/python3.7/site-packages/gaphor/ui/pixmaps
Application INFO initializing service service.action_manager
ActionManager INFO Loading action provider services
Application INFO initializing service service.ui_manager
Application INFO initializing service service.properties
Application INFO initializing service service.adapter_loader
Application INFO initializing service service.alignment
Application INFO initializing service service.copy
Application INFO initializing service service.diagram_export_manager
Application INFO initializing service service.diagram_layout
Application INFO initializing service service.element_dispatcher
Application INFO initializing service service.element_factory
Application INFO initializing service service.file_manager
gaphor.services.filemanager INFO Updating recent files
Application INFO initializing service service.help
HelpService INFO Starting
Application INFO initializing service service.pynsource
Application INFO initializing service service.sanitizer
Application INFO initializing service service.undo_manager
UndoManager INFO Starting
Application INFO initializing service service.xmi_export
gaphor.services.filemanager INFO Setting current file
gaphor.services.filemanager INFO Loading file
gaphor.storage.storage INFO Loading file b'diagram-#4.gaphor'
b'/home/awilms/Development/gaphor/test-diagrams/diagram-#4.gaphor'
gaphor.storage.storage INFO Read 149 elements from file
version 0.14.1
gaphor.ui.diagramtools ERROR Error during connect
Traceback (most recent call last):
  File "/app/lib/python3.7/site-packages/gaphor/ui/diagramtools.py", line 92, in connect
    adapter.connect(handle, sink.port)
  File "/app/lib/python3.7/site-packages/gaphor/adapters/connectors.py", line 429, in connect
    self.connect_connected_items()
  File "/app/lib/python3.7/site-packages/gaphor/adapters/connectors.py", line 373, in connect_connected_items
    assert adapter
AssertionError
Traceback (most recent call last):
  File "/app/lib/python3.7/site-packages/gaphas/view.py", line 867, in on_draw
    Context(cairo=cr, items=self.get_items_in_rectangle(area), area=area)
  File "/app/lib/python3.7/site-packages/gaphas/painter.py", line 83, in paint
    painter.paint(context)
  File "/app/lib/python3.7/site-packages/gaphas/painter.py", line 155, in paint
    self._draw_items(context.items, cairo, context.area)
  File "/app/lib/python3.7/site-packages/gaphas/painter.py", line 132, in _draw_items
    self._draw_item(item, cairo, area=area)
  File "/app/lib/python3.7/site-packages/gaphas/painter.py", line 120, in _draw_item
    draw_all=self.draw_all,
  File "/app/lib/python3.7/site-packages/gaphor/diagram/compartment.py", line 541, in draw_compartment
    comp.draw(context)
  File "/app/lib/python3.7/site-packages/gaphor/diagram/compartment.py", line 189, in draw
    item.draw(context)
  File "/app/lib/python3.7/site-packages/gaphor/diagram/compartment.py", line 85, in draw

TheTypeError: Pango.Layout.set_text() takes exactly 3 arguments (2 given) repeats quite often.

Expected behavior

There should be no errors.

Minimal reproduction of the problem with instructions

Open test-diagrams/diagram-#4.gaphor in the current Flatpak version of Gaphor (1.0.0rc1)

System Information

OS:

  • Linux (Please put in notes the specific distro)
  • MacOS
  • Windows 10
  • Windows 7

NOTES:
Distro: Fedora 29 KDE

fix for editing transition attributes

Transition property dialogue fails. The patch below seems to fix the problem (use self.subject instead of missing self.context.subject). The error message can be found after the patch.

diff --git a/gaphor/adapters/states/propertypages.py b/gaphor/adapters/states/propertypages.py
index fa7cd2c..908bb61 100644
--- a/gaphor/adapters/states/propertypages.py
+++ b/gaphor/adapters/states/propertypages.py
@@ -24,7 +24,7 @@ class TransitionPropertyPage(NamedItemPropertyPage):
def construct(self):
page = super(TransitionPropertyPage, self).construct()

  •    subject = self.context.subject
    
  •    subject = self.subject
    
     if not subject:
         return page
    

    @@ -49,7 +49,7 @@ class TransitionPropertyPage(NamedItemPropertyPage):
    @transactional
    def _on_guard_change(self, entry):
    value = entry.get_text().strip()

  •    subject = self.context.subject
    
  •    subject = self.subject
     if subject.guard is None:
         subject.guard = self.element_factory.create(UML.Constraint)
         subject.guard.specification = self.element_factory.create(UML.LiteralSpecification)
    

2009-12-29 12:44:47,639 ERROR Could not construct property page for Properties
Traceback (most recent call last):
File "./gaphor/ui/propertyeditor.py", line 68, in create_pages
page = adapter.construct()
File "./gaphor/adapters/states/propertypages.py", line 27, in construct
subject = self.context.subject
AttributeError: 'TransitionPropertyPage' object has no attribute 'context'
data ('delay', u'5', True, <gaphor.UML.uml2.Property object at 0x957e4cc>, <gaphor.UML.uml2.InstanceSpecification object at 0x957e7ec>, <gaphor.UML.uml2.Slot object at 0x957e84c>)

gaphor won't start: importerror in gi.respository

I'm submitting a...

  • Bug report
  • Feature request
  • Documentation issue or request

Current behavior

Gaphor exits after an ImportError is raised from gi:

raceback (most recent call last):
  File "/usr/local/bin/gaphor", line 11, in <module>
    load_entry_point('gaphor==0.17.2', 'console_scripts', 'gaphor')()
  File "/usr/local/lib/python2.7/dist-packages/gaphor/__init__.py", line 98, in main
    launch(model)
  File "/usr/local/lib/python2.7/dist-packages/gaphor/__init__.py", line 34, in launch
    Application.init()
  File "/usr/local/lib/python2.7/dist-packages/gaphor/application.py", line 53, in init
    self.load_services(services)
  File "/usr/local/lib/python2.7/dist-packages/gaphor/application.py", line 75, in load_services
    cls = ep.load()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2324, in load
    return self.resolve()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2330, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/local/lib/python2.7/dist-packages/gaphor/services/filemanager.py", line 13, in <module>
    from gaphor.storage import storage, verify
  File "/usr/local/lib/python2.7/dist-packages/gaphor/storage/storage.py", line 18, in <module>
    import gaphas
  File "/usr/local/lib/python2.7/dist-packages/gaphas/__init__.py", line 45, in <module>
    from .canvas import Canvas
  File "/usr/local/lib/python2.7/dist-packages/gaphas/canvas.py", line 43, in <module>
    from gaphas.decorators import nonrecursive, AsyncIO
  File "/usr/local/lib/python2.7/dist-packages/gaphas/decorators.py", line 9, in <module>
    import gi
  File "/usr/lib/python2.7/dist-packages/gi/__init__.py", line 39, in <module>
    raise ImportError(_static_binding_error)
ImportError: When using gi.repository you must not import static modules like "gobject". Please change all occurrences of "import gobject" to "from gi.repository import GObject". See: https://bugzilla.gnome.org/show_bug.cgi?id=709183

Expected behavior

gaphor starts.

Minimal reproduction of the problem with instructions

Install gaphor via pip: python2 -m pip install gaphor

System Information

OS:

  • Linux (Please put in notes the specific distro)
  • MacOS
  • Windows 10
  • Windows 7

NOTES:

Python:

  • 2.7.15rc1

System:

  • Kernel: 4.15.0-43-generic x86_64 bits: 64
  • Desktop: Cinnamon 3.8.9
  • Distro: Linux Mint 19 Tara

Usability: Hide stereotype options in the element editor.

When editing a class element, it might make sense to hide the stereotype section since it isn't implemented. At least it appears that way. It may be viewed as defective by some users. My first impression was that I was missing a step somewhere.

Element editor isn't updated.

When I double click a method in a class element, I can edit it and it updates the canvas. However, if the class element is selected while I do this, the element editor dialog doesn't reflect my change. If I deselect the class and select it again, my changes become apparent.

This could be harmful if someone makes a change, and doesn't notice that the change was actually made on the canvas. They will think that the inline, double-click method editing capability is broken when it isn't.

Lifeline extension broken with create messages.

When a creation message is attached to the instance (not the dashed lifeline), the dashed lifeline size cannot be extended in size. If I move the message to the dashed lifeline or remove it completely, the size extension will work as expected.

DiagramItems do not send events on state change

In the property editor we can change the state of an item, but that state is only updated when an element get's focus.

Example: I'd like to disable the orthogonal property of a line if it exists only of one segment. The user can add extra segments and then the option should become enabled.

Connection code is to complicated

The connect/disconnect code has evolved. However, currently it's hard to sort out what is happening on a connect/disconnect.

This should be refactored to more clear/easier to read code.

Element editor doesn't recognize selections

When Gaphor is first started, it seems that the element editor doesn't populate with the selected element data. To reproduce:

  • Start Gaphor.
  • Create any element and select it.
  • Open the element editor (no data populated).
  • Close the element editor.
  • Create another element and select it.
  • Open the element editor (data populated).

UI Tests Fail: AttributeError for Getting Diagram / Page

The get_current_diagram and get_current_view method use to be part of the MainWindow class. Now that they are part of the Diagrams class, we need to determine how to inject them in to the unit tests. The unit tests are currently getting the main_window service and we need to ensure that the diagram page has actually been created as part of the test fixture.

There are 5 tests currently failing due to similar issues around this.

I'm submitting a...

  • Bug report
  • Feature request
  • Documentation issue or request

Current behavior

Expected behavior

gaphor/ui/tests/test_diagramtools.py:27 (DiagramItemConnectorTestCase.test_item_reconnect)
self = <gaphor.ui.tests.test_diagramtools.DiagramItemConnectorTestCase testMethod=test_item_reconnect>
def setUp(self):
super(DiagramItemConnectorTestCase, self).setUp()
mw = self.get_service("main_window")
mw.open()
>       mw.show_diagram(self.diagram)
E AttributeError: 'MainWindow' object has no attribute 'show_diagram'
gaphor/ui/tests/test_diagramtools.py:25: AttributeError

Gen UML Test Case TypeError for NoneType Object not Callable

The GenUMLTestCase is failing with a TypeError: NoneType object is not callable for value = value.replace(" ", "").replace("\n", "").replace("\r", "")

I'm submitting a...

  • Bug report
  • Feature request
  • Documentation issue or request

Current behavior

 F/home/dan/Projects/gaphor/tests/test-model.gaphor
scanning subsets = <gaphor.storage.parser.element object at 0x7f373773fa58>
tests/test_gen_uml.py:24 (GenUmlTestCase.test_loading)
self = <test_gen_uml.GenUmlTestCase testMethod=test_loading>
def test_loading(self):

dist = pkg_resources.get_distribution("gaphor")
model_file = os.path.join(dist.location, "tests/test-model.gaphor")
outfile = PseudoFile()

>       generate(model_file, outfile)
tests/test_gen_uml.py:31:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
utils/command/gen_uml.py:564: in generate
parse_association_end(e1, e2)
utils/command/gen_uml.py:379: in parse_association_end
subsets, redefines = parse_association_tags(head.appliedStereotype)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
appliedStereotypes = [<gaphor.storage.parser.element object at 0x7f373775c9e8>]
def parse_association_tags(appliedStereotypes):
subsets = []
redefines = None

for stereotype in appliedStereotypes or []:
for slot in stereotype.slot or []:

msg("scanning %s = %s" % (slot.definingFeature.name, slot.value))

if slot.definingFeature.name == "subsets":
value = slot.value
# remove all whitespaces and stuff
>                   value = value.replace(" ", "").replace("\n", "").replace("\r", "")
E TypeError: 'NoneType' object is not callable
utils/command/gen_uml.py:336: TypeError

Update from LGPL 2.0 to 2.1 (or Apache)

GitHub supports displaying the license on the repository overview. It only supports licenses from choose a license, which includes the LGPL 2.1, but not 2.0.

The main changes are rewording Library to Lesser, and adding another option for using a shared library mechanism:
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.

Any concerns with us migrating to the LGPL 2.1?

Interaction message alignment.

If I have a complex sequence interaction diagram with several messages and roles, there is a good chance I'm going to want to extend the vertical length of the lifelines when adding new messages to the interaction.

However, when the vertical length of lifelines are extended, the horizontal alignment of the messages are not maintained. When there are several messages, these diagrams are hard to maintain.

Spruce up our README

I'm submitting a...

  • Bug report
  • Feature request
  • Documentation issue or request

We would ❀️ someone to craft a new README. We need a better description of what Gaphor is and is not, a nice gif showing it in action, and details about how to install it on the different platforms.

A good starting point may be to get the sections setup first, and then we can get the information added. https://github.com/matiassingers/awesome-readme has many resources and examples showing great READMEs for other projects.

Screenshots in appdata

I'm submitting a...

  • Bug report
  • Feature request
  • Documentation issue or request

Current behavior

Appdata file is missing some screenshots

Expected behavior

Maybe show Gaphor being used to create one of each supported UML diagram types

Minimal reproduction of the problem with instructions

Go to https://flathub.org/apps/details/org.gaphor.Gaphor, notice that there's no screenshots

If this is a feature request please fill out the following:


As a (user, developer, contributor, etc):
I want:
So that:

System Information

OS:

  • Linux (Please put in notes the specific distro)
  • MacOS
  • Windows 10
  • Windows 7

NOTES:
There are some guidelines regarding the screenshots in the appdata spec: https://www.freedesktop.org/software/appstream/docs/chap-Quickstart.html

The "in" keyword in Operations

Hi, I want to say thanks for the really good software that you have created.
However I find something really frustrating. When I create a new operation and I write:
"add(a: int)"
and press enter, then It gets transformed to this:
"add(in a: int)"

For me the "in" keyword should be out, because most params you pass to a function will be "in", so it should be omitted. If you take a look to Umbrello, that's how they do it.

Comment Line Relationship (un)link behaviour

The Comment Line Test case is failing based on an assert that a multi adapter was found between cinfo.item and cinfo.connected using the IConnect interface.

I'm submitting a...

  • Bug report
  • Feature request
  • Documentation issue or request

Current behavior

gaphor/adapters/tests/test_comment.py:156 (CommentLineTestCase.test_commentline_relationship_unlink)
self = <gaphor.adapters.tests.test_comment.CommentLineTestCase testMethod=test_commentline_relationship_unlink>
def test_commentline_relationship_unlink(self):
"""Test comment line to a relationship item connection and unlink.

Demonstrates defect #103.
"""
clazz1 = self.create(items.ClassItem, UML.Class)
clazz2 = self.create(items.ClassItem, UML.Class)
gen = self.create(items.GeneralizationItem)

self.connect(gen, gen.head, clazz1)
self.connect(gen, gen.tail, clazz2)

assert gen.subject

# now, connect comment to a generalization (relationship)
comment = self.create(items.CommentItem, UML.Comment)
line = self.create(items.CommentLineItem)
self.connect(line, line.head, comment)
self.connect(line, line.tail, gen)

self.assertTrue(gen.subject in comment.subject.annotatedElement)
self.assertTrue(comment.subject in gen.subject.ownedComment)

# FixMe: This should invoke the disconnnect handler of the line's
# handles.

>       gen.unlink()
gaphor/adapters/tests/test_comment.py:183:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
gaphor/diagram/diagramitem.py:234: in unlink
self.canvas.remove(self)
../../.cache/pypoetry/virtualenvs/gaphor-py3.7/lib/python3.7/site-packages/gaphas/canvas.py:155: in remove
self.remove_connections_to_item(item)
../../.cache/pypoetry/virtualenvs/gaphor-py3.7/lib/python3.7/site-packages/gaphas/canvas.py:371: in remove_connections_to_item
disconnect_item(*cinfo)
<decorator-gen-18>:2: in _disconnect_item
???
../../.cache/pypoetry/virtualenvs/gaphor-py3.7/lib/python3.7/site-packages/gaphas/state.py:77: in wrapper
return func(*args, **kwargs)
../../.cache/pypoetry/virtualenvs/gaphor-py3.7/lib/python3.7/site-packages/gaphas/canvas.py:355: in _disconnect_item
callback()
gaphor/ui/diagramtools.py:136: in __call__
adapter.disconnect(handle)
gaphor/adapters/connectors.py:455: in disconnect
connections = self.disconnect_connected_items()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <gaphor.adapters.classes.classconnect.GeneralizationConnect object at 0x7f3749884518>
def disconnect_connected_items(self):
"""
Cause items connected to @line to be disconnected.
This is nessesary if the subject of the @line is to be removed.

Returns a list of (item, handle) pairs that were connected (this
list can be used to connect items again with connect_connected_items()).
"""
line = self.line
canvas = self.canvas
solver = canvas.solver

# First make sure coordinates match
solver.solve()
connections = list(canvas.get_connections(connected=line))
for cinfo in connections:
adapter = component.queryMultiAdapter(
(cinfo.item, cinfo.connected), IConnect
)
>           assert adapter
E AssertionError
gaphor/adapters/connectors.py:405: AssertionError

Tooltips Deprecation warning

I get this deprecation warning during startup:

/gaphor/ui/toolbox.py:127: DeprecationWarning: Use the new widget gtk.Tooltip
self.tooltips.enable()

I'm not sure if it is even relevant but thought it might be worth mentioning.

Python 3 version

It would be great to have a python 3 compatible version of gaphor.

association navigability

when connecting use case and actor with an association
then the navigability of association ends is set by default
to 'navigable'.

it is an issue because most of the associations on my use
case diagrams have unknown navigability or known navigability
only towards a use case, so i have to put extra work to change
the navigability. see also

http://images.google.com/images?oe=UTF-8&q=use%20case%20diagram&um=1&ie=UTF-8&sa=N&hl=en&tab=wi

above applies as well to associations set between nodes (deployment
diagrams).

therefore, i would change default navigability to 'unknown'. this would help
with rapid prototyping on class diagrams (i.e. set navigability to navigable
if you are sure that one class knows about the other one)

Make element editor more prominent

I'm submitting a...

  • Bug report
  • Feature request
  • Documentation issue or request

Current behavior

Initially, I thought something was broken, since I didn't see any way of editing elements like classes etc.

Expected behavior

When right-clicking on an UML element, it should offer to open the element editor, or it should reside in a (semi-)permanent side pane.

Minimal reproduction of the problem with instructions

Create new diagram, add class element, try to edit it.

If this is a feature request please fill out the following:


As a (user, developer, contributor, etc): user
I want: A more obvious way of editing UML elements
So that: I can start working faster

System Information

OS:

  • Linux (Please put in notes the specific distro)
  • MacOS
  • Windows 10
  • Windows 7

NOTES:
Fedora 29 KDE

Class doesn't resize after inline element edit.

Here is the problem:

  • Double-click a method in a class element to open the inline editor.
  • Create a long method signature (long enough to take up more horizontal space than the class.
  • Press enter to save the change. Notice the method signature is expanded beyond the class boundary.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.