|
1 | 1 | /*******************************************************************************
|
2 |
| - * Copyright (c) 2000, 2010 IBM Corporation and others. |
| 2 | + * Copyright (c) 2000, 2025 IBM Corporation and others. |
3 | 3 | *
|
4 | 4 | * This program and the accompanying materials are made available under the
|
5 | 5 | * terms of the Eclipse Public License 2.0 which is available at
|
|
13 | 13 | package org.eclipse.gef.requests;
|
14 | 14 |
|
15 | 15 | import org.eclipse.draw2d.geometry.Dimension;
|
16 |
| -import org.eclipse.draw2d.geometry.Point; |
17 | 16 |
|
18 | 17 | import org.eclipse.gef.RequestConstants;
|
19 | 18 |
|
20 | 19 | /**
|
21 | 20 | * A Request to create a new object.
|
22 | 21 | */
|
23 |
| -public class CreateRequest extends org.eclipse.gef.Request implements DropRequest { |
| 22 | +public class CreateRequest extends LocationRequest implements DropRequest { |
24 | 23 |
|
25 | 24 | private Object newObject;
|
26 | 25 |
|
27 | 26 | private Dimension size;
|
28 |
| - private Point location; |
29 | 27 | private int flags = 0;
|
30 | 28 | private static final int SNAP_TO = 1;
|
31 | 29 |
|
@@ -56,16 +54,6 @@ protected CreationFactory getFactory() {
|
56 | 54 | return creationFactory;
|
57 | 55 | }
|
58 | 56 |
|
59 |
| - /** |
60 |
| - * Returns the location of the object to be created. |
61 |
| - * |
62 |
| - * @return the location |
63 |
| - */ |
64 |
| - @Override |
65 |
| - public Point getLocation() { |
66 |
| - return location; |
67 |
| - } |
68 |
| - |
69 | 57 | /**
|
70 | 58 | * Gets the new object from the factory and returns that object.
|
71 | 59 | *
|
@@ -122,15 +110,6 @@ public void setFactory(CreationFactory factory) {
|
122 | 110 | creationFactory = factory;
|
123 | 111 | }
|
124 | 112 |
|
125 |
| - /** |
126 |
| - * Sets the location where the new object will be placed. |
127 |
| - * |
128 |
| - * @param location the location |
129 |
| - */ |
130 |
| - public void setLocation(Point location) { |
131 |
| - this.location = location; |
132 |
| - } |
133 |
| - |
134 | 113 | /**
|
135 | 114 | * Sets the size of the new object.
|
136 | 115 | *
|
|
0 commit comments