Hi all,

probably that sounds like a silly question, but how can i start implementing a graphical editor? I have already worked through the JGraphX manual, read all questions in this board tagged with "tutorial", searched for further tutorials/docs/manuals, but it seems that I'm overlooking something.

I also waded through JGraphX examples, especially SchemaEditor.java, GraphEditor.java and BasicGraphEditor, but I think there must be some doc about the further concepts of JGraphX, instead of picking knowledge out of many different class files. Or is this the way to do?

Hopefully someone can give me advice how to go into advance. Especially, I want to know how to add a palette into my project (kind of extended hello world). Inheriting from BasicGraphEditor.java is not best practice for me, since I want to know each detail happening in the background AND further, I don't want a toolbar, nor an outline, nor this sheet of paper as working space, nor this menu bar containing File, Edit, View, etc...

Hopefully this question is not to silly and I want to apologize if I overlooked something.

Thanks and regards, fachexot

asked 24 Jun '12, 16:51

fachexot's gravatar image

fachexot
461210
accept rate: 11%

edited 26 Jun '12, 03:56


I can only tell you what I did (and I was successful):

1) Read the short documentation provided in docs/manual, it is too short but really useful to get an idea of how JGraphX works.

2) Explored the source code of the examples and learned how JGraphX is used there. Yes, I think that is the way to go! It's quite easy to understand and JavaDoc is all along the way.

3) Whenever questions arise, first looked at the JavaDoc, then into the forums, finally tried to find the answer in the source of JGraphX. Only if all that didn't work out, asked in forum (actually I didn't have to :) )

I hope this helps you.. if not (which means you'd be too lazy to read and understand source code) I'm afraid JGraphX is not for you.

link

answered 26 Jun '12, 02:40

ThomasX's gravatar image

ThomasX
183
accept rate: 100%

edited 26 Jun '12, 02:41

Thanks. I already did those three points and even more. I also understood everything I explored. But an extended doc would help so much. To check for example each style property on its own to see what happens or to check each graph setting on its own takes up a lot of time, especially because the javadoc in jgraphx is not that descriptive at some points. I don't think it's a problem of laziness here. But okay, I will go on like this. Just thought it is possible to get JGraphX in a nutshell. Thanks anyway. Edit: I also have to learn a lot more about Swing. This could be my primary problem getting the concepts of JGraphX. ;-)

(26 Jun '12, 03:51) fachexot

Style properties (and many other things, too) can be checked efficiently in the GraphEditor example. Just launch it and create a node or edge. Then right-click it and select Format->Style. There you can enter your style string and see the change without compiling a program every time.

Furthermore, the GUI of the GraphEditor example allows some style definitions graphically (e.g. font color, background color, font size, ...). Set them through the GUI and afterwards have a look at Format->Style and you see how to set them.

The JavaDoc of mxConstants shows you which properties are implemented (and some are described well, while others need to be tried out, I agree).

Of course, a book about JGraphX would be cool... you should write one when you'll have finished your investigations! :-) But remember that it will quickly become out-of-date... the investigation approach is always on the bleeding edge :D

(27 Jun '12, 02:23) ThomasX
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×194
×10
×1

Asked: 24 Jun '12, 16:51

Seen: 35,080 times

Last updated: 27 Jun '12, 02:25