Change node name in runtime

14 views
Skip to first unread message

Ilya Romanenko

unread,
Mar 13, 2008, 8:25:27 AM3/13/08
to Flex Visual Graph Library
I've implmented very important (for me) feature of changing node name
in runtime:
example of usage:

var vnode:IVisualNode=graph.nodeByStringId("1").vnode;
vnode.changeName("test");

actual changes:
NodeRenderer.as
private var lb:LinkButton=null; //move up lb to change
label later
public function changeName(newName:String):void { //actuallly change
name
lb.label=newName;
_imageObject.toolTip=newName;
toolTip=newName;
}
IVisualNode.as
/**
*This method changes name of node (including stored in data)
*
*/
function changeName(newName:String):void;
VisualNode.as
public function changeName(newName:String):void{
data.@name=newName;
(view as NodeRenderer).changeName(newName);
}

That's all :)

Daniel

unread,
Mar 21, 2008, 3:00:47 PM3/21/08
to Flex Visual Graph Library
Dear Ilya,

thanks. This shows on another side that currently the data management
aspect is still not dynamic enough. Currently the main data repository
is more or less the XML object, but changes to and from it in a
dynamic
way are not handled well, i.e. typically crash the application.

I think we would need to think of what kind internal data
representation
would be best suited to continue to work with (XML may be fine).

Then to add a layer that handles CRUD to this layer in a way that
makes use of the visualisation.

And then a way to dynamically update the visualisation properly
without
all the troubles of the layout calculation which typically causes
problems.

Maybe the "edit" mode I previously thought about could be implemented
as
a special type of layouter. Or at least requires/automatically sets a
layouter
that helps the cause....

What do the others think?

Daniel


On 13 Mrz., 08:25, Ilya Romanenko <IlyaRomane...@googlemail.com>
wrote:
Reply all
Reply to author
Forward
0 new messages