* Moves the label to the given position.
*/
protected void moveLabelTo(mxCellState edgeState, double x, double y)
{
mxGraph graph = graphComponent.getGraph();
mxIGraphModel model = graph.getModel();
mxGeometry geometry = model.getGeometry(state.getCell());
if (geometry != null)
{
geometry = (mxGeometry) geometry.clone();
// Resets the relative location stored inside the geometry
mxPoint pt = graph.getView().getRelativePoint(edgeState, x, y);
geometry.setX(pt.getX());
geometry.setY(pt.getY());
// Resets the offset inside the geometry to find the offset
// from the resulting point
double scale = graph.getView().getScale();
geometry.setOffset(new mxPoint(0, 0));
pt = graph.getView().getPoint(edgeState, geometry);
geometry.setOffset(new mxPoint(Math.round((x - pt.getX()) / scale),
Math.round((y - pt.getY()) / scale)));
model.setGeometry(edgeState.getCell(), geometry);
}
}