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 @@ -17,7 +17,6 @@
import org.eclipse.wb.core.model.IAbstractComponentInfo;
import org.eclipse.wb.core.model.ITopBoundsSupport;
import org.eclipse.wb.draw2d.FigureUtils;
import org.eclipse.wb.gef.core.requests.ChangeBoundsRequest;
import org.eclipse.wb.gef.graphical.handles.Handle;
import org.eclipse.wb.gef.graphical.handles.MoveHandle;
import org.eclipse.wb.gef.graphical.handles.ResizeHandle;
Expand All @@ -29,6 +28,7 @@
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.gef.Request;
import org.eclipse.gef.commands.Command;
import org.eclipse.gef.requests.ChangeBoundsRequest;

import java.util.ArrayList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import org.eclipse.wb.core.gef.policy.PolicyUtils;
import org.eclipse.wb.core.model.JavaInfo;
import org.eclipse.wb.gef.core.policies.ILayoutRequestValidator;
import org.eclipse.wb.gef.core.requests.ChangeBoundsRequest;
import org.eclipse.wb.gef.core.requests.CreateRequest;
import org.eclipse.wb.gef.core.requests.PasteRequest;
import org.eclipse.wb.gef.graphical.policies.LayoutEditPolicy;
Expand All @@ -36,6 +35,7 @@
import org.eclipse.gef.Request;
import org.eclipse.gef.RequestConstants;
import org.eclipse.gef.commands.Command;
import org.eclipse.gef.requests.ChangeBoundsRequest;

import org.apache.commons.lang3.ClassUtils;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2011, 2024 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 All @@ -14,7 +14,6 @@

import org.eclipse.wb.core.model.JavaInfo;
import org.eclipse.wb.gef.core.policies.ILayoutRequestValidator;
import org.eclipse.wb.gef.core.requests.ChangeBoundsRequest;
import org.eclipse.wb.gef.core.requests.CreateRequest;
import org.eclipse.wb.gef.core.requests.PasteRequest;
import org.eclipse.wb.internal.core.DesignerPlugin;
Expand All @@ -26,6 +25,7 @@
import org.eclipse.wb.internal.core.utils.execution.ExecutionUtils;

import org.eclipse.gef.EditPart;
import org.eclipse.gef.requests.ChangeBoundsRequest;

import org.apache.commons.lang3.StringUtils;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2011, 2024 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 All @@ -14,7 +14,6 @@

import org.eclipse.wb.core.model.JavaInfo;
import org.eclipse.wb.gef.core.policies.ILayoutRequestValidator;
import org.eclipse.wb.gef.core.requests.ChangeBoundsRequest;
import org.eclipse.wb.gef.core.requests.CreateRequest;
import org.eclipse.wb.gef.core.requests.PasteRequest;
import org.eclipse.wb.internal.core.model.nonvisual.AbstractArrayObjectInfo;
Expand All @@ -23,6 +22,7 @@
import org.eclipse.wb.internal.core.utils.reflect.ReflectionUtils;

import org.eclipse.gef.EditPart;
import org.eclipse.gef.requests.ChangeBoundsRequest;

/**
* Implementation of {@link ILayoutRequestValidator} for validate items for <i>array object</i>.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
*******************************************************************************/
package org.eclipse.wb.gef.core.policies;

import org.eclipse.wb.gef.core.requests.ChangeBoundsRequest;
import org.eclipse.wb.gef.core.requests.CreateRequest;
import org.eclipse.wb.gef.core.requests.PasteRequest;

import org.eclipse.gef.EditPart;
import org.eclipse.gef.EditPolicy;
import org.eclipse.gef.Request;
import org.eclipse.gef.requests.ChangeBoundsRequest;

/**
* Validator for known layout requests {@link Request#REQ_CREATE}, {@link Request#REQ_PASTE},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,199 +12,16 @@
*******************************************************************************/
package org.eclipse.wb.gef.core.requests;

import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.gef.EditPart;
import org.eclipse.gef.requests.DropRequest;
import org.eclipse.gef.requests.GroupRequest;

/**
* A {@link Request} to change the bounds of the {@link EditPart}(s).
*
* @author lobas_av
* @coverage gef.core
* @deprecated Use {@link org.eclipse.gef.requests.ChangeBoundsRequest
* ChangeBoundsRequest} directly.
*/
public class ChangeBoundsRequest extends GroupRequest implements DropRequest {
private static final int SNAP_TO = 16;
private Point m_mouseLocation;
private Point m_moveDelta = new Point();
private Dimension m_resizeDelta = new Dimension();
private int m_resizeDirection;
private int m_flags = 0;

////////////////////////////////////////////////////////////////////////////
//
// Constructors
//
////////////////////////////////////////////////////////////////////////////
/**
* Constructs an empty {@link ChangeBoundsRequest}.
*/
public ChangeBoundsRequest() {
}

/**
* Constructs a {@link ChangeBoundsRequest} with the specified <i>type</i>.
*/
public ChangeBoundsRequest(Object type) {
super(type);
}

////////////////////////////////////////////////////////////////////////////
//
// Access
//
////////////////////////////////////////////////////////////////////////////
/**
* Returns the location of the mouse pointer.
*/
@Override
public final Point getLocation() {
return m_mouseLocation;
}

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

/**
* Returns a {@link Point} representing the distance the {@link EditPart} has moved.
*/
public Point getMoveDelta() {
return m_moveDelta;
}

/**
* Sets the move delta.
*/
public void setMoveDelta(Point moveDelta) {
m_moveDelta = moveDelta;
}

/**
* Returns a {@link Dimension} representing how much the {@link EditPart} has been resized.
*/
public Dimension getSizeDelta() {
return m_resizeDelta;
}

/**
* Sets the size delta.
*/
public void setSizeDelta(Dimension sizeDelta) {
m_resizeDelta = sizeDelta;
}

/**
* Returns the direction the figure is being resized. Possible values are
* <ul>
* <li>{@link org.eclipse.draw2d.PositionConstants#EAST}
* <li>{@link org.eclipse.draw2d.PositionConstants#WEST}
* <li>{@link org.eclipse.draw2d.PositionConstants#NORTH}
* <li>{@link org.eclipse.draw2d.PositionConstants#SOUTH}
* <li>{@link org.eclipse.draw2d.PositionConstants#NORTH_EAST}
* <li>{@link org.eclipse.draw2d.PositionConstants#NORTH_WEST}
* <li>{@link org.eclipse.draw2d.PositionConstants#SOUTH_EAST}
* <li>{@link org.eclipse.draw2d.PositionConstants#SOUTH_WEST}
* </ul>
*/
public int getResizeDirection() {
return m_resizeDirection;
}

/**
* Sets the direction the figure is being resized.
*
* @see #getResizeDirection()
*/
public void setResizeDirection(int direction) {
m_resizeDirection = direction;
}

/**
* Transforms a copy of the passed in rectangle to account for the move and/or resize deltas and
* returns this copy.
*/
public Rectangle getTransformedRectangle(Rectangle rectangle) {
Rectangle result = rectangle.getCopy();
result.performTranslate(m_moveDelta);
result.resize(m_resizeDelta);
return result;
}

////////////////////////////////////////////////////////////////////////////
//
// DND Feedback
//
////////////////////////////////////////////////////////////////////////////
private int m_dndFeedback;

/**
* @return additional DND feedback flags.
*/
public int getDNDFeedback() {
return m_dndFeedback;
}

/**
* Sets additional DND feedback flags.
*/
public void setDNDFeedback(int dndFeedback) {
m_dndFeedback = dndFeedback;
}

////////////////////////////////////////////////////////////////////////////
//
// Snap to horizontal axis
//
////////////////////////////////////////////////////////////////////////////

/**
* Used to set whether snap-to is being performed.
*
* @param value <code>true</code> if the request is for a creation with snap-to
* enabled
*/
public void setSnapToEnabled(boolean value) {
m_flags = value ? m_flags | SNAP_TO : m_flags & ~SNAP_TO;
}

/**
* Returns <code>true</code> if snap-to is enabled
*
* @return <code>true</code> if the request is for a creation with snap-to
* enabled
*/
public boolean isSnapToEnabled() {
return (m_flags & SNAP_TO) != 0;
}

////////////////////////////////////////////////////////////////////////////
//
// Object
//
////////////////////////////////////////////////////////////////////////////
@Override
public String toString() {
StringBuffer buffer = new StringBuffer("ChangeBoundsRequest(type=");
buffer.append(getType());
buffer.append(", editParts=");
buffer.append(getEditParts());
buffer.append(", m_flags=");
buffer.append(m_flags);
buffer.append(", location=");
buffer.append(m_mouseLocation);
buffer.append(", resizeDelta=");
buffer.append(m_resizeDelta);
buffer.append(", moveDelta=");
buffer.append(m_moveDelta);
buffer.append(", direction=");
buffer.append(m_resizeDirection);
buffer.append(")");
return buffer.toString();
}
@Deprecated(forRemoval = true, since = "2026-06")
public class ChangeBoundsRequest extends org.eclipse.gef.requests.ChangeBoundsRequest {
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
*******************************************************************************/
package org.eclipse.wb.gef.core.tools;

import org.eclipse.wb.gef.core.requests.ChangeBoundsRequest;
import org.eclipse.wb.gef.core.requests.DragPermissionRequest;
import org.eclipse.wb.internal.gef.core.IObjectInfoEditPart;
import org.eclipse.wb.internal.gef.core.SharedCursors;
Expand All @@ -27,6 +26,7 @@
import org.eclipse.gef.RequestConstants;
import org.eclipse.gef.commands.Command;
import org.eclipse.gef.commands.CompoundCommand;
import org.eclipse.gef.requests.ChangeBoundsRequest;
import org.eclipse.gef.requests.GroupRequest;
import org.eclipse.jface.viewers.StructuredSelection;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@
*******************************************************************************/
package org.eclipse.wb.gef.core.tools;

import org.eclipse.wb.gef.core.requests.ChangeBoundsRequest;

import org.eclipse.gef.EditPart;
import org.eclipse.gef.requests.ChangeBoundsRequest;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import org.eclipse.wb.gef.core.policies.DesignEditPolicy;
import org.eclipse.wb.gef.core.policies.IEditPartDecorationListener;
import org.eclipse.wb.gef.core.policies.ILayoutRequestValidator;
import org.eclipse.wb.gef.core.requests.ChangeBoundsRequest;
import org.eclipse.wb.gef.core.requests.CreateRequest;
import org.eclipse.wb.gef.core.requests.PasteRequest;

Expand All @@ -24,6 +23,7 @@
import org.eclipse.gef.Request;
import org.eclipse.gef.RequestConstants;
import org.eclipse.gef.commands.Command;
import org.eclipse.gef.requests.ChangeBoundsRequest;
import org.eclipse.gef.requests.GroupRequest;

import java.util.Iterator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
*******************************************************************************/
package org.eclipse.wb.gef.graphical.tools;

import org.eclipse.wb.gef.core.requests.ChangeBoundsRequest;
import org.eclipse.wb.gef.core.requests.KeyRequest;
import org.eclipse.wb.gef.core.tools.Tool;

Expand All @@ -25,6 +24,7 @@
import org.eclipse.gef.Request;
import org.eclipse.gef.commands.Command;
import org.eclipse.gef.commands.CompoundCommand;
import org.eclipse.gef.requests.ChangeBoundsRequest;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.graphics.Cursor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@

import org.eclipse.wb.core.gef.policy.PolicyUtils;
import org.eclipse.wb.gef.core.policies.ILayoutRequestValidator;
import org.eclipse.wb.gef.core.requests.ChangeBoundsRequest;
import org.eclipse.wb.gef.core.requests.CreateRequest;
import org.eclipse.wb.gef.core.requests.PasteRequest;
import org.eclipse.wb.internal.core.EnvironmentUtils;
import org.eclipse.wb.internal.gef.tree.TreeViewer;

import org.eclipse.draw2d.geometry.Point;
Expand All @@ -29,8 +27,8 @@
import org.eclipse.gef.TreeEditPart;
import org.eclipse.gef.commands.Command;
import org.eclipse.gef.editpolicies.AbstractEditPolicy;
import org.eclipse.gef.requests.ChangeBoundsRequest;
import org.eclipse.gef.requests.DropRequest;
import org.eclipse.swt.dnd.DND;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;

Expand Down Expand Up @@ -327,15 +325,6 @@ public void run() {
// drop to children
removeFromSelection();
boolean beforeLocation = isBeforeLocation(targetItem, location);
if (EnvironmentUtils.IS_LINUX && request instanceof ChangeBoundsRequest changeBoundsRequest) {
/*
* Feature in Linux: during DND dragOver() operation the
* DropTargetEvent.feedback resets all previous tree insert marks.
*/
changeBoundsRequest.setDNDFeedback(beforeLocation
? DND.FEEDBACK_INSERT_BEFORE
: DND.FEEDBACK_INSERT_AFTER);
}
setTreeInsertMark(targetItem, beforeLocation);
}
}
Expand Down
Loading
Loading