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

fontSize cannot be null

parent a6493bf3
No related branches found
No related tags found
1 merge request!981Resolve "Set border color for TextAreas"
......@@ -42,10 +42,7 @@ public abstract class CompartmentConverter<T extends Compartment> extends Elemen
* Default alpha level for semi-transparent borders.
*/
protected static final int HIGH_ALPHA_LEVEL = 127;
/**
* Default font size.
*/
private static final int DEFAULT_FONT_SIZE = 10;
/**
* Default class logger.
*/
......@@ -231,10 +228,7 @@ public abstract class CompartmentConverter<T extends Compartment> extends Elemen
compartment.getHeight() - (compartment.getNamePoint().getY() - compartment.getY()));
}
double fontSize = DEFAULT_FONT_SIZE * params.getScale();
if (compartment.getFontSize() != null) {
fontSize = compartment.getFontSize() * params.getScale();
}
double fontSize = compartment.getFontSize() * params.getScale();
String fontName = Font.SANS_SERIF;
Color tmpColor = graphics.getColor();
try {
......
......@@ -147,10 +147,7 @@ public class ComplexConverter extends SpeciesConverter<Complex> {
String text = getText(complex);
try {
graphics.setColor(complex.getFontColor());
double fontSize = DEFAULT_SPECIES_FONT_SIZE;
if (complex.getFontSize() != null) {
fontSize = complex.getFontSize();
}
double fontSize = complex.getFontSize();
int size = (int) FontFinder.findMaxFontSize(params.getScale() * fontSize, Font.SANS_SERIF, graphics,
complex.getBorder(), text);
FontFinder.drawText(size, Font.SANS_SERIF, graphics, complex.getBorder(), text);
......
......@@ -132,10 +132,7 @@ public abstract class SpeciesConverter<T extends Species> extends ElementConvert
* description
*/
protected Font getFont(final Species species, ConverterParams params) {
double fontSize = DEFAULT_SPECIES_FONT_SIZE;
if (species.getFontSize() != null) {
fontSize = species.getFontSize();
}
double fontSize = species.getFontSize();
return new Font(Font.SANS_SERIF, 0, (int) (fontSize * params.getScale()));
}
......
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