Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
minerva
core
Commits
f22df594
Commit
f22df594
authored
6 years ago
by
Piotr Gawron
Browse files
Options
Downloads
Patches
Plain Diff
error information is more informative
parent
74315676
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!630
WIP: Resolve "The privileges of a new user are not saved in some cases"
,
!538
Resolve "improve information in exception"
Pipeline
#7911
passed
6 years ago
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/reaction/ReactionFromXml.java
+25
-21
25 additions, 21 deletions
...onverter/model/celldesigner/reaction/ReactionFromXml.java
with
25 additions
and
21 deletions
converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/reaction/ReactionFromXml.java
+
25
−
21
View file @
f22df594
...
...
@@ -64,6 +64,7 @@ import lcsb.mapviewer.model.map.reaction.type.TwoProductReactionInterface;
import
lcsb.mapviewer.model.map.reaction.type.TwoReactantReactionInterface
;
import
lcsb.mapviewer.model.map.species.Element
;
import
lcsb.mapviewer.model.map.species.Species
;
import
lcsb.mapviewer.modelutils.map.ElementUtils
;
/**
* This is a part of {@link ReactionXmlParser} class functionality that allows
...
...
@@ -216,9 +217,9 @@ public class ReactionFromXml extends XmlParser {
}
}
try
{
assignStochiometry
(
result
.
getReactants
(),
reactantsNode
,
elements
);
assignStochiometry
(
result
.
getProducts
(),
productsNode
,
elements
);
assignStochiometry
(
result
.
getModifiers
(),
modifiersNode
,
elements
);
assignStochiometry
(
result
.
getReactants
(),
reactantsNode
,
elements
);
assignStochiometry
(
result
.
getProducts
(),
productsNode
,
elements
);
assignStochiometry
(
result
.
getModifiers
(),
modifiersNode
,
elements
);
}
catch
(
InvalidStateException
e
)
{
throw
new
ReactionParserException
(
result
,
e
);
}
...
...
@@ -476,7 +477,7 @@ public class ReactionFromXml extends XmlParser {
result
.
removeModifier
(
modifier
);
i
--;
}
else
if
(
modifier
.
getLine
()
==
null
)
{
createLineForModifier
(
result
,
modifier
);
createLineForModifier
(
modifier
);
}
}
...
...
@@ -579,26 +580,29 @@ public class ReactionFromXml extends XmlParser {
/**
* Creates line information for the modifier.
*
* @param reaction
* reaction where modifier is placed
* @param modifier
* modifier to update
* @throws ReactionParserException
*/
private
void
createLineForModifier
(
Reaction
reaction
,
Modifier
modifier
)
{
Element
element
=
modifier
.
getElement
();
CellDesignerAliasConverter
converter
=
new
CellDesignerAliasConverter
(
element
,
sbgn
);
Point2D
startPoint
=
converter
.
getPointCoordinates
(
element
,
anchorsByNodes
.
get
(
modifier
));
ModifierTypeUtils
modifierTypeUtils
=
new
ModifierTypeUtils
();
Point2D
p
=
modifierTypeUtils
.
getAnchorPointOnReactionRect
(
modifier
.
getReaction
(),
lineTypeByModifier
.
get
(
modifier
));
PolylineData
line
=
PolylineDataFactory
.
createPolylineDataFromEditPoints
(
startPoint
,
p
,
pointsByModifier
.
get
(
modifier
));
startPoint
=
converter
.
getAnchorPointCoordinates
(
element
,
anchorsByNodes
.
get
(
modifier
),
line
);
line
.
setStartPoint
(
startPoint
);
modifier
.
setLine
(
line
);
modifierTypeUtils
.
updateLineEndPoint
(
modifier
);
private
void
createLineForModifier
(
Modifier
modifier
)
throws
ReactionParserException
{
try
{
Element
element
=
modifier
.
getElement
();
CellDesignerAliasConverter
converter
=
new
CellDesignerAliasConverter
(
element
,
sbgn
);
Point2D
startPoint
=
converter
.
getPointCoordinates
(
element
,
anchorsByNodes
.
get
(
modifier
));
ModifierTypeUtils
modifierTypeUtils
=
new
ModifierTypeUtils
();
Point2D
p
=
modifierTypeUtils
.
getAnchorPointOnReactionRect
(
modifier
.
getReaction
(),
lineTypeByModifier
.
get
(
modifier
));
PolylineData
line
=
PolylineDataFactory
.
createPolylineDataFromEditPoints
(
startPoint
,
p
,
pointsByModifier
.
get
(
modifier
));
startPoint
=
converter
.
getAnchorPointCoordinates
(
element
,
anchorsByNodes
.
get
(
modifier
),
line
);
line
.
setStartPoint
(
startPoint
);
modifier
.
setLine
(
line
);
modifierTypeUtils
.
updateLineEndPoint
(
modifier
);
}
catch
(
Exception
e
)
{
throw
new
ReactionParserException
(
"Problem with creating layout for modifier."
,
modifier
.
getReaction
());
}
}
/**
...
...
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