Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 215970 Details for
Bug 380140
[GEF] thread safety issue
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Fixed patch
clipboard.txt (text/plain), 4.04 KB, created by
Arnaud MERGEY
on 2012-05-21 10:56:28 EDT
(
hide
)
Description:
Fixed patch
Filename:
MIME Type:
Creator:
Arnaud MERGEY
Created:
2012-05-21 10:56:28 EDT
Size:
4.04 KB
patch
obsolete
>diff --git a/bundles/org.eclipse.rap.gef/.gitignore b/bundles/org.eclipse.rap.gef/.gitignore >index aaf292f..cbde6ba 100644 >--- a/bundles/org.eclipse.rap.gef/.gitignore >+++ b/bundles/org.eclipse.rap.gef/.gitignore >@@ -4,4 +4,3 @@ > preview.pix > *.jpage > *.prefs >-org >diff --git a/bundles/org.eclipse.rap.gef/src/org/eclipse/gef/editparts/AbstractConnectionEditPart.java b/bundles/org.eclipse.rap.gef/src/org/eclipse/gef/editparts/AbstractConnectionEditPart.java >index d51c53b..f5edd8a 100644 >--- a/bundles/org.eclipse.rap.gef/src/org/eclipse/gef/editparts/AbstractConnectionEditPart.java >+++ b/bundles/org.eclipse.rap.gef/src/org/eclipse/gef/editparts/AbstractConnectionEditPart.java >@@ -18,7 +18,6 @@ > import org.eclipse.draw2d.ConnectionAnchor; > import org.eclipse.draw2d.IFigure; > import org.eclipse.draw2d.PolylineConnection; >-import org.eclipse.draw2d.XYAnchor; > import org.eclipse.draw2d.geometry.Point; > > import org.eclipse.gef.AccessibleAnchorProvider; >@@ -29,6 +28,7 @@ > import org.eclipse.gef.LayerConstants; > import org.eclipse.gef.NodeEditPart; > import org.eclipse.gef.Request; >+import org.eclipse.gef.internal.GEFSingleton; > import org.eclipse.gef.tools.SelectEditPartTracker; > > /** >@@ -37,10 +37,12 @@ > public abstract class AbstractConnectionEditPart extends > AbstractGraphicalEditPart implements ConnectionEditPart, LayerConstants { > >- private static final ConnectionAnchor DEFAULT_SOURCE_ANCHOR = new XYAnchor( >- new Point(10, 10)); >- private static final ConnectionAnchor DEFAULT_TARGET_ANCHOR = new XYAnchor( >- new Point(100, 100)); >+ // private static final ConnectionAnchor DEFAULT_SOURCE_ANCHOR = new >+ // XYAnchor( >+ // new Point(10, 10)); >+ // private static final ConnectionAnchor DEFAULT_TARGET_ANCHOR = new >+ // XYAnchor( >+ // new Point(100, 100)); > > /** > * Provides accessibility support for when connections are also themselves >@@ -189,7 +191,7 @@ > IFigure f = ((GraphicalEditPart) getSource()).getFigure(); > return new ChopboxAnchor(f); > } >- return DEFAULT_SOURCE_ANCHOR; >+ return GEFSingleton.getInstance().getDefaultSourceAnchor(); > } > > /** >@@ -212,7 +214,7 @@ > IFigure f = ((GraphicalEditPart) getTarget()).getFigure(); > return new ChopboxAnchor(f); > } >- return DEFAULT_TARGET_ANCHOR; >+ return GEFSingleton.getInstance().getDefaultTargetAnchor(); > } > > /** >diff --git a/bundles/org.eclipse.rap.gef/src/org/eclipse/gef/internal/GEFSingleton.java b/bundles/org.eclipse.rap.gef/src/org/eclipse/gef/internal/GEFSingleton.java >new file mode 100644 >index 0000000..0a65b08 >--- /dev/null >+++ b/bundles/org.eclipse.rap.gef/src/org/eclipse/gef/internal/GEFSingleton.java >@@ -0,0 +1,45 @@ >+/******************************************************************************* >+ * Copyright (c) 2012 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+ >+package org.eclipse.gef.internal; >+ >+import org.eclipse.rwt.SessionSingletonBase; >+ >+import org.eclipse.draw2d.ConnectionAnchor; >+import org.eclipse.draw2d.XYAnchor; >+import org.eclipse.draw2d.geometry.Point; >+ >+/** >+ * Internal session singleton used to scope some objects to user session instead >+ * of static application wide, where it is required >+ * >+ * @since 3.2 >+ */ >+public class GEFSingleton { >+ private ConnectionAnchor defaultSourceAnchor = new XYAnchor(new Point(10, >+ 10)); >+ private ConnectionAnchor defaultTargetAnchor = new XYAnchor(new Point(100, >+ 100)); >+ >+ public static GEFSingleton getInstance() { >+ return (GEFSingleton) SessionSingletonBase >+ .getInstance(GEFSingleton.class); >+ } >+ >+ public ConnectionAnchor getDefaultSourceAnchor() { >+ return defaultSourceAnchor; >+ } >+ >+ public ConnectionAnchor getDefaultTargetAnchor() { >+ return defaultTargetAnchor; >+ } >+ >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 380140
:
215959
| 215970 |
228375