tesis-dynaware / graph-editor

Eclipse Public License 1.0
132 stars 42 forks source link

Connection selection #21

Closed jmdsc closed 9 years ago

jmdsc commented 9 years ago

Great job so far!!!

Not sure if I've over looked anything while experimenting with the library but...

It seems that connections aren't "first class citizens" in the model. What I mean by this is that currently there is no easy way to select and consequently edit connection domain properties which unfortunately limits the "usefulness" of the API in applications where the "type of connection" between nodes is a core concept; i.e. weighted connections, relationships between nodes, etc...

Another consequence of not being able to select connections revolves around the actual "editing" of the graph and the difficulty in deleting a specific connection for nodes that allow multiple incoming and/or outgoing connections.

rmfisher commented 9 years ago

Just so I understand you correctly, you would like to select a connection, maybe delete it, edit its name, things like this?

jmdsc commented 9 years ago

Yes, the same way as we know which vertices are selected, knowing which connections are selected so that we can act upon them (delete, edit intrinsic or custom properties).

A multi-selection could include both vertices and connections which would probably require an abstraction of both, perhaps "Object".

rmfisher commented 9 years ago

Ok, it's an interesting point. I'll take a look into it and get back to you.

rmfisher commented 9 years ago

So the difference with connections is that the default connection skins use left-mouse-clicks for something else (creating new joints). I didn't want to hard-wire a left-click-to-select logic into the library for connections.

However, it is simple enough to add the logic in the skins themselves. I've made some changes to incorporate connections into the rest of the selection logic. For example being able to select them by dragging the selection-box, select-all, delete-selection, and so on.

I've made the connections in the tree-skins in the demo selectable to demonstrate how this works.