Prepare print.

@param _print the print
@throws EFapsException the e faps exception
165791
private void preparePrint(final AbstractPrint _print) throws EFapsException {
        for (final Select select : _print.getSelection().getAllSelects()) {
            for (final AbstractElement<?> element : select.getElements()) {
                if (element instanceof AbstractDataElement) {
                    ((AbstractDataElement<?>) element).append2SQLSelect(sqlSelect);
                }
            }
        }
        if (sqlSelect.getColumns().size() > 0) {
            for (final Select select : _print.getSelection().getAllSelects()) {
                for (final AbstractElement<?> element : select.getElements()) {
                    if (element instanceof AbstractDataElement) {
                        ((AbstractDataElement<?>) element).append2SQLWhere(sqlSelect.getWhere());
                    }
                }
            }
            if (_print instanceof ObjectPrint) {
                addWhere4ObjectPrint((ObjectPrint) _print);
            } else if (_print instanceof ListPrint) {
                addWhere4ListPrint((ListPrint) _print);
            } else {
                addTypeCriteria((QueryPrint) _print);
                addWhere4QueryPrint((QueryPrint) _print);
            }
            addCompanyCriteria(_print);
        }
    }
1289038
@Override
    public void print(MoneyPrintContext context, Appendable appendable, BigMoney money) throws IOException {
        MoneyFormatter fmt = (money.isZero() ? whenZero : money.isPositive() ? whenPositive : whenNegative);
        fmt.getPrinterParser().print(context, appendable, money);
    }
1297992
def print_page_cb(self, print_op, print_context, keep_refs={}):
        
        ORIENTATION_PORTRAIT = 0
        ORIENTATION_LANDSCAPE = 1
        scaling = 2.0

        img = self.img
        (width, height) = img.size

        # take care of rotating the image if required
        if print_context.get_width() <= print_context.get_height():
            print_orientation = ORIENTATION_PORTRAIT
        else:
            print_orientation = ORIENTATION_LANDSCAPE
        if width <= height:
            img_orientation = ORIENTATION_PORTRAIT
        else:
            img_orientation = ORIENTATION_LANDSCAPE
        if print_orientation != img_orientation:
            logger.info("Rotating the page ...")
            img = img.rotate(90, expand=True)

        (width, height) = img.size

        # scale the image down
        # XXX(Jflesch): beware that we get floats for the page size ...
        scaling = min(
            print_context.get_width() / width,
            print_context.get_height() / height
        )

        logger.info("DPI: %fx%f" % (print_context.get_dpi_x(),
                                    print_context.get_dpi_y()))

        surface = image2surface(img)
        keep_refs['surface_cache_' + str(self.page_nb)] = surface

        # .. and print !
        cairo_context = print_context.get_cairo_context()
        cairo_context.scale(scaling, scaling)
        cairo_context.set_source_surface(surface, 0, 0)
        cairo_context.paint()
519422
private function printOutput(): void
    {
        foreach ($this->db->query('SELECT id, file_name FROM tests WHERE completed = 1')->fetchAll() as $test) {
            $this->printer->printFeedback($this->pending[$test['file_name']]);
            $this->db->prepare('DELETE FROM tests WHERE id = :id')->execute([
                'id' => $test['id'],
            ]);
        }
    }
370319
def do_print(self,args):
        """"""
        parser = CommandArgumentParser("print")
        parser.add_argument('-r','--refresh',dest='refresh',action='store_true',help='refresh view of the current stack')
        parser.add_argument('-i','--include',dest='include',default=None,nargs='+',help='resource types to include')
        parser.add_argument(dest='filters',nargs='*',default=["*"],help='Filter stacks');
        args = vars(parser.parse_args(args))

        if args['refresh']:
            self.do_refresh('')

        self.printStack(self.wrappedStack,args['include'],args['filters'])
17467
public void print(ProjectModel project, File f, boolean includeClasses)
			throws IOException {
		FileWriter writer = new FileWriter(f);
		print(project, writer, includeClasses);
		writer.close();
	}
248367
public void setPrintDirective(SoyPrintDirective printDirective) {
    checkState(this.printDirective == null, "setPrintDirective has already been called");
    checkArgument(name.identifier().equals(printDirective.getName()));
    this.printDirective = checkNotNull(printDirective);
  }
1178655
public void print(Printable painter) {
        printer.setPrintable(painter);
        if (printer.printDialog(printAttributes)) {
            try {
                printer.print(printAttributes);
            } catch (PrinterException ex) {
                logger.error("Failed to print", ex);
                JOptionPane.showMessageDialog(null, ex.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
            }
        }
    }
1278304
private void initialize()
        throws EFapsException
    {
        if (!this.init) {
            this.init = true;
            for (final Entry<Type, Collection<Instance>> entry : this.instanceMap.asMap().entrySet()) {
                this.accessMap.putAll(entry.getKey().checkAccess(entry.getValue(), this.accessType));
            }
        }
    }
35633
def _maybe_print(something_to_print, end=None, min_=1, max_=99, verbose=0):
    """"""
    if min_ <= verbose <= max_:
        import sys
        print(something_to_print, end=end)
        sys.stdout.flush()
1120173
def Print(self, title=None, event=None):
        
        pdd = wx.PrintDialogData()
        pdd.SetPrintData(self.printerData)
        pdd.SetToPage(1)
        printer  = wx.Printer(pdd)
        if title is None:
            title = self.title

        printout = PrintoutWx(self.parent.canvas, title=title,
                              width=self.pwidth, margin=self.pmargin)
        print_ok = printer.Print(self.parent, printout, True)

        if not print_ok and not printer.GetLastError() == wx.PRINTER_CANCELLED:
            wx.MessageBox("""There was a problem printing.
            Perhaps your current printer is not set correctly?""",
                          "Printing", wx.OK)
        printout.Destroy()
1036115
def get_print_setup(self, print_data):
        """"""

        psd = wx.PageSetupDialogData(print_data)
        # psd.EnablePrinter(False)
        psd.CalculatePaperSizeFromId()
        dlg = wx.PageSetupDialog(self.main_window, psd)
        dlg.ShowModal()

        # this makes a copy of the wx.PrintData instead of just saving
        # a reference to the one inside the PrintDialogData that will
        # be destroyed when the dialog is destroyed
        data = dlg.GetPageSetupData()
        new_print_data = wx.PrintData(data.GetPrintData())
        new_print_data.PaperId = data.PaperId
        new_print_data.PaperSize = data.PaperSize

        dlg.Destroy()

        return new_print_data
156997
def OnPageSetup(self, event):
        """"""

        print_data = self.main_window.print_data
        new_print_data = \
            self.main_window.interfaces.get_print_setup(print_data)
        self.main_window.print_data = new_print_data
725348
public static Print print(final Instance... _instances)
    {
        return print(Arrays.stream(_instances)
                        .map(instance -> instance.getOid())
                        .toArray(String[]::new));
    }
580200
public void execute(final OutputStream _out)
        throws EFapsException
    {
        final boolean hasAccess = super.getInstance().getType().hasAccess(super.getInstance(),
                                                                          AccessTypeEnums.CHECKOUT.getAccessType());
        if (!hasAccess) {
            throw new EFapsException(this.getClass(), "execute.NoAccess");
        }
        this.executeWithoutAccessCheck(_out);
    }
1360035
private function printStepExceptionsAndStdOut(OutputPrinter $printer, array $events)
    {
        foreach ($events as $event) {
            $this->printStepStdOut($printer, $event->getTestResult());
            $this->printStepException($printer, $event->getTestResult());
        }
    }
556889
private void setProperties(final Instance _instance)
        throws EFapsException
    {
        final QueryBuilder queryBldr = new QueryBuilder(CIAdminCommon.Property);
        queryBldr.addWhereAttrEqValue(CIAdminCommon.Property.Abstract, _instance.getId());
        final MultiPrintQuery multi = queryBldr.getPrint();
        multi.addAttribute(CIAdminCommon.Property.Name, CIAdminCommon.Property.Value);
        multi.executeWithoutAccessCheck();
        while (multi.next()) {
            super.setProperty(multi.<String>getAttribute(CIAdminCommon.Property.Name),
                            multi.<String>getAttribute(CIAdminCommon.Property.Value));
        }
    }