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 86008 Details for
Bug 212935
ConnectionEndHandle is declared as a final class.
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]
ConnectionEndpointHandle
ConnectionEndpointHandle.txt (text/plain), 9.62 KB, created by
Anthony Hunter
on 2008-01-02 13:36:06 EST
(
hide
)
Description:
ConnectionEndpointHandle
Filename:
MIME Type:
Creator:
Anthony Hunter
Created:
2008-01-02 13:36:06 EST
Size:
9.62 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.gef >Index: src/org/eclipse/gef/handles/ConnectionEndHandle.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.gef/plugins/org.eclipse.gef/src/org/eclipse/gef/handles/ConnectionEndHandle.java,v >retrieving revision 1.12 >diff -u -r1.12 ConnectionEndHandle.java >--- src/org/eclipse/gef/handles/ConnectionEndHandle.java 30 Mar 2005 21:27:02 -0000 1.12 >+++ src/org/eclipse/gef/handles/ConnectionEndHandle.java 2 Jan 2008 18:33:07 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2005 IBM Corporation and others. >+ * Copyright (c) 2000, 2008 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 >@@ -13,16 +13,14 @@ > import org.eclipse.draw2d.ConnectionLocator; > > import org.eclipse.gef.ConnectionEditPart; >-import org.eclipse.gef.DragTracker; >-import org.eclipse.gef.RequestConstants; >-import org.eclipse.gef.tools.ConnectionEndpointTracker; > > /** > * A handle used at the end of the {@link org.eclipse.draw2d.Connection}. > * This is treated differently than the start of the Connection. >+ * @deprecated use {@link ConnectionEndpointHandle} > */ > public final class ConnectionEndHandle >- extends ConnectionHandle >+ extends ConnectionEndpointHandle > { > > /** >@@ -31,8 +29,7 @@ > * @param owner the ConnectionEditPart owner > */ > public ConnectionEndHandle(ConnectionEditPart owner) { >- setOwner(owner); >- setLocator(new ConnectionLocator(getConnection(), ConnectionLocator.TARGET)); >+ super(owner, ConnectionLocator.SOURCE); > } > > /** >@@ -42,28 +39,14 @@ > * @param fixed if true, handle cannot be dragged > */ > public ConnectionEndHandle(ConnectionEditPart owner, boolean fixed) { >- super(fixed); >- setOwner(owner); >- setLocator(new ConnectionLocator(getConnection(), ConnectionLocator.TARGET)); >+ super(owner, fixed, ConnectionLocator.SOURCE); > } > > /** > * Creates a new ConnectionEndHandle. > */ >-public ConnectionEndHandle() { } >- >-/** >- * Creates and returns a new {@link ConnectionEndpointTracker}. >- * @return the new ConnectionEndpointTracker >- */ >-protected DragTracker createDragTracker() { >- if (isFixed()) >- return null; >- ConnectionEndpointTracker tracker; >- tracker = new ConnectionEndpointTracker((ConnectionEditPart)getOwner()); >- tracker.setCommandName(RequestConstants.REQ_RECONNECT_TARGET); >- tracker.setDefaultCursor(getCursor()); >- return tracker; >+public ConnectionEndHandle() { >+ super(ConnectionLocator.SOURCE); > } > > } >Index: src/org/eclipse/gef/handles/ConnectionStartHandle.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.gef/plugins/org.eclipse.gef/src/org/eclipse/gef/handles/ConnectionStartHandle.java,v >retrieving revision 1.12 >diff -u -r1.12 ConnectionStartHandle.java >--- src/org/eclipse/gef/handles/ConnectionStartHandle.java 30 Mar 2005 21:27:02 -0000 1.12 >+++ src/org/eclipse/gef/handles/ConnectionStartHandle.java 2 Jan 2008 18:33:07 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2005 IBM Corporation and others. >+ * Copyright (c) 2000, 2008 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 >@@ -13,16 +13,14 @@ > import org.eclipse.draw2d.ConnectionLocator; > > import org.eclipse.gef.ConnectionEditPart; >-import org.eclipse.gef.DragTracker; >-import org.eclipse.gef.RequestConstants; >-import org.eclipse.gef.tools.ConnectionEndpointTracker; > > /** > * A handle used at the start of the {@link org.eclipse.draw2d.Connection}. > * This is treated differently than the end of the Connection. >+ * @deprecated use {@link ConnectionEndpointHandle} > */ > public final class ConnectionStartHandle >- extends ConnectionHandle >+ extends ConnectionEndpointHandle > { > > /** >@@ -31,8 +29,7 @@ > * @param owner the ConnectionEditPart owner > */ > public ConnectionStartHandle(ConnectionEditPart owner) { >- setOwner(owner); >- setLocator(new ConnectionLocator(getConnection(), ConnectionLocator.SOURCE)); >+ super(owner, ConnectionLocator.TARGET); > } > > /** >@@ -42,28 +39,14 @@ > * @param fixed if true, handle cannot be dragged. > */ > public ConnectionStartHandle(ConnectionEditPart owner, boolean fixed) { >- super(fixed); >- setOwner(owner); >- setLocator(new ConnectionLocator(getConnection(), ConnectionLocator.SOURCE)); >+ super(owner, fixed, ConnectionLocator.SOURCE); > } > > /** > * Creates a new ConnectionStartHandle. > */ >-public ConnectionStartHandle() { } >- >-/** >- * Creates and returns a new {@link ConnectionEndpointTracker}. >- * @return the new ConnectionEndpointTracker >- */ >-protected DragTracker createDragTracker() { >- if (isFixed()) >- return null; >- ConnectionEndpointTracker tracker; >- tracker = new ConnectionEndpointTracker((ConnectionEditPart)getOwner()); >- tracker.setCommandName(RequestConstants.REQ_RECONNECT_SOURCE); >- tracker.setDefaultCursor(getCursor()); >- return tracker; >+public ConnectionStartHandle() { >+ super(ConnectionLocator.TARGET); > } > > } >Index: src/org/eclipse/gef/handles/ConnectionEndpointHandle.java >=================================================================== >RCS file: src/org/eclipse/gef/handles/ConnectionEndpointHandle.java >diff -N src/org/eclipse/gef/handles/ConnectionEndpointHandle.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/gef/handles/ConnectionEndpointHandle.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,112 @@ >+/******************************************************************************* >+ * Copyright (c) 2008 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.handles; >+ >+import org.eclipse.core.runtime.Assert; >+ >+import org.eclipse.draw2d.ConnectionLocator; >+ >+import org.eclipse.gef.ConnectionEditPart; >+import org.eclipse.gef.DragTracker; >+import org.eclipse.gef.RequestConstants; >+import org.eclipse.gef.tools.ConnectionEndpointTracker; >+ >+/** >+ * A handle used at the start or end of the >+ * {@link org.eclipse.draw2d.Connection}. A ConnectionEndpointHandle may be >+ * extended rather than using the final {@link ConnectionStartHandle} or >+ * {@link ConnectionEndHandle} >+ * >+ * @author Anthony Hunter >+ * @since 3.4 >+ */ >+public class ConnectionEndpointHandle extends ConnectionHandle { >+ >+ /** >+ * Caches whether the handle is for the source or target endpoint. endPoint >+ * is either {@link ConnectionLocator#SOURCE} or >+ * {@link ConnectionLocator#TARGET}. >+ */ >+ private int endPoint; >+ >+ /** >+ * Creates a new ConnectionStartHandle, sets its owner to <code>owner</code>, >+ * and sets its locator to a {@link ConnectionLocator}. >+ * >+ * @param owner >+ * the ConnectionEditPart owner >+ * @param endPoint >+ * one of {@link ConnectionLocator#SOURCE} or >+ * {@link ConnectionLocator#TARGET}. >+ */ >+ public ConnectionEndpointHandle(ConnectionEditPart owner, int endPoint) { >+ setOwner(owner); >+ Assert.isTrue(endPoint == ConnectionLocator.SOURCE >+ || endPoint == ConnectionLocator.TARGET); >+ this.endPoint = endPoint; >+ setLocator(new ConnectionLocator(getConnection(), endPoint)); >+ } >+ >+ /** >+ * Creates a new ConnectionStartHandle and sets its owner to >+ * <code>owner</code>. If the handle is fixed, it cannot be dragged. >+ * >+ * @param owner >+ * the ConnectionEditPart owner >+ * @param fixed >+ * if true, handle cannot be dragged. >+ * @param endPoint >+ * one of {@link ConnectionLocator#SOURCE} or >+ * {@link ConnectionLocator#TARGET}. >+ */ >+ public ConnectionEndpointHandle(ConnectionEditPart owner, boolean fixed, >+ int endPoint) { >+ super(fixed); >+ setOwner(owner); >+ Assert.isTrue(endPoint == ConnectionLocator.SOURCE >+ || endPoint == ConnectionLocator.TARGET); >+ this.endPoint = endPoint; >+ setLocator(new ConnectionLocator(getConnection(), endPoint)); >+ } >+ >+ /** >+ * Creates a new ConnectionStartHandle. >+ * >+ * @param endPoint >+ * one of {@link ConnectionLocator#SOURCE} or >+ * {@link ConnectionLocator#TARGET}. >+ */ >+ public ConnectionEndpointHandle(int endPoint) { >+ Assert.isTrue(endPoint == ConnectionLocator.SOURCE >+ || endPoint == ConnectionLocator.TARGET); >+ this.endPoint = endPoint; >+ } >+ >+ /** >+ * Creates and returns a new {@link ConnectionEndpointTracker}. >+ * >+ * @return the new ConnectionEndpointTracker >+ */ >+ protected DragTracker createDragTracker() { >+ if (isFixed()) >+ return null; >+ ConnectionEndpointTracker tracker; >+ tracker = new ConnectionEndpointTracker((ConnectionEditPart) getOwner()); >+ if (endPoint == ConnectionLocator.SOURCE) { >+ tracker.setCommandName(RequestConstants.REQ_RECONNECT_SOURCE); >+ } else { >+ tracker.setCommandName(RequestConstants.REQ_RECONNECT_TARGET); >+ } >+ tracker.setDefaultCursor(getCursor()); >+ return tracker; >+ } >+ >+}
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 212935
:
85721
| 86008