Is there a handy way to return a vertex object if you have it's id as a string? I'd like to be able to write something like:

\n
graph.insertEdge(parent, null, "", graph.getVertexByID("Alice"), graph.getVertexByID("Bob"));\n

asked 26 Sep '11, 08:25

Joe%20Reddington's gravatar image

Joe Reddington
135
accept rate: 0%

edited 27 Sep '11, 07:04

David's gravatar image

David
4.9k21831

Thank you! Saves me using the hashmap :)

(27 Sep '11, 06:07) Joe Reddington

graph.getModel().getCell("Bob") should work.

link

answered 27 Sep '11, 06:04

Gaudenz's gravatar image

Gaudenz
80.1k1310
accept rate: 39%

There is no such method in JGraphX.

(24 Nov '11, 02:21) DeadMeat

There is on mxGraphModel, just not on the model interface. The original poster did specify the language of the question before the answer was given, I added the tag afterwards.

(24 Nov '11, 06:27) David
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
×79
×45
×5
×1

Asked: 26 Sep '11, 08:25

Seen: 1,520 times

Last updated: 24 Nov '11, 06:27