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
Merge requests
!1028
issues that were discovered during biohackathon 2019 in Paris
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
issues that were discovered during biohackathon 2019 in Paris
wikipathways-issues
into
master
Overview
0
Commits
55
Pipelines
1
Changes
3
Merged
Piotr Gawron
requested to merge
wikipathways-issues
into
master
5 years ago
Overview
0
Commits
55
Pipelines
1
Changes
3
Expand
0
0
Merge request reports
Viewing commit
33110ed0
Prev
Next
Show latest version
3 files
+
70
−
6
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
33110ed0
allow to extend invalid lines
· 33110ed0
Piotr Gawron
authored
5 years ago
pathvisio/src/main/java/lcsb/mapviewer/wikipathway/model/Edge.java
+
16
−
6
Options
package
lcsb.mapviewer.wikipathway.model
;
import
java.awt.
*
;
import
java.awt.
Color
;
import
java.awt.geom.Point2D
;
import
java.io.Serializable
;
import
java.util.*
;
import
java.util.List
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
@@ -365,15 +364,26 @@ public class Edge implements Serializable {
*/
public
void
extend
(
Edge
edge2
)
{
// check if extension make sense (they should point to the same identifier)
if
(!
getEnd
().
equals
(
edge2
.
getStart
()))
{
if
(!
Objects
.
equals
(
getEnd
(),
edge2
.
getStart
()))
{
throw
new
InvalidArgumentException
(
" Cannot merge - anchor points doesn't match: "
+
getEnd
()
+
","
+
edge2
.
getStart
());
}
if
(
line
.
getEndPoint
().
distance
(
edge2
.
getLine
().
getBeginPoint
())
>
EPSILON
)
{
int
mergePoint
=
line
.
getPoints
().
size
()
-
1
;
while
(
mergePoint
>=
0
)
{
if
(
line
.
getPoints
().
get
(
mergePoint
).
distance
(
edge2
.
getLine
().
getBeginPoint
())
<
EPSILON
)
{
break
;
}
mergePoint
--;
}
if
(
mergePoint
<
0
)
{
throw
new
InvalidArgumentException
(
" Cannot merge - edges are far from each other: "
+
line
.
getEndPoint
()
+
","
+
edge2
.
getLine
().
getBeginPoint
());
+
line
+
","
+
edge2
.
getLine
());
}
while
(
mergePoint
<
line
.
getPoints
().
size
()
-
1
)
{
line
.
getPoints
().
remove
(
line
.
getPoints
().
size
()
-
1
);
}
// graphId should be the same
Loading