Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
kernel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
af3
kernel
Commits
494b4a43
Commit
494b4a43
authored
8 years ago
by
Vincent Aravantinos
Browse files
Options
Downloads
Patches
Plain Diff
fixed
refs 2750
parent
8fe78025
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/policy/DirectConnectionAndReconnectionEditPolicy.java
+11
-4
11 additions, 4 deletions
...art/policy/DirectConnectionAndReconnectionEditPolicy.java
with
11 additions
and
4 deletions
org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/policy/DirectConnectionAndReconnectionEditPolicy.java
+
11
−
4
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
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment