* y - Integer that defines the y-coordinate of the new location.
*/
public mxRectangle setVertexLocation(Object vertex, double x, double y)
{
mxIGraphModel model = graph.getModel();
mxGeometry geometry = model.getGeometry(vertex);
mxRectangle result = null;
if (geometry != null)
{
result = new mxRectangle(x, y, geometry.getWidth(),
geometry.getHeight());
mxGraphView graphView = graph.getView();
// Checks for oversize labels and offset the result
if (useBoundingBox)
{
mxCellState state = graphView.getState(vertex);
if (state != null)
{
double scale = graph.getView().getScale();
mxRectangle box = state.getBoundingBox();
if (state.getBoundingBox().getX() < state.getX())
{
x += (state.getX() - box.getX()) / scale;
result.setWidth(box.getWidth());
}
if (state.getBoundingBox().getY() < state.getY())
{
y += (state.getY() - box.getY()) / scale;
result.setHeight(box.getHeight());
}
}
}
if (this.parent != null)
{
Object parent = model.getParent(vertex);
if (parent != null && parent != this.parent)
{
mxPoint parentOffset = getParentOffset(parent);
x = x - parentOffset.getX();
y = y - parentOffset.getY();
}
}
if (geometry.getX() != x || geometry.getY() != y)
{
geometry = (mxGeometry) geometry.clone();
geometry.setX(x);
geometry.setY(y);
model.setGeometry(vertex, geometry);
}
}