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
Gitlab will go in to maintenance on Friday 5:30pm since SIU is doing Isilon maintenance and we use isilon shares on the Gitlab
You are on a read-only GitLab instance.
Show more breadcrumbs
minerva
core
Commits
f2eb5642
Commit
f2eb5642
authored
7 years ago
by
Piotr Gawron
Browse files
Options
Downloads
Patches
Plain Diff
simplification of abstract methods syntax (unnecessary params removed)
parent
fe4a1d2d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!44
Resolve "semantic zoom"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/AbstractImageGenerator.java
+19
-28
19 additions, 28 deletions
.../mapviewer/converter/graphics/AbstractImageGenerator.java
with
19 additions
and
28 deletions
converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/AbstractImageGenerator.java
+
19
−
28
View file @
f2eb5642
...
...
@@ -679,20 +679,20 @@ public abstract class AbstractImageGenerator {
// compartment/complexes)
if
(
element
instanceof
Species
)
{
if
(((
Species
)
element
).
getComplex
()
==
null
&&
element
.
getCompartment
()
==
null
)
{
drawSpecies
((
Species
)
element
,
params
.
getVisibleLayoutsForElement
(
element
),
params
);
drawSpecies
((
Species
)
element
);
}
}
}
// draw all reactions
for
(
Reaction
reaction
:
params
.
getModel
().
getSortedReactions
())
{
drawReaction
(
reaction
,
params
.
getVisibleLayoutsForElement
(
reaction
),
params
);
drawReaction
(
reaction
);
}
// draw all compartments
for
(
Compartment
compartment
:
params
.
getModel
().
getSortedCompartments
())
{
// draw only compartment that don't have parents (aren't included in any
// compartment/complexes)
if
(
compartment
.
getCompartment
()
==
null
)
{
drawCompartment
(
compartment
,
params
.
getVisibleLayoutsForElement
(
compartment
),
params
);
drawCompartment
(
compartment
);
}
}
...
...
@@ -731,14 +731,10 @@ public abstract class AbstractImageGenerator {
*
* @param compartment
* object that we want to draw
* @param visibleLayouts
* list of {@link ColorSchema} used for coloring element in layouts
* @param params
* list of all params to create apropriate image
* @throws DrawingException
* thrown when there was a problem with drawing {@link Compartment}
*/
protected
void
drawCompartment
(
final
Compartment
compartment
,
List
<
ColorSchema
>
visibleLayouts
,
Params
params
)
throws
DrawingException
{
protected
void
drawCompartment
(
final
Compartment
compartment
)
throws
DrawingException
{
// get a converter for this compartment
BioEntityConverterImpl
converter
=
new
BioEntityConverterImpl
(
compartment
,
colorExtractor
);
ConverterParams
compartmentParams
=
new
ConverterParams
().
level
(
level
).
nested
(
params
.
nested
);
...
...
@@ -750,7 +746,7 @@ public abstract class AbstractImageGenerator {
// we draw compartment only when we have hierarchical view or it's
// standard compartment (not the pathway)
if
(
params
.
nested
||
!(
compartment
instanceof
PathwayCompartment
))
{
converter
.
draw
(
compartment
,
graphics
,
compartmentParams
,
v
isibleLayouts
);
converter
.
draw
(
compartment
,
graphics
,
compartmentParams
,
params
.
getV
isibleLayouts
ForElement
(
compartment
)
);
}
// If compartment should be filled, then we could skip drawing the inside
...
...
@@ -762,12 +758,12 @@ public abstract class AbstractImageGenerator {
Collections
.
sort
(
result
,
Element
.
SIZE_COMPARATOR
);
// draw all children of this compartment
for
(
Element
element
:
result
)
{
for
(
Element
child
:
result
)
{
// if a child is a standard species
if
(
element
instanceof
Species
)
{
drawSpecies
((
Species
)
element
,
params
.
getVisibleLayoutsForElement
(
element
),
params
);
}
else
if
(
element
instanceof
Compartment
)
{
drawCompartment
((
Compartment
)
element
,
params
.
getVisibleLayoutsForElement
(
element
),
params
);
if
(
child
instanceof
Species
)
{
drawSpecies
((
Species
)
child
);
}
else
if
(
child
instanceof
Compartment
)
{
drawCompartment
((
Compartment
)
child
);
}
else
{
// if a child is not a compartment or a species then we have a
// problem
...
...
@@ -788,14 +784,10 @@ public abstract class AbstractImageGenerator {
*
* @param species
* object to be drawn
* @param visibleLayouts
* list of {@link ColorSchema} used for coloring species in layouts
* @param params
* list of all params to create apropriate image
* @throws DrawingException
* thrown when there was a problem with drawing a {@link Species}
*/
protected
void
drawSpecies
(
final
Species
species
,
List
<
ColorSchema
>
visibleLayouts
,
Params
params
)
throws
DrawingException
{
protected
void
drawSpecies
(
final
Species
species
)
throws
DrawingException
{
/**
* Last conditions in this 'ifs' provides the certainty of visibility of
...
...
@@ -827,7 +819,9 @@ public abstract class AbstractImageGenerator {
if
(
rescale
)
{
customScale
=
scale
;
}
converter
.
draw
(
species
,
graphics
,
new
ConverterParams
().
scale
(
customScale
).
level
(
level
).
sbgnFormat
(
sbgnFormat
).
nested
(
params
.
nested
),
visibleLayouts
);
converter
.
draw
(
species
,
graphics
,
new
ConverterParams
().
scale
(
customScale
).
level
(
level
).
sbgnFormat
(
sbgnFormat
).
nested
(
params
.
nested
),
params
.
getVisibleLayoutsForElement
(
species
));
// if the species is a complex then we may want to draw children
// objects
...
...
@@ -838,8 +832,8 @@ public abstract class AbstractImageGenerator {
if
(!
complex
.
getState
().
equalsIgnoreCase
(
"brief"
))
{
// depending on current zoom level, children are drawn or not
if
(
zoomLevelMatcher
.
isTransparent
(
level
,
complex
.
getTransparencyLevel
())
||
!
params
.
nested
)
{
for
(
Species
a
:
complex
.
getElements
())
{
drawSpecies
(
a
,
visibleLayouts
,
params
);
for
(
Species
child
:
complex
.
getElements
())
{
drawSpecies
(
child
);
}
}
}
...
...
@@ -851,18 +845,15 @@ public abstract class AbstractImageGenerator {
*
* @param reaction
* object to be drawn
* @param visibleLayouts
* list of {@link ColorSchema} used for coloring reaction in layouts
* @param params
* list of all params to create apropriate image
* @throws DrawingException
*/
protected
void
drawReaction
(
final
Reaction
reaction
,
List
<
ColorSchema
>
visibleLayouts
,
Params
params
)
throws
DrawingException
{
protected
void
drawReaction
(
final
Reaction
reaction
)
throws
DrawingException
{
if
(!
cross
(
reaction
.
getLines
()))
{
return
;
}
BioEntityConverterImpl
converter
=
new
BioEntityConverterImpl
(
reaction
,
sbgnFormat
,
colorExtractor
);
converter
.
draw
(
reaction
,
graphics
,
new
ConverterParams
().
sbgnFormat
(
sbgnFormat
).
nested
(
params
.
nested
).
level
(
level
),
visibleLayouts
);
converter
.
draw
(
reaction
,
graphics
,
new
ConverterParams
().
sbgnFormat
(
sbgnFormat
).
nested
(
params
.
nested
).
level
(
level
),
params
.
getVisibleLayoutsForElement
(
reaction
));
}
/**
...
...
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