0


I want to get the new labeloffset after a label of a cell was moved.

For example, after you add a cell mxGraph.cellsAdded() is called. After a cell is moved mxGraph.cellsMoved() is called. But when you move a label of a cell, is there any method, event or anything else that could be used to react on this. I only found that mxGraph.repaint() is called after label movement, but that is a very general method, and I hope there is something more specific.

Thanks for your help in advance!

jay
  • 1
  • 2

1 Answers1

0

In general, after to call any event, a 'mxEventObject' is triggered, i.e.:

public void cellsAdded(.){
    ...
    fireEvent(new mxEventObject(<mx_event_name>, [<par_name>,<par_value>]));
}
  • 'mx_event_name': the name of the event in 'mxEvent' (String)
  • 'par_name': the parameter name (String)
  • 'par_value': the parameter value (Object)

try to listen the event

graph.addListener(<mx_event_name>, <listener>);
  • 'listener': a class extends 'mxEventSource.mxIEventListener'

Probably, is more effective look the code for 'mxEventSource' and check the method 'fireEvent'. In case the event that you need is not triggered, you can create your own events following the structure of 'mxEventObject' and override the target method on 'mxGraph'.

Hope thats helps.

Trauco
  • 41
  • 3