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
!1260
Resolve "AND gate is not visible"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "AND gate is not visible"
1408-and-gate-in-sbgn-like-view
into
devel_15.1.x
Overview
0
Commits
2
Pipelines
1
Changes
14
Merged
Piotr Gawron
requested to merge
1408-and-gate-in-sbgn-like-view
into
devel_15.1.x
4 years ago
Overview
0
Commits
2
Pipelines
1
Changes
14
Expand
Closes
#1408 (closed)
0
0
Merge request reports
Compare
devel_15.1.x
devel_15.1.x (base)
and
latest version
latest version
b36dbbb8
2 commits,
4 years ago
14 files
+
43
−
65
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
14
Search (e.g. *.vue) (Ctrl+P)
converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/bioEntity/reaction/ReactionConverter.java
+
23
−
35
Options
@@ -16,7 +16,8 @@ import lcsb.mapviewer.converter.graphics.ConverterParams;
import
lcsb.mapviewer.converter.graphics.DrawingException
;
import
lcsb.mapviewer.converter.graphics.bioEntity.BioEntityConverter
;
import
lcsb.mapviewer.converter.graphics.geometry.ArrowTransformation
;
import
lcsb.mapviewer.model.graphics.*
;
import
lcsb.mapviewer.model.graphics.ArrowTypeData
;
import
lcsb.mapviewer.model.graphics.PolylineData
;
import
lcsb.mapviewer.model.map.layout.ColorSchema
;
import
lcsb.mapviewer.model.map.layout.GenericColorSchema
;
import
lcsb.mapviewer.model.map.reaction.*
;
@@ -357,41 +358,28 @@ public class ReactionConverter extends BioEntityConverter<Reaction> {
// draw line
arrowTransformation
.
drawLine
(
operator
.
getLine
(),
graphics
);
// in SBGN view - draw connecting point only if it's not connected to
// reactants or products
if
(!
sbgnFormat
||
operator
.
getLine
().
getEndAtd
().
getArrowType
()
!=
ArrowType
.
NONE
||
(!
operator
.
getOutputs
().
isEmpty
()
&&
operator
.
getOutputs
().
get
(
0
)
instanceof
NodeOperator
))
{
// and now connecting point
Point2D
centerPoint
=
operator
.
getLine
().
getPoints
().
get
(
0
);
Color
fillColor
=
Color
.
WHITE
;
double
radius
=
DEFAULT_OPERATOR_RADIUS
;
// bigger connecting point circles in SBGN view
if
(
sbgnFormat
)
{
radius
*=
SBGN_RADIUS_MULTIPLIER
;
}
else
if
(
operator
instanceof
AndOperator
||
operator
instanceof
SplitOperator
||
operator
instanceof
DissociationOperator
||
operator
instanceof
AssociationOperator
||
operator
instanceof
TruncationOperator
)
{
radius
=
1.5
;
fillColor
=
operator
.
getLine
().
getColor
();
}
// it's a circle
Ellipse2D
cir
=
new
Ellipse2D
.
Double
(
centerPoint
.
getX
()
-
radius
,
centerPoint
.
getY
()
-
radius
,
2
*
radius
,
2
*
radius
);
graphics
.
setColor
(
fillColor
);
graphics
.
fill
(
cir
);
graphics
.
setColor
(
operator
.
getLine
().
getColor
());
graphics
.
draw
(
cir
);
// and text defined by operator
String
text
;
if
(!
sbgnFormat
)
{
text
=
operator
.
getOperatorText
();
}
else
{
text
=
operator
.
getSBGNOperatorText
();
}
Rectangle2D
rect
=
graphics
.
getFontMetrics
().
getStringBounds
(
text
,
graphics
);
graphics
.
drawString
(
text
,
(
int
)
(
centerPoint
.
getX
()
-
rect
.
getWidth
()
/
2
+
1
),
(
int
)
(
centerPoint
.
getY
()
+
rect
.
getHeight
()
/
2
)
-
2
);
Point2D
centerPoint
=
operator
.
getLine
().
getPoints
().
get
(
0
);
Color
fillColor
=
Color
.
WHITE
;
double
radius
=
DEFAULT_OPERATOR_RADIUS
;
// bigger connecting point circles in SBGN view
if
(
operator
instanceof
AndOperator
||
operator
instanceof
SplitOperator
||
operator
instanceof
DissociationOperator
||
operator
instanceof
AssociationOperator
||
operator
instanceof
TruncationOperator
)
{
radius
=
1.5
;
fillColor
=
operator
.
getLine
().
getColor
();
}
// it's a circle
Ellipse2D
cir
=
new
Ellipse2D
.
Double
(
centerPoint
.
getX
()
-
radius
,
centerPoint
.
getY
()
-
radius
,
2
*
radius
,
2
*
radius
);
graphics
.
setColor
(
fillColor
);
graphics
.
fill
(
cir
);
graphics
.
setColor
(
operator
.
getLine
().
getColor
());
graphics
.
draw
(
cir
);
// and text defined by operator
String
text
=
operator
.
getOperatorText
();
Rectangle2D
rect
=
graphics
.
getFontMetrics
().
getStringBounds
(
text
,
graphics
);
graphics
.
drawString
(
text
,
(
int
)
(
centerPoint
.
getX
()
-
rect
.
getWidth
()
/
2
+
1
),
(
int
)
(
centerPoint
.
getY
()
+
rect
.
getHeight
()
/
2
)
-
2
);
graphics
.
setColor
(
oldColor
);
}
Loading