Skip to content
Snippets Groups Projects
Commit c2b216e7 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

drawCompartment method parameters simplified

parent 811912ce
No related branches found
No related tags found
1 merge request!44Resolve "semantic zoom"
......@@ -689,7 +689,7 @@ public abstract class AbstractImageGenerator {
// draw only compartment that don't have parents (aren't included in any
// compartment/complexes)
if (compartment.getCompartment() == null) {
drawCompartment(compartment, params.isNested(), params.getVisibleLayoutsForElement(compartment), params);
drawCompartment(compartment, params.getVisibleLayoutsForElement(compartment), params);
}
}
......@@ -724,8 +724,6 @@ public abstract class AbstractImageGenerator {
*
* @param compartment
* object that we want to draw
* @param nested
* are the compartments drawn in hierarchical view
* @param visibleLayouts
* list of {@link ColorSchema} used for coloring element in layouts
* @param params
......@@ -733,8 +731,7 @@ public abstract class AbstractImageGenerator {
* @throws DrawingException
* thrown when there was a problem with drawing {@link Compartment}
*/
protected void drawCompartment(final Compartment compartment, final boolean nested, List<ColorSchema> visibleLayouts, Params params)
throws DrawingException {
protected void drawCompartment(final Compartment compartment, List<ColorSchema> visibleLayouts, Params params) throws DrawingException {
// If 'compartment' has not the big enough visibility level then should not
// be visible.
......@@ -749,7 +746,7 @@ public abstract class AbstractImageGenerator {
*/
boolean fill = true;
if (compartment.getTransparencyLevel() <= level || !nested) {
if (compartment.getTransparencyLevel() <= level || !params.nested) {
fill = false;
}
......@@ -757,13 +754,13 @@ public abstract class AbstractImageGenerator {
BioEntityConverterImpl converter = new BioEntityConverterImpl(compartment, colorExtractor);
ConverterParams compartmentParams = new ConverterParams().textCentered(fill).level(level).semanticZoomingOn(params.semanticZoom);
if (nested) {
if (params.nested) {
compartmentParams.fill(fill).scale(Math.max(scale, 1));
}
// we draw compartment only when we have hierarchical view or it's
// standard compartment (not the pathway)
if (nested || !(compartment instanceof PathwayCompartment)) {
if (params.nested || !(compartment instanceof PathwayCompartment)) {
try {
converter.draw(compartment, graphics, compartmentParams, visibleLayouts);
} catch (Exception e) {
......@@ -787,7 +784,7 @@ public abstract class AbstractImageGenerator {
if (element instanceof Species) {
drawSpecies((Species) element, params.getVisibleLayoutsForElement(element), params);
} else if (element instanceof Compartment) {
drawCompartment((Compartment) element, nested, params.getVisibleLayoutsForElement(element), params);
drawCompartment((Compartment) element, params.getVisibleLayoutsForElement(element), params);
} else {
// if a child is not a compartment or a species then we have a
// problem
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment