Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 380140 | Differences between
and this patch

Collapse All | Expand All

(-)a/bundles/org.eclipse.rap.gef/.gitignore (-1 lines)
Lines 4-7 Link Here
4
preview.pix
4
preview.pix
5
*.jpage
5
*.jpage
6
*.prefs
6
*.prefs
7
org
(-)a/bundles/org.eclipse.rap.gef/src/org/eclipse/gef/editparts/AbstractConnectionEditPart.java (-7 / +9 lines)
Lines 18-24 Link Here
18
import org.eclipse.draw2d.ConnectionAnchor;
18
import org.eclipse.draw2d.ConnectionAnchor;
19
import org.eclipse.draw2d.IFigure;
19
import org.eclipse.draw2d.IFigure;
20
import org.eclipse.draw2d.PolylineConnection;
20
import org.eclipse.draw2d.PolylineConnection;
21
import org.eclipse.draw2d.XYAnchor;
22
import org.eclipse.draw2d.geometry.Point;
21
import org.eclipse.draw2d.geometry.Point;
23
22
24
import org.eclipse.gef.AccessibleAnchorProvider;
23
import org.eclipse.gef.AccessibleAnchorProvider;
Lines 29-34 Link Here
29
import org.eclipse.gef.LayerConstants;
28
import org.eclipse.gef.LayerConstants;
30
import org.eclipse.gef.NodeEditPart;
29
import org.eclipse.gef.NodeEditPart;
31
import org.eclipse.gef.Request;
30
import org.eclipse.gef.Request;
31
import org.eclipse.gef.internal.GEFSingleton;
32
import org.eclipse.gef.tools.SelectEditPartTracker;
32
import org.eclipse.gef.tools.SelectEditPartTracker;
33
33
34
/**
34
/**
Lines 37-46 Link Here
37
public abstract class AbstractConnectionEditPart extends
37
public abstract class AbstractConnectionEditPart extends
38
		AbstractGraphicalEditPart implements ConnectionEditPart, LayerConstants {
38
		AbstractGraphicalEditPart implements ConnectionEditPart, LayerConstants {
39
39
40
	private static final ConnectionAnchor DEFAULT_SOURCE_ANCHOR = new XYAnchor(
40
	// private static final ConnectionAnchor DEFAULT_SOURCE_ANCHOR = new
41
			new Point(10, 10));
41
	// XYAnchor(
42
	private static final ConnectionAnchor DEFAULT_TARGET_ANCHOR = new XYAnchor(
42
	// new Point(10, 10));
43
			new Point(100, 100));
43
	// private static final ConnectionAnchor DEFAULT_TARGET_ANCHOR = new
44
	// XYAnchor(
45
	// new Point(100, 100));
44
46
45
	/**
47
	/**
46
	 * Provides accessibility support for when connections are also themselves
48
	 * Provides accessibility support for when connections are also themselves
Lines 189-195 Link Here
189
			IFigure f = ((GraphicalEditPart) getSource()).getFigure();
191
			IFigure f = ((GraphicalEditPart) getSource()).getFigure();
190
			return new ChopboxAnchor(f);
192
			return new ChopboxAnchor(f);
191
		}
193
		}
192
		return DEFAULT_SOURCE_ANCHOR;
194
		return GEFSingleton.getInstance().getDefaultSourceAnchor();
193
	}
195
	}
194
196
195
	/**
197
	/**
Lines 212-218 Link Here
212
			IFigure f = ((GraphicalEditPart) getTarget()).getFigure();
214
			IFigure f = ((GraphicalEditPart) getTarget()).getFigure();
213
			return new ChopboxAnchor(f);
215
			return new ChopboxAnchor(f);
214
		}
216
		}
215
		return DEFAULT_TARGET_ANCHOR;
217
		return GEFSingleton.getInstance().getDefaultTargetAnchor();
216
	}
218
	}
217
219
218
	/**
220
	/**
(-)a/bundles/org.eclipse.rap.gef/src/org/eclipse/gef/internal/GEFSingleton.java (+45 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2012 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
12
package org.eclipse.gef.internal;
13
14
import org.eclipse.rwt.SessionSingletonBase;
15
16
import org.eclipse.draw2d.ConnectionAnchor;
17
import org.eclipse.draw2d.XYAnchor;
18
import org.eclipse.draw2d.geometry.Point;
19
20
/**
21
 * Internal session singleton used to scope some objects to user session instead
22
 * of static application wide, where it is required
23
 * 
24
 * @since 3.2
25
 */
26
public class GEFSingleton {
27
	private ConnectionAnchor defaultSourceAnchor = new XYAnchor(new Point(10,
28
			10));
29
	private ConnectionAnchor defaultTargetAnchor = new XYAnchor(new Point(100,
30
			100));
31
32
	public static GEFSingleton getInstance() {
33
		return (GEFSingleton) SessionSingletonBase
34
				.getInstance(GEFSingleton.class);
35
	}
36
37
	public ConnectionAnchor getDefaultSourceAnchor() {
38
		return defaultSourceAnchor;
39
	}
40
41
	public ConnectionAnchor getDefaultTargetAnchor() {
42
		return defaultTargetAnchor;
43
	}
44
45
}

Return to bug 380140