Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
*/
public class ChangeBoundsRequest extends GroupRequest implements DropRequest {
private static final int SNAP_TO = 16;
private Point m_mouseAbsoluteLocation;
private Point m_mouseLocation;
private Point m_moveDelta = new Point();
private Dimension m_resizeDelta = new Dimension();
Expand Down Expand Up @@ -57,17 +58,37 @@ public ChangeBoundsRequest(Object type) {
//
////////////////////////////////////////////////////////////////////////////
/**
* Returns the location of the mouse pointer.
* Returns the <b>absolute<b> location of the mouse pointer.
*
* @deprecated Use {@link #getRelativeLocation()} instead.
*/
@Override
@Deprecated
public Point getLocation() {
return m_mouseAbsoluteLocation;
}

/**
* Sets the <b>absolute<b> location of the mouse pointer.
*
* @deprecated Use {@link #setRelativeLocation(Point)} instead.
*/
@Deprecated
public void setLocation(Point absoluteLocation) {
m_mouseAbsoluteLocation = absoluteLocation;
}

/**
* Returns the location of the mouse pointer.
*/
public Point getRelativeLocation() {
return m_mouseLocation;
}

/**
* Sets the location of the mouse pointer.
*/
public void setLocation(Point location) {
public void setRelativeLocation(Point location) {
m_mouseLocation = location;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,14 @@ protected Request createTargetRequest() {
* location and type.
*/
@Override
@SuppressWarnings("deprecation")
protected void updateTargetRequest() {
super.updateTargetRequest();
ChangeBoundsRequest request = (ChangeBoundsRequest) getTargetRequest();
request.setEditParts(getOperationSet());
request.setMoveDelta(new Point(getDragMoveDelta()));
request.setLocation(getAbsoluteLocation());
request.setRelativeLocation(getLocation());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2011, 2025 Google, Inc. and others.
* Copyright (c) 2011, 2026 Google, Inc. and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
Expand Down Expand Up @@ -229,6 +229,7 @@ protected List<? extends EditPart> createOperationSet() {
* Updates the request with the current {@link Tool#getOperationSet() operation set}, move delta,
* size delta and location.
*/
@SuppressWarnings("deprecation")
private void updateRequest() {
// create request
if (getRequest() == null) {
Expand Down Expand Up @@ -261,6 +262,7 @@ private void updateRequest() {
getRequest().setMoveDelta(corner);
getRequest().setSizeDelta(resize);
getRequest().setLocation(getAbsoluteLocation());
getRequest().setRelativeLocation(getLocation());
}

/**
Expand Down
Loading