Search in sources :

Example 6 with VTOL

use of megamek.common.VTOL in project megameklab by MegaMek.

the class PrintCompositeTankSheet method processImage.

@Override
protected void processImage(int startPage, PageFormat pageFormat) {
    double ratio = includeReferenceCharts() ? TABLE_RATIO : 1.0;
    RecordSheetOptions subOptions = new RecordSheetOptions(options);
    subOptions.setReferenceCharts(false);
    PrintRecordSheet sheet = new PrintTank(tank1, getFirstPage(), subOptions);
    sheet.createDocument(startPage, pageFormat, false);
    Element g = getSVGDocument().createElementNS(svgNS, SVGConstants.SVG_G_TAG);
    g.setAttributeNS(null, SVGConstants.SVG_TRANSFORM_ATTRIBUTE, String.format("%s(%f 0 0 %f %f %f)", SVGConstants.SVG_MATRIX_VALUE, ratio, ratio, pageFormat.getImageableX(), pageFormat.getImageableY()));
    sheet.hideElement(FOOTER);
    g.appendChild(getSVGDocument().importNode(sheet.getSVGDocument().getDocumentElement(), true));
    getSVGDocument().getDocumentElement().appendChild(g);
    if (tank2 != null) {
        sheet = new PrintTank(tank2, getFirstPage(), subOptions);
    } else if (tank1 instanceof VTOL) {
        sheet = new VTOLTables(options);
    } else {
        sheet = new TankTables(options);
    }
    sheet.createDocument(startPage, pageFormat, false);
    g = getSVGDocument().createElementNS(svgNS, SVGConstants.SVG_G_TAG);
    g.setAttributeNS(null, SVGConstants.SVG_TRANSFORM_ATTRIBUTE, String.format("%s(%f 0 0 %f %f %f)", SVGConstants.SVG_MATRIX_VALUE, ratio, ratio, pageFormat.getImageableX(), pageFormat.getImageableY() + pageFormat.getImageableHeight() * 0.5 * ratio));
    g.appendChild(getSVGDocument().importNode(sheet.getSVGDocument().getDocumentElement(), true));
    getSVGDocument().getDocumentElement().appendChild(g);
    if (includeReferenceCharts()) {
        addReferenceCharts(pageFormat);
    }
}
Also used : VTOL(megamek.common.VTOL) Element(org.w3c.dom.Element)

Aggregations

VTOL (megamek.common.VTOL)6 Tank (megamek.common.Tank)4 File (java.io.File)3 Image (java.awt.Image)2 Vector (java.util.Vector)2 ImageIcon (javax.swing.ImageIcon)2 Aero (megamek.common.Aero)2 BattleArmor (megamek.common.BattleArmor)2 ConvFighter (megamek.common.ConvFighter)2 Dropship (megamek.common.Dropship)2 LargeSupportTank (megamek.common.LargeSupportTank)2 Font (java.awt.Font)1 Frame (java.awt.Frame)1 ActionEvent (java.awt.event.ActionEvent)1 ActionListener (java.awt.event.ActionListener)1 KeyEvent (java.awt.event.KeyEvent)1 Book (java.awt.print.Book)1 PageFormat (java.awt.print.PageFormat)1 Paper (java.awt.print.Paper)1 PrinterJob (java.awt.print.PrinterJob)1