1
1

According to this thread removeCells can be used to clear the graph like this:

\n
  graph.removeCells(graph.getChildCells(graph.getDefaultParent(), true, true))"\n
\n

I tried this but it had no effect. I changed removeCells to cellsRemoved and it worked as expected, though it caused an IndexOutOfBoundsException in mxCell.getChildAt when the AWT thread tried to repaint.

\n

Is there something else I need to do to get either of these methods to work?

asked 16 Jan '12, 07:35

waitinforatrain's gravatar image

waitinforatrain
567
accept rate: 50%

edited 28 Mar '12, 07:20

David's gravatar image

David
4.9k21831


((mxGraphModel) graph.getModel()).clear() should also work

link

answered 17 Jan '12, 09:17

Gaudenz's gravatar image

Gaudenz
80.1k1310
accept rate: 39%

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
×45
×10
×6

Asked: 16 Jan '12, 07:35

Seen: 1,768 times

Last updated: 28 Mar '12, 07:20