/** * */ public JSSDrawVisitor(ReportConverter reportConverter, Graphics2D grx) { this.reportConverter = reportConverter; this.convertVisitor = new JSSConvertVisitor(reportConverter); final JasperReportsContext jasperReportsContext = reportConverter.getJasperReportsContext(); this.drawVisitor = new PrintDrawVisitor(jasperReportsContext) { @Override public void setTextRenderer(JRReport report) { AwtTextRenderer textRenderer = new AwtTextRenderer(jasperReportsContext, JRPropertiesUtil.getInstance( jasperReportsContext).getBooleanProperty(report, JRGraphics2DExporter.MINIMIZE_PRINTER_JOB_SIZE, true), JRPropertiesUtil.getInstance(jasperReportsContext).getBooleanProperty(report, JRStyledText.PROPERTY_AWT_IGNORE_MISSING_FONT, false)); setTextDrawer(new TextDrawer(jasperReportsContext, textRenderer)); setFrameDrawer(new FrameDrawer(jasperReportsContext, null, textRenderer)); } }; setTextRenderer(reportConverter.getReport()); this.grx = grx; setGraphics2D(grx); this.drawVisitor.setClip(true); }
/** * @deprecated Replaced by {@link #getDrawVisitor()}. */ public FrameDrawer getFrameDrawer() { return drawVisitor.getFrameDrawer(); }
@Override public void exportElement( JRGraphics2DExporterContext exporterContext, JRGenericPrintElement element, Graphics2D grx, Offset offset) { try { JRPrintText labelPrintText = (JRPrintText)element.getParameterValue(IconLabelElement.PARAMETER_LABEL_TEXT_ELEMENT); if (labelPrintText == null) //FIXMEINPUT deal with xml serialization { return; } JRBasePrintFrame frame = new JRBasePrintFrame(element.getDefaultStyleProvider()); frame.setX(element.getX()); frame.setY(element.getY()); frame.setWidth(element.getWidth()); frame.setHeight(element.getHeight()); frame.setStyle(element.getStyle()); frame.setBackcolor(element.getBackcolor()); frame.setForecolor(element.getForecolor()); frame.setMode(element.getModeValue()); JRLineBox lineBox = (JRLineBox)element.getParameterValue(IconLabelElement.PARAMETER_LINE_BOX); if (lineBox != null) { frame.copyBox(lineBox); } frame.addElement(labelPrintText); JRPrintText iconPrintText = (JRPrintText)element.getParameterValue(IconLabelElement.PARAMETER_ICON_TEXT_ELEMENT); if (iconPrintText != null) //FIXMEINPUT deal with xml serialization { frame.addElement(iconPrintText); } JRGraphics2DExporter exporter = (JRGraphics2DExporter)exporterContext.getExporterRef(); FrameDrawer frameDrawer = exporter.getDrawVisitor().getFrameDrawer(); frameDrawer.draw( grx, frame, offset.getX(), offset.getY() ); } catch (Exception e) { throw new RuntimeException(e); } }