Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
framed
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
rosi
framed
Commits
65b7f13b
Commit
65b7f13b
authored
7 years ago
by
nullsub
Browse files
Options
Downloads
Patches
Plain Diff
fix error when adding Inheritance
parent
ba9b092e
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
org.framed.iorm.ui/core/inheritance/InheritancePattern.java
+14
-12
14 additions, 12 deletions
org.framed.iorm.ui/core/inheritance/InheritancePattern.java
with
14 additions
and
12 deletions
org.framed.iorm.ui/core/inheritance/InheritancePattern.java
+
14
−
12
View file @
65b7f13b
...
@@ -110,7 +110,7 @@ public class InheritancePattern extends FRaMEDConnectionPattern {
...
@@ -110,7 +110,7 @@ public class InheritancePattern extends FRaMEDConnectionPattern {
if
(
addContext
.
getNewObject
()
instanceof
Relation
)
{
if
(
addContext
.
getNewObject
()
instanceof
Relation
)
{
Relation
relation
=
(
Relation
)
addContext
.
getNewObject
();
Relation
relation
=
(
Relation
)
addContext
.
getNewObject
();
if
(
relation
.
getType
()
==
Type
.
INHERITANCE
)
if
(
relation
.
getType
()
==
Type
.
INHERITANCE
)
return
EditPolicyService
.
getHandler
(
this
.
getDiagram
()).
canAdd
(
addContext
,
relation
.
get
Type
()
);
return
EditPolicyService
.
getHandler
(
this
.
getDiagram
()).
canAdd
(
addContext
,
this
.
model
Type
);
}
}
return
false
;
return
false
;
}
}
...
@@ -169,13 +169,15 @@ public class InheritancePattern extends FRaMEDConnectionPattern {
...
@@ -169,13 +169,15 @@ public class InheritancePattern extends FRaMEDConnectionPattern {
Anchor
targetAnchor
=
createContext
.
getTargetAnchor
();
Anchor
targetAnchor
=
createContext
.
getTargetAnchor
();
ModelElement
source
=
UIUtil
.
getModelElementForAnchor
(
sourceAnchor
);
ModelElement
source
=
UIUtil
.
getModelElementForAnchor
(
sourceAnchor
);
ModelElement
target
=
UIUtil
.
getModelElementForAnchor
(
targetAnchor
);
ModelElement
target
=
UIUtil
.
getModelElementForAnchor
(
targetAnchor
);
if
(
source
!=
null
&&
target
!=
null
)
{
Model
sM
=
getModelToCreateIn
(
source
);
Model
sM
=
getModelToCreateIn
(
source
);
Model
tM
=
getModelToCreateIn
(
target
);
Model
tM
=
getModelToCreateIn
(
target
);
if
(
source
instanceof
org
.
framed
.
iorm
.
model
.
Shape
&&
target
instanceof
org
.
framed
.
iorm
.
model
.
Shape
)
{
if
(
source
instanceof
org
.
framed
.
iorm
.
model
.
Shape
&&
target
instanceof
org
.
framed
.
iorm
.
model
.
Shape
)
{
org
.
framed
.
iorm
.
model
.
Shape
sourceShape
=
(
org
.
framed
.
iorm
.
model
.
Shape
)
source
;
org
.
framed
.
iorm
.
model
.
Shape
sourceShape
=
(
org
.
framed
.
iorm
.
model
.
Shape
)
source
;
org
.
framed
.
iorm
.
model
.
Shape
targetShape
=
(
org
.
framed
.
iorm
.
model
.
Shape
)
target
;
org
.
framed
.
iorm
.
model
.
Shape
targetShape
=
(
org
.
framed
.
iorm
.
model
.
Shape
)
target
;
if
(
sourceShape
!=
null
&&
targetShape
!=
null
&&
sM
==
tM
)
{
if
(
sourceShape
!=
null
&&
targetShape
!=
null
&&
sM
==
tM
)
{
return
EditPolicyService
.
getHandler
(
this
.
getDiagram
()).
canCreate
(
createContext
,
Type
.
INHERITANCE
);
return
EditPolicyService
.
getHandler
(
this
.
getDiagram
()).
canCreate
(
createContext
,
this
.
modelType
);
}
}
}
}
}
return
false
;
return
false
;
...
@@ -197,7 +199,7 @@ public class InheritancePattern extends FRaMEDConnectionPattern {
...
@@ -197,7 +199,7 @@ public class InheritancePattern extends FRaMEDConnectionPattern {
org
.
framed
.
iorm
.
model
.
Shape
sourceShape
=
(
org
.
framed
.
iorm
.
model
.
Shape
)
source
;
org
.
framed
.
iorm
.
model
.
Shape
sourceShape
=
(
org
.
framed
.
iorm
.
model
.
Shape
)
source
;
if
(
sourceShape
.
getFirstSegment
()
!=
null
&&
sourceShape
.
getSecondSegment
()
!=
null
)
{
if
(
sourceShape
.
getFirstSegment
()
!=
null
&&
sourceShape
.
getSecondSegment
()
!=
null
)
{
if
(
sourceShape
!=
null
){
if
(
sourceShape
!=
null
){
return
EditPolicyService
.
getHandler
(
this
.
getDiagram
()).
canStart
(
createContext
,
Type
.
INHERITANCE
);
return
EditPolicyService
.
getHandler
(
this
.
getDiagram
()).
canStart
(
createContext
,
this
.
modelType
);
}
}
}
}
}
}
return
false
;
return
false
;
}
}
...
@@ -237,7 +239,7 @@ public class InheritancePattern extends FRaMEDConnectionPattern {
...
@@ -237,7 +239,7 @@ public class InheritancePattern extends FRaMEDConnectionPattern {
/**
/**
* searches for the main or group model the inheritance should be added to
* searches for the main or group model the inheritance should be added to
*/
*/
public
Model
getModelToCreateIn
(
org
.
framed
.
iorm
.
model
.
ModelElement
sourceShape
)
{
//FIXME
public
Model
getModelToCreateIn
(
org
.
framed
.
iorm
.
model
.
ModelElement
sourceShape
)
{
while
(
sourceShape
.
getContainer
()
!=
null
)
{
while
(
sourceShape
.
getContainer
()
!=
null
)
{
if
(
sourceShape
.
getContainer
().
getParent
()
==
null
||
if
(
sourceShape
.
getContainer
().
getParent
()
==
null
||
(
sourceShape
.
getContainer
().
getParent
()
!=
null
&&
(
sourceShape
.
getContainer
().
getParent
()
!=
null
&&
...
...
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