Hello,

I am trying to create/customize a simple graph (mainly using the helloworld example). Now I want to explicitly set the cell label. The code I am utilizing is basically these two lines:

mxCellState state=graph.getView().getState(vertex)
state.setLabel(graph.convertValueToString(vertex)+"_customized");

Now the labels show up as expected in the corresponding cells (in this case the vertices) of the JFrame application. However when I somehow touch the cells and for example moving it to another position in the JFrame they disappear and the original labels (a string representation of the associated objects) are displayed instead.

Is there any way to make the custom labels more permanent ? (So maybe directly associate them to the cells itself.) Or do I have to implement some function that generates the custom labels when a cell is touched.

Thanks, marian

asked 07 Aug '12, 04:56

marian's gravatar image

marian
1516
accept rate: 0%

edited 07 Aug '12, 05:00


link

answered 08 Aug '12, 07:13

David's gravatar image

David
4.9k21831
accept rate: 47%

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
×29

Asked: 07 Aug '12, 04:56

Seen: 2,562 times

Last updated: 08 Aug '12, 07:13