Search in sources :

Example 1 with CanvasSize

use of org.gephi.preview.api.CanvasSize in project gephi by gephi.

the class SVGRenderTargetBuilder method buildRenderTarget.

@Override
public RenderTarget buildRenderTarget(PreviewModel previewModel) {
    CanvasSize cs = previewModel.getGraphicsCanvasSize();
    boolean scaleStrokes = previewModel.getProperties().getBooleanValue(SVGTarget.SCALE_STROKES);
    SVGRenderTargetImpl renderTarget = new SVGRenderTargetImpl(cs, scaleStrokes);
    return renderTarget;
}
Also used : CanvasSize(org.gephi.preview.api.CanvasSize)

Example 2 with CanvasSize

use of org.gephi.preview.api.CanvasSize in project gephi by gephi.

the class PDFRenderTargetBuilder method buildRenderTarget.

@Override
public RenderTarget buildRenderTarget(PreviewModel previewModel) {
    CanvasSize cs = previewModel.getGraphicsCanvasSize();
    PreviewProperties properties = previewModel.getProperties();
    float marginBottom = properties.getFloatValue(PDFTarget.MARGIN_BOTTOM);
    float marginLeft = properties.getFloatValue(PDFTarget.MARGIN_LEFT);
    float marginRight = properties.getFloatValue(PDFTarget.MARGIN_RIGHT);
    float marginTop = properties.getFloatValue(PDFTarget.MARGIN_TOP);
    com.itextpdf.text.Rectangle pageSize = properties.getValue(PDFTarget.PAGESIZE);
    boolean landscape = properties.getBooleanValue(PDFTarget.LANDSCAPE);
    PdfContentByte cb = properties.getValue(PDFTarget.PDF_CONTENT_BYTE);
    PDFRenderTargetImpl renderTarget = new PDFRenderTargetImpl(cb, cs, pageSize, marginLeft, marginRight, marginTop, marginBottom, landscape);
    return renderTarget;
}
Also used : CanvasSize(org.gephi.preview.api.CanvasSize) PreviewProperties(org.gephi.preview.api.PreviewProperties) PdfContentByte(com.itextpdf.text.pdf.PdfContentByte)

Aggregations

CanvasSize (org.gephi.preview.api.CanvasSize)2 PdfContentByte (com.itextpdf.text.pdf.PdfContentByte)1 PreviewProperties (org.gephi.preview.api.PreviewProperties)1