Limited the size of the "missing shape" shape.

This commit is contained in:
hneemann 2018-02-23 19:33:32 +01:00
parent f118a6c565
commit 5245e52b4d
2 changed files with 6 additions and 2 deletions

View File

@ -29,6 +29,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.URISyntaxException;
import java.util.*;
@ -511,7 +512,7 @@ public class ElementLibrary implements Iterable<ElementLibrary.ElementContainer>
Circuit circuit;
try {
circuit = Circuit.loadCircuit(file, shapeFactory);
} catch (IOException e) {
} catch (FileNotFoundException e) {
throw new IOException(Lang.get("err_couldNotFindIncludedFile_N0", file));
}
ElementTypeDescriptionCustom description =

View File

@ -49,7 +49,10 @@ public class MissingShape implements Shape {
int y = 4;
while (c != null) {
y += style.getFontSize();
graphic.drawText(new Vector(4, y), new Vector(5, y), c.getMessage(), Orientation.LEFTTOP, style);
String message = c.getMessage();
if (message.length() > 100)
message = message.substring(0, 100) + "...";
graphic.drawText(new Vector(4, y), new Vector(5, y), message, Orientation.LEFTTOP, style);
c = c.getCause();
}
}