Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    How to update an existing DrawItem?

    Hi,
    I'm using smartGwt version 3.0 and FF browser.
    I'm creating a graph of nodes (Canvas objects) connected by DrawLinePath. When the user moves a node, I'd like to re-position the line.
    My problem is that I cannot find a way to update the position of an existing line. The only alternative I found is to erase the old line and create a new one. Is it the correct practice?
    Two related questions:
    1) should I call erase() or destroy() method on the old line?
    2) sometimes when I erase() an old line I get a
    WARN:DrawLinePath:isc_DrawLinePath_43:DrawItem not yet drawn - exiting erase()
    How can I check whether a line was already drawn (and need to be erased) or not?

    Thanks for the help, David

    #2
    At the moment, yes, the simplest thing is to destroy() and re-create a DrawLinePath that you want to modify. Using destroy() will avoid the error message related to erase() as well.

    Comment

    Working...
    X