Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
af3
kernel
Commits
494b4a43
Commit
494b4a43
authored
Dec 05, 2016
by
Vincent Aravantinos
Browse files
fixed
refs 2750
parent
8fe78025
Changes
1
Hide whitespace changes
Inline
Side-by-side
org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/policy/DirectConnectionAndReconnectionEditPolicy.java
View file @
494b4a43
...
...
@@ -19,7 +19,9 @@ package org.fortiss.tooling.base.ui.editpart.policy;
import
static
org
.
fortiss
.
tooling
.
base
.
ui
.
utils
.
DragAndDropBaseUtils
.
createConnectionDragContext
;
import
org.eclipse.draw2d.geometry.Point
;
import
org.eclipse.gef.ConnectionEditPart
;
import
org.eclipse.gef.GraphicalEditPart
;
import
org.eclipse.gef.NodeEditPart
;
import
org.eclipse.gef.commands.Command
;
import
org.eclipse.gef.commands.UnexecutableCommand
;
...
...
@@ -81,7 +83,7 @@ import org.fortiss.tooling.base.ui.editpart.command.ReconnectCommand;
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating
GREEN
Hash:
DE2453742
ED
5
A7
86A15BEFD4EA79DB53
* @ConQAT.Rating
YELLOW
Hash:
6756B9E77E054DD
EDA7
D39B5A51BD2BE
*/
public
class
DirectConnectionAndReconnectionEditPolicy
extends
GraphicalNodeEditPolicy
{
...
...
@@ -89,8 +91,10 @@ public class DirectConnectionAndReconnectionEditPolicy extends GraphicalNodeEdit
@Override
protected
Command
getConnectionCompleteCommand
(
CreateConnectionRequest
request
)
{
if
(
request
.
getStartCommand
()
instanceof
ConnectCommand
)
{
Point
location
=
new
Point
(
request
.
getLocation
());
((
GraphicalEditPart
)
getHost
()).
getFigure
().
translateToRelative
(
location
);
ConnectCommand
cmd
=
(
ConnectCommand
)
request
.
getStartCommand
();
cmd
.
setTarget
(
getHost
(),
request
.
getL
ocation
()
);
cmd
.
setTarget
(
getHost
(),
l
ocation
);
return
cmd
;
}
return
UnexecutableCommand
.
INSTANCE
;
...
...
@@ -99,9 +103,12 @@ public class DirectConnectionAndReconnectionEditPolicy extends GraphicalNodeEdit
/** {@inheritDoc} */
@Override
protected
Command
getConnectionCreateCommand
(
CreateConnectionRequest
request
)
{
// Here we need to create a new point, otherwise the translation on the next line will
// *modify* the request which brings problems later on.
Point
location
=
new
Point
(
request
.
getLocation
());
((
GraphicalEditPart
)
getHost
()).
getFigure
().
translateToRelative
(
location
);
ConnectionDragContext
context
=
createConnectionDragContext
(
getHost
(),
getHost
(),
request
.
getLocation
(),
request
.
getLocation
());
createConnectionDragContext
(
getHost
(),
getHost
(),
location
,
null
);
ConnectCommand
cmd
=
new
ConnectCommand
(
context
);
request
.
setStartCommand
(
cmd
);
return
cmd
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment