diff --git a/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/annotation/RestAnnotationParser.java b/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/annotation/RestAnnotationParser.java index 24021c6d339acc1db72e219a2ef94d811c14c5a2..a1ab11fc4ad10cb3e8b74f6fb9e6b0196013f9b4 100644 --- a/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/annotation/RestAnnotationParser.java +++ b/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/annotation/RestAnnotationParser.java @@ -562,6 +562,14 @@ public class RestAnnotationParser extends XmlParser { } } + /** + * Assigns semanticZoomingLevel to the element from notes string. + * + * @param element + * element to which data should be put to + * @param annotationString + * notes string + */ private void setSemanticZoomLevelVisibility(AnnotatedObject element, String annotationString) { String zoomLevelVisibility = getParamByPrefix(annotationString, NoteField.SEMANTIC_ZOOM_LEVEL_VISIBILITY.getCommonName() + ":"); if (zoomLevelVisibility == null) { diff --git a/converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/AbstractImageGenerator.java b/converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/AbstractImageGenerator.java index b68a48171a95b851ea030085623717a0388ef1ca..16e997154b53d5419fbf41c379f9d409dd39ac33 100644 --- a/converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/AbstractImageGenerator.java +++ b/converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/AbstractImageGenerator.java @@ -172,6 +172,10 @@ public abstract class AbstractImageGenerator { * Should the visualization include hierarchical view or not. */ private boolean nested = false; + + /** + * Should the visualization include semantic zoom view or not. + */ private boolean semanticZoom = false; /** @@ -208,7 +212,13 @@ public abstract class AbstractImageGenerator { this.scale = scale; return this; } - + + /** + * @param semanticZoom + * semanticZoom to set + * @return object with all parameters + * @see #semanticZoom + */ public Params semanticZoom(boolean semanticZoom) { this.semanticZoom = semanticZoom; return this; @@ -801,6 +811,7 @@ public abstract class AbstractImageGenerator { * @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} */ @@ -872,6 +883,7 @@ public abstract class AbstractImageGenerator { * @param visibleLayouts * list of {@link ColorSchema} used for coloring reaction in layouts * @param params + * list of all params to create apropriate image */ protected void drawReaction(final Reaction reaction, List<ColorSchema> visibleLayouts, Params params) { if (!cross(reaction.getLines())) { diff --git a/converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/MapGenerator.java b/converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/MapGenerator.java index 56c6e0722c2e4db01ae81a39bd1ce76b475959c8..5e44baf42537fb87f7051a0005efa08c45a86f97 100644 --- a/converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/MapGenerator.java +++ b/converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/MapGenerator.java @@ -57,22 +57,25 @@ public class MapGenerator { * Do we want to generate images in hierarchical view or normal. * */ - private boolean nested = false; - private boolean semanticZoom = false; + private boolean nested = false; + /** + * Do we want to generate images with semantic zoom view or not. + */ + private boolean semanticZoom = false; /** * Should we remove empty elements in nested view. * */ - private boolean removeEmpty = false; + private boolean removeEmpty = false; /** * Callback function that update progress information. * */ - private IProgressUpdater updater = new IProgressUpdater() { - @Override - public void setProgress(double progress) { - } - }; + private IProgressUpdater updater = new IProgressUpdater() { + @Override + public void setProgress(double progress) { + } + }; /** * Zoom factor on the lowest level. @@ -135,7 +138,13 @@ public class MapGenerator { this.nested = nested; return this; } - + + /** + * @param semanticZoom + * the semanticZoom to set + * @see #nested + * @return full {@link MapGeneratorParams} object + */ public MapGeneratorParams semanticZoom(boolean semanticZoom) { this.semanticZoom = semanticZoom; return this; diff --git a/converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/bioEntity/BioEntityConverter.java b/converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/bioEntity/BioEntityConverter.java index 6f9714b2cf08d8227619a279e7295e7f55a69fe3..25fbd300a7cc51d34d57a923dc724d6735c3adc8 100644 --- a/converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/bioEntity/BioEntityConverter.java +++ b/converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/bioEntity/BioEntityConverter.java @@ -34,6 +34,7 @@ public abstract class BioEntityConverter<T extends AnnotatedObject> { /** * Default class logger. */ + @SuppressWarnings("unused") private final Logger logger = Logger.getLogger(BioEntityConverter.class); /** @@ -93,6 +94,16 @@ public abstract class BioEntityConverter<T extends AnnotatedObject> { */ public abstract void drawText(T bioEntity, Graphics2D graphics, ConverterParams params) throws DrawingException; + /** + * Checks if {@link AbstractNode} is visible according to visualization given + * in params. + * + * @param node + * visibility of this object will be checked + * @param params + * visualization params + * @return true if object is visible + */ protected boolean isVisible(AbstractNode node, ConverterParams params) { if (node instanceof NodeOperator) { return isVisible((NodeOperator) node, params); @@ -103,6 +114,16 @@ public abstract class BioEntityConverter<T extends AnnotatedObject> { } } + /** + * Checks if {@link NodeOperator} is visible according to visualization given + * in params. + * + * @param operator + * visibility of this object will be checked + * @param params + * visualization params + * @return true if object is visible + */ protected boolean isVisible(NodeOperator operator, ConverterParams params) { boolean result = false; if (operator.isModifierOperator() || operator.isReactantOperator()) { @@ -119,6 +140,16 @@ public abstract class BioEntityConverter<T extends AnnotatedObject> { return result; } + /** + * Checks if {@link AnnotatedObject} is visible according to visualization + * given in params. + * + * @param bioEntity + * visibility of this object will be checked + * @param params + * visualization params + * @return true if object is visible + */ protected boolean isVisible(AnnotatedObject bioEntity, ConverterParams params) { if (params.isSemanticZoomingOn()) { boolean result = matchLevel(params.getLevel(), bioEntity.getSemanticZoomLevelVisibility()); @@ -139,6 +170,16 @@ public abstract class BioEntityConverter<T extends AnnotatedObject> { return true; } + /** + * Checks if level belongs to the range defined in + * semanticZoomLevelVisibility. + * + * @param level + * level to ve checked + * @param semanticZoomLevelVisibility + * range of levels to be checked + * @return true if level is in the range + */ protected boolean matchLevel(int level, String semanticZoomLevelVisibility) { if (semanticZoomLevelVisibility == null || semanticZoomLevelVisibility.isEmpty()) { return true; diff --git a/converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/bioEntity/element/species/package-info.java b/converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/bioEntity/element/species/package-info.java index 2fb83e5d857d08503c4d1c7840c238107400c650..bb5eba0424d844789420b16d4b88a0c4c8962213 100644 --- a/converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/bioEntity/element/species/package-info.java +++ b/converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/bioEntity/element/species/package-info.java @@ -1,7 +1,6 @@ /** - * Provides classes that draws aliases of + * Provides classes that draws * {@link lcsb.mapviewer.db.model.map.species.Species Species} on the Graphics2D * object. */ package lcsb.mapviewer.converter.graphics.bioEntity.element.species; - diff --git a/converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/bioEntity/reaction/ReactionConverter.java b/converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/bioEntity/reaction/ReactionConverter.java index b50c7ef53d1d4e382dc07264e9351a2c26ff2e9a..1881210ae7ea63ec35a9382d0950bafea12cfc9d 100644 --- a/converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/bioEntity/reaction/ReactionConverter.java +++ b/converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/bioEntity/reaction/ReactionConverter.java @@ -222,19 +222,7 @@ public class ReactionConverter extends BioEntityConverter<Reaction> { graphics.setColor(color); } - /** - * Draw reaction on the graphics2D. - * - * @param reaction - * object to be drawn - * @param graphics - * where we want to draw the object - * @param sbgnFormat - * true if reaction is to be drawn in SBGN format - * @param visualizedLayoutsColorSchemas - * list of {@link ColorSchema} that were used for visualizing this - * alias in different layouts that should be overlayed on the alias - */ + @Override public void draw(final Reaction reaction, final Graphics2D graphics, final ConverterParams params, List<ColorSchema> visualizedLayoutsColorSchemas) { if (visualizedLayoutsColorSchemas.size() == 0) { draw(reaction, graphics, params);