Skip to content
Open
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 @@ -75,8 +75,8 @@ protected boolean handleButtonUp(int button) {
protected boolean handleMove() {
updateTargetRequest();
updateTargetUnderMouse();
showTargetFeedback();
setCurrentCommand(getCommand());
showTargetFeedback();
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.eclipse.gef.EditPartListener;
import org.eclipse.gef.EditPolicy;
import org.eclipse.gef.Request;
import org.eclipse.gef.RequestConstants;
import org.eclipse.gef.requests.DropRequest;
import org.eclipse.swt.graphics.Color;

Expand Down Expand Up @@ -121,6 +122,15 @@ private void refreshSelectionGrid() {
private static final Color m_badTargetFillColor = new Color(255, 0, 0);
private static final Color m_badTargetBorderColor = new Color(255, 192, 192);

@Override
public EditPart getTargetEditPart(Request request) {
if (RequestConstants.REQ_CREATE.equals(request.getType())) {
Point location = PolicyUtils.getAbsoluteLocation(getHost(), (DropRequest) request);
updateGridTarget(location);
}
return super.getTargetEditPart(request);
}

@Override
protected final void showLayoutTargetFeedback(Request request) {
IGridInfo gridInfo = getGridInfo();
Expand Down Expand Up @@ -368,5 +378,5 @@ public String toString() {
* @param mouseLocation
* the location of mouse in absolute coordinates.
*/
protected abstract void updateGridTarget(Point mouseLocation) throws Exception;
protected abstract void updateGridTarget(Point mouseLocation);
}
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public static int[] getInsertFeedbackParameters(Interval interval,
}

@Override
protected void updateGridTarget(Point mouseLocation) throws Exception {
protected void updateGridTarget(Point mouseLocation) {
m_target = new GridTarget();
// prepare location in model
Point location = mouseLocation.getCopy();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ protected void executeEdit() throws Exception {
//
////////////////////////////////////////////////////////////////////////////
@Override
protected void updateGridTarget(Point mouseLocation) throws Exception {
protected void updateGridTarget(Point mouseLocation) {
m_target = new GridTarget();
//
mouseLocation = mouseLocation.getCopy();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ public static int[] getInsertFeedbackParameters(Interval interval,
}

@Override
protected void updateGridTarget(Point mouseLocation) throws Exception {
protected void updateGridTarget(Point mouseLocation) {
m_target = new GridTarget();
// prepare location in model
Point location = mouseLocation.getCopy();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ protected Command getAddCommand(ChangeBoundsRequest request) {
//
////////////////////////////////////////////////////////////////////////////
@Override
protected void updateGridTarget(Point mouseLocation) throws Exception {
protected void updateGridTarget(Point mouseLocation) {
m_target = new GridTarget();
// prepare location in model
Point location = mouseLocation.getCopy();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ public static int[] getInsertFeedbackParameters(Interval interval,
}

@Override
protected void updateGridTarget(Point mouseLocation) throws Exception {
protected void updateGridTarget(Point mouseLocation) {
m_target = new GridTarget();
// prepare location in model
Point location = mouseLocation.getCopy();
Expand Down
Loading