use of de.neemann.digital.draw.graphics.GraphicMinMax in project Digital by hneemann.
the class FragmentVisualElement method doLayout.
@Override
public Box doLayout() {
GraphicMinMax mm = new GraphicMinMax();
for (Vector p : inputs) mm.check(p);
for (Vector p : outputs) mm.check(p);
Vector delta = mm.getMax().sub(mm.getMin());
if (visualElement.equalsDescription(FlipflopJK.DESCRIPTION) || visualElement.equalsDescription(FlipflopD.DESCRIPTION))
// Space for label
return new Box(delta.x, delta.y + SIZE);
else
return new Box(delta.x, delta.y);
}
use of de.neemann.digital.draw.graphics.GraphicMinMax in project Digital by hneemann.
the class DocuTest method writeSVG.
private void writeSVG(File imageFile, VisualElement ve) throws IOException {
try (FileOutputStream out = new FileOutputStream(imageFile)) {
try (GraphicSVG svg = new GraphicSVGIndex(out, null, 20)) {
GraphicMinMax minMax = new GraphicMinMax(true, svg);
ve.drawTo(minMax, null);
svg.setBoundingBox(minMax.getMin(), minMax.getMax());
ve.drawTo(svg, null);
}
}
}
Aggregations