tesis-dynaware / graph-editor

Eclipse Public License 1.0
132 stars 42 forks source link

Add read-only mode #19

Open eckig opened 9 years ago

eckig commented 9 years ago

It would be very nice to add a (implicit) read-only state of the graph editor.

Maybe not a single switch to do so, but what we need is:

rmfisher commented 9 years ago

The easiest way to do this right now is to add the following line to the constructor of your custom skins:

getRoot().setMouseTransparent(true);

By the way if you have no intention of creating or dragging joints to manually position connections, you could consider creating your own connection skin that just draws a simple path from start to finish and requires no joints at all. You could use the static method in RectangularPathCreator to draw the path for you.

eckig commented 9 years ago

No, not quite right :-)

I got this to work with a custom MouseEvent filter, but I thought it might be an option to offer in the API?

rmfisher commented 9 years ago

Ok I see. Would you like to call the API methods on the skin instances or on the graphEditor instance?

eckig commented 9 years ago

Well, getting the skin instance is somewhat difficult in some situations, so the GraphEditor or is properties are a good place.

rmfisher commented 9 years ago

Ok, I'll take a look further into it and see what I can do.

eckig commented 8 years ago

Since you are no longer developing, I added the future in a fork: https://github.com/eckig/graph-editor/commit/4e868d256686a070240641eab8b4915ac6123825