Commit ca2b405f authored by Piotr Gawron's avatar Piotr Gawron
Browse files

method names unified

parent 4b7bd7d5
...@@ -42,7 +42,7 @@ public class AntisenseRnaConverter extends SpeciesConverter<AntisenseRna> { ...@@ -42,7 +42,7 @@ public class AntisenseRnaConverter extends SpeciesConverter<AntisenseRna> {
@Override @Override
protected void drawImpl(final AntisenseRna antisenseRna, final Graphics2D graphics, final ConverterParams params) { protected void drawImpl(final AntisenseRna antisenseRna, final Graphics2D graphics, final ConverterParams params) {
Color oldColor = graphics.getColor(); Color oldColor = graphics.getColor();
GeneralPath path = getAntisenseRnaPath(antisenseRna); GeneralPath path = getShape(antisenseRna);
graphics.setColor(antisenseRna.getFillColor()); graphics.setColor(antisenseRna.getFillColor());
graphics.fill(path); graphics.fill(path);
Stroke stroke = graphics.getStroke(); Stroke stroke = graphics.getStroke();
...@@ -66,7 +66,8 @@ public class AntisenseRnaConverter extends SpeciesConverter<AntisenseRna> { ...@@ -66,7 +66,8 @@ public class AntisenseRnaConverter extends SpeciesConverter<AntisenseRna> {
* {@link AntisenseRna} for which we want to get border * {@link AntisenseRna} for which we want to get border
* @return border of the {@link AntisenseRna} * @return border of the {@link AntisenseRna}
*/ */
private GeneralPath getAntisenseRnaPath(final AntisenseRna antisenseRna) { @Override
protected GeneralPath getShape(final AntisenseRna antisenseRna) {
// CHECKSTYLE:OFF // CHECKSTYLE:OFF
GeneralPath path = new GeneralPath(Path2D.WIND_EVEN_ODD, 4); GeneralPath path = new GeneralPath(Path2D.WIND_EVEN_ODD, 4);
path.moveTo(antisenseRna.getX(), antisenseRna.getY()); path.moveTo(antisenseRna.getX(), antisenseRna.getY());
...@@ -80,7 +81,7 @@ public class AntisenseRnaConverter extends SpeciesConverter<AntisenseRna> { ...@@ -80,7 +81,7 @@ public class AntisenseRnaConverter extends SpeciesConverter<AntisenseRna> {
@Override @Override
public PathIterator getBoundPathIterator(final AntisenseRna alias) { public PathIterator getBoundPathIterator(final AntisenseRna alias) {
return getAntisenseRnaPath(alias).getPathIterator(new AffineTransform()); return getShape(alias).getPathIterator(new AffineTransform());
} }
} }
...@@ -68,7 +68,7 @@ public class ComplexConverter extends SpeciesConverter<Complex> { ...@@ -68,7 +68,7 @@ public class ComplexConverter extends SpeciesConverter<Complex> {
complex.setX(complex.getX() - SpeciesConverter.HOMODIMER_OFFSET); complex.setX(complex.getX() - SpeciesConverter.HOMODIMER_OFFSET);
complex.setY(complex.getY() - SpeciesConverter.HOMODIMER_OFFSET); complex.setY(complex.getY() - SpeciesConverter.HOMODIMER_OFFSET);
GeneralPath path = getAliasPath(complex); GeneralPath path = getShape(complex);
Stroke stroke = graphics.getStroke(); Stroke stroke = graphics.getStroke();
graphics.setColor(complex.getFillColor()); graphics.setColor(complex.getFillColor());
...@@ -79,14 +79,14 @@ public class ComplexConverter extends SpeciesConverter<Complex> { ...@@ -79,14 +79,14 @@ public class ComplexConverter extends SpeciesConverter<Complex> {
if (complex.getState().equals("brief")) { if (complex.getState().equals("brief")) {
complex.increaseBorder(-INTERNAL_BORDER_DIST); complex.increaseBorder(-INTERNAL_BORDER_DIST);
path = getAliasPath(complex); path = getShape(complex);
complex.increaseBorder(INTERNAL_BORDER_DIST); complex.increaseBorder(INTERNAL_BORDER_DIST);
graphics.setStroke(LineType.DOTTED.getStroke()); graphics.setStroke(LineType.DOTTED.getStroke());
graphics.draw(path); graphics.draw(path);
} }
if (complex.getActivity() && !params.isSbgnFormat()) { if (complex.getActivity() && !params.isSbgnFormat()) {
complex.increaseBorder(INTERNAL_BORDER_DIST); complex.increaseBorder(INTERNAL_BORDER_DIST);
path = getAliasPath(complex); path = getShape(complex);
complex.increaseBorder(-INTERNAL_BORDER_DIST); complex.increaseBorder(-INTERNAL_BORDER_DIST);
graphics.setStroke(LineType.DOTTED.getStroke()); graphics.setStroke(LineType.DOTTED.getStroke());
graphics.draw(path); graphics.draw(path);
...@@ -128,7 +128,7 @@ public class ComplexConverter extends SpeciesConverter<Complex> { ...@@ -128,7 +128,7 @@ public class ComplexConverter extends SpeciesConverter<Complex> {
@Override @Override
public PathIterator getBoundPathIterator(final Complex complex) { public PathIterator getBoundPathIterator(final Complex complex) {
return getAliasPath(complex).getPathIterator(new AffineTransform()); return getShape(complex).getPathIterator(new AffineTransform());
} }
/** /**
...@@ -138,7 +138,8 @@ public class ComplexConverter extends SpeciesConverter<Complex> { ...@@ -138,7 +138,8 @@ public class ComplexConverter extends SpeciesConverter<Complex> {
* exact object for which we want to get a border * exact object for which we want to get a border
* @return border of the {@link Complex} * @return border of the {@link Complex}
*/ */
private GeneralPath getAliasPath(final Complex complex) { @Override
protected GeneralPath getShape(final Complex complex) {
GeneralPath path = new GeneralPath(Path2D.WIND_EVEN_ODD); GeneralPath path = new GeneralPath(Path2D.WIND_EVEN_ODD);
path.moveTo(complex.getX() + TRIMMED_CORNER_SIZE, complex.getY()); path.moveTo(complex.getX() + TRIMMED_CORNER_SIZE, complex.getY());
path.lineTo(complex.getX() + complex.getWidth() - TRIMMED_CORNER_SIZE, complex.getY()); path.lineTo(complex.getX() + complex.getWidth() - TRIMMED_CORNER_SIZE, complex.getY());
......
...@@ -45,6 +45,21 @@ public class DegradedConverter extends SpeciesConverter<Degraded> { ...@@ -45,6 +45,21 @@ public class DegradedConverter extends SpeciesConverter<Degraded> {
@Override @Override
protected void drawImpl(final Degraded degraded, final Graphics2D graphics, final ConverterParams params) { protected void drawImpl(final Degraded degraded, final Graphics2D graphics, final ConverterParams params) {
Area a1 = getShape(degraded);
Color oldColor = graphics.getColor();
graphics.setColor(degraded.getFillColor());
graphics.fill(a1);
graphics.setColor(degraded.getBorderColor());
Stroke stroke = graphics.getStroke();
graphics.setStroke(getBorderLine(degraded));
graphics.draw(a1);
graphics.setStroke(stroke);
drawText(degraded, graphics, params);
graphics.setColor(oldColor);
}
@Override
protected Area getShape(final Degraded degraded) {
double diameter = getDiameter(degraded); double diameter = getDiameter(degraded);
double x = getXCoord(degraded, diameter); double x = getXCoord(degraded, diameter);
double y = getYCoord(degraded); double y = getYCoord(degraded);
...@@ -64,16 +79,7 @@ public class DegradedConverter extends SpeciesConverter<Degraded> { ...@@ -64,16 +79,7 @@ public class DegradedConverter extends SpeciesConverter<Degraded> {
path.closePath(); path.closePath();
a1.exclusiveOr(new Area(path)); a1.exclusiveOr(new Area(path));
Color oldColor = graphics.getColor(); return a1;
graphics.setColor(degraded.getFillColor());
graphics.fill(a1);
graphics.setColor(degraded.getBorderColor());
Stroke stroke = graphics.getStroke();
graphics.setStroke(getBorderLine(degraded));
graphics.draw(a1);
graphics.setStroke(stroke);
drawText(degraded, graphics, params);
graphics.setColor(oldColor);
} }
/** /**
......
...@@ -56,14 +56,15 @@ public class DrugConverter extends SpeciesConverter<Drug> { ...@@ -56,14 +56,15 @@ public class DrugConverter extends SpeciesConverter<Drug> {
* {@link Drug} for which we are looking for a border * {@link Drug} for which we are looking for a border
* @return Shape object defining given alias * @return Shape object defining given alias
*/ */
private Shape getDrugShape(final Drug drug) { @Override
protected Shape getShape(final Drug drug) {
return new RoundRectangle2D.Double(drug.getX(), drug.getY(), drug.getWidth(), drug.getHeight(), return new RoundRectangle2D.Double(drug.getX(), drug.getY(), drug.getWidth(), drug.getHeight(),
RECTANGLE_CORNER_ARC_SIZE, RECTANGLE_CORNER_ARC_SIZE); RECTANGLE_CORNER_ARC_SIZE, RECTANGLE_CORNER_ARC_SIZE);
} }
@Override @Override
protected void drawImpl(Drug drug, final Graphics2D graphics, final ConverterParams params) { protected void drawImpl(Drug drug, final Graphics2D graphics, final ConverterParams params) {
Shape a1 = getDrugShape(drug); Shape a1 = getShape(drug);
double offset = OFFSET_BETWEEN_BORDERS; double offset = OFFSET_BETWEEN_BORDERS;
Shape a2 = new RoundRectangle2D.Double( Shape a2 = new RoundRectangle2D.Double(
drug.getX() + offset, drug.getY() + offset, drug.getWidth() - 2 * offset, drug.getHeight() - 2 * offset, drug.getX() + offset, drug.getY() + offset, drug.getWidth() - 2 * offset, drug.getHeight() - 2 * offset,
...@@ -113,7 +114,7 @@ public class DrugConverter extends SpeciesConverter<Drug> { ...@@ -113,7 +114,7 @@ public class DrugConverter extends SpeciesConverter<Drug> {
@Override @Override
public PathIterator getBoundPathIterator(Drug drug) { public PathIterator getBoundPathIterator(Drug drug) {
return getDrugShape(drug).getPathIterator(new AffineTransform()); return getShape(drug).getPathIterator(new AffineTransform());
} }
} }
...@@ -41,7 +41,7 @@ public class GeneConverter extends SpeciesConverter<Gene> { ...@@ -41,7 +41,7 @@ public class GeneConverter extends SpeciesConverter<Gene> {
@Override @Override
protected void drawImpl(final Gene gene, final Graphics2D graphics, final ConverterParams params) { protected void drawImpl(final Gene gene, final Graphics2D graphics, final ConverterParams params) {
Shape shape = getGeneShape(gene); Shape shape = getShape(gene);
Color c = graphics.getColor(); Color c = graphics.getColor();
graphics.setColor(gene.getFillColor()); graphics.setColor(gene.getFillColor());
graphics.fill(shape); graphics.fill(shape);
...@@ -66,7 +66,8 @@ public class GeneConverter extends SpeciesConverter<Gene> { ...@@ -66,7 +66,8 @@ public class GeneConverter extends SpeciesConverter<Gene> {
* {@link Gene} for which we are looking for a {@link Shape} * {@link Gene} for which we are looking for a {@link Shape}
* @return {@link Shape} that represents {@link Gene} * @return {@link Shape} that represents {@link Gene}
*/ */
private Shape getGeneShape(final Gene gene) { @Override
protected Shape getShape(final Gene gene) {
Shape shape; Shape shape;
shape = new Rectangle(gene.getX().intValue(), gene.getY().intValue(), gene.getWidth().intValue(), shape = new Rectangle(gene.getX().intValue(), gene.getY().intValue(), gene.getWidth().intValue(),
gene.getHeight().intValue()); gene.getHeight().intValue());
...@@ -75,7 +76,7 @@ public class GeneConverter extends SpeciesConverter<Gene> { ...@@ -75,7 +76,7 @@ public class GeneConverter extends SpeciesConverter<Gene> {
@Override @Override
public PathIterator getBoundPathIterator(final Gene gene) { public PathIterator getBoundPathIterator(final Gene gene) {
return getGeneShape(gene).getPathIterator(new AffineTransform()); return getShape(gene).getPathIterator(new AffineTransform());
} }
} }
...@@ -40,10 +40,7 @@ public class IonConverter extends SpeciesConverter<Ion> { ...@@ -40,10 +40,7 @@ public class IonConverter extends SpeciesConverter<Ion> {
@Override @Override
protected void drawImpl(Ion ion, final Graphics2D graphics, final ConverterParams params) { protected void drawImpl(Ion ion, final Graphics2D graphics, final ConverterParams params) {
double diameter = getDiameter(ion); Shape shape = getShape(ion);
double x = getXCoord(ion, diameter);
double y = getYCoord(ion);
Shape shape = new Ellipse2D.Double(x, y, diameter, diameter);
Color oldColor = graphics.getColor(); Color oldColor = graphics.getColor();
graphics.setColor(ion.getFillColor()); graphics.setColor(ion.getFillColor());
graphics.fill(shape); graphics.fill(shape);
...@@ -56,6 +53,15 @@ public class IonConverter extends SpeciesConverter<Ion> { ...@@ -56,6 +53,15 @@ public class IonConverter extends SpeciesConverter<Ion> {
graphics.setColor(oldColor); graphics.setColor(oldColor);
} }
@Override
protected Shape getShape(Ion ion) {
double diameter = getDiameter(ion);
double x = getXCoord(ion, diameter);
double y = getYCoord(ion);
Shape shape = new Ellipse2D.Double(x, y, diameter, diameter);
return shape;
}
/** /**
* Returns transformed y coordinate for the {@link Ion}. * Returns transformed y coordinate for the {@link Ion}.
* *
......
...@@ -38,7 +38,7 @@ public class PhenotypeConverter extends SpeciesConverter<Phenotype> { ...@@ -38,7 +38,7 @@ public class PhenotypeConverter extends SpeciesConverter<Phenotype> {
@Override @Override
protected void drawImpl(Phenotype phenotype, final Graphics2D graphics, final ConverterParams params) { protected void drawImpl(Phenotype phenotype, final Graphics2D graphics, final ConverterParams params) {
GeneralPath path = getPhenotypePath(phenotype); GeneralPath path = getShape(phenotype);
Color oldColor = graphics.getColor(); Color oldColor = graphics.getColor();
graphics.setColor(phenotype.getFillColor()); graphics.setColor(phenotype.getFillColor());
...@@ -60,7 +60,8 @@ public class PhenotypeConverter extends SpeciesConverter<Phenotype> { ...@@ -60,7 +60,8 @@ public class PhenotypeConverter extends SpeciesConverter<Phenotype> {
* @return {@link GeneralPath} object defining border of the given * @return {@link GeneralPath} object defining border of the given
* {@link Phenotype} * {@link Phenotype}
*/ */
private GeneralPath getPhenotypePath(final Phenotype phenotype) { @Override
protected GeneralPath getShape(final Phenotype phenotype) {
// CHECKSTYLE:OFF // CHECKSTYLE:OFF
GeneralPath path = new GeneralPath(Path2D.WIND_EVEN_ODD, 6); GeneralPath path = new GeneralPath(Path2D.WIND_EVEN_ODD, 6);
path.moveTo(phenotype.getX() + phenotype.getWidth() / 6, phenotype.getY()); path.moveTo(phenotype.getX() + phenotype.getWidth() / 6, phenotype.getY());
...@@ -76,7 +77,7 @@ public class PhenotypeConverter extends SpeciesConverter<Phenotype> { ...@@ -76,7 +77,7 @@ public class PhenotypeConverter extends SpeciesConverter<Phenotype> {
@Override @Override
public PathIterator getBoundPathIterator(Phenotype phenotype) { public PathIterator getBoundPathIterator(Phenotype phenotype) {
return getPhenotypePath(phenotype).getPathIterator(new AffineTransform()); return getShape(phenotype).getPathIterator(new AffineTransform());
} }
} }
...@@ -50,8 +50,8 @@ public class ProteinConverter extends SpeciesConverter<Protein> { ...@@ -50,8 +50,8 @@ public class ProteinConverter extends SpeciesConverter<Protein> {
* Default constructor. * Default constructor.
* *
* @param colorExtractor * @param colorExtractor
* Object that helps to convert {@link DataOverlayEntry} values into colors * Object that helps to convert {@link DataOverlayEntry} values into
* when drawing {@link Species} * colors when drawing {@link Species}
*/ */
public ProteinConverter(ColorExtractor colorExtractor) { public ProteinConverter(ColorExtractor colorExtractor) {
super(colorExtractor); super(colorExtractor);
...@@ -93,7 +93,8 @@ public class ProteinConverter extends SpeciesConverter<Protein> { ...@@ -93,7 +93,8 @@ public class ProteinConverter extends SpeciesConverter<Protein> {
protein.setX(protein.getX() - SpeciesConverter.HOMODIMER_OFFSET); protein.setX(protein.getX() - SpeciesConverter.HOMODIMER_OFFSET);
protein.setY(protein.getY() - SpeciesConverter.HOMODIMER_OFFSET); protein.setY(protein.getY() - SpeciesConverter.HOMODIMER_OFFSET);
Shape shape = getShape(protein, graphics); drawActivityShape(protein, graphics);
Shape shape = getShape(protein);
Color oldColor = graphics.getColor(); Color oldColor = graphics.getColor();
graphics.setColor(protein.getFillColor()); graphics.setColor(protein.getFillColor());
graphics.fill(shape); graphics.fill(shape);
...@@ -119,25 +120,27 @@ public class ProteinConverter extends SpeciesConverter<Protein> { ...@@ -119,25 +120,27 @@ public class ProteinConverter extends SpeciesConverter<Protein> {
protein.setHeight(protein.getHeight() + SpeciesConverter.HOMODIMER_OFFSET * (protein.getHomodimer() - 1)); protein.setHeight(protein.getHeight() + SpeciesConverter.HOMODIMER_OFFSET * (protein.getHomodimer() - 1));
} }
Shape getShape(final Protein protein, final Graphics2D graphics) { void drawActivityShape(final Protein protein, final Graphics2D graphics) {
if (protein instanceof GenericProtein && protein.getActivity()) {
drawActivityGenericProtein(protein, graphics);
} else if (protein instanceof TruncatedProtein && protein.getActivity()) {
drawActivityTruncatedShape(protein, graphics);
} else if (protein instanceof ReceptorProtein && protein.getActivity()) {
drawActivityReceptorProtein(protein, graphics);
}
}
@Override
protected Shape getShape(final Protein protein) {
Shape shape = null; Shape shape = null;
if (protein instanceof GenericProtein) { if (protein instanceof GenericProtein) {
shape = getGenericShape(protein); shape = getGenericShape(protein);
if (protein.getActivity()) {
drawActivityGenericProtein(protein, graphics);
}
} else if (protein instanceof IonChannelProtein) { } else if (protein instanceof IonChannelProtein) {
shape = getIonChannelShape(protein); shape = getIonChannelShape(protein);
} else if (protein instanceof TruncatedProtein) { } else if (protein instanceof TruncatedProtein) {
shape = getTruncatedShape(protein); shape = getTruncatedShape(protein);
if (protein.getActivity()) {
drawActivityTruncatedShape(protein, graphics);
}
} else if (protein instanceof ReceptorProtein) { } else if (protein instanceof ReceptorProtein) {
shape = getReceptorShape(protein); shape = getReceptorShape(protein);
if (protein.getActivity()) {
drawActivityReceptorProtein(protein, graphics);
}
} else { } else {
logger.warn(new LogMarker(ProjectLogEntryType.DRAWING_ISSUE, protein) + "Unknown shape for protein"); logger.warn(new LogMarker(ProjectLogEntryType.DRAWING_ISSUE, protein) + "Unknown shape for protein");
shape = getDefaultAliasShape(protein); shape = getDefaultAliasShape(protein);
......
...@@ -78,9 +78,13 @@ public class ProteinSbgnConverter extends ProteinConverter { ...@@ -78,9 +78,13 @@ public class ProteinSbgnConverter extends ProteinConverter {
} }
@Override @Override
Shape getShape(final Protein protein, final Graphics2D graphics) { protected Shape getShape(final Protein protein) {
return getGenericShape(protein); return getGenericShape(protein);
} }
@Override
void drawActivityShape(final Protein protein, final Graphics2D graphics) {
}
@Override @Override
Shape getStructuralStateShape(StructuralState state) { Shape getStructuralStateShape(StructuralState state) {
......
...@@ -46,7 +46,7 @@ public class RnaConverter extends SpeciesConverter<Rna> { ...@@ -46,7 +46,7 @@ public class RnaConverter extends SpeciesConverter<Rna> {
@Override @Override
protected void drawImpl(final Rna rna, final Graphics2D graphics, final ConverterParams params) { protected void drawImpl(final Rna rna, final Graphics2D graphics, final ConverterParams params) {
GeneralPath path = getRnaPath(rna); GeneralPath path = getShape(rna);
Color oldColor = graphics.getColor(); Color oldColor = graphics.getColor();
graphics.setColor(rna.getFillColor()); graphics.setColor(rna.getFillColor());
graphics.fill(path); graphics.fill(path);
...@@ -71,7 +71,8 @@ public class RnaConverter extends SpeciesConverter<Rna> { ...@@ -71,7 +71,8 @@ public class RnaConverter extends SpeciesConverter<Rna> {
* {@link Rna} for which we are looking for a border * {@link Rna} for which we are looking for a border
* @return {@link GeneralPath} object defining border of the given {@link Rna} * @return {@link GeneralPath} object defining border of the given {@link Rna}
*/ */
private GeneralPath getRnaPath(final Rna rna) { @Override
protected GeneralPath getShape(final Rna rna) {
// CHECKSTYLE:OFF // CHECKSTYLE:OFF
GeneralPath path = new GeneralPath(Path2D.WIND_EVEN_ODD, 4); GeneralPath path = new GeneralPath(Path2D.WIND_EVEN_ODD, 4);
path.moveTo(rna.getX() + rna.getWidth() / 4, rna.getY()); path.moveTo(rna.getX() + rna.getWidth() / 4, rna.getY());
...@@ -85,7 +86,7 @@ public class RnaConverter extends SpeciesConverter<Rna> { ...@@ -85,7 +86,7 @@ public class RnaConverter extends SpeciesConverter<Rna> {
@Override @Override
public PathIterator getBoundPathIterator(final Rna rna) { public PathIterator getBoundPathIterator(final Rna rna) {
return getRnaPath(rna).getPathIterator(new AffineTransform()); return getShape(rna).getPathIterator(new AffineTransform());
} }
} }
...@@ -42,7 +42,8 @@ public class SBGNNucleicAcidFeatureConverter extends SpeciesConverter<Species> { ...@@ -42,7 +42,8 @@ public class SBGNNucleicAcidFeatureConverter extends SpeciesConverter<Species> {
* {@link Species} for which the shape should be returned * {@link Species} for which the shape should be returned
* @return shape of the SBGN Nucleic acid feature for given alias * @return shape of the SBGN Nucleic acid feature for given alias
*/ */
private Shape getShape(final Species species) { @Override
protected Shape getShape(final Species species) {
GeneralPath bottomRoundedRectangle = new GeneralPath(GeneralPath.WIND_EVEN_ODD); GeneralPath bottomRoundedRectangle = new GeneralPath(GeneralPath.WIND_EVEN_ODD);
double x = species.getX(), y = species.getY(), width = species.getWidth(), height = species.getHeight(); double x = species.getX(), y = species.getY(), width = species.getWidth(), height = species.getHeight();
......
...@@ -66,7 +66,8 @@ public class SimpleMoleculeConverter extends SpeciesConverter<SimpleMolecule> { ...@@ -66,7 +66,8 @@ public class SimpleMoleculeConverter extends SpeciesConverter<SimpleMolecule> {
drawText(simpleMolecule, graphics, params); drawText(simpleMolecule, graphics, params);
} }
Shape getShape(final SimpleMolecule simpleMolecule) { @Override
protected Shape getShape(final SimpleMolecule simpleMolecule) {
return new Ellipse2D.Double(simpleMolecule.getX(), simpleMolecule.getY(), simpleMolecule.getWidth(), return new Ellipse2D.Double(simpleMolecule.getX(), simpleMolecule.getY(), simpleMolecule.getWidth(),
simpleMolecule.getHeight()); simpleMolecule.getHeight());
} }
......
...@@ -65,7 +65,8 @@ public class SimpleMoleculeSbgnConverter extends SimpleMoleculeConverter { ...@@ -65,7 +65,8 @@ public class SimpleMoleculeSbgnConverter extends SimpleMoleculeConverter {
graphics.setColor(oldColor); graphics.setColor(oldColor);
} }
Shape getShape(final SimpleMolecule simpleMolecule) { @Override
protected Shape getShape(final SimpleMolecule simpleMolecule) {
int arc = (int) Math.min(simpleMolecule.getWidth(), simpleMolecule.getHeight()); int arc = (int) Math.min(simpleMolecule.getWidth(), simpleMolecule.getHeight());
return new RoundRectangle2D.Double(simpleMolecule.getX(), simpleMolecule.getY(), simpleMolecule.getWidth(), return new RoundRectangle2D.Double(simpleMolecule.getX(), simpleMolecule.getY(), simpleMolecule.getWidth(),
simpleMolecule.getHeight(), arc, arc); simpleMolecule.getHeight(), arc, arc);
......
...@@ -626,4 +626,6 @@ public abstract class SpeciesConverter<T extends Species> extends ElementConvert ...@@ -626,4 +626,6 @@ public abstract class SpeciesConverter<T extends Species> extends ElementConvert
this.arrowTransformation = arrowTransformation; this.arrowTransformation = arrowTransformation;
} }
protected abstract Shape getShape(T species);
} }
...@@ -45,7 +45,7 @@ public class UnknownConverter extends SpeciesConverter<Unknown> { ...@@ -45,7 +45,7 @@ public class UnknownConverter extends SpeciesConverter<Unknown> {
if (unknown.getActivity()) { if (unknown.getActivity()) {
int border = ACTIVITY_BORDER_DISTANCE; int border = ACTIVITY_BORDER_DISTANCE;
unknown.increaseBorder(border); unknown.increaseBorder(border);
Shape shape2 = new Ellipse2D.Double(unknown.getX(), unknown.getY(), unknown.getWidth(), unknown.getHeight());